t("About This Photo")); } static function get($block_id, $theme) { $block = new Block(); switch ($block_id) { case "simple": $item = $theme->item; if ((!$item) or (!$item->is_photo())) { return ""; } $block->css_id = "g-about-this-photo"; $block->title = t("About this photo"); $block->content = new View("about_this_photo.html"); // exif API doesn't give easy access to individual keys, so do this the hard way if (module::is_active("exif")) { $exif = ORM::factory("exif_record")->where("item_id", "=", $theme->item()->id)->find(); if ($exif->loaded()) { $exif = unserialize($exif->data); $timestamp = strtotime($exif["DateTime"]); //$block->content->date = gallery::date($timestamp); $block->content->date = date('D j M Y', $timestamp); $block->content->time = gallery::time($timestamp); } } $block->content->vcount = $theme->item()->view_count; // IPTC - copied more or less from iptc.php if (module::is_active("iptc")) { $record = ORM::factory("iptc_record")->where("item_id", "=", $theme->item()->id)->find(); if ($record->loaded()) { $record = unserialize($record->data); $block->content->name = $record["ObjectName"]; $block->content->caption = $record["Caption"]; } } if (module::is_active("tag")) { $block->content->tags = tag::item_tags($theme->item()); } break; } return $block; } }