'; $licenses = Array(); $licenses[1]['name'] = "by-nc-sa"; $licenses[1]['url'] = "http://creativecommons.org/licenses/by-nc-sa/2.0/"; $licenses[2]['name'] = "by-nc"; $licenses[2]['url'] = "http://creativecommons.org/licenses/by-nc/2.0/"; $licenses[3]['name'] = "by-nc-nd"; $licenses[3]['url'] = "http://creativecommons.org/licenses/by-nc-nd/2.0/"; $licenses[4]['name'] = "by"; $licenses[4]['url'] = "http://creativecommons.org/licenses/by/2.0/"; $licenses[5]['name'] = "by-sa"; $licenses[5]['url'] = "http://creativecommons.org/licenses/by-sa/2.0/"; $licenses[6]['name'] = "by-nd"; $licenses[6]['url'] = "http://creativecommons.org/licenses/by-nd/2.0/"; # if no page passed in url, page = 1 if(!isset($_GET[p])) $page = "1"; else $page = $_GET[p]; $ppage = $page - 1; $npage = $page + 1; $call = "http://www.flickr.com/services/rest/?method=flickr.favorites.getPublicList"; $call .= "&user_id=11349677@N00&page=$page&per_page=25&extras=license,owner_name,icon_server&api_key=$api_key"; $handle = cached_fopen_url("$call", "rb"); $content = ''; while(!feof($handle)) {$content .= fread($handle,4096);} fclose($handle); $objXML = new xml2Array(); $foto = $objXML->parse($content); $foto = $foto[0][children][0][children]; $i = 1; if ($ppage) $i = ($page * 25) + 1; $s = $i; $k = 0; foreach ($foto as $thisfoto) { if ($thisfoto[attrs][LICENSE]) { $out .= "
\n\t
#$i.
\n\t"; $out .= ' '; $out .= $thisfoto[attrs][OWNERNAME] . "
\n\t"; $out .= $cc . ' ' . $licenses[$thisfoto[attrs][LICENSE]][name] . "\n\t
"; $out .= '
' . "\n\t"; if ($thisfoto[attrs][TITLE]) $out .= "

" . $thisfoto[attrs][TITLE] . "

\n\t"; $fotosrc = "http://static.flickr.com/" . $thisfoto[attrs][SERVER]. '/' . $thisfoto[attrs][ID] . "_" . $thisfoto[attrs][SECRET] . "_m.jpg"; $out .= "\n\t"; $out .= "\n\t
\n\t
\n
"; $k++; } $i++; } echo "

$s to $i of Faves: $k $cc Photos

"; echo $out; echo '

 
'; if ($ppage) echo '< prev  '; echo '  next >'; ?>