Comment appeller les informations avec balises et mots-clés en utlisant ECMS

2022-09-23 16:48:04  vendredi  2192 mots  

1. 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;';
}
?>

2. 搜索关键字代码

<?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>';
}
?>

3. 限制数量

把$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]

 

Commentaire