帝国CMS内容页怎么调用TAG标签、动态URL、伪静态URL?(
内容页调用tag,按tagname调用:
Tags: $a="$navinfor[infotags]"; $str=str_replace(',', ',', $a); $tag=''; $t= explode(",", $str); for($i=0;$i".$t[$i]." "; } } echo $tag; ?>
或,按tagname调用:
fetch1("select infotags from {$dbtbpre}ecms_news_data_{$navinfor[stb]} where id='$navinfor[id]'"); $infotags=$fr['infotags'];//这个就是infotags字段内容 $tag=''; $t=explode(',',$infotags);//去逗号 $d=count($t); for($i=0;$i".$t[$i]." "; } } echo $tag; ?>
或,按id调用:
$tbname=$class_r[$navinfor['classid']]['tbname']; $ftbname=$dbtbpre."ecms_".$tbname."_data_".$navinfor['stb']; $hlt = $empire->fetch1("select infotags from {$ftbname} where id='$navinfor[id]'"); $a=$hlt[infotags]; $str=str_replace(',', ',', $a); $tag=''; $t= explode(",", $str); for($i=0;$ifetch1("select tagid from {$dbtbpre}enewstags where tagname='$t[$i]' limit 1"); $tagslink="/e/tags/?tagid=".$datar[tagid].""; $tag.="".$t[$i]." "; } } echo $tag; ?>
注释:
限制数量,把$i
mid=1数据模型id tempid=1模型的模板id orderby排列方式 classid=34栏目id &line=5调用条数
如:上面的 &tempid=1
如果想用静态以ID的HTML 可以参考下面这个
本文标签: $tbname=$class_r[$navinfor['classid']]['tbname']; $ftbname=$dbtbpre."ecms_".$tbname."_data_".$navinfor['stb']; $hlt = $empire->fetch1("select infotags from {$ftbname} where id='$navinfor[id]'"); $a=$hlt[infotags]; $str=str_replace(',', ',', $a); $tag=''; $t= explode(",", $str); for($i=1;$i
fetch1("select tagid from {$dbtbpre}enewstags where tagname='$t[$i]' limit 1"); $tagslink="/tag/".$datar[tagid].".html"; $tag.="".$t[$i]." "; } } echo $tag; ?>