Discuz教程网

discuz x1.5 本地附件与远程附件的转换

[复制链接]
authicon dly 发表于 2012-1-16 17:08:22 | 显示全部楼层 |阅读模式
=============Discuz!x1.5=============

由于最近论坛上很多用户问及附件转移问题,所以现在总结下 有关远程附件转移的注意事项


1.首先将 data下attachment的文件夹移动到远程服务器上

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

3.更改数据库,其中需要更改的表有五个。分别为:
pre_forum_attachment
pre_home_pic
pre_portal_article_title
pre_portal_attachment
pre_portal_topic_pic
执行更新语句:
其中,pre_forum_attachment,pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic
语句为:
update pre_forum_attachment set remote=1;
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
update pre_home_pic set remote=remote+1;

注意:执行语句前,请备份数据库




上一篇:求discuz x2门户内链实现方法。顺便求nginx下的tag伪静态方法。
下一篇:T中楼了,来申请免费空间
authicon  楼主| dly 发表于 2012-1-16 17:24:42 | 显示全部楼层
这句update pre_home_pic set remote=remote+1; 有问题

如果用 remote=remote+1; 原先remote=2的会变成 3,所以
网站www.givedog.cn  这样用的:
update pre_home_pic set remote=1 where remote=0

另外,从X2开始附件表改成了 下面11个表,所以新方法如下
update pre_forum_attachment set remote=1 where remote=0;
update pre_portal_article_title set remote=1 where remote=0;
update pre_portal_attachment set remote=1 where remote=0;
update pre_portal_topic_pic set remote=1 where remote=0;
update pre_home_pic set remote=1 where remote=0;


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;
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2024-5-3 01:42

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表