靈動標簽調用的信息帶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> '; } ?>
搜索關鍵字代碼
<?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> '; } ?> 關鍵字: <?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> '; } ?> [/e:loop]
Copyright © 2009-2019 Ywcms.Com All Right Reserved. 湘ICP備16006489號-2