ERROR: No API key has been defined.
'; }else{ if(isset($_GET['photo']) and isset($_GET['photoset'])){ // // INDIVIDUAL PHOTO // $photoinfo=file('http://api.flickr.com/services/rest/?method=flickr.photos.getInfo&api_key='.$apikey.'&photo_id='.$_GET['photo']); $photo=array(); $photo["desc"]=""; //Lazy bodge for multi-line descriptions $indesc=0; foreach($photoinfo as $line){ if(strstr($line, ''.html_entity_decode($photoset["desc"]).'
Return to the photoset list - Return to the photo list
'."\n\n"; if($userid==$photo["nsid"]){ echo ''.html_entity_decode($photo["desc"]).'
'."\n\t";} echo 'Taken at '.date("g:i a", strtotime($photo["taken"])).' on '.date("jS F Y", strtotime($photo["taken"])).'
'."\n\t\t"; } echo 'Copyright © '.date("Y", strtotime($photo["taken"])).' '.$photo["realname"].'. ';//'.$photo[""].' if($photo["license"]==0){ echo 'All rights reserved.'; }else{ echo 'Some Rights Reserved.'; } echo '
'."\n\t\t".''."\n\t".'ERROR: Photo does not appear to belong to the specified user.
'; } }elseif(isset($_GET['photoset']) and $_GET['photoset']>0){ // // INDIVIDUAL PHOTOSET // $pageurl=''; if(isset($perpage) and $perpage>0){ $pageurl.='&per_page='.$perpage; } if(isset($_GET['page']) and $_GET['page']>0){ $page=$_GET['page']; $pageurl.='&page='.$page; }else{ $page=1; } //Get list of photos $photoset=file('http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key='.$apikey.'&photoset_id='.$_GET['photoset'].'&extras=license%2C+date_upload%2C+date_taken%2C+owner_name%2C+icon_server%2C+original_format%2C+last_update'.$pageurl); $photolist=array(); foreach($photoset as $line){ if(strstr($line, "'.html_entity_decode($photosetdetails["desc"]).'
'."\n"; if($userid==$photosetdetails["owner"] and (!isset($layout) or $layout=="square")){ // // SQUARE THUMBNAIL PHOTOS // echo ''; }elseif($userid==$photosetdetails["owner"] and isset($layout) and $layout=="detail"){ // // DETAIL PHOTOS // $licensedetails=file('http://api.flickr.com/services/rest/?method=flickr.photos.licenses.getInfo&api_key='.$apikey); $licenses=array(); foreach($licensedetails as $license){ if(strstr($license, "Copyright © '.date("Y", strtotime($photo["datetaken"])).' '.$photo["ownername"].'
';
if($photo["license"]==0){
echo 'All rights reserved';
}else{
echo 'Some Rights Reserved';
}
echo '
ERROR: Photoset does not appear to belong to the specified user.
'; }else{ // // INVALID PHOTO DISPLAY // echo 'ERROR: Invalid photo display option.
'; } // Previous/Next links if($photosetdetails["pages"]==1){ //Only one page echo 'Showing all '.$photosetdetails["photos"].' photos.
'; }else{ //More than one page if($photosetdetails["page"]>1){ $previous='< Previous'; }else{ $previous='< Previous'; } if($photosetdetails["page"]<$photosetdetails["pages"]){ $next='Next >'; }else{ $next='Next >'; } echo "\n".''.$previous.' | '."\n\t".''; for ($i = 1; $i <= $photosetdetails["pages"]; $i++) { if($i==$photosetdetails["page"]){$idname=' id="currentpage"';}else{$idname='';} echo "\t\t".''.$i.''."\n"; } echo "\t".' | '."\n\t".''.$next.' | '."\n".'
ERROR: Invalid User ID or User ID not set.
'; } //Handle preset list if(isset($presetphotosets) and count($presetphotosets)>0){ $allphotosets=$photosets; $photosets=array(); foreach($presetphotosets as $label => $id){ if(array_key_exists($id, $allphotosets)){ $photosets[$id]=$allphotosets[$id]; }else{ echo 'ERROR: Photoset '.$id.' ('.$label.') not found for user '.$userid.'.
'; } } } //Output photosets if(count($photosets)>0){ echo ''.html_entity_decode($photoset["desc"]).'
'.$photoset["photos"].' photos - View on Flickr
ERROR: No photosets found or no photosets specified.
'; } } if($photosetcols>1 and !isset($_GET['photoset'])){ ?>