首先在module.php中增加以下函数
<?php//comment:输出批评人品级function echo_levels($comment_author_email,$comment_author_url){ $DB = MySql::getInstance(); $adminEmail = '"[email protected]"'; if($comment_author_email==$adminEmail) { echo '<sy id="ys">(管理员)</sy>'; } $sql = "SELECT cid as author_count,mail FROM emlog_comment WHERE mail != '' and mail = $comment_author_email and hide ='n'"; $res = $DB->query($sql); $author_count = mysql_num_rows($res); if($author_count>=0 && $author_count<5 && $comment_author_email!=$adminEmail) echo '<sy id="ya">(打酱油的)</sy>'; else if($author_count>=5 && $author_count<10 && $comment_author_email!=$adminEmail) echo '<sy id="yb">(渐渐过客)</sy>'; else if($author_count>=10 && $author_count<20 && $comment_author_email!=$adminEmail) echo '<sy id="yc">(重生入住)</sy>'; else if($author_count>=20 && $author_count<30 && $comment_author_email!=$adminEmail) echo '<sy id="yd">(常住住户)</sy>'; else if($author_count>=30 &&$author_count<40 && $comment_author_email!=$adminEmail) echo '活泼住户'; else if($author_count>=40 && $author_coun<50 && $comment_author_email!=$adminEmail) echo '主动住户'; else if($author_count>=50 && $author_coun<60 && $comment_author_email!=$adminEmail) echo '五好住户'; else if($author_count>=60 && $author_coun<70 && $comment_author_email!=$adminEmail) echo '十佳住户'; else if($author_count>=70 && $author_coun<80 && $comment_author_email!=$adminEmail) echo '住户委员'; else if($author_count>=100 && $comment_author_email!=$adminEmail) echo '住户代表';}?>
以上代码用于推断批评人所填写的e-mail统计次数,到达响应次数后输出差别的品级,所以在批评中只人e-mail不认称号。
个中上面的<sy id="y*">是给输出品级增加响应的css,平常是笔墨色彩,可直接写在CSS文件中。
挪用代码:
<?php $mail_str="\"".strip_tags($comment['mail']).\"";echo_levels($mail_str,"\"".$comment['url']."\""); ?>在须要挪用的处所插进去以上代码即可

评论列表