people_findByUsername($_POST['flickr_user_id']); $pset = $f->photosets_getList($person['id']); foreach($pset['photoset'] as $set) { $skey=array_search('Rang Panchami 2008',$set); if($skey !== false) { $photo_set_id=$set['id']; } } // Get the friendly URL of the user's photos $photos_url = $f->urls_getUserPhotos($person['id']); // Get the user's first 500 public photos $photos = $f->people_getPublicPhotos($person['id'], NULL, 500); $json='{"photos":['; // Loop through the photos and output the json foreach ((array)$photos['photo'] as $photo) { $json=$json.'{"title":"'.$photo['title'].'","src":"'.$f->buildPhotoURL($photo, "Square").'","url":"'.$photos_url.$photo['id'].'","id":"'.$photo['id'].'"},'; } $json=substr($json,0,-1); $json=$json."]}"; echo $json; } } function getMetaData() { global $f; error_reporting(0); $photo_id=$_POST['photo_id']; $meta_data=$f->photos_getInfo($photo_id); $meta_sizes=$f->photos_getSizes($photo_id); foreach($meta_sizes as $size) { $imgsize[strtolower($size['label'])]=$size['source']; } //write code for description etc. $json='{"photo":{"title":"'.$meta_data['title'].'","thumb":"'.$imgsize['thumbnail'].'","small":"'.$imgsize['small'].'","square":"'.$imgsize['square'].'","medium":"'.$imgsize['medium'].'","large":"'.$imgsize['large'].'","original":"'.$imgsize['original'].'","desc":"'.$meta_data['description'].'"}}'; echo $json; }