";
if (
$data &&
property_exists($data, "resource_response") &&
property_exists($data->{"resource_response"}, "data") &&
property_exists($data->{"resource_response"}->{"data"}, "results")
) {
foreach (
$data->{"resource_response"}->{"data"}->{"results"}
as $result
) {
$image = $result->{"images"}->{"orig"};
$url = $image->{"url"};
array_push($images, $url);
echo "
";
echo "";
}
} else {
echo "
No results found.
";
}
echo "
";
$result = new SearchResult();
$result->images = $images;
if (
$data &&
property_exists($data, "resource_response") &&
property_exists($data->{"resource_response"}, "bookmark")
) {
$result->bookmark = $data->{"resource_response"}->{"bookmark"};
}
return $result;
};
$result = $search($query, $bookmark);
if ($result->bookmark != null) {
$query_encoded = urlencode($query);
$bookmark_encoded = urlencode($result->bookmark);
$csrftoken_encoded = $csrftoken ? urlencode($csrftoken) : "";
echo "