帝国CMS灵动标签调用的信息带tag和搜索关键字
灵动标签调用的信息带tag和搜索关键字
tag代码 ($tbname=”news”;中的“news”为新闻数据表名称)
<?php
$tbname=”news”;
$ftbname=$dbtbpre.”ecms_”.$tbname.”_data_”.$bqr[‘stb’];
$hlt = $empire->fetch1(“select infotags from {$ftbname} where id=’$bqr[id]'”);
$keyr=explode(‘,’,$hlt[infotags]);
for($i=0;$i<count($keyr);$i++)
{
echo ”.$keyr[$i].’ ‘;
}
?>
搜索关键字代码
<?php
$keyr=explode(‘,’,$bqr[keyboard]);
for($i=0;$i<count($keyr);$i++)
{
echo”.$keyr[$i].”;
}
?>
限制数量,把$i<count($keyr)修改为$i<count($keyr)&&$i<限制数量
——————————————————–
实例:
[e:loop={34,50,3,0}]
、” target=”_blank”>
tag:
<?php
$tbname=”news”;
$ftbname=$dbtbpre.”ecms_”.$tbname.”_data_”.$bqr[‘stb’];
$hlt = $empire->fetch1(“select infotags from {$ftbname} where id=’$bqr[id]'”);
$keyr=explode(‘,’,$hlt[infotags]);
for($i=0;$i<count($keyr);$i++)
{
echo ”.$keyr[$i].’ ‘;
}
?>
关键字:
<?php
$keyr=explode(‘,’,$bqr[keyboard]);
for($i=0;$i<count($keyr);$i++)
{
echo”.$keyr[$i].’ ‘;
}
?>
[/e:loop]