<?php
$sql=$empire->query("select classid,classname,bname from {$dbtbpre}enewsclass where bclassid=0 and showclass=0 order by myorder,myorder asc");
while($s=$empire->fetch($sql)){
$classurl=sys_ReturnBqClassname($s,9);
$tclass="nav-link";
$fr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);
$topbclassid=$fr[1]?$fr[1]:$GLOBALS[navclassid];
if($topbclassid==$s[classid]){
$tclass='on';
}
if($s[classid]==22) {
echo '<a class="nav-link '.$tclass.'" href="'.$classurl.'" title="'.$s[bname].'" target="_blank">'.$s[bname].'<span class="icon_hot2_new"></span></a>';
}else{
echo '<a class="nav-link '.$tclass.'" href="'.$classurl.'" title="'.$s[bname].'" target="_blank">'.$s[bname].'</a>';
}
}
?>
如果classid是22,则显示<span class=”icon_hot2_new”></span>
如果不是就正常显示。
css部分:
.navbar .icon_hot2_new {
background: url(/skin/zhann/images/hot.png) no-repeat scroll 0 0;
width: 21px;
height: 12px;
display: block;
position: absolute;
right: 16%;
top: 8%;
}
效果: