= $base_count) { $div = $num / $base_count; $mod = ($num - ($base_count * intval($div))); $encoded = $alphabet[$mod] . $encoded; $num = intval($div); } if ($num) { $encoded = $alphabet[$num] . $encoded; } return $encoded; } # if no page passed in url, page = 1 $date = $_GET[date]; if($date) { $datequery = "&date=$date"; $nextday = date("Y-m-d", strtotime("+1 day", strtotime ($date))); $prevday = date("Y-m-d", strtotime("-1 day", strtotime ($date))); } $pp = $_GET[pp]; if(!$pp) { $pp = '10'; } $pg = $_GET[pg]; if(!$pg) { $pg = '1'; } # build the API URL to call $params = array( 'api_key' => '1fdcaf0220c18333ff286189bda15692', 'method' => 'flickr.interestingness.getList', 'user_id' => '11349677@N00', 'format' => 'php_serial', 'extras' => 'owner_name,date_upload', 'per_page' => $pp, 'page' => $pg, ); $encoded_params = array(); foreach ($params as $k => $v){ $encoded_params[] = urlencode($k).'='.urlencode($v); } # call the API and decode the response $url = "http://api.flickr.com/services/rest/?" . implode('&', $encoded_params) . $datequery; $rsp = file_get_contents($url); $rsp_obj = unserialize($rsp); if (!isset($date)) { $date = date("Y-m-d",$rsp_obj['photos']['photo'][0]['dateupload']); $prevday = date("Y-m-d", strtotime("-1 day", $rsp_obj['photos']['photo'][0]['dateupload'])); $nextday = date("Y-m-d", strtotime("+1 day", $rsp_obj['photos']['photo'][0]['dateupload'])); $datequery = "&date=$date"; } echo " Flickr Interestingness: Wii Edition for $date"; ?>
‹"; ?>"; if ($thisfoto[title]) echo $thisfoto[title] . ", "; echo "By " . $thisfoto[ownername]; echo "
"; echo " \n"; } }?>
›"; ?>
‹"; ?>›"; ?>