中科大家长论坛

 找回密码
 加入论坛

QQ登录

只需一步,快速开始

大宋水师

http://ww.ustcjz.cn/?3

Discuz,将本地附件全部改为远程附件的方法

已有 845 次阅读2011-2-21 10:58 |个人分类:网站建设

将以往的附件全部改为远程附件的网址,需要做的是:

将本地附件连同 attachment 目录一起上传到图片服务器上

在USTCJZ后台系统设置里的附件目录填写绝对URL地址目录

在论坛后台 系统工具 数据库升级 运行一条语句

update cdb_attachments set remote = ’1′

如果要把远程附件全部移动到本地,转为本地附件,按照上面反过来操作下。并执行sql:

update cdb_attachments set remote = ’0′


============================
2.0之后,数据库结构改变

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即可

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 加入论坛

渝ICP备19009968号|公安备案号50010502000023|手机版|中科大家长网

GMT+8, 2024-4-28 15:11 , Processed in 0.144662 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部