优晟SEO

您现在的位置是:首页 > CMS教程 > 帝国cms > 正文

帝国cms

帝国CMS二次开发调用当前信息tags

帝国   信息   CMS  
佚名 2024-08-23帝国cms
[e:loop={"SELECT*FROM表前缀_ecms_表名_data_1WHEREid='".$navinfor[id]."'",1,24,0}]<?$a="$bqr[infotags]";$str=str_replace(',',',',$a);$tag='';$t=explode(",&quot……

帝国CMS二次开发调用当前信息tags

[e:loop={"SELECT*FROM表前缀_ecms_表名_data_1WHEREid='".$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.="<spanclass='item'><atarget='_blank'href='/e/tags/?tempid=15&tagname=".$t[$i]."'title='".$t[$i]."'>".$t[$i]."</a></span>";}}echo$tag;?>[/e:loop]

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