帝国CMS灵动标签调用tag和搜索关键字

时间:2023年08月08日

/

来源:网络

/

编辑:佚名

灵动标签调用的信息带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 '<a href="'.$public_r[newsurl].'e/tags/?tagname='.$keyr[$i].'" target=_blank>'.$keyr[$i].'</a>&nbsp;&nbsp;';
}
?>
搜索关键字代码
<?php
$keyr=explode(',',$bqr[keyboard]);
for($i=0;$i<count($keyr);$i++)
{
echo'<a href="'.$public_r[newsurl].'e/search/?searchget=1&keyboard='.$keyr[$i].'&show=title" target=_blank>'.$keyr[$i].'</a>';
}
?>
限制数量,把$i<count($keyr)修改为$i<count($keyr)&&$i<限制数量
实例:
[e:loop={34,50,3,0}]
<?=$bqno?>、<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a>
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 '<a href="'.$public_r[newsurl].'e/tags/?tagname='.$keyr[$i].'" target=_blank>'.$keyr[$i].'</a>&nbsp;&nbsp;';
}
?>
关键字:
<?php
$keyr=explode(',',$bqr[keyboard]);
for($i=0;$i<count($keyr);$i++)
{
echo'<a href="'.$public_r[newsurl].'e/search/?searchget=1&keyboard='.$keyr[$i].'&show=title" target=_blank>'.$keyr[$i].'</a>&nbsp;&nbsp;';
}
?>
<br>
[/e:loop]
猜你需要

豫ICP备2021026617号-1  豫公网安备:41172602000185   Copyright © 2021-2028 www.78moban.com/ All Rights Reserved

本站作品均来自互联网,转载目的在于传递更多信息,并不代表本站赞同其观点和对其真实性负责。如有侵犯您的版权,请联系 1565229909#qq.com(把#改成@),我们将立即处理。