1 | <?php |
---|
2 | |
---|
3 | /***************************************************************************\ |
---|
4 | * SPIP, Systeme de publication pour l'internet * |
---|
5 | * * |
---|
6 | * Copyright (c) 2001-2015 * |
---|
7 | * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * |
---|
8 | * * |
---|
9 | * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * |
---|
10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
---|
11 | \***************************************************************************/ |
---|
12 | |
---|
13 | if (!defined('_ECRIRE_INC_VERSION')) return; |
---|
14 | // http://code.spip.net/@inc_meme_rubrique_dist |
---|
15 | function inc_meme_rubrique_dist($id_rubrique, $id, $type, $order = '') { |
---|
16 | |
---|
17 | $table = table_objet($type); |
---|
18 | $primary = id_table_objet($type); |
---|
19 | |
---|
20 | $lister_objets = charger_fonction('lister_objets', 'inc'); |
---|
21 | $contexte = array('id_rubrique' => $id_rubrique,'where' => "$primary!=".intval($id)); |
---|
22 | |
---|
23 | if ($GLOBALS['visiteur_session']['statut'] !== '0minirezo') |
---|
24 | $contexte['statut'] = array('publie','prop'); |
---|
25 | |
---|
26 | if ($order) |
---|
27 | $contexte['par'] = $order; |
---|
28 | elseif ($type == 'article' and defined('_TRI_ARTICLES_RUBRIQUE')) |
---|
29 | $contexte['par'] = _TRI_ARTICLES_RUBRIQUE; |
---|
30 | |
---|
31 | $contexte['titre'] = _T('info_meme_rubrique'); |
---|
32 | return $lister_objets($table, $contexte); |
---|
33 | |
---|
34 | } |
---|