4 |
david |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/***************************************************************************\
|
|
|
4 |
* SPIP, Systeme de publication pour l'internet *
|
|
|
5 |
* *
|
|
|
6 |
* Copyright (c) 2001-2005 *
|
|
|
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 |
|
|
|
14 |
// SPIP RSS
|
|
|
15 |
//
|
|
|
16 |
// On recoit un op (operation) + args (arguments)
|
|
|
17 |
// + id (id_auteur) + cle (low_sec(id_auteur, "op args"))
|
|
|
18 |
// On verifie que la cle correspond
|
|
|
19 |
// On cree ensuite le RSS correspondant a l'operation
|
|
|
20 |
|
|
|
21 |
include("ecrire/inc_version.php3");
|
|
|
22 |
include_ecrire("inc_texte.php3");
|
|
|
23 |
include_ecrire('inc_rss.php3');
|
|
|
24 |
include_ecrire("inc_acces.php3");
|
|
|
25 |
// Gestionnaire d'URLs
|
|
|
26 |
if (@file_exists("inc-urls.php3"))
|
|
|
27 |
include_local("inc-urls.php3");
|
|
|
28 |
else
|
|
|
29 |
include_local("inc-urls-".$GLOBALS['type_urls'].".php3");
|
|
|
30 |
|
|
|
31 |
|
|
|
32 |
//
|
|
|
33 |
// Verifier la securite du lien et decoder les arguments
|
|
|
34 |
//
|
|
|
35 |
spip_timer('rss');
|
|
|
36 |
if (!verifier_low_sec ($id, $cle,
|
|
|
37 |
"rss $op $args"
|
|
|
38 |
)
|
|
|
39 |
OR ($a['id_auteur']>0 AND $id<>$a['id_auteur'])) {
|
|
|
40 |
$op = 'erreur securite';
|
|
|
41 |
unset($a);
|
|
|
42 |
} else {
|
|
|
43 |
$a = array();
|
|
|
44 |
foreach (split(':', $args) as $bout) {
|
|
|
45 |
list($var, $val) = split('-', $bout, 2);
|
|
|
46 |
$a[$var] = $val;
|
|
|
47 |
}
|
|
|
48 |
include_ecrire('inc_lang.php3');
|
|
|
49 |
lang_select($lang);
|
|
|
50 |
}
|
|
|
51 |
|
|
|
52 |
//
|
|
|
53 |
// Choisir la fonction de calcul du RSS
|
|
|
54 |
//
|
|
|
55 |
switch($op) {
|
|
|
56 |
# forum public
|
|
|
57 |
case 'forum':
|
|
|
58 |
if ($id = intval($a['id_article'])) {
|
|
|
59 |
$critere = "statut='publie' AND id_article=$id";
|
|
|
60 |
$url = generer_url_article($id);
|
|
|
61 |
}
|
|
|
62 |
else if ($id = intval($a['id_syndic'])) {
|
|
|
63 |
$critere = "statut='publie' AND id_syndic=$id";
|
|
|
64 |
$url = generer_url_site($id);
|
|
|
65 |
}
|
|
|
66 |
else if ($id = intval($a['id_breve'])) {
|
|
|
67 |
$critere = "statut='publie' AND id_breve=$id";
|
|
|
68 |
$url = generer_url_breve($id);
|
|
|
69 |
}
|
|
|
70 |
else if ($id = intval($a['id_rubrique'])) {
|
|
|
71 |
$critere = "statut='publie' AND id_rubrique=$id";
|
|
|
72 |
$url = generer_url_rubrique($id);
|
|
|
73 |
}
|
|
|
74 |
else if ($id = intval($a['id_thread'])) {
|
|
|
75 |
$critere = "statut='publie' AND id_thread=$id";
|
|
|
76 |
$url = generer_url_forum($id);
|
|
|
77 |
}
|
|
|
78 |
if ($id) $rss = rss_suivi_forums($a, $critere, false);
|
|
|
79 |
$title = _T("ecrire:titre_page_forum_suivi");
|
|
|
80 |
break;
|
|
|
81 |
# suivi prive des forums
|
|
|
82 |
case 'forums':
|
|
|
83 |
include_ecrire("inc_forum.php3");
|
|
|
84 |
$critere = critere_statut_controle_forum($a['page']);
|
|
|
85 |
$rss = rss_suivi_forums($a, $critere, true);
|
|
|
86 |
$title = _T("ecrire:titre_page_forum_suivi")." (".$a['page'].")";
|
|
|
87 |
$url = _DIR_RESTREINT_ABS .'controle_forum.php3?page='.$a['page'];
|
|
|
88 |
break;
|
|
|
89 |
# revisions des articles
|
|
|
90 |
case 'revisions':
|
|
|
91 |
$rss = rss_suivi_versions($a);
|
|
|
92 |
$title = _T("icone_suivi_revisions");
|
|
|
93 |
$url = _DIR_RESTREINT_ABS .'suivi_revisions.php3?';
|
|
|
94 |
foreach (array('id_secteur', 'id_auteur', 'lang_choisie') as $var)
|
|
|
95 |
if ($a[$var]) $url.= '&'.$var.'='.$a[$var];
|
|
|
96 |
break;
|
|
|
97 |
# messagerie privee
|
|
|
98 |
case 'messagerie':
|
|
|
99 |
$rss = rss_suivi_messagerie($a);
|
|
|
100 |
$title = _T("icone_messagerie_personnelle");
|
|
|
101 |
$url = _DIR_RESTREINT_ABS .'messagerie.php3';
|
|
|
102 |
break;
|
|
|
103 |
# a suivre
|
|
|
104 |
case 'a-suivre':
|
|
|
105 |
$rss = rss_a_suivre($a);
|
|
|
106 |
$title = _T("icone_a_suivre");
|
|
|
107 |
$url = _DIR_RESTREINT_ABS .'';
|
|
|
108 |
break;
|
|
|
109 |
case 'erreur securite':
|
|
|
110 |
$rss = array(array('title' => _L('Erreur de sécurité')));
|
|
|
111 |
$title = _L('Erreur de sécurité');
|
|
|
112 |
$url = '';
|
|
|
113 |
break;
|
|
|
114 |
default:
|
|
|
115 |
$rss = array(array('title' => _L('Erreur')));
|
|
|
116 |
$title = _L('Erreur');
|
|
|
117 |
$url = '';
|
|
|
118 |
break;
|
|
|
119 |
}
|
|
|
120 |
|
|
|
121 |
//
|
|
|
122 |
// Envoyer le RSS
|
|
|
123 |
//
|
|
|
124 |
$intro = array(
|
|
|
125 |
'title' => "[".lire_meta('nom_site')."] RSS ".$title,
|
|
|
126 |
'url' => $url
|
|
|
127 |
);
|
|
|
128 |
|
|
|
129 |
list($content,$header) = affiche_rss($rss, $intro, $fmt);
|
|
|
130 |
if ($header) @header($header);
|
|
|
131 |
echo $content;
|
|
|
132 |
|
|
|
133 |
spip_log("spip_rss: ".spip_timer('rss'));
|
|
|
134 |
exit;
|
|
|
135 |
|
|
|
136 |
|
|
|
137 |
?>
|