X1.5和X2在附件存储稍微做了一些调整和变化,X2多了一些附件的分表,所以有些站长不会使用X2来本地附件转换远程附件,其实方法基本是一样的,下面我们就一起来分享学习下。
1.首先将 data下attachment的文件夹移动到远程服务器上

2.后台配置远程附件,(确保ftp空间商提供的域名能够直接访问空间)如图:

远程附件设置方法

3.更改数据库,其中需要更改的表有五个。分别为:
pre_forum_attachment
pre_home_pic
pre_portal_article_title
pre_portal_attachment
pre_portal_topic_pic
执行更新语句:
其中,pre_forum_attachment
执行语句:

1
2
3
4
5
6
7
8
9
10
update pre_forum_attachment_0 set remote = ‘1’;
update pre_forum_attachment_1 set remote = ‘1’;
update pre_forum_attachment_2 set remote = ‘1’;
update pre_forum_attachment_3 set remote = ‘1’;
update pre_forum_attachment_4 set remote = ‘1’;
update pre_forum_attachment_5 set remote = ‘1’;
update pre_forum_attachment_6 set remote = ‘1’;
update pre_forum_attachment_7 set remote = ‘1’;
update pre_forum_attachment_8 set remote = ‘1’;
update pre_forum_attachment_9 set remote = ‘1’;

其他几个依次为pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic
语句:

1
2
3
update pre_portal_article_title set remote=1;
update pre_portal_attachment set remote=1;
update pre_portal_topic_pic set remote=1;

由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic:

1
update pre_home_pic set remote=remote+1;

注意:执行语句前,请备份数据库,远程附件转换本地附件只需要把里面的1改为0即可

http://www.h517.com/1931.html

赞赏

微信赞赏支付宝赞赏

「赏不在多,觉得文章有用,就赞赏下吧!」

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据