$vars = array(); $hot_mess=$QUERY_STRING ; # Gallery variable defaults: $frameColor="0xFFFFFF" ; $frameWidth="15" ; $imagePadding="20" ; $displayTime="6" ; $enableRightClickOpen="true" ; $extramess = array() ; $extramess = split('EXTRA', $hot_mess) ; $pairs = array() ; $pairs = split('AMPERSAND', $extramess[0]) ; foreach ($pairs as $pair) { list($variable, $value) = split('EQUALS', $pair) ; array_push($vars,"$variable=$value") ; } $extrapairs = array() ; $extrapairs = split('AMPERSAND', $extramess[1]) ; foreach ($extrapairs as $extrapair) { list($extravariable, $extravalue) = split('EQUALS', $extrapair) ; $$extravariable=$extravalue ; } $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) ; if (curl_errno($ch)) { print curl_error($ch); } else { curl_close($ch) ; $xml = new SimpleXMLElement($dump); # print '
' ; # print_r($xml) ; # print '' ; $total_images = 0 ; $images = $captions = $links = $heights = $widths = array(); $albumtitle = $xml->channel['title'] ; if (preg_match("/^.+?'s/", $albumtitle)) { $username = preg_replace("/^(.+?'s).+/", "$1", $albumtitle) ; } 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 ; if (preg_match("/$username photo/", $title)) { $title = '' ; } $link =$item->link ; $url = preg_replace('/http:\/\/.*\/photos\//', 'http://api.smugmug.com/photos/', $url) ; # preg_match('/(http.*\/)/', $url, $match) ; # $imagepath = $match[0] ; # $url = preg_replace('/http.*\//', '', $url) ; array_push($images,$url) ; array_push($captions,$title) ; array_push($links,$link) ; array_push($widths,$width) ; array_push($heights,$height) ; $total_images++ ; } } print '
You are missing an RSS feed.
" ; } ?>