[文章目录]显示/隐藏

在module.php新增下面的内容:

<?php
//comment:输出评论人等级
function echo_levels($comment_author_email,$comment_author_url){
	$DB = MySql::getInstance();
	global $CACHE;
	$user_cache = $CACHE->readCache('user'); 
	$adminEmail = '"'.$user_cache[1]['mail'].'"';
	if($comment_author_email==$adminEmail){
		echo '<a class="admin" title="这货就是管理员"><img src="'.TEMPLATE_URL.'img/admin.png"></a>';
	}
	$sql = "SELECT cid as author_count,mail FROM ".DB_PREFIX."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 '<a class="vip1" title="VIP等级:初入联盟 LV.1"><i class="pro"></i><i class="level">Lv.1</i></a>';
	else if($author_count>=5 && $author_count<10 && $comment_author_email!=$adminEmail)
		echo '<a class="vip2" title="VIP等级:英勇黄铜 LV.2"><i class="pro"></i><i class="level">Lv.2</i></a>';
	else if($author_count>=10 && $author_count<20 && $comment_author_email!=$adminEmail)
		echo '<a class="vip3" title="VIP等级:不屈白银 LV.3"><i class="pro"></i><i class="level">Lv.3</i></a>';
	else if($author_count>=20 && $author_count<30 && $comment_author_email!=$adminEmail)
		echo '<a class="vip4" title="VIP等级:华贵铂金 LV.4"><i class="pro"></i><i class="level">Lv.4</i></a>';
	else if($author_count>=30 &&$author_count<40 && $comment_author_email!=$adminEmail)
		echo '<a class="vip5" title="VIP等级:璀璨钻石 LV.5"><i class="pro"></i><i class="level">Lv.5</i></a>';
	else if($author_count>=40 && $author_coun<50 && $comment_author_email!=$adminEmail)
		echo '<a class="vip6" title="VIP等级:超凡大师 LV.6"><i class="pro"></i><i class="level">Lv.6</i></a>';
	else if($author_count>=50 && $author_coun<60 && $comment_author_email!=$adminEmail)
		echo '<a class="vip7" title="VIP等级:最强王者 LV.7"><i class="pro"></i><i class="level">Lv.7</i></a>';
	else if($author_count>=60 && $author_coun<70 && $comment_author_email!=$adminEmail)
		echo '<a class="vip8" title="VIP等级:职业选手 LV.8"><i class="pro"></i><i class="level">Lv.8</i></a>';
}
?>

在CSS里面添加:

.admin{position:relative;top:-2px}
.vip1,.vip2,.vip3,.vip4,.vip5,.vip6,.vip7,.vip8{position:relative;display:inline-block;width:35px;height:16px;border:1px solid #c7c7c7;background:#dfdfdf;vertical-align:middle;text-align:center}
.level{position:absolute;top:-4px;left:6px;color:#fff;text-shadow:1px 1px 1px rgba(0,0,0,.5);font-style:normal;font-size:10px}
.comment-body-children .level{top:-4px}
.vip .pro{width:1.5%;background:#000}
.vip1 .pro{width:12.5%;background:#48a8c0}
.vip2 .pro{width:25%;background:#1b6dff}
.vip3 .pro{width:37.5%;background:#d664c9}
.vip4 .pro{width:50%;background:#bb915c}
.vip5 .pro{width:62.5%;background:#5cbb6b}
.vip6 .pro{width:75%;background:#5c86bb}
.vip7 .pro{width:87.5%;background:#bb5c5c}
.vip8 .pro{width:100%;background:#493f3f}
.vip1 .pro,.vip2 .pro,.vip3 .pro,.vip4 .pro,.vip5 .pro,.vip6 .pro,.vip7 .pro,.vip8 .pro{position:absolute;display:block;height:14px;background-image:linear-gradient(to top left,transparent,transparent 25%,rgba(255,255,255,.15) 25%,rgba(255,255,255,.15) 50%,transparent 50%,transparent 75%,rgba(255,255,255,.15) 75%,rgba(255,255,255,.15));background-size:16px 16px}
.vip1:hover .pro,.vip2:hover .pro,.vip3:hover .pro,.vip4:hover .pro,.vip5:hover .pro,.vip6:hover .pro,.vip7:hover .pro,.vip8:hover .pro{animation:progress .6s linear infinite;-webkit-animation:progress .6s linear infinite}

在评论列表和子评论列表中调用:

<?php echo echo_levels("\"".strip_tags($comment['mail'])."\"","\"".$comment['url']."\"");?>