织梦内容页调用关键词和链接的方法

2017-04-13 21:03:23 dedecms
dedecms

 内容页调用关键词的方法。代码如下:

{dede:field name='keywords' runphp='yes' } if(!empty(@me)) { $kws = explode(',',@me); @me = ""; foreach($kws as $k) { @me .= "<a href='/plus/search.php?keyword=".urlencode($k)."' target=_blank ><strong>$k</strong></a> "; } @me= str_replace(' ', ' ',trim(@me)); } {/dede:field}