當前位置: 首頁>>代碼示例>>PHP>>正文


PHP gallery::time方法代碼示例

本文整理匯總了PHP中gallery::time方法的典型用法代碼示例。如果您正苦於以下問題:PHP gallery::time方法的具體用法?PHP gallery::time怎麽用?PHP gallery::time使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gallery的用法示例。


在下文中一共展示了gallery::time方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get

 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->source = $record["Source"];
                     $block->content->caption = $record["Caption"];
                 }
             }
             if (module::is_active("tag")) {
                 $block->content->tags = tag::item_tags($theme->item());
             }
             break;
     }
     return $block;
 }
開發者ID:Retroguy,項目名稱:gallery3-contrib,代碼行數:40,代碼來源:about_this_photo_block.php


注:本文中的gallery::time方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。