" with one provided * by Flickr: http://www.flickr.com/services/api/key.gne */ require_once("latest/phpFlickr.php"); srand(time()); $f = new phpFlickr("c95a3e0740a95da8d29bd63f058cb9ee"); $f->die_on_error = true; if (isset($_REQUEST['submit'])) { $id = $_REQUEST['id']; $title = $_REQUEST['title']; $description = $_REQUEST['description']; echo "saving $title, $description for $id
"; $result = $f->photos_setMeta($photo_id, $title, $description); print_r($result); return; } $nsid = "32485920@N00"; $random_page = rand()%329; $result = $f->people_getPublicPhotos($nsid, NULL, NULL, 50, $random_page); if (!array_key_exists('photos', $result)) { echo "No photos found, result was empty.
"; return; } $photos = $result['photos']; $pages = $photos['pages']; $per_page = $photos['perpage']; #echo "Found $pages pages, $per_page pictures per page.
"; $pics = $photos['photo']; #echo "Actual pic array looks like this:
"; #print_r($pics); $pic_count = count($pics); #echo "pic count is $pic_count
"; $random_photo = rand()%$pic_count; #echo "Now display index $random_photo from that array.
"; $photo = $pics["$random_photo"]; $owner = $f->people_getInfo($photo['owner']); #print_r($owner); $photo_info = $f->photos_getInfo($photo['id']); #print_r($photo_info); $tagarray = $photo_info['tags']; #print_r($tagarray); $tags = $tagarray['tag']; #echo "

"; $url = "http://www.flickr.com/photos/" . $photo['owner'] . "/" . $photo['id'] . "/"; $static_url = "http://farm" . $photo['farm'] . ".static.flickr.com/" . $photo['server'] . '/' . $photo['id'] . '_' . $photo['secret'] . '.jpg?v=0'; $title = $photo['title']; $description = $photo_info['description']; if (!strlen($description)) $description = "no caption"; $id = $photo['id']; #echo $static_url; echo "dan's flickr randomizer"; echo ''; #echo ''; #echo ''; #echo ''; echo ""; echo ""; echo ""; /* if ($tags) { echo "("; foreach ($tags as $tag) { #echo "" . $tag['raw'] . " "; echo $tag['raw'] . " "; } echo ")"; } echo ""; */ echo "
"; echo "
"; echo "$title, $description @ flickr"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo ""; echo "
"; echo "
"; return; $blah=0; foreach($photos['photo'] as $photo) { $blah++; if ($blah==10) break; $owner = $f->people_getInfo($photo['owner']); echo "http://www.flickr.com/photos/" . $photo['owner'] . "/" . $photo['id'] . "/
"; #echo "
"; #echo $photo['title']; #echo "
"; } return; $recent = $f->photos_getRecent(); $count = count($recent['photo']); echo "got $count recent photos
"; $blah=0; foreach ($recent['photo'] as $photo) { $blah++; if ($blah==10) break; $owner = $f->people_getInfo($photo['owner']); echo ""; echo $photo['title']; echo " Owner: "; echo ""; echo $owner['username']; echo "
"; } ?>