Typecho博客添加评论用户等级

Admin
2025-07-24 / 0 评论 / 0 阅读 / 正在检测是否收录...


function dengji($i){
$db=Typecho_Db::get();
$mail=$db->fetchAll($db->select(array('COUNT(cid)'=>'rbq'))->from('table.comments')->where('mail = 
?', $i)->where('authorId = ?','0'));
foreach ($mail as $sl){
$rbq=$sl['rbq'];}
if($rbq<1){
echo '博主';
}elseif ($rbq<10 && $rbq>0) {
echo 'VIP1';
}elseif ($rbq<20 && $rbq>=10) {
echo 'VIP2';
}elseif ($rbq<40 && $rbq>=20) {
echo 'VIP3';
}elseif ($rbq<80 && $rbq>=40) {
echo 'VIP4';
}elseif ($rbq<100 && $rbq>=80) {
echo 'VIP5';
}elseif ($rbq>=100) {
echo 'SVIP';
}
}

<span style="border-radius: 3px;color: #ffffff;padding-right: 5px; padding-left: 5px;margin-top: 1px;background: #ee9b11;font-size: 12px;float: left;height: 16px;line-height: 16px;"><?php dengji($comments->mail);?></span>
0

评论 (0)

取消