useCached(); $rss->title = "Foodie-Project"; $rss->description = "News Foodie-Project"; $rss->link = "http://www.foodie-project.eu"; $rss->linkatom = "http://www.foodie-project.eu/feed/news.php"; $rss->syndicationURL = "http://www.foodie-project.eu/".$PHP_SELF; $rss->copyright="Copyright 2014 proprietario contenuti Foodie-Project"; $rss->language = $linguaxml; $res = mysql_query("SELECT * FROM news WHERE flag_pubblicazione='Y' ORDER BY data DESC"); while ($data = mysql_fetch_array($res)) { $titolonews=trim($data["titolo_".$lingua]); if($titolonews==""){ $titolonews=$data["titolo_en_us"]; } $url="http://www.foodie-project.eu/news-zoom.php?id=".$data["id"]; //TITOLO NEWS $titolonews=stripslashes($data["titolo_".$lingua]); $titolonews=utf8_decode($titolonews); //$titolonews=puliscirss($titolonews); //DESCRIPTION $description=stripslashes($data["abstract_".$lingua]); $description=utf8_decode($description); //$description=puliscirss($description); //CONTENT $content=stripslashes($data["corpo_".$lingua]); $content=utf8_decode($content); //$content=puliscirss($content); //******************** //TESTO //******************** $testo=""; $testo.="

".$titolonews."

"; $testo.="

"; $testo.=getDataEstesa($data["data"],$lingua); if($data["luogo"]!=""){ $testo.=" - ".$data["luogo"]; } $testo.="
".$description."

"; $testo.="
"; if($data["img"]!="" && file_exists($pathnews.$data["img"])){ $maxside=300; $prefix="crop_".$maxside."_"; if(!file_exists($pathnews.$prefix.$data["img"])){ resizeLarghezza($pathnews.$data["img"],$maxside,$prefix); } $testo.=""; } $testo.="

".$content."

"; $item = new FeedItem(); $item->descriptionHtmlSyndicated = true; $item->title = $titolonews; $item->link = $url; $item->description = $testo; $item->guid = $url; $item->source = "http://www.foodie-project.eu"; $nomeimg=$data["img"]; $nomeimg=ltrim(rtrim(str_replace(array(">","<","\"","'","&"),"",$nomeimg))); if($nomeimg!="" && file_exists($pathnews.$nomeimg)){ $ext = substr($pathnews.$nomeimg, strrpos($pathnews.$nomeimg, '.') + 1); if($ext == "jpg" || $ext == "gif" || $ext == "png"){ $type=$ext; if($type=="jpg"){$type="jpeg";} $item->enclosure = new EnclosureItem(); $item->enclosure->url="http://www.foodie-project.eu/public/".$nomeimg; $item->enclosure->length=filesize($pathnews.$nomeimg); $item->enclosure->type="image/".$type; } } $rss->addItem($item); } $rss->outputFeed("RSS2.0"); //$rss->saveFeed("RSS2.0", "..public/feed.xml"); ?>