Jump to content

Showing RSS feed with photos on another page


cnl83

Recommended Posts

If you goto http://www.actionfx.net/bfd/photos.php you will see that im trying to show an rss feed from http://picasaweb.google.com/data/feed/base/user/114565750484201639035?alt=rss&kind=album&hl=en_US&access=public

 

My code works well if its just text on the rss but it does not work on this particular rss. I want the photos to show up on my page also. Im hoping someone here can be so kind to help me out with this coding. Below is my code.

<?php  

$feed_url = "http://picasaweb.google.com/data/feed/base/user/114565750484201639035?alt=rss&kind=album&hl=en_US&access=public";

// INITIATE CURL. 
$curl = curl_init(); 

// CURL SETTINGS. 
curl_setopt($curl, CURLOPT_URL,"$feed_url"); 
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0); 

// GRAB THE XML FILE. 
$xmlTwitter = curl_exec($curl); 

curl_close($curl); 

// SET UP XML OBJECT.
// Use either one of these, depending on revision of PHP.
// Comment-out the line you are not using.
//$xml = new SimpleXMLElement($xmlTwitter);
$xml = simplexml_load_string($xmlTwitter); 

// How many items to display 
$count = 10; 

// How many characters from each item 
// 0 (zero) will show them all. 
$char = 100; 

foreach ($xml->channel->item as $item) { 
if($char == 0){ 
$newstring = $item->description; 
} 
else{ 
$newstring = substr($item->description, 0, $char); 
} 
if($count > 0){ 
//in case they have non-closed italics or bold, etc ... 
echo"</i></b></u></a>\n"; 
echo" 
<div style='font-family:verdana; font-size:.12;'>  
<b>{$item->title}</b><br />
$newstring ...  <span class='redlink' id='redlink' style='redlink'> <a href='{$item->guid}'>read more</a> </span>
<br /><br /> 
</div> 
";  
} 
$count--; 
}  
?> 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.