|
方法1
- <?php
- $fr=$empire->fetch1("select infotags from {$dbtbpre}ecms_news_data_{$navinfor[stb]} where id=$navinfor[id]");
- $infotags=$fr[infotags];//这个就是infotags字段内容
- $tag=;
- $t=explode(,,$infotags);//去逗号
- $d=count($t);
- for($i=0;$i<count($t);$i++)
- {
- if($t[$i])
- {
- $tagslink="!--news.url--]e/tags/?tagname=".urlencode($t[$i])."&tempid=1";
- $tag.="<a href=$tagslink target=_blank>".$t[$i]."</a> ";
- }
- }
- echo $tag;
- ?>
复制代码 方法2
- <?
- $infotags=$navinfor[infotags];
- $tags=explode(',',$infotags);
- $count=count($tags);
- for($i=0;$i<$count;$i++)
- {
- if($tags[$i])
- {
- $datar=$empire->fetch1("select * from {$dbtbpre}enewstags where tagname='$tags[$i]' limit 1");
- {
- $tag.='<a href="javascript:;" title="'.$tags[$i].'手机游戏合集">'.$tags[$i].'</a>';
- }
- }
- }
- echo $tag;
- ?>
复制代码
|
上一篇:帝国cms前台投稿不显示栏目的解决方法下一篇:帝国cms内容模板截取内容文章的字数做描述
|