template_dir = $_SERVER["DOCUMENT_ROOT"].$mydir.'/templates/'; $tpl->compile_dir = $_SERVER["DOCUMENT_ROOT"].$mydir.'/templates_c/'; $tpl->config_dir = $_SERVER["DOCUMENT_ROOT"].$mydir.'/configs/'; $tpl->cache_dir = $_SERVER["DOCUMENT_ROOT"].$mydir.'/cache/'; /* The URL of the feed we want to include */ $url = "http://www.jornada.unam.mx/rss/edicion.xml"; /*$url = "http://rss.news.yahoo.com/rss/world"; */ /* magpierss does all the work! */ $rss = fetch_rss($url); /* Uncomment the following line to see the object and array data returned. Good to see which other information has been processed by magpierss */ // echo "

"; print_r($rss); echo "
"; /* If the RSS could be parsed, add it to the template */ if ($rss) { /* Sends the feed title to the template engine */ $tpl->assign("feedtitle",$rss->channel["title"]); /* Sends the RSS items as an array */ $tpl->assign("items",$rss->items); } else { /* RSS problem? */ $tpl->assign("feedtitle","Problemas al accesar la liga: $url"); } /* Fill the template file itemlist.html with the information and return it */ $feedhtml = $tpl->fetch($_SERVER["DOCUMENT_ROOT"].$mydir."/templates/itemlist2.html"); /* Do with $feedhtml whatever you want */ echo $feedhtml; ?>