typecho评论拆分,没时间写详细的,自己参考,只能说可以将就用


<?php function threadedComments($comments, $options) {
    $commentClass = '';
    if ($comments->authorId) {
        if ($comments->authorId == $comments->ownerId) {
            $commentClass .= ' comment-by-author';  //如果是文章作者的评论添加 .comment-by-author 样式
        } else {
            $commentClass .= ' comment-by-user';  //如果是评论作者的添加 .comment-by-user 样式
        }
    } 
    $commentLevelClass = $comments->_levels > 0 ? ' comment-child' : ' comment-parent';  //评论层数大于0为子级,否则是父级
?>
 
/* 自定义评论列表部分 */
<div>
    <?php $comments->gravatar('40', ''); ?>
    <h2><?php $comments->author(); ?></h2>
    <p>评论时间:<?php $comments->date('Y-m-d H:i'); ?></p>
    <div>
    <?php $comments->content(); ?>
    </div>
    <p><?php $comments->reply(); ?></p>
</div>
/*子评论*/
<?php if ($comments->children) { ?>
      <?php $comments->threadedComments($options); ?>
    <?php } ?>
 
<?php } ?>

示例代码仅供参考。。。。

<?php while($comments->next()): ?>

            <div class="neirong"><?php $comments->content(); ?></div>
            
            
              
              <div class="zi2">
       <?php $comments->threadedComments($options); ?>
    </div>
  
            暂无祝福!
            
            

            
            
          <div class="touy">
    <?php $comments->gravatar('80', ''); ?>
    
    
    <hr>
    <?php endwhile; ?>

//示例代码,仅供参考,不保证完整

扫描二维码,在手机上阅读!