This is a discussion on Thumbnail through PHP RSS parser within the PHP General forums, part of the PHP Programming Forums category; Hello, folks! I'm trying to parse RSS feed and display it on my own page. MagpieRSS looks good enough ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello, folks!
I'm trying to parse RSS feed and display it on my own page. MagpieRSS looks good enough for me, but I have a little problem. http://magpierss.sourceforge.net/ I want to display not only the title and description of each article, but the thumbnail as well. For example, I tried to do that with this feed. http://newsrss.bbc.co.uk/rss/newsonl...t_page/rss.xml Everything is alright with the title and the description, but I can't do the thumbnail thing. What I've tried is the following: Code:
foreach ($rss->items as $item ) {
$title = $item[title];
$url = $item[link];
$description = $item[description];
$thumbnail = $item['media:thumbnail'];
echo "<a href=$url>$title</a></li><br>";
echo $description;
echo "<img $thumbnail>";
}
thumbnail. This is the structure: Code:
<title>txt</title> <description>txt</description> <media:thumbnail width="X" height="Y" url="url"/> (probably because we require parameter of media:thumbnail, not the value inside it): Code:
$thumbnail = $item['media:thumbnail']; can we get it. Thanks in advance for any help! |