好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 網站建設 > 建站知識 > dedecms根據文章標題自動獲取tag

dedecms根據文章標題自動獲取tag

POST TIME:2017-11-13 01:00

關鍵字描述:獲取 自動 標題 根據 文章   " tag sp-> if

圖片:
圖片:
圖片:
看到論壇上有人跟我一樣有這個需要,就嘗試著弄了下,經測試可以根據文章標題自動獲取tag
我對php不熟悉,是瞎改的,不知道會不會有什么其他影響,修改請慎重……

修改:\dede\action目錄article_add_action.php文件

在【//寫入Tag索引】與【InsertTags($dsql,$tag,$arcID,0,$typeid,$arcrank);】之間插入:
Copy code
if($autokey==1){
require_once(DEDEADMIN."/../include/pub_splitword_[url]www.php[/url]");
$tag = "";
$sp = new SplitWord();
$titleindexs = explode(" ",trim($sp->GetIndexText($sp->SplitRMM($title))));
//$allindexs = explode(" ",trim($sp->GetIndexText($sp->SplitRMM(Html2Text($body)),200)));
if(/*is_array($allindexs) && */is_array($titleindexs)){
foreach($titleindexs as $k){
if(strlen($tag)>=50) break;
else $tag .= $k." ";
}
/*foreach($allindexs as $k){
if(strlen($keywords)>=50) break;
else if(!in_array($k,$titleindexs)) $keywords .= $k." ";
}*/
}
$sp->Clear();
unset($sp);
//$tag = preg_replace("/
上一頁12 下一頁


收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266