DEDE設置根據文章標題自動獲取tag的方法:
修改:dedeaction目錄article_add_action.php文件
在【//寫入Tag索引】與【InsertTags($dsql,$tag,$arcID,0,$typeid,$arcrank);】之間插入:

01if($autokey==1){
02    require_once(DEDEADMIN."/../include/pub_splitword_[url]www.php[/url]");
03    $tag = "";
04    $sp = new SplitWord();
05    $titleindexs = explode(" ",trim($sp->GetIndexText($sp->SplitRMM($title))));
06    //$allindexs = explode(" ",trim($sp->GetIndexText($sp->SplitRMM(Html2Text($body)),200)));
07    if(is_array($titleindexs)){
08        foreach($titleindexs as $k){  
09            if(strlen($tag)>=50) break;
10            else $tag .= $k." ";
11        }
12        
16    }
17    $sp->Clear();
18    unset($sp);
19    //$tag = preg_replace("/#1#|#2#/","",$tag);
20    $tag = addslashes($tag);
21}

1 等于 p
2 等于 e
分頁干擾 所以替換
默認只對文章標題分詞,要想加入內容分詞請刪除注釋!

DEDE織夢模板設置根據文章標題自動獲取tag的代碼

DEDE織夢模板設置根據文章標題自動獲取tag的代碼

 
?