/** * 评论回调函数 * * @access private * @return void */ private function threadedCommentsCallback() { $singleCommentOptions = $this->_singleCommentOptions; if ($this->_customThreadedCommentsCallback) { return threadedComments($this, $singleCommentOptions); } $commentClass = ''; if ($this->authorId) { if ($this->authorId == $this->ownerId) { $commentClass .= ' comment-by-author'; } else { $commentClass .= ' comment-by-user'; } } ?> <li itemscope itemtype="http://schema.org/UserComments" id="<?php $this->theId(); ?> " class="comment-body<?php if ($this->levels > 0) { echo ' comment-child'; $this->levelsAlt(' comment-level-odd', ' comment-level-even'); } else { echo ' comment-parent'; } $this->alt(' comment-odd', ' comment-even'); echo $commentClass; ?> "> <div class="comment-author" itemprop="creator" itemscope itemtype="http://schema.org/Person"> <span itemprop="image"><?php $this->gravatar($singleCommentOptions->avatarSize, $singleCommentOptions->defaultAvatar); ?> </span> <cite class="fn" itemprop="name"><?php $singleCommentOptions->beforeAuthor(); $this->author(); $singleCommentOptions->afterAuthor(); ?> </cite> </div> <div class="comment-meta"> <a href="<?php $this->permalink(); ?> "><time itemprop="commentTime" datetime="<?php $this->date('c'); ?> "><?php $singleCommentOptions->beforeDate(); $this->date($singleCommentOptions->dateFormat); $singleCommentOptions->afterDate(); ?> </time></a> <?php if ('waiting' == $this->status) { ?> <em class="comment-awaiting-moderation"><?php $singleCommentOptions->commentStatus(); ?> </em> <?php } ?> </div> <div class="comment-content" itemprop="commentText"> <?php $this->content(); ?> </div> <div class="comment-reply"> <?php $this->reply($singleCommentOptions->replyWord); ?> </div> <?php if ($this->children) { ?> <div class="comment-children" itemprop="discusses"> <?php $this->threadedComments(); ?> </div> <?php } ?> </li> <?php }
/** * 评论回调函数 * * @access private * @return void */ private function threadedCommentsCallback() { $singleCommentOptions = $this->_singleCommentOptions; if ($this->_customThreadedCommentsCallback) { return threadedComments($this, $singleCommentOptions); } $this->realAuthorUrl = $this->authorId ? $this->poster->ucenter : 'javascript:;'; $commentClass = ''; if ($this->authorId && $this->authorId == $this->ownerId) { $commentClass = ' reply-by-author'; } echo "<div id=\"{$this->theId}\" class=\"cell{$commentClass}\"><div class=\"reply-avatar fl\">"; $this->poster->avatar(48); echo '</div><div class="fr">'; echo '<a href="javascript:replyAt(\'' . $this->poster->name . '\');">' . $singleCommentOptions->replyWord . '</a>'; echo '</div><p><a href="' . $this->realAuthorUrl . '">' . $this->poster->name . '</a>'; echo '<span class="reply-time">'; $this->dateWord(); echo '</span></p><div class="reply-content">'; $this->content(); echo '</div></div>'; if ($this->children) { $this->threadedComments(); } }
/** * 评论回调函数 * * @access private * @return void */ private function threadedCommentsCallback() { $singleCommentOptions = $this->_singleCommentOptions; if ($this->_customThreadedCommentsCallback) { return threadedComments($this, $singleCommentOptions); } $this->realAuthorUrl = $this->authorId ? $this->poster->ucenter : 'javascript:;'; $commentClass = ''; if ($this->authorId && $this->authorId == $this->ownerId) { $commentClass = ' reply-by-author'; } echo "<div id=\"{$this->theId}\" class=\"cell{$commentClass}\"><div class=\"reply-avatar fl\">"; if ($this->options->commentsAvatar) { $this->poster->avatar(48); } echo '</div><div class="fr">'; if ($this->user->hasLogin()) { echo '<a href="javascript:replyAt(\'' . $this->poster->name . '\');">' . $singleCommentOptions->replyWord . '</a>'; } if (!$this->options->commentsPageBreak) { $no = $this->sequence; } else { $no = ($this->_currentPage - 1) * $this->options->commentsPageSize + $this->sequence; } if ('DESC' == $this->options->commentsOrder) { $no = $this->getTotal() - $no + 1; } echo '<span class="no">' . $no . '</span>'; echo '</div><p><a href="' . $this->realAuthorUrl . '">' . $this->poster->name . '</a>'; echo '<span class="reply-time">'; $this->dateWord(); echo '</span>'; if ('waiting' == $this->status) { echo '<span class="reply-waiting">' . $singleCommentOptions->commentStatus . '</span>'; } echo '</p><div class="reply-content">'; $this->content(); echo '</div></div>'; }
/** * 评论回调函数 * * @access private * @param string $singleCommentOptions 单个评论自定义选项 * @return void */ private function threadedCommentsCallback($singleCommentOptions) { if ($this->_customThreadedCommentsCallback) { return threadedComments($this, $singleCommentOptions); } $commentClass = ''; if ($this->authorId) { if ($this->authorId == $this->ownerId) { $commentClass .= ' comment-by-author'; } else { $commentClass .= ' comment-by-user'; } } $commentLevelClass = $this->levels > 0 ? ' comment-child' : ' comment-parent'; ?> <li id="<?php $this->theId(); ?> " class="comment-body<?php if ($this->levels > 0) { echo ' comment-child'; $this->levelsAlt(' comment-level-odd', ' comment-level-even'); } else { echo ' comment-parent'; } $this->alt(' comment-odd', ' comment-even'); echo $commentClass; ?> "> <div class="comment-author"> <?php $this->gravatar($singleCommentOptions->avatarSize, $singleCommentOptions->defaultAvatar); ?> <cite class="fn"><?php $singleCommentOptions->beforeAuthor(); $this->author(); $singleCommentOptions->afterAuthor(); ?> </cite> </div> <div class="comment-meta"> <a href="<?php $this->permalink(); ?> "><?php $singleCommentOptions->beforeDate(); $this->date($singleCommentOptions->dateFormat); $singleCommentOptions->afterDate(); ?> </a> <?php if ('waiting' == $this->status) { ?> <em class="comment-awaiting-moderation"><?php $singleCommentOptions->commentStatus(); ?> </em> <?php } ?> </div> <div class="comment-content"> <?php $this->content(); ?> </div> <div class="comment-reply"> <?php $this->reply($singleCommentOptions->replyWord); ?> </div> <?php if ($this->children) { ?> <div class="comment-children"> <?php $this->threadedComments($singleCommentOptions); ?> </div> <?php } ?> </li> <?php }