Typecho自定义评论样式

in Typecho with 6 commentsand 5814 read

可以设置自定义的评论样式,具体代码如下:

<?php
function threadedComments($comments,$singleCommentOptions) {
$imgUrl = Helper::options()->siteUrl . 'usr/themes/thinkH/images/pingback.jpg';
$author = '<a href="'.$comments->url.'" rel="external nofollow" target="_blank">'.$comments->author.'';
$depth = $comments->levels +1;
if($depth<=1){
$size = (int) Helper::options()->commentsPageSize;
$curr = (int) $comments->currentPage;//这个数值为0,暂不清楚是干什么的,但我需要一个输出当前页数的函数!!!
$cn   = (int) $comments->sequence;
$n = $cn + $curr*$size;
$floor = 'For All '.$n.' The-FatherC'; // 主楼层
}else{
$floor = ($depth-1).'#InnerC';  // 子楼层
$style = 'style="margin-left:' . ceil(5/$depth) . 'px;"';
}
?>
<li id="<?php $comments->theId(); ?>" <?php if( $depth > 1) echo $style;?>>
<div id="comment-<?php $comments->theId(); ?>">
<div  class="comment-body <?php echo 'depth-'.$depth;?>">
<div class="commentmeta <?php echo 'commentmeta-'.$depth;?>"></div>
<div class="comment-author">
<?php
$tLC = (Helper::options()->ShGravatar)?(Helper::options()->ShGravatar):0;
if ($tLC == 0) {
?>
<?php include("include/avatar.php"); ?>
<?php }else{?>
<?php $comments->gravatar(32, 'identicon', 'X', 'avatar'); ?>
<?php } ?>
<cite class="fn"><?php commentApprove($comments, $comments->mail); ?><?php echo $author; ?></cite>
<span><?php $comments->date('Y-m-d H:i:s') ?></span>  
<span class="subcolor">This</span><span style="margin-left:5px;color:#617d0e;font-size:12px">
<?php if($comments->levels == 0): ?>
<?php if($comments->sequence == 1): ?>沙发
<?php elseif($comments->sequence == 2): ?>板凳
<?php elseif($comments->sequence == 3): ?>地毯
<?php elseif($comments->sequence == 4): ?>门口
<?php elseif($comments->sequence == 5): ?>走廊
<?php elseif($comments->sequence == 6): ?>楼梯
<?php elseif($comments->sequence == 7): ?>宅院
<?php elseif($comments->sequence == 8): ?>小区
<?php elseif($comments->sequence == 9): ?>街道
<?php else: ?>
第<?php  $comments->sequence(); ?>号大院<?php endif; ?>
<?php endif; ?>
</span><span class="subcolor"><?php echo $floor; ?></span>
<span class="comment-reply">
<?php $comments->reply('reply'); ?>
</span>
<div class="subcolor ">
[<?php GetBrowser($comments->agent)?> @ <?php GetOs($comments->agent)?>]
</div>
</div>
<div class="comment_content"><?php $comments->content(); ?></div>
</div>
<div class="children">
<?php if ($comments->children) { ?><?php $comments->threadedComments($singleCommentOptions); ?><?php } ?>
</div>
</div>
</li>
<?php
}
?>
评论 / Cancel Reply
  1. lzc

    求阿鲁表情包打包链接

    回复
  2. 看看,学习学习,感谢分享。

    回复
    1. @Jdeal

      你才是真大佬啊,修改的很不错,我这个太简陋了!

      回复
  3. 我在

    哪个文件啊?

    回复
  4. 而且,我很中意你的OwO表情样式,特别是泡泡和阿鲁表情包,里面的表情很丰富,而且你家的阿鲁表情包比别人家的全,例如这张有些人就没有。

    回复
  5. 这些代码放在哪个文件里面,博主能不能说详细一点啊,小白感觉在看天书,不知如何下手。

    回复