百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>织梦CMS教程> 织梦dede织梦设置依据文章标题主动获取tag的办法
分享文章到:

织梦dede织梦设置依据文章标题主动获取tag的办法

发布时间:09/08 来源:未知 浏览: 关键词:
修改:\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("/
打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有162人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板