mlog默认所有回复的一样,闲来没事,就捣鼓了一些,具体教程如下:首先在当前加入代码函数然后在该判断的地方加入代码- <?php if($comment['url']==$url){?>此处自定义代码函数<?php }?>
复制代码 举例说明,以默认板子为例:用以下代码直接替换模板文件中module.php中子评论列表
+ Q: E. z3 ^3 j; Y7 `- <?php$ A5 O( d% ^$ ^2 b0 ~
- //blog:子评论列表
2 x$ i ~9 _. l - function blog_comments_children($comments, $children){+ A" u0 \9 F& O* y4 |4 Z, m' D
- $url .=BLOG_URL.'';: j3 n) ?, ~) C
- $isGravatar = Option::get('isgravatar');
! K% l2 Z/ [4 p: e& w - foreach($children as $child):, C' W j" T3 ^$ E9 D6 s9 I
- $comment = $comments[$child];
- W- T3 [" x) D+ E/ s8 X. D - $comment['poster'] = $comment['url'] ? '<a href="'.$comment['url'].'" target="_blank">'.$comment['poster'].'</a>' : $comment['poster'];
% f* L7 V5 L4 K8 }: g# K1 V - ?>- |+ @( J6 u# l1 a! R
- <div class="comment comment-children" id="comment-<?php echo $comment['cid']; ?>">
( Y# Q( p ?& \6 e - <a name="<?php echo $comment['cid']; ?>"></a>
6 x! j, q3 f2 N4 v' t) T- | P - <?php if($isGravatar == 'y'): ?><div class="avatar"><img src="<?php echo getGravatar($comment['mail']); ?>" /></div><?php endif; ?>
( u/ }9 h) ?3 n1 m7 ` - <div class="comment-info">
- U+ B9 O0 o, ]' {" c: X0 O - <b><?php echo $comment['poster']; ?> </b><br /><span class="comment-time"><?php echo $comment['date']; ?></span>
$ O$ k+ I9 h! P c" J - <div class="comment-content"<?php if(($comment['url']==$url)||($comment['mail']=='sl@shuyong.net')){?> style="color:#F00;"<?php }?>><?php echo $comment['content']; ?></div>
! g7 ^3 ^- o# W& u% H - <?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; ?>8 B& r0 a; C+ }0 r/ S: p
- </div>
7 g' D1 k/ ~; Z$ H" ~+ R, n - <?php blog_comments_children($comments, $comment['children']);?>( D7 m4 {5 j* o- A# w. z
- </div>* @& [6 K6 p- A8 U, ?; Z3 k1 |
- <?php endforeach; ?>
) Z+ e% ?4 v+ U8 T - <?php }?>
复制代码 如对教程有疑问,请直接在下方留言。$ a& C7 p0 e1 I5 w& M6 x
|