帝国cms内容模板sql语句方式调用当前TAG标签

方法1
  1. <?php
  2. $fr=$empire->fetch1("select infotags from {$dbtbpre}ecms_news_data_{$navinfor[stb]} where id=$navinfor[id]");
  3. $infotags=$fr[infotags];//这个就是infotags字段内容
  4. $tag=;
  5. $t=explode(,,$infotags);//去逗号
  6. $d=count($t);
  7.     for($i=0;$i<count($t);$i++)
  8.     {
  9.             if($t[$i])
  10.             {
  11.                     $tagslink="!--news.url--]e/tags/?tagname=".urlencode($t[$i])."&tempid=1";
  12.                    $tag.="<a href=$tagslink target=_blank>".$t[$i]."</a> ";
  13.             }
  14. }
  15. echo $tag;
  16. ?>   
复制代码
方法2
  1. <?
  2. $infotags=$navinfor[infotags];
  3. $tags=explode(',',$infotags);
  4. $count=count($tags);
  5. for($i=0;$i<$count;$i++)
  6. {
  7. if($tags[$i])
  8. {
  9. $datar=$empire->fetch1("select * from {$dbtbpre}enewstags where tagname='$tags[$i]' limit 1");
  10. {
  11. $tag.='<a href="javascript:;" title="'.$tags[$i].'手机游戏合集">'.$tags[$i].'</a>';
  12. }
  13. }

  14. }
  15. echo $tag;
  16. ?>
复制代码






上一篇:帝国cms前台投稿不显示栏目的解决方法
下一篇:帝国cms内容模板截取内容文章的字数做描述
如无回复请发邮件