实现方式参考:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | < div class = "fenlei_n" > < div class = "bcat-wrap" >< label class = "cat-pre-notice" >分类 :</ label >< ul class = "bcat-menu-wrap" >< li >< a class="bcat-menu-a <?php echo ($cat==0)?'current':'';?>" href="<?=$public_r['newsurl']?>pptpeitu" >全部</ a ></ li > <? php //查询出某个模型cat字段的初始值 $fr=$empire->fetch1("select fvalue from {$dbtbpre}enewsf where f='cat' and tbname='peitu'"); $astr=explode('|',$fr['fvalue']); $a=array(); $n=0; foreach ($astr as $v){ $av=explode('==',$v); $n++; if($n>12)break; ?> < li >< a class="bcat-menu-a <?php echo ($cat==$av[0])?'current':'';?>" href="<?=$public_r['newsurl']?>pt-[!--self.classid--]-<?=$av[0]?>-0-<?=$fileformat?>-<?=$orderby?>-<?=$title?>-0.html"><?=$av[1]?></ a ></ li > <? php } ?> |
最终前台实现的展示效果
另外内容页的调用方式
1 2 3 4 | <?php $r = $empire ->fetch1( "select `fvalue` from {$dbtbpre}enewsf where f='hangye' and tid={$class_r[$navinfor['classid']]['modid']}" ); preg_match( '#\\|' . $navinfor [ 'hangye' ]. '==([^\\|]+)#' , '|' . $r [ 'fvalue' ]. '|' , $match ); echo $match [1];?> |
如果本文对你有帮助,欢迎打赏本站