bgbs Posted April 28, 2008 Share Posted April 28, 2008 I need help solve things with this script I want the script to show only my flickr gallery pics from a particular set. Not from tags, like it is doing right now. The user path and ID is "http://www.flickr.com/photos/25721203@N05/" and set is "warren" And the other thing I wanted the script to do is make the pictures clickable so that when you click on them it takes you to the flickr page to view your picture. Any help is appreciated. Thanks <?php $tags = "birds"; $imageNumber = 6; function getFlickrRSS(){ global $tags, $ids; $url = "http://api.flickr.com/services/feeds/photos_public.gne?format=rss2&tags=".$tags; if ($fp = fopen($url, 'r')) { $content = ''; while ($line = fread($fp, 1024)) { $content .= $line; } } return $content; } function getImages($rssContent){ global $imageNumber; $before = '<media:thumbnail url="'; $after = '"'; $imageList = array(); $oldPos = 0; $startPos=0; do { $oldPos = $startPos; $startPos = strpos($rssContent,$before,$startPos) + strlen($before); $endPos = strpos($rssContent,$after,$startPos); $imageList[] = substr($rssContent,$startPos,$endPos-$startPos); } while (($startPos > $oldPos) && (sizeof($imageList)<$imageNumber)); return $imageList; } $content = getFlickrRSS(); $imageList = getImages($content); for ($x = 0; $x < sizeof($imageList); $x++) { if (($x%(ceil($imageNumber/2)) == 0) && ($x !== 0)) { echo "<br>"; } echo "<img src='$imageList[$x]'>"; } ?> Link to comment https://forums.phpfreaks.com/topic/103299-need-help-with-flickr-script/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.