当前位置: 首页>>代码示例>>PHP>>正文


PHP Timestamp::getHumanReadable方法代码示例

本文整理汇总了PHP中Timestamp::getHumanReadable方法的典型用法代码示例。如果您正苦于以下问题:PHP Timestamp::getHumanReadable方法的具体用法?PHP Timestamp::getHumanReadable怎么用?PHP Timestamp::getHumanReadable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Timestamp的用法示例。


在下文中一共展示了Timestamp::getHumanReadable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getFormattedList

 public function getFormattedList($conditions)
 {
     //data [array(id, blogid, category, content,
     $data = $this->getWithConditions($conditions);
     $view = '';
     foreach ($data as $d) {
         $template = $conditions['template'];
         $d['created'] = Timestamp::getHumanReadable($d['created']);
         if ($d['root'] == 'default') {
             $d['root'] = 'Textcube Line';
         }
         foreach ($conditions['dress'] as $tag => $match) {
             dress($tag, $d[$match], $template);
         }
         $view .= $template;
     }
     return $view;
 }
开发者ID:Avantians,项目名称:Textcube,代码行数:18,代码来源:Line.php

示例2: requireStrictRoute

require ROOT . '/library/preprocessor.php';
requireStrictRoute();
$conditions = array();
$conditions['blogid'] = getBlogId();
$conditions['page'] = $_POST['page'];
if (isset($_POST['category'])) {
    $conditions['category'] = $_POST['category'];
}
if (isset($_POST['keyword'])) {
    $conditions['keyword'] = $_POST['keyword'];
}
$conditions['linesforpage'] = $_POST['lines'];
$skin = new Skin($context->getProperty('skin.skin'));
$line = Model_Line::getInstance();
$stream = $line->getWithConditions($conditions);
$contentView = '';
foreach ($stream as $item) {
    $time = Timestamp::getHumanReadable($item['created']);
    if ($item['root'] == 'default') {
        $item['root'] = 'Textcube Line';
    }
    $contentView .= str_replace(array('[##_line_rep_regdate_##]', '[##_line_rep_content_##]', '[##_line_rep_author_##]', '[##_line_rep_source_##]', '[##_line_rep_permalink_##]'), array(fireEvent('ViewLineDate', $time, $item['created']), fireEvent('ViewLineContent', $item['content']), fireEvent('ViewLineAuthor', htmlspecialchars($item['author'])), fireEvent('ViewLineSource', htmlspecialchars($item['root'])), fireEvent('ViewLinePermalink', $item['permalink'])), $skin->lineItem);
}
if (empty($stream)) {
    $contentView = '';
    $buttonView = '';
} else {
    $buttonView = str_replace(array('[##_line_onclick_more_##]'), array('getMoreLineStream(' . ($conditions['page'] + 1) . ',' . $conditions['linesforpage'] . ',\'bottom\');return false;'), $skin->lineButton);
}
$result = array('error' => 0, 'contentView' => $contentView, 'buttonView' => $buttonView);
Respond::PrintResult($result);
开发者ID:ragi79,项目名称:Textcube,代码行数:31,代码来源:stream.php


注:本文中的Timestamp::getHumanReadable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。