set_title("Image {$image->id}: ".html_escape($image->get_tag_list())); $page->set_heading(html_escape($image->get_tag_list())); $page->add_block(new Block("Navigation", $this->build_navigation($image->id), "left", 0)); $page->add_block(new Block("Image", $this->build_image_view($image), "main", 0)); $page->add_block(new Block(null, $this->build_info($image), "main", 10)); } var $pin = null; protected function build_pin($image_id) { if(!is_null($this->pin)) { return $this->pin; } global $database; if(isset($_GET['search'])) { $search_terms = explode(' ', $_GET['search']); $query = "search=".url_escape($_GET['search']); } else { $search_terms = array(); $query = null; } $next = $database->get_next_image($image_id, $search_terms); $prev = $database->get_prev_image($image_id, $search_terms); $h_prev = (!is_null($prev) ? "Prev" : "Prev"); $h_index = "Index"; $h_next = (!is_null($next) ? "Next" : "Next"); $this->pin = "$h_prev | $h_index | $h_next"; return $this->pin; } protected function build_navigation($image_id) { $h_pin = $this->build_pin($image_id); $h_search = "

"; return "$h_pin
$h_search"; } protected function build_image_view($image) { $ilink = $image->get_image_link(); return ""; } protected function build_info($image) { global $user; $owner = $image->get_owner(); $h_owner = html_escape($owner->name); $h_ip = html_escape($image->owner_ip); $h_source = html_escape($image->source); $i_owner_id = int_escape($owner->id); $html = ""; $html .= "

Uploaded by $h_owner"; if($user->is_admin()) { $html .= " ($h_ip)"; } if(!is_null($image->source)) { if(substr($image->source, 0, 7) == "http://") { $html .= " (source)"; } else { $html .= " (source)"; } } global $config; global $user; if($config->get_bool("tag_edit_anon") || ($user->id != $config->get_int("anon_id"))) { $html .= " (edit)"; if(isset($_GET['search'])) {$h_query = "search=".url_escape($_GET['search']);} else {$h_query = "";} $h_tags = html_escape($image->get_tag_list()); $i_image_id = int_escape($image->id); $html .= "

Tags
Source
 
"; } $html .= "

".$this->build_pin($image->id); return $html; } } ?>