修改拼音支持
打开 phpcmsmodulescontent ag.php文件
找到
$r = $this->keyword_db->get_one(array('keyword'=>$tag, 'siteid'=>$this->siteid), 'id');
修改为
$r = $this->keyword_db->get_one(array('pinyin'=>$tag, 'siteid'=>$this->siteid), 'id,pinyin,keyword');
找到
$tagid = intval($r['id']);
修改为
$tagid = intval($r['id']); $tagzw = $r['keyword'];
URL重写规则,例子:d/xdsdfs/1 d/{$r[pinyin]}/{$page}
rewrite ^/d/([a-z-A-Z-0-9]+) /index.php?m=content&c=tag&a=lists&tag=$1&page=$2 last;
rewrite ^/d/([a-z-A-Z-0-9]+)/([0-9]+) /index.php?m=content&c=tag&a=lists&tag=$1&page=$2 last;
文章列表页调用关键字,或者首页调用关键字,如index或者list
{php $keywords = explode(',',$r[keywords]);}
{loop $keywords $keyword}{pc:get sql="SELECT * FROM where keyword = '$keyword' " return="datatag"}{loop $datatag $r}<a target="_blank" href="//www.wendaba.com/tiku/{$r[pinyin]}" title="{$keyword}">{$keyword}</a>{/loop}
{/pc}
{/loop}
打开phpcms emplatesdefaultcontentshow.html 模板文件
将
{loop $keywords $keyword}
<a href="{APP_PATH}index.php?m=content&c=tag&a=lists&tag={urlencode($keyword)}" class="blue">{$keyword}</a>
{/loop}
修改为
{loop $keywords $keyword}
{pc:get sql="SELECT * FROM v9_keyword where keyword = '$' " return="dattag"}{loop $datatag $r}<a href="https//www.wentiyi.com/" class="blue">{$r[keyword]}</a>
{/loop}{/pc}
{/loop}