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


PHP Gdn_Format::toTimeStamp方法代碼示例

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


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

示例1: newVisit

 /**
  *
  *
  * @return bool
  */
 public function newVisit()
 {
     static $NewVisit = null;
     if ($NewVisit !== null) {
         return $NewVisit;
     }
     if (!$this->User) {
         return false;
     }
     $Current = $this->getCookie('-Vv');
     $Now = time();
     $TimeToExpire = 1200;
     // 20 minutes
     $Expires = $Now + $TimeToExpire;
     // Figure out if this is a new visit.
     if ($Current) {
         $NewVisit = false;
         // user has cookie, not a new visit.
     } elseif (Gdn_Format::toTimeStamp($this->User->DateLastActive) + $TimeToExpire > $Now) {
         $NewVisit = false;
     } else {
         $NewVisit = true;
     }
     $this->setCookie('-Vv', $Now, $Expires);
     return $NewVisit;
 }
開發者ID:sitexa,項目名稱:vanilla,代碼行數:31,代碼來源:class.session.php

示例2: foreach

<?php 
$SlugBase = AddonModel::slug($this->Data, FALSE);
foreach ($this->data('Versions') as $Version) {
    $VersionSlug = urlencode($SlugBase . '-' . $Version['Version']);
    ?>
    <item>
        <title><?php 
    echo Gdn_Format::text($this->data('Name') . ' ' . $Version['Version']);
    ?>
</title>
        <link><?php 
    echo url('/addon/' . $VersionSlug, TRUE);
    ?>
</link>
        <pubDate><?php 
    echo date(DATE_RSS, Gdn_Format::toTimeStamp($Version['DateInserted']));
    ?>
</pubDate>
        <dc:creator><?php 
    echo Gdn_Format::text($this->data('InsertName'));
    ?>
</dc:creator>
        <guid isPermaLink="true"><?php 
    echo Url('/addons/addon/' . $VersionSlug, TRUE);
    ?>
</guid>
        <description><![CDATA[<?php 
    echo Gdn_Format::html($this->data('Description'));
    ?>
]]></description>
    </item>
開發者ID:vanilla,項目名稱:community,代碼行數:31,代碼來源:addon_rss.php


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