帝国cms调用当前文章信息TAG标签 根据TAG的id调用
帝国cms调用当前文章信息TAG标签,很多网上代码是根据TAG的名字调用的,有需要根据TAG的ID调用的可以参考下面代码:
[e:loop={"SELECT * FROM www_96kaifa_com_ecms_news_data_1 WHERE id = '".$navinfor[id]."'",1,24,0}]
<?
$a="$bqr[infotags]";
$str=str_replace(',', ',', $a);
$tag='';
$t= explode(",", $str);
for($i=0;$i<count($t);$i++)
{
if($i<count($t)-1){$doudouhao=",";}else{$doudouhao='';}
if($t[$i])
{
$tsql=$empire->query("SELECT * FROM www_96kaifa_com_enewstags WHERE tagname = '".$t[$i]."'");
while($trs=$empire->fetch($tsql)){
$tagid=$trs['tagid'];
}
$tagslink="/e/tags/?tagid=".$tagid;
$tag.=" <a href='$tagslink' target='_blank'>".$t[$i]."</a>";
}
}
echo $tag;
?>
[/e:loop]
调用效果:/e/tags/?tagid=1203