900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > 织梦DedeCMS设置根据文章标题自动获取tag标签的方法

织梦DedeCMS设置根据文章标题自动获取tag标签的方法

时间:2021-02-09 14:23:03

相关推荐

织梦DedeCMS设置根据文章标题自动获取tag标签的方法

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

在【//写入Tag索引】与【InsertTags($dsql,$tag,$arcID,0,$typeid,$arcrank);】之间插入:

if($autokey==1){require_once(DEDEADMIN."/../include/pub_splitword_www.php");$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("/

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。