帝国CMS二次开发调用当前信息tags_帝国cms教程-大众资源网

[e:loop={"SELECT * FROM 表中后缀_ecms_表名_data_1 WHERE id = '".$navinfor[id]."'",1,24,0}]
            <?
            $a="$bqr[infotags]";
            $str=str_replace(',', ',', $a);
            $tag='';
            $t= explode(",", $str);
            
                    for($i=0;$i<count($t);$i++)
                    {
if($i<count($t)-1){$doudouhao=",";}else{$doudouhao='';}
                            if($t[$i])
                            {
                                    $tag.="<span class='item'><a target='_blank' href='/e/tags/?tempid=15&tagname=".$t[$i]."' title='".$t[$i]."'>".$t[$i]."</a></span>";
                            }
            }
            echo $tag;
            ?>
[/e:loop]

调用当前信息ID,查询信息的infotags,分隔infotags并循环出来,最后合并成一段链接。代码并不复杂,收藏分享给大家,以免以后可以使用。

发表评论