source: branches/old/rss_generator.php

Last change on this file was 448, checked in by george, 16 years ago
  • Přesunuto: Obsah kořenové složky byl přesunut do složky trunk a beta web přesunut do branches/beta.
File size: 936 bytes
Line 
1<?php
2
3function GenerateRSS($Data, $Charset)
4{
5 $Result = '<?xml version="1.0" encoding="'.$Charset.'" ?>'."\n". //<?
6 '<rss version="2.0">'."\n".
7 " <channel>\n".
8 " <title>".$Data['Title']."</title>\n".
9 " <link>".$Data['Link']."</link>\n".
10 " <description>".$Data['Description']."</description>\n".
11 " <language>cs</language>\n".
12 " <webMaster>".$Data['WebmasterEmail']."</webMaster>\n".
13 " <pubDate>".date('r')."</pubDate>\n".
14 " <ttl>20</ttl>\n";
15 foreach($Data['Items'] as $Item)
16 {
17 $Result .= " <item>\n".
18 ' <title>'.htmlspecialchars($Item['Title'])."</title>\n".
19 ' <description>'.htmlspecialchars($Item['Description'])."</description>\n".
20 ' <pubDate>'.date('r',$Item['Time'])."</pubDate>\n".
21 ' <link>'.$Item['Link']."</link>\n".
22 " </item>\n";
23 }
24 $Result .= " </channel>\n".
25 "</rss>";
26 return($Result);
27}
28
29?>
Note: See TracBrowser for help on using the repository browser.