Emlog判断管理员评论回复用不同的样式-站长杂谈下载

Emlog判断管理员评论回复用不同的样式

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

全部评论 0

您需要登录后才可以回帖 立即登录
登录
0
0
0
返回顶部