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


PHP Gdn_Format::DateFull方法代码示例

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


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

示例1: dateUpdated

 function dateUpdated($Row, $Wrap = null)
 {
     $Result = '';
     $DateUpdated = GetValue('DateUpdated', $Row);
     $UpdateUserID = GetValue('UpdateUserID', $Row);
     if ($DateUpdated) {
         $UpdateUser = Gdn::UserModel()->GetID($UpdateUserID);
         if ($UpdateUser) {
             $Title = sprintf(T('Edited %s by %s.'), Gdn_Format::DateFull($DateUpdated), GetValue('Name', $UpdateUser));
         } else {
             $Title = sprintf(T('Edited %s.'), Gdn_Format::DateFull($DateUpdated));
         }
         $Result = ' <span title="' . htmlspecialchars($Title) . '" class="DateUpdated">' . sprintf(T('edited %s'), Gdn_Format::Date($DateUpdated)) . '</span> ';
         if ($Wrap) {
             $Result = $Wrap[0] . $Result . $Wrap[1];
         }
     }
     return $Result;
 }
开发者ID:rensi4rn,项目名称:vanilla,代码行数:19,代码来源:functions.render.php

示例2: WriteDiscussion

    function WriteDiscussion($Discussion, &$Sender, &$Session)
    {
        $CssClass = CssClass($Discussion);
        $DiscussionUrl = $Discussion->Url;
        $Category = CategoryModel::Categories($Discussion->CategoryID);
        if ($Session->UserID) {
            $DiscussionUrl .= '#latest';
        }
        $Sender->EventArguments['DiscussionUrl'] =& $DiscussionUrl;
        $Sender->EventArguments['Discussion'] =& $Discussion;
        $Sender->EventArguments['CssClass'] =& $CssClass;
        $First = UserBuilder($Discussion, 'First');
        $Last = UserBuilder($Discussion, 'Last');
        $Sender->EventArguments['FirstUser'] =& $First;
        $Sender->EventArguments['LastUser'] =& $Last;
        $Sender->FireEvent('BeforeDiscussionName');
        $DiscussionName = $Discussion->Name;
        if ($DiscussionName == '') {
            $DiscussionName = T('Blank Discussion Topic');
        }
        $Sender->EventArguments['DiscussionName'] =& $DiscussionName;
        static $FirstDiscussion = TRUE;
        if (!$FirstDiscussion) {
            $Sender->FireEvent('BetweenDiscussion');
        } else {
            $FirstDiscussion = FALSE;
        }
        $Discussion->CountPages = ceil($Discussion->CountComments / $Sender->CountCommentsPerPage);
        ?>
<li id="Discussion_<?php 
        echo $Discussion->DiscussionID;
        ?>
" class="<?php 
        echo $CssClass;
        ?>
">
   <?php 
        if (!property_exists($Sender, 'CanEditDiscussions')) {
            $Sender->CanEditDiscussions = GetValue('PermsDiscussionsEdit', CategoryModel::Categories($Discussion->CategoryID)) && C('Vanilla.AdminCheckboxes.Use');
        }
        $Sender->FireEvent('BeforeDiscussionContent');
        //   WriteOptions($Discussion, $Sender, $Session);
        ?>
   <span class="Options">
      <?php 
        echo OptionsList($Discussion);
        echo BookmarkButton($Discussion);
        ?>
   </span>
   <div class="ItemContent Discussion">
      <div class="Title">
      <?php 
        echo AdminCheck($Discussion, array('', ' '));
        WriteTags($Discussion);
        echo Anchor(SliceString($DiscussionName, 80), $DiscussionUrl, '', array('title' => $DiscussionName));
        if (C('Vanilla.Categories.Use') && $Category) {
            echo Wrap(Anchor(htmlspecialchars($Discussion->Category), CategoryUrl($Discussion->CategoryUrlCode)), 'span', array('class' => 'Tag MItem Category ' . $Category['CssClass']));
        }
        $Sender->FireEvent('AfterDiscussionTitle');
        echo NewComments($Discussion);
        ?>
      </div>
      <div class="Meta Meta-Discussion">
         <div class="row">
            <div class="col-lg-4">
               <span class="MItem LastCommentBy"><?php 
        echo UserAnchor($First);
        ?>
</span>
            </div>
            <div class="col-lg-3">
               <span class="MItem MCount ViewCount"><?php 
        printf(PluralTranslate($Discussion->CountViews, '%s view html', '%s views html', '%s view', '%s views'), BigPlural($Discussion->CountViews, '%s view'));
        ?>
</span>
               <span class="MItem MCount CommentCount"><?php 
        printf(PluralTranslate($Discussion->CountComments, '%s comment html', '%s comments html', '%s comment', '%s comments'), BigPlural($Discussion->CountComments, '%s comment'));
        ?>
</span>
               <span class="MItem MCount DiscussionScore Hidden"><?php 
        $Score = $Discussion->Score;
        if ($Score == '') {
            $Score = 0;
        }
        printf(Plural($Score, '%s point', '%s points', BigPlural($Score, '%s point')));
        ?>
</span>
            </div>
            <div class="col-lg-5 LastPost">
               <?php 
        $Sender->FireEvent('AfterCountMeta');
        if ($Discussion->LastCommentID != '') {
            echo ' <span class="MItem LastCommentBy">' . sprintf(T('Latest: %1$s'), UserAnchor($Last)) . '</span> ';
            echo '• <span class="MItem LastCommentDate">' . Gdn_Format::DateFull($Discussion->LastDate, 'html') . '</span>';
            //echo ' <span class="MItem LastCommentDate">'.Gdn_Format::Date($Discussion->LastDate, 'html').'</span>';
        } else {
            echo ' <span class="MItem LastCommentBy">' . sprintf(T('Latest: %1$s'), UserAnchor($First)) . '</span> ';
            echo '• <span class="MItem LastCommentDate">' . Gdn_Format::DateFull($Discussion->FirstDate, 'html');
            if ($Source = GetValue('Source', $Discussion)) {
                echo ' ' . sprintf(T('via %s'), T($Source . ' Source', $Source));
//.........这里部分代码省略.........
开发者ID:pp-work,项目名称:forum-theme,代码行数:101,代码来源:helper_functions.php

示例3: WriteComment

    function WriteComment($Comment, $Sender, $Session, $CurrentOffset)
    {
        static $UserPhotoFirst = NULL;
        if ($UserPhotoFirst === NULL) {
            $UserPhotoFirst = C('Vanilla.Comment.UserPhotoFirst', TRUE);
        }
        $Author = Gdn::UserModel()->GetID($Comment->InsertUserID);
        //UserBuilder($Comment, 'Insert');
        $Permalink = GetValue('Url', $Comment, '/discussion/comment/' . $Comment->CommentID . '/#Comment_' . $Comment->CommentID);
        // Set CanEditComments (whether to show checkboxes)
        if (!property_exists($Sender, 'CanEditComments')) {
            $Sender->CanEditComments = $Session->CheckPermission('Vanilla.Comments.Edit', TRUE, 'Category', 'any') && C('Vanilla.AdminCheckboxes.Use');
        }
        // Prep event args
        $CssClass = CssClass($Comment, $CurrentOffset);
        $Sender->EventArguments['Comment'] =& $Comment;
        $Sender->EventArguments['Author'] =& $Author;
        $Sender->EventArguments['CssClass'] =& $CssClass;
        // DEPRECATED ARGUMENTS (as of 2.1)
        $Sender->EventArguments['Object'] =& $Comment;
        $Sender->EventArguments['Type'] = 'Comment';
        // First comment template event
        $Sender->FireEvent('BeforeCommentDisplay');
        ?>
<li class="<?php 
        echo $CssClass;
        ?>
">
   <div class="Comment">
      
      <?php 
        // Write a stub for the latest comment so it's easy to link to it from outside.
        if ($CurrentOffset == Gdn::Controller()->Data('_LatestItem')) {
            echo '<a class="anchor" id="latest"></a>';
            echo '<a class="anchor" id="Comment_' . $Comment->CommentID . '"></a>';
        } else {
            echo '<a class="anchor" id="Comment_' . $Comment->CommentID . '"></a>';
        }
        ?>
      <div class="Options">
         <?php 
        WriteCommentOptions($Comment);
        ?>
      </div>
      <?php 
        $Sender->FireEvent('BeforeCommentMeta');
        ?>
      <div class="Item-Header CommentHeader">
         <div class="AuthorWrap">
            <span class="Author">
               <?php 
        if ($UserPhotoFirst) {
            echo UserPhoto($Author);
            echo UserAnchor($Author, 'Username');
        } else {
            echo UserAnchor($Author, 'Username');
            echo UserPhoto($Author);
        }
        echo FormatMeAction($Comment);
        $Sender->FireEvent('AuthorPhoto');
        ?>
            </span>
            <span class="AuthorInfo">
               <?php 
        echo ' ' . WrapIf(htmlspecialchars(GetValue('Title', $Author)), 'span', array('class' => 'MItem AuthorTitle'));
        echo ' ' . WrapIf(htmlspecialchars(GetValue('Location', $Author)), 'span', array('class' => 'MItem AuthorLocation'));
        $Sender->FireEvent('AuthorInfo');
        ?>
            </span>   
         </div>
         <div class="Meta CommentMeta CommentInfo">
            <span class="MItem DateCreated">
               <?php 
        echo Anchor(Gdn_Format::DateFull($Comment->DateInserted, 'html'), $Permalink, 'Permalink', array('name' => 'Item_' . $CurrentOffset, 'rel' => 'nofollow'));
        ?>
            </span>
            <?php 
        echo DateUpdated($Comment, array('<span class="MItem">', '</span>'));
        ?>
            <?php 
        // Include source if one was set
        if ($Source = GetValue('Source', $Comment)) {
            echo Wrap(sprintf(T('via %s'), T($Source . ' Source', $Source)), 'span', array('class' => 'MItem Source'));
        }
        $Sender->FireEvent('CommentInfo');
        $Sender->FireEvent('InsideCommentMeta');
        // DEPRECATED
        $Sender->FireEvent('AfterCommentMeta');
        // DEPRECATED
        // Include IP Address if we have permission
        if ($Session->CheckPermission('Garden.Moderation.Manage')) {
            echo Wrap(IPAnchor($Comment->InsertIPAddress), 'span', array('class' => 'MItem IPAddress'));
        }
        ?>
         </div>
      </div>
      <div class="Item-BodyWrap">
         <div class="Item-Body">
            <div class="Message">
               <?php 
//.........这里部分代码省略.........
开发者ID:pp-work,项目名称:forum-theme,代码行数:101,代码来源:helper_functions.php

示例4: foreach

                }
                if (count($Category->ChildIDs) > 0) {
                    foreach ($Category->ChildIDs as $SubcatRow) {
                        if (isset($lastPosts[$SubcatRow])) {
                            $lastPostsInner[] = $lastPosts[$SubcatRow];
                        }
                    }
                    foreach ($lastPostsInner as $key => $row) {
                        $postDates[$key] = $row['LastDateInserted'];
                    }
                }
                if (count($lastPostsInner) > 1) {
                    array_multisort($postDates, SORT_DESC, $lastPostsInner);
                }
                if (count($lastPostsInner) > 0) {
                    $CatList .= '<div class="MItem LastDiscussionTitle">' . Anchor(Gdn_Format::Text(SliceString($lastPostsInner[0]['LastTitle'], 40)), $lastPostsInner[0]['LastUrl']) . '</div>' . '<div class="MItem LastCommentDate">' . Anchor($lastPostsInner[0]['LastName'], 'profile/' . $lastPostsInner[0]['LastUserID'] . '/' . $lastPostsInner[0]['LastName']) . ' • ' . Gdn_Format::DateFull($lastPostsInner[0]['LastDateInserted'], 'html') . '</div>';
                }
                $CatList .= '</div>
                 </div>
               </div>

            </li>';
            }
        }
    }
}
// If there are any remaining child categories that have been collected, do
// the replacement one last time.
if ($ChildCategories != '') {
    $CatList = str_replace('{ChildCategories}', '<span class="ChildCategories">' . Wrap(T('Child Categories:'), 'b') . ' ' . $ChildCategories . '</span>', $CatList);
}
开发者ID:pp-work,项目名称:forum-theme,代码行数:31,代码来源:all.php

