首页 > CMS建站 > Discuz > 正文

discuz论坛帖子内容动态链接批量替换成静态链接 discuz帖子

2020-10-12 20:08:34
字体:
来源:转载
供稿:网友

discuz论坛帖子内容动态链接批量替换成静态链接 discuz帖子内容批量替换

forum_viewthread.php,1054行$_G['forum_firstpid'] = intval($_G['forum_firstpid']);前添加:

  1. $post['message']=preg_replace("/category/.php/?id=(/d+)/s","category-//1-b0.html",$post['message']);        
  2. $post['message']=preg_replace("//.php/?id=(/d+)/s","-//1.html",$post['message']);        
  3. $post['message']=str_replace("abc.php","abc.html",$post['message']);        
  4. $post['message']=str_replace("index.php","",$post['message']);        
  5. $post['message']=preg_replace("//.html&cid=(/d+)/s","-//1.html",$post['message']);    
  6. $post['message']=preg_replace("/article_cat-(/d+)-(/d+)/.html/s","abc-//1-//2.html",$post 
  7. ['message']);    

注意跟自己的静态页面正则匹配,可以参照上面的,添加或删减.

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表