这个教程已经烂大街,但是网上采集来采集去内容乱七八糟,多走了很多弯路,之前不知道几句sql代码就能实现,差点花钱买插件替换帖子中的图片地址。。。
首先去目录下找到/data/wwwroot/config/config_global.php
编辑:
1 2 | $_config['admincp']['runquery'] = '0'; //是否开启后台执行SQL语句 ↑ |
将= ‘0’; 改为 = ‘1’; 开启后台SQL升级
然后复制下面的代码进行远程转换,同时需要将本地/data/wwwroot/data/attachment/ 中的内容上传到远程附件服务器中。
1 2 3 4 5 6 7 8 9 10 | update pre_forum_attachment_0 set remote=1 where remote=0; update pre_forum_attachment_1 set remote=1 where remote=0; update pre_forum_attachment_2 set remote=1 where remote=0; update pre_forum_attachment_3 set remote=1 where remote=0; update pre_forum_attachment_4 set remote=1 where remote=0; update pre_forum_attachment_5 set remote=1 where remote=0; update pre_forum_attachment_6 set remote=1 where remote=0; update pre_forum_attachment_7 set remote=1 where remote=0; update pre_forum_attachment_8 set remote=1 where remote=0; update pre_forum_attachment_9 set remote=1 where remote=0; |
上面的SQL语句实现了 论坛附件 forum 转换成远程附件,关闭方法如下:
1 2 3 4 5 6 7 8 9 10 | update pre_forum_attachment_0 set remote=0 where remote=1; update pre_forum_attachment_1 set remote=0 where remote=1; update pre_forum_attachment_2 set remote=0 where remote=1; update pre_forum_attachment_3 set remote=0 where remote=1; update pre_forum_attachment_4 set remote=0 where remote=1; update pre_forum_attachment_5 set remote=0 where remote=1; update pre_forum_attachment_6 set remote=0 where remote=1; update pre_forum_attachment_7 set remote=0 where remote=1; update pre_forum_attachment_8 set remote=0 where remote=1; update pre_forum_attachment_9 set remote=0 where remote=1; |
将forum转换成本地附件