Show top google images on page using a request system

Viewed 27
public function Index($realm = false, $id = false) {

    clientLang("loading", "item");

    // Make sure item and realm are set
    if (!$id || !$realm) {
        die(lang("no_item", "item"));
    }


    $this -> realm = $realm;

    $cache = $this -> cache -> get("items/tooltip_".$realm."_".$id."_".getLang());
    $cache2 = $this -> cache -> get("items/item_".$realm."_".$id);

    if ($cache2 !== false) {
        $itemName = $cache2['name'];
    }
    else {
        $itemName = lang("view_item", "item");
    }

    $this -> template -> setTitle($itemName);

    $icon = $this -> getIcon($id);

    if ($cache !== false) {
        $item = $cache;
    }
    else {
        $item = $this -> template -> loadPage("ajax.tpl", array('module' => 'item', 'id' => $id, 'realm' => $realm, 'icon' => $icon));
    }

    $content = $this -> template -> loadPage("item.tpl", array('module' => 'item', 'item' => $item, 'icon' => $icon));

    $data3 = array(
        "module" => "default",
        "headline" => "<span style='cursor:pointer;' onClick='window.location=\"".$this -> template -> page_url."armory\"'>".lang("armory", "item")."</span> &rarr; ".$itemName,
        "content" => $content
    );

    $page = $this -> template -> loadPage("page.tpl", $data3);

    $this -> template -> view($page, "modules/item/css/item.css");
}

While I do have a function to send informations, how could I make use of this system in a way that would make possible for me to use a pre-search on Google image and show this on the user end when he is selecting a specific item per example.

Clicking on item 87652 returns you with the item page + a Google image search with the top 2-3 results of the ID searched (just an example)

0 Answers
Related