当前位置: 首页>>代码示例>>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;未经允许,请勿转载。