Changeset 375 for trunk/Common/RSS.php
- Timestamp:
- Jan 20, 2012, 7:46:05 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/RSS.php
r373 r375 1 1 <?php 2 2 3 function GenerateRSS($Data) 3 class RSS 4 4 { 5 global $Config; 5 var $Charset; 6 var $Title; 7 var $Link; 8 var $Description; 9 var $WebmasterEmail; 10 var $Items; 6 11 7 $Result = '<?xml version="1.0" encoding="'.$Config['Web']['Charset'].'" ?>'."\n". //<? 12 function __construct() 13 { 14 $this->Charset = 'utf8'; 15 $this->Items = array(); 16 } 17 18 function Generate($Data) 19 { 20 $Result = '<?xml version="1.0" encoding="'.$this->Charset.'" ?>'."\n". //<? 8 21 '<rss version="2.0">'."\n". 9 22 " <channel>\n". 10 " <title>".$ Data['Title']."</title>\n".11 " <link>".$ Data['Link']."</link>\n".12 " <description>".$ Data['Description']."</description>\n".23 " <title>".$this->Title."</title>\n". 24 " <link>".$this->Link."</link>\n". 25 " <description>".$this->Description."</description>\n". 13 26 " <language>cs</language>\n". 14 " <webMaster>".$ Data['WebmasterEmail']."</webMaster>\n".27 " <webMaster>".$this->WebmasterEmail."</webMaster>\n". 15 28 " <pubDate>".date('r')."</pubDate>\n". 16 29 " <ttl>20</ttl>\n"; 17 foreach($Data['Items'] as $Item) 18 { 19 $Result .= " <item>\n". 20 ' <title>'.htmlspecialchars($Item['Title'])."</title>\n". 21 ' <description>'.htmlspecialchars($Item['Description'])."</description>\n". 22 ' <pubDate>'.date('r',$Item['Time'])."</pubDate>\n". 23 ' <link>'.$Item['Link']."</link>\n". 24 " </item>\n"; 30 foreach($this->Items as $Item) 31 { 32 $Result .= " <item>\n". 33 ' <title>'.htmlspecialchars($Item['Title'])."</title>\n". 34 ' <description>'.htmlspecialchars($Item['Description'])."</description>\n". 35 ' <pubDate>'.date('r',$Item['Time'])."</pubDate>\n". 36 ' <link>'.$Item['Link']."</link>\n". 37 " </item>\n"; 38 } 39 $Result .= " </channel>\n". 40 "</rss>"; 41 return($Result); 25 42 } 26 $Result .= " </channel>\n".27 "</rss>";28 return($Result);29 43 } 30 44
Note:
See TracChangeset
for help on using the changeset viewer.