示例5: FormatMeAction

}
echo FormatMeAction($Discussion);
?>
            </span>
            <span class="AuthorInfo">
               <?php 
echo WrapIf(htmlspecialchars(GetValue('Title', $Author)), 'span', array('class' => 'MItem AuthorTitle'));
echo WrapIf(htmlspecialchars(GetValue('Location', $Author)), 'span', array('class' => 'MItem AuthorLocation'));
$this->FireEvent('AuthorInfo');
?>
            </span>
         </div>
         <div class="Meta DiscussionMeta">
            <span class="MItem DateCreated">
               <?php 
echo Anchor(Gdn_Format::DateFull($Discussion->DateInserted, 'html'), $Discussion->Url, 'Permalink', array('rel' => 'nofollow'));
?>
            </span>
            <?php 
echo DateUpdated($Discussion, array('<span class="MItem">', '</span>'));
?>
            <?php 
// Include source if one was set
if ($Source = GetValue('Source', $Discussion)) {
    echo ' ' . Wrap(sprintf(T('via %s'), T($Source . ' Source', $Source)), 'span', array('class' => 'MItem MItem-Source')) . ' ';
}
// Category
if (C('Vanilla.Categories.Use')) {
    echo ' <span class="MItem Category">';
    echo ' ' . T('in') . ' ';
    echo Anchor(htmlspecialchars($this->Data('Discussion.Category')), CategoryUrl($this->Data('Discussion.CategoryUrlCode')));
开发者ID:pp-work,项目名称:forum-theme,代码行数:31,代码来源:discussion.php


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