mlog默认所有回复的一样,闲来没事,就捣鼓了一些,具体教程如下:首先在当前加入代码函数然后在该判断的地方加入代码- <?php if($comment['url']==$url){?>此处自定义代码函数<?php }?>
复制代码 举例说明,以默认板子为例:用以下代码直接替换模板文件中module.php中子评论列表
2 r" t- V* W" P9 d# A- <?php
7 Q7 ~0 Z1 h5 B; d: F& } - //blog:子评论列表) I( |* i: w- ^$ J2 D! t
- function blog_comments_children($comments, $children){) q+ m. F' L, D
- $url .=BLOG_URL.'';
* s! `" ]& S5 ?- ~$ f - $isGravatar = Option::get('isgravatar');
/ D' J o! _4 w+ | - foreach($children as $child):
0 W% O! k3 ~5 L; S - $comment = $comments[$child];& T9 e- b1 r* w- ~3 \
- $comment['poster'] = $comment['url'] ? '<a href="'.$comment['url'].'" target="_blank">'.$comment['poster'].'</a>' : $comment['poster'];
; `7 x% ? p2 a; y; f, o# M4 m9 u9 A6 R - ?>2 \. B0 |* R! `
- <div class="comment comment-children" id="comment-<?php echo $comment['cid']; ?>">
) T/ U7 H- w6 `1 t% R, m& n; f - <a name="<?php echo $comment['cid']; ?>"></a>- T, f/ A$ Z. W* S3 ]% D
- <?php if($isGravatar == 'y'): ?><div class="avatar"><img src="<?php echo getGravatar($comment['mail']); ?>" /></div><?php endif; ?>$ w6 \6 J3 p) e+ @+ v7 J4 \
- <div class="comment-info">
1 t8 Q" |$ g7 A - <b><?php echo $comment['poster']; ?> </b><br /><span class="comment-time"><?php echo $comment['date']; ?></span>8 P/ L9 R) l- a( @! }" K
- <div class="comment-content"<?php if(($comment['url']==$url)||($comment['mail']=='sl@shuyong.net')){?> style="color:#F00;"<?php }?>><?php echo $comment['content']; ?></div>5 y5 S$ D; _. h: y
- <?php if($comment['level'] < 4): ?><div class="comment-reply"><a href="#comment-<?php echo $comment['cid']; ?>" onclick="commentReply(<?php echo $comment['cid']; ?>,this)">回复</a></div><?php endif; ?>
% s5 k% t7 F% n% q - </div>
0 K8 m; }% b& t3 o& f - <?php blog_comments_children($comments, $comment['children']);?>
/ _. I# }6 t1 w8 o6 X4 b - </div>) S4 _+ g! m4 E6 Y' G
- <?php endforeach; ?>: r8 C9 Y6 L) u8 {. d
- <?php }?>
复制代码 如对教程有疑问,请直接在下方留言。3 G, V3 l" X9 j
|