'."\n"; } } ?>

: (working code and proof of concepts)

query->count != 0) { echo '

Results of your search for item '.$id.' (Showing '.$data->query->count.' out of a possible '.$data->query->count.' matches)

'."\n"; echo '
    '."\n"; $itemId = $data->query->results->photo->id; $farm = $data->query->results->photo->farm; $server = $data->query->results->photo->server; $secret = $data->query->results->photo->secret; $title = htmlentities($data->query->results->photo->title); $uploaded = $data->query->results->photo->dates->posted; $date = $data->query->results->photo->dates->taken; //$duration = date("i:s",intval($item->duration)); $user = $data->query->results->photo->owner->username; $userId = $data->query->results->photo->owner->nsid; $showPage = $data->query->results->photo->urls->url->content; $viewCount = $data->query->results->photo->views; if ($data->query->results->photo->description && $data->query->results->photo->description != '') { $description = $data->query->results->photo->description; } else { $description = 'No description available.'; } //foreach ($data->query->results->photo as $item) { //check to make sure id is available - set default message if it is not //if (strlen($item->id) < 2) { $id = 'No id available.'; } else { $id = $item->id; } //http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}.jpg //z=medium 640, 640 on longest side b=large, 1024 on longest side o=original image echo '
  1. '.$title.'
    '.$title.'
    '.$description.'
    date taken: '.$date.'
    views: '.$viewCount.'
    View in flickr
    View high resolution
  2. '."\n"; //} echo '
'."\n"; echo '

Try another search?

'."\n"; } else { echo '

No results for item '.$id.'.

'."\n"; echo '

Try another search

'."\n"; } ?>