0 && $i<6) { //this line tells the parser to get all post numbers between 0 and 7 - so it will display the six most recent posts. you should change this if you want more or less posts displayed per feed.
if (strlen($text)<1) {$text = ' ';}
// build string
/*
this is where you will define how each item in the feed will be parsed. you can style this to be paragraphs or list items or h-tags, etc - remember this is how each item in the feed will be displayed.
*/
$parsedata = ('
' .$title . '
' . $text .'
');
$alldata .= $parsedata;
}
}
}
/* you should not have to do anything from this point on. this is where most of the heavy-lifing takes place.
*/
// takes alldata from loop and outputs it to page
$news = 'output';
//startcache($news);
global $cached;
if (strlen ($cached) >0) {
echo $cached;
}else {
global $alldata;
echo $alldata;
//endcache();
}
// This is the XML parsing function.
function getXmlData($xml_doc) {
$n=0; // Counter used for arraying the XML data
$ar=array(); // The main array for storing parsed xml using xml_parse_into_struct()
// Parse the XML document
$parser = xml_parser_create();
xml_parse_into_struct($parser,$xml_doc,$vals,$index) or die(xml_error_string(xml_get_error_code($parser)));
xml_parser_free($parser);
$ttags=array(); // Temporary arry for storing tag names
for($n=0;$n<=count($vals)-1;$n++) {
if(trim($vals[$n][value])) {
$ar[$vals[$n][tag]][count($ar[$vals[$n][tag]])]=$vals[$n][value];
$ttags[$vals[$n][tag]]=$vals[$n][tag];
}
}
$tags=array();
// Extract and save the tag names to the array
foreach($ttags as $tagi) { array_push($tags,$tagi); }
return $ar;
}
?>