useCached(); $rss->title = "Последни обяви от Obiavi-bg.com - безплатните обяви"; $rss->description = "Obiavi-bg.com - безплатните обяви http://www.obiavi-bg.com/"; //optional //$rss->descriptionTruncSize = 500; //$rss->descriptionHtmlSyndicated = true; //$rss->xslStyleSheet = "http://feedster.com/rss20.xsl"; $rss->link = "http://www.obiavi-bg.com"; $rss->feedURL = "http://www.obiavi-bg.com/".$PHP_SELF; /*$image = new FeedImage(); $image->title = "evangelskivestnik.net logo"; $image->url = "http://www.evangelskivestnik.net/img/evangelski_logo.jpg"; $image->link = "http://www.evangelskivestnik.net"; $image->description = "Feed provided by www.evangelskivestnik.net. Click to visit."; */ //optional /*$image->descriptionTruncSize = 500; $image->descriptionHtmlSyndicated = true; $rss->image = $image; */ // get your news items from somewhere, e.g. your database: $res = mysql_query("select OID,RIDS,OHEAD,OEMAIL,TEXT,IMG,ODATE from OBIAVI where ACTIVE='YES' and RIDS not like '%|3|%' order by DATEADD desc limit 0,45"); while ($data = mysql_fetch_array($res)) { $O_ALL=$data; $OID=$O_ALL[OID]; $RIDS=$O_ALL[RIDS]; $TEXT=strip_tags($O_ALL[TEXT]); $OHEAD=$O_ALL[OHEAD]; $OHEAD=strip_tags($OHEAD); $RIDM_N=substr($O_ALL[RIDS],1,-1); if(strlen($TEXT)>25){ $TEXT=nl2br(strip_tags(substr($TEXT,0,222)."...")); } $NOV_LINK=""; $NOV_LINK=tolink("$O_ALL[OHEAD]"); $LINKO=tolink5($O_ALL[OHEAD])."__$O_ALL[OID]"; $date_arr=explode(".",$data[ODATE]); $MONTH=gMonthName( ($date_arr[1]*10/10) ); if($data[IMG]!=""){ $img=""; }else{ $img=""; } $item = new FeedItem(); $item->title = "$OHEAD"; $item->link = "http://www.obiavi-bg.com/$LINKO"; // $item->description = "$img$data[TEXT]"; //optional //item->descriptionTruncSize = 500; $item->descriptionHtmlSyndicated = true; $date = mktime(13, 0, 0, $date_arr[1], $date_arr[0], $date_arr[2]); $item->date = strtotime($data[ODATE]); $item->source = "http://www.obiavi-bg.com"; $item->author = "admin@obiavi-bg.com"; $rss->addItem($item); } // valid format strings are: RSS0.91, RSS1.0, RSS2.0, PIE0.1, MBOX, OPML, ATOM0.3, HTML, JS echo $rss->saveFeed("RSS0.91", "../xml/rss091_news.xml",true);