$vars = array(); $hot_mess=$QUERY_STRING ; $pairs = array() ; $pairs = split('AMPERSAND', $hot_mess) ; foreach ($pairs as $pair) { list($variable, $value) = split('EQUALS', $pair) ; array_push($vars,"$variable=$value") ; } $base_url = 'http://api.smugmug.com/hack/feed.mg?' ; $full_url = $base_url.join("&",$vars) ; # print "
$full_url" ; if ($full_url != '') { $ch=curl_init($full_url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $dump = curl_exec($ch) ; curl_close($ch) ; $xml = new SimpleXMLElement($dump); $total_images = 0 ; $images = array(); $captions = array(); $albumtitle = $xml->channel['title'] ; foreach ($xml->channel->item as $item) { if ($item->link != '') { $media = $item->children('http://search.yahoo.com/mrss/'); $attrs = $media->group->content[3]->attributes() ; $url = $attrs['url'] ; $width = $attrs['width'] ; $height = $attrs['height'] ; $title = $item->title ; array_push($images,$url) ; array_push($captions,$title) ; $total_images++ ; } } switch (TRUE) { case ($total_images < 10) ; $zoomout = 20 ; break ; case ($total_images >= 10 AND $total_images < 50) ; $zoomout = 10 ; break ; case ($total_images >= 50 ) ; $zoomout = 5 ; break ; } $columns = round(sqrt($total_images)) ; print "
You are missing an RSS feed.
" ; } ?>