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--; 
}  
?> 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.