widget('Widget_Archive')->created)) { $postCreated = $this->widget('Widget_Archive')->created; } ?> authorId) { if ($comments->authorId == $comments->ownerId) { $commentClass .= " comment-by-author"; } else { $commentClass .= " comment-by-user"; } } ?>
  • levelsAlt(" comment-level-odd", " comment-level-even"); } else { echo " comment-parent"; } $comments->alt(" comment-odd", " comment-even"); echo $commentClass; ?>">
    authorId == $comments->ownerId) { ?> <?php $comments->author; ?> <?php $comments->author; ?>
    url) { echo '' . $comments->author . ''; } else { // 如果没有网址,也显示为橙色文本 echo '' . $comments->author . ''; } } ?> authorId); } ?> authorId) . ')'; } ?> authorId > 0) { ?> mail); ?> status == "waiting") { ?> - 您的评论正等待审核!
    coid && $comments->cid): ?> coid, $comments->cid); ?> reply("回复"); ?>
    coid); // 如果是回复评论,在内容前面添加@被回复用户(可跳转) $replyPrefix = ''; if ($comments->parent > 0) { $parentAuthor = getParentCommentAuthor($comments->parent); $parentUrl = getParentCommentUrl($comments->parent); if ($parentAuthor) { // 修复@作者名重复问题:只在没有commentAt时才添加replyPrefix if (!$commentAt) { if ($parentUrl) { $replyPrefix = '@' . $parentAuthor . ' '; } else { $replyPrefix = '@' . $parentAuthor . ' '; } } } } $cos = parseBiaoQing($comments->content); ?>
    hasLogin()) { ?> authorId > 0 && $comments->authorId == $comments->ownerId); // 如果不是管理员,添加相对时间到data属性中 if (!$isAdminComment && function_exists('getRelativeTime')) { global $postCreated; $relativeTime = getRelativeTime($comments->created, $postCreated, false); if ($relativeTime) { echo ' data-relative="ID: ' . $comments->coid . ' | ' . htmlspecialchars($relativeTime) . '评论"'; } else { echo ' data-relative="ID: ' . $comments->coid . '"'; } } elseif (!$isAdminComment) { // 如果函数不存在,至少显示ID echo ' data-relative="ID: ' . $comments->coid . '"'; } ?> > created); ?>
    created, $postCreated, false); if ($relativeTime) { echo '本评论ID: ' . $comments->coid . ' | ' . htmlspecialchars($relativeTime) . '评论'; } else { echo '本评论ID: ' . $comments->coid; } } else { echo '本评论ID: ' . $comments->coid; } ?>
    ip); ?> agent); ?>
    children) { ?>
    threadedComments($options); ?>
  • fetchRow($db->select('author') ->from('table.comments') ->where('coid = ?', $parentId)); return isset($row['author']) ? $row['author'] : null; } catch (Exception $e) { return null; } } /** * 获取父评论URL * @param int $parentId 父评论ID * @return string 父评论URL */ function getParentCommentUrl($parentId) { $db = Typecho_Db::get(); try { $row = $db->fetchRow($db->select('url') ->from('table.comments') ->where('coid = ?', $parentId)); return isset($row['url']) && !empty($row['url']) ? $row['url'] : null; } catch (Exception $e) { return null; } } ?> hasLogin()) { ?>
    comments()->to($comments); ?> allow("comment")): ?>
    user->hasLogin()): ?>
    " required/> " options->commentsRequireMail): ?> required /> " options->commentsRequireURL): ?> required /> widget("Widget_Security"); ?>
    cancelReply(); ?>
    have()): ?> listComments(); ?> pageNav("上一页", "下一页", 0, ".."); ?>