session_start();
foreach ($_POST as $key => $value) { $$key = $value; }
foreach ($_GET as $key => $value) { $$key = $value; }
foreach ($_SESSION as $key => $value) { $$key = $value; }
foreach ($_REQUEST as $key => $value) { $$key = $value; }
/* flikr stuff */
//$picset = $_REQUEST['Picset'];
$picset=72157710466476481;
$api_key = "baf17893c19370413eb561fb21b64957"; //API Key for KNudson
// secret: 4cd8633733b61f38
$flickr_userid = "183694827@N07"; //user ID for KNudson
//SET $recordsperpage TO THE NUMBER OF PICTURES YOU WANT PER PAGE
if(!$recordsperpage){
$recordsperpage=100;
}
//SET $numofthumbnails TO THE NUMBER OF THUMBNAILS PER ROW
//(SHOULD BE A FACTOR OF $recordsperpage)
$numofthumbnails = 4;
$nowtime=time();
$nowyear=date('Y', $nowtime);
/* Change $recordsperpage value here to display
whatever number of properties per page you want */
if(!$startrow){
$startrow=0;
}
$pagenum = 0;
$done=false;
$idxcount=0;
function multisort($array, $sort_by, $key1, $key2=NULL, $key3=NULL, $key4=NULL, $key5=NULL, $key6=NULL){
// sort by ?
foreach ($array as $pos => $val)
$tmp_array[$pos] = $val[$sort_by];
asort($tmp_array);
// display however you want
foreach ($tmp_array as $pos => $val){
$return_array[$pos][$sort_by] = $array[$pos][$sort_by];
$return_array[$pos][$key1] = $array[$pos][$key1];
if (isset($key2)){
$return_array[$pos][$key2] = $array[$pos][$key2];
}
if (isset($key3)){
$return_array[$pos][$key3] = $array[$pos][$key3];
}
if (isset($key4)){
$return_array[$pos][$key4] = $array[$pos][$key4];
}
if (isset($key5)){
$return_array[$pos][$key5] = $array[$pos][$key5];
}
if (isset($key6)){
$return_array[$pos][$key6] = $array[$pos][$key6];
}
}
return $return_array;
}
if($picset){
$ch = curl_init(); /// initialize a cURL session
$api_url="https://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=$api_key&photoset_id=$picset&format=rest&extras=url_s%2C+url_q%2C+url_z";
curl_setopt ($ch, CURLOPT_URL, $api_url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$flickrreturn = curl_exec ($ch);
//echo "$flickrreturn
";
$doc = new SimpleXmlElement($flickrreturn, LIBXML_NOCDATA);
$photocount = count($doc->photoset->photo);
//print_r($doc);
curl_close ($ch);
}
/* end flikr stuff */
?>