当前位置: 首页>>代码示例>>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方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: NewVisit

 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;
     } elseif (Gdn_Format::ToTimeStamp($this->User->DateLastActive) + $TimeToExpire > $Now) {
         $NewVisit = FALSE;
     } else {
         $NewVisit = TRUE;
     }
     $this->SetCookie('-Vv', $Now, $Expires);
     return $NewVisit;
 }
开发者ID:rnovino,项目名称:Garden,代码行数:25,代码来源:class.session.php

示例2: AddCategoryColumns

 /**
  * Modifies category data before it is returned.
  *
  * Adds CountAllDiscussions column to each category representing the sum of
  * discussions within this category as well as all subcategories.
  * 
  * @since 2.0.17
  * @access public
  *
  * @param object $Data SQL result.
  */
 public static function AddCategoryColumns($Data)
 {
     $Result =& $Data->Result();
     $Result2 = $Result;
     foreach ($Result as &$Category) {
         if (!property_exists($Category, 'CountAllDiscussions')) {
             $Category->CountAllDiscussions = $Category->CountDiscussions;
         }
         if (!property_exists($Category, 'CountAllComments')) {
             $Category->CountAllComments = $Category->CountComments;
         }
         // Calculate the following field.
         $Following = !((bool) GetValue('Archived', $Category) || (bool) GetValue('Unfollow', $Category));
         $Category->Following = $Following;
         $DateMarkedRead = GetValue('DateMarkedRead', $Category);
         $UserDateMarkedRead = GetValue('UserDateMarkedRead', $Category);
         if (!$DateMarkedRead) {
             $DateMarkedRead = $UserDateMarkedRead;
         } elseif ($UserDateMarkedRead && Gdn_Format::ToTimestamp($UserDateMarkedRead) > Gdn_Format::ToTimeStamp($DateMarkedRead)) {
             $DateMarkedRead = $UserDateMarkedRead;
         }
         // Set appropriate Last* columns.
         SetValue('LastTitle', $Category, GetValue('LastDiscussionTitle', $Category, NULL));
         $LastDateInserted = GetValue('LastDateInserted', $Category, NULL);
         if (GetValue('LastCommentUserID', $Category) == NULL) {
             SetValue('LastCommentUserID', $Category, GetValue('LastDiscussionUserID', $Category, NULL));
             SetValue('DateLastComment', $Category, GetValue('DateLastDiscussion', $Category, NULL));
             SetValue('LastUserID', $Category, GetValue('LastDiscussionUserID', $Category, NULL));
             $LastDiscussion = ArrayTranslate($Category, array('LastDiscussionID' => 'DiscussionID', 'CategoryID' => 'CategoryID', 'LastTitle' => 'Name'));
             SetValue('LastUrl', $Category, DiscussionUrl($LastDiscussion, FALSE, '//') . '#latest');
             if (is_null($LastDateInserted)) {
                 SetValue('LastDateInserted', $Category, GetValue('DateLastDiscussion', $Category, NULL));
             }
         } else {
             $LastDiscussion = ArrayTranslate($Category, array('LastDiscussionID' => 'DiscussionID', 'CategoryID' => 'CategoryID', 'LastTitle' => 'Name'));
             SetValue('LastUserID', $Category, GetValue('LastCommentUserID', $Category, NULL));
             SetValue('LastUrl', $Category, DiscussionUrl($LastDiscussion, FALSE, '//') . '#latest');
             if (is_null($LastDateInserted)) {
                 SetValue('LastDateInserted', $Category, GetValue('DateLastComment', $Category, NULL));
             }
         }
         $LastDateInserted = GetValue('LastDateInserted', $Category, NULL);
         if ($DateMarkedRead) {
             if ($LastDateInserted) {
                 $Category->Read = Gdn_Format::ToTimestamp($DateMarkedRead) >= Gdn_Format::ToTimestamp($LastDateInserted);
             } else {
                 $Category->Read = TRUE;
             }
         } else {
             $Category->Read = FALSE;
         }
         foreach ($Result2 as $Category2) {
             if ($Category2->TreeLeft > $Category->TreeLeft && $Category2->TreeRight < $Category->TreeRight) {
                 $Category->CountAllDiscussions += $Category2->CountDiscussions;
                 $Category->CountAllComments += $Category2->CountComments;
             }
         }
     }
 }
开发者ID:robhazkes,项目名称:Garden,代码行数:70,代码来源:class.categorymodel.php

示例3: array

<?php 
$Activities = $this->data('Activities', array());
foreach ($Activities as $Activity) {
    $Author = UserBuilder($Activity, 'Activity');
    ?>
    <item>
        <title><?php 
    echo Gdn_Format::text(val('Headline', $Activity));
    ?>
</title>
        <link><?php 
    echo url(userUrl($Author, '', 'activity'), true);
    ?>
</link>
        <pubDate><?php 
    echo date('r', Gdn_Format::ToTimeStamp(val('DateUpdated', $Activity)));
    ?>
</pubDate>
        <dc:creator><?php 
    echo Gdn_Format::text($Author->Name);
    ?>
</dc:creator>
        <guid
            isPermaLink="false"><?php 
    echo val('ActivityID', $Activity) . '@' . Url(userUrl($Author, '', 'activity'));
    ?>
</guid>
        <?php 
    if ($Story = val('Story', $Activity)) {
        ?>
            <description><![CDATA[<?php 
开发者ID:karanjitsingh,项目名称:iecse-forum,代码行数:31,代码来源:activity_rss.php

示例4: foreach

?>
" rel="self" type="application/rss+xml" />
<?php 
foreach ($this->DiscussionData->Result() as $Discussion) {
    ?>
   <item>
      <title><?php 
    echo Gdn_Format::Text($Discussion->Name);
    ?>
</title>
      <link><?php 
    echo htmlspecialchars(Url('/discussion/' . $Discussion->DiscussionID . '/' . Gdn_Format::Url($Discussion->Name), TRUE));
    ?>
</link>
      <pubDate><?php 
    echo date(DATE_RSS, Gdn_Format::ToTimeStamp($Discussion->DateInserted));
    ?>
</pubDate>
      <dc:creator><?php 
    echo Gdn_Format::Text($Discussion->FirstName);
    ?>
</dc:creator>
      <guid isPermaLink="false"><?php 
    echo $Discussion->DiscussionID . '@' . Url('/discussions');
    ?>
</guid>
      <description><![CDATA[<?php 
    echo Gdn_Format::To($Discussion->Body, $Discussion->Format);
    ?>
]]></description>
   </item>
开发者ID:edward-tsai,项目名称:vanilla4china,代码行数:31,代码来源:taggeddiscussions_rss.php

示例5: Url

    ?>
]]></title>
        <link href="<?php 
    echo $Discussion->Url;
    ?>
"/>
        <id><?php 
    echo $Discussion->DiscussionID . '@' . Url('/discussions');
    ?>
</id>
        <author>
            <name><?php 
    echo Gdn_Format::text($Discussion->FirstName);
    ?>
</name>
            <uri><?php 
    echo htmlspecialchars(url('/profile/' . $Discussion->InsertUserID . '/' . $Discussion->FirstName, true));
    ?>
</uri>
        </author>
        <updated><?php 
    echo date('c', Gdn_Format::ToTimeStamp($Discussion->DateLastComment));
    ?>
</updated>
        <summary><![CDATA[<?php 
    echo Gdn_Format::RssHtml($Discussion->Body, $Discussion->Format);
    ?>
]]></summary>
    </entry>
<?php 
}
开发者ID:caidongyun,项目名称:vanilla,代码行数:31,代码来源:index_atom.php

示例6: foreach

<div class="SubTitleWrapper">
    <div class="SubTitle">
        <h1>Members who have filled out the Vanilla Forums Contributor Agreement</h1>
    </div>
</div>
<table>
    <thead>
    <tr>
        <td>Name</td>
        <td>Date</td>
    </tr>
    </thead>
    <tbody>
    <?php 
foreach ($this->UserData->Result() as $User) {
    ?>
        <tr>
            <td><?php 
    echo $User->Name;
    ?>
</td>
            <td><?php 
    echo date("m/d/y", Gdn_Format::ToTimeStamp($User->DateContributorAgreement));
    ?>
</td>
        </tr>
        <?php 
}
?>
    </tbody>
</table>
开发者ID:vanilla,项目名称:community,代码行数:31,代码来源:signed.php

示例7: foreach

?>
" rel="self" type="application/rss+xml" />
<?php 
foreach ($this->DiscussionData->Result() as $Discussion) {
    ?>
   <item>
      <title><?php 
    echo Gdn_Format::Text($Discussion->Name);
    ?>
</title>
      <link><?php 
    echo $Discussion->Url;
    ?>
</link>
      <pubDate><?php 
    echo date('r', Gdn_Format::ToTimeStamp($Discussion->DateInserted));
    ?>
</pubDate>
      <dc:creator><?php 
    echo Gdn_Format::Text($Discussion->FirstName);
    ?>
</dc:creator>
      <guid isPermaLink="false"><?php 
    echo $Discussion->DiscussionID . '@' . Url('/discussions');
    ?>
</guid>
      <description><![CDATA[<?php 
    echo Gdn_Format::RssHtml($Discussion->Body, $Discussion->Format);
    ?>
]]></description>
   </item>
开发者ID:elpum,项目名称:TgaForumBundle,代码行数:31,代码来源:index_rss.php


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