Line | |
---|
1 | <?php |
---|
2 | function exec_feed(){ |
---|
3 | header('Content-Type: text/xml'); |
---|
4 | echo "<?xml version='1.0' encoding='utf-8'?>"; |
---|
5 | $url_lien_distant=generer_url_public('patronyme'); |
---|
6 | $url_site = $_SERVER['HTTP_REFERER']; |
---|
7 | |
---|
8 | echo "<rss version='2.0'>"; |
---|
9 | echo "<channel>"; |
---|
10 | echo "<title>Liste de patronymes</title>"; |
---|
11 | echo "<link>$url_site</link>"; |
---|
12 | echo "<description>Site de genealogie par GENESPIP</description>"; |
---|
13 | echo "<language>fr</language>"; |
---|
14 | echo "<ttl>5</ttl>"; |
---|
15 | |
---|
16 | echo "<item>"; |
---|
17 | echo "<title>Liste de NOMS</title>"; |
---|
18 | echo "<link>$url_lien_distant</link>"; |
---|
19 | echo "<category>PATRONYME</category>"; |
---|
20 | echo "<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 | } |
---|
25 | echo "</description>"; |
---|
26 | echo "<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 | } |
---|
31 | echo "</pubDate>"; |
---|
32 | echo "</item>"; |
---|
33 | echo "</channel>"; |
---|
34 | echo "</rss>"; |
---|
35 | } |
---|
36 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.