欢迎来到258分享网,纯净的网络源码分享基地!

258资源分享网

全部作品
全部作品
网站源码
微信源码
素材特效
源码插件
视频教程
建站学院
热门搜索: 织梦  农业种植  农业  安全设置  官方
258资源分享 > 建站学院 > 织梦教程 > 织梦dedecms设置根据文章标题自动获取tag的方法

推荐下载

HTML5响应式自适应网咯设计

2020-05-12   浏览:740

高端HTML5响应式企业通用网

2020-05-06   浏览:521

html5响应式外贸网站英文版

2020-05-08   浏览:510

HTML5自适应律师工作室类网

2020-04-04   浏览:504

HTML5影视传媒文化公司类网

2020-05-12   浏览:502

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

发布时间:2020-08-08  

织梦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_"); 
    $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("/