不同文章作者的评论样式
commnet模块可以定义当前文章作者发表的评论采用不同的样式, 或者指定其中的几个用户采用不同的样式.
方法如下:
打开site/all/themes/yourthemes/comment.tpl.php, 找到:
<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ' '. $status ?> clear-block">在其中加上一句:
print ($comment->uid == $node->uid) ? ' author-comment' : '';最后的样子是:
<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ($comment->uid == $node->uid) ? ' author-comment' : ''; print ' '. $status ?> clear-block">实现的效果就是当前文章作者的评论采用.author-comment的样式
下一步就是定义author-comment样式了, 例如:
.comment .author-comment {background-color:#000;}如果只指定某个用户的留言采用不同样式, 则应该加上这句:
print ($comment->uid == 1) ? ' author-comment' : '';
评论
发表新评论