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


PHP Timestamp::getUNIXTime方法代码示例

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


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

示例1: add

 public function add()
 {
     if (is_null($this->created)) {
         $this->created = Timestamp::getUNIXTime();
     }
     if (!$this->validate()) {
         return false;
     }
     $this->setAttribute('id', $this->id);
     $this->setAttribute('blogid', $this->blogid);
     $this->setAttribute('category', $this->category, true);
     $this->setAttribute('root', $this->root, true);
     $this->setAttribute('author', $this->author, true);
     $this->setAttribute('content', $this->content, true);
     $this->setAttribute('permalink', $this->permalink, true);
     $this->setAttribute('created', $this->created);
     return $this->insert();
 }
开发者ID:Avantians,项目名称:Textcube,代码行数:18,代码来源:Line.php

示例2: getLinesFeed

function getLinesFeed($blogid, $category = 'public', $mode = 'atom')
{
    global $blog;
    $channel = array();
    $channel = initializeRSSchannel($blogid);
    $lineobj = Model_Line::getInstance();
    $lineobj->reset();
    $lineobj->setFilter(array('created', 'bigger', Timestamp::getUNIXTime() - 86400));
    $lineobj->setFilter(array('blogid', 'equals', $blogid));
    $lineobj->setFilter(array('category', 'equals', $category, true));
    $lines = $lineobj->get();
    $channel['items'] = getFeedItemByLines($lines);
    $channel['title'] = RSSMessage($blog['title'] . ': ' . _text('Lines'));
    $rss = array('channel' => $channel);
    if ($mode == 'rss') {
        return publishRSS($blogid, $rss);
    } else {
        if ($mode == 'atom') {
            return publishATOM($blogid, $rss);
        }
    }
    return false;
}
开发者ID:hinablue,项目名称:TextCube,代码行数:23,代码来源:blog.feed.php

示例3: update

 function update($openid, $delegatedid, $nickname, $homepage = null)
 {
     $context = Model_Context::getInstance();
     $pool = DBModel::getInstance();
     $pool->reset('OpenIDUsers');
     $pool->setQualifier('openid', 'equals', $openid, true);
     $result = $pool->getCell('openidinfo');
     if (is_null($result)) {
         $data = serialize(array('nickname' => $nickname, 'homepage' => $homepage));
         OpenIDConsumer::setUserInfo($nickname, $homepage);
         /* Owner column is used for reference, all openid records are shared */
         $pool->reset('OpenIDUsers');
         $pool->setAttribute('blogid', $context->getProperty('blog.id'));
         $pool->setAttribute('openid', $openid, true);
         $pool->setAttribute('delegatedid', $deligatedid, true);
         $pool->setAttribute('firstlogin', Timestamp::getUNIXTime());
         $pool->setAttribute('lastlogin', Timestamp::getUNIXTime());
         $pool->setAttribute('logincount', 1);
         $pool->setAttribute('openidinfo', $data, true);
         $pool->insert();
     } else {
         $data = unserialize($result);
         if (!empty($nickname)) {
             $data['nickname'] = $nickname;
         }
         if (!empty($homepage)) {
             $data['homepage'] = $homepage;
         }
         OpenIDConsumer::setUserInfo($data['nickname'], $data['homepage']);
         $data = serialize($data);
         $pool->reset('OpenIDUsers');
         $pool->setQualifier('openid', 'equals', $openid, true);
         $lastcount = $pool->getCell('logincount');
         $pool->reset('OpenIDUsers');
         $pool->setAttribute('openidinfo', $data, true);
         $pool->setAttribute('lastlogin', Timestamp::getUNIXTime());
         $pool->setAttribute('logincount', $lastcount + 1);
         $pool->setQualifier('openid', 'equals', $openid, true);
         $pool->update();
     }
     return;
 }
开发者ID:Avantians,项目名称:Textcube,代码行数:42,代码来源:Textcube.Control.Openid.php


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