/ Published in: PHP
This is a small tutorial that guide you to use a small php function that parse the flickr\'s feed and output a simply thumbs gallery. Than you can customize the output using css style sheets. Here you can find the functions, follow the link to read the tutorial.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function attr($s,$attrname) { // return html attribute } // id = id of the feed // n = number of thumbs function parseFlickrFeed($id,$n) { $url = "http://api.flickr.com/services/feeds/photos_public.gne?id={$id}&lang=it-it&format=rss_200"; $out = ""; if($i>=$n) return $out; $item = $items[1][$i]; $link = $temp[1][0]; $title = $temp[1][0]; $thumb = attr($temp[0][0],"url"); $out.="<a href='$link' target='_blank' title=\"".str_replace('"','',$title)."\"><img src='$thumb'/></a>"; } return $out; } // usage example: echo parseFlickrFeed("16664181@N00",9); // you have to use css to customize it
URL: http://www.barattalo.it/2010/05/30/parsing-flickr-feed-with-php-tutorial/