RSS generated by PHP
Channel_title = $ title; $ this-> channel_link = $ link; $ this-> channel_description = $ description; $ this-> channel_imgurl = $ imgurl; $ this-> pubDate = Date ('Y-m-d H: I: S', time ()); $ this-> lastBuildDate = Date ('Y-m-d H: I: S', time ());} /** + variables * set private variables + ---------------------------------------------------------- * @ access public + --------------------- ----------------------------------- * @ Param string $ key variable name * @ param string $ value variable value + variable */public function Config ($ key, $ value) {$ this-> {$ key} = $ value;}/** + ------------------------------------------------------------ * add an RSS entry + token * @ access public + ------------------------------- --------------------------- * @ Param string $ title log title * @ param string $ link log link * @ param string $ description log summary * @ param string $ pubDate log release date + region ---------------------------------------------------------- */function AddItem ($ title, $ link, $ description, $ pubDate) {$ this-> items [] = array ('title' => $ title, 'link' => $ link, 'description' => $ description, 'pubdate' => $ pubDate);}/** + ----- ------------------------------------------------- * The XML output of RSS is a string + response * @ access public + response * @ return string + response */public function Fetch () {$ rss = "\ r \ n "; $ rss = "\ r \ n"; $ rss. = "\ r \ n"; $ rss. = "channel_title}]> \ r \ n"; $ rss. = "Channel_description}]> \ r \ n"; $ rss. = "{$ this-> channel_link} \ r \ n"; $ rss. = "{$ this-> language} \ r \ n"; if (! Empty ($ this-> pubDate) $ rss. = "{$ this-> pubDate} \ r \ n"; if (! Empty ($ this-> lastBuildDate) $ rss. = "{$ this-> lastBuildDate} \ r \ n"; if (! Empty ($ this-> generator) $ rss. = "{$ this-> generator} \ r \ n"; $ rss. = "5 \ r \ n"; if (! Empty ($ this-> channel_imgurl) {$ rss. = "\ r \ n"; $ rss. = "channel_title}]> \ r \ n"; $ rss. = "{$ this-> channel_link} \ r \ n"; $ rss. = "{$ this-> channel_imgurl} \ r \ n"; $ rss. = "\ r \ n" ;}for ($ I = 0; $ I <count ($ this-> items); $ I ++) {$ rss. = "\ r \ n"; $ rss. = "items [$ I] ['title']}]> \ r \ n"; $ rss. = "{$ this-> items [$ I] ['link']} \ r \ n"; $ rss. = "items [$ I] ['description']}]> \ r \ n"; $ rss. = "{$ this-> items [$ I] ['pubdate']} \ R \ n "; $ rss. = "\ r \ n";} $ rss. = "\ r \ n"; return $ rss ;} /** + ---------------------------------------------------------- * output rss xml to the browser + ------------------------------------------------------------ * @ access public + ---------------------------------------------------------- * @ return void + consumer */public function Display () {header ("Content-Type: Text/xml; charset = utf-8 "); echo $ this-> Fetch (); exit ;}}?>