欢迎来到润旭源码网
帮助中心

润旭源码网

热门搜索: 企业源码    免费源码   

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

  • 时间:2020-06-27 11:48 编辑: 来源: 阅读:207
  • 扫一扫,手机访问
摘要:修改:dedeaction目录article_add_action.php文件 在【//写入Tag索引】与【InsertTags($dsql,$tag,$arcID,0,$typeid,$arcrank);】之间插入:   if($autokey==1){     require_once(DEDEADMIN."/../include/pub_split

修改:dedeaction目录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("/

  • 全部评论(0)
资讯详情页最新发布上方横幅
联系我们

QQ:888477 {点击直接联系}

邮箱:runxu123@qq.com

时间:周1——周6 【9:00-23:00

联系客服
购买源码 源码咨询 投诉建议 联系客服
0373-6621888
手机版

扫一扫进手机版
返回顶部