/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $flickrId = 'userId'; // Find your Flickr ID at http://idgettr.com $flickrrequest = 'http://api.flickr.com/services/feeds/photos_public.gne?id=' . $flickrId . '&format=json'; // Flickr JSON doesn't come in standard form, some str replace needed // parameter 'true' is necessary for output as PHP array $flickritem = $flickrvalue['items']; // echo the channel information echo "<h3><a href=\"" . $flickrvalue['link'] . "\">" . $flickrvalue['title'] . "</a></h3>\n"; echo "<p>" . $flickrvalue['description'] . "</p>\n"; $photosToDisplay = 5; //change this to the number of photos you want to display for($p=0;$p<$photosToDisplay;$p++){ echo "<a href=\"" . $flickritem[$p]['link'] . "\"><img src=\"" . $flickritem[$p]['media']['m'] . "\" /></a>\n"; } echo "<p><a href=\"" . $flickrvalue['link'] . "\">View all my photos</p>\n"; ?>