Saturday, 26 February 2011

Producing individual Divs for each twitter update and photo

This shows produces an individual div for each element taken from the RSS file :





   Show RSS Document 




channel->item as $photoitem) {
	if($photocounter < 6){
	    $photocounter=$photocounter+1;
}  
	//loads rss feed variable of the image, concatination used to add a counter e.g. 1,2,3... to each photo so that they can be individually edited - using css ID, however had to apply ID to the image source not ID for css styles to work
	print "

"; print "
"; // if the counter reaches 6, break the function, meaning that it will only display 6 photos in total from the RSS feed. if($photocounter==6){ break; } } foreach ($twitterxml->channel->item as $twitteritem) { /*loads rss feed of the twitter same proccess as above, but different paremeters have been used in the CSS stylesheet for each individual twitter update. however unlike the photos above div id is added to the div */ print "
$twitteritem->title
"; print "
"; if($twittercounter < 6){ $twittercounter=$twittercounter+1; if($twittercounter==6){ break; } } } ?>

No comments:

Post a Comment