source: spip-zone/_plugins_/exec/feed.php @ 31412

Last change on this file since 31412 was 31412, checked in by fdm@…, 12 years ago

Mise à jour spip 2.0

File size: 1.2 KB
Line 
1<?php
2function exec_feed(){
3header('Content-Type: text/xml');
4echo "<?xml version='1.0' encoding='utf-8'?>";
5$url_lien_distant=generer_url_public('patronyme');
6$url_site = $_SERVER['HTTP_REFERER'];
7
8echo "<rss version='2.0'>";
9echo "<channel>";
10echo "<title>Liste de patronymes</title>";
11echo "<link>$url_site</link>";
12echo "<description>Site de genealogie par GENESPIP</description>";
13echo "<language>fr</language>";
14echo "<ttl>5</ttl>";
15
16echo "<item>";
17echo "<title>Liste de NOMS</title>";
18echo "<link>$url_lien_distant</link>";
19echo "<category>PATRONYME</category>";
20echo "<description>";
21$result_individu = spip_query("SELECT nom, count(id_individu) as comptenom FROM spip_genespip_individu where poubelle<>1 group by nom");
22        while ($indi = spip_fetch_array($result_individu)) {
23        echo $indi['nom']." (".$indi['comptenom']."), ";
24        }
25echo "</description>";
26echo "<pubDate>";
27$result_individu = spip_query("SELECT date_update FROM spip_genespip_liste ORDER BY date_update DESC limit 0,1");
28        while ($indi = spip_fetch_array($result_individu)) {
29        echo $indi['date_update'];
30        }
31echo "</pubDate>";
32echo "</item>";
33echo "</channel>";
34echo "</rss>";
35}
36?>
Note: See TracBrowser for help on using the repository browser.