找回密码
 立即注册

QQ登录

只需一步,快速开始

Discuz系列教程-本地附件转远程附件设置

程序版本:discuz!X1.5 X2 X2.5 X3
目的:本地和远程附件互相转换
适合人群:使用Discuz!系列的站长


1.首先将 data下attachment的文件夹移动到远程服务器上
2.后台配置远程附件,(确保ftp空间商提供的域名能够直接访问空间)如图:

QQ图片20130517011225.jpg

3.更改数据库,其中需要更改的表有五个。分别为:
  1. pre_forum_attachment
  2. pre_home_pic
  3. pre_portal_article_title
  4. pre_portal_attachment
  5. pre_portal_topic_pic
复制代码
执行更新语句:
其中,pre_forum_attachment
执行语句:
  1. update pre_forum_attachment_0 set remote = '1';
  2. update pre_forum_attachment_1 set remote = '1';
  3. update pre_forum_attachment_2 set remote = '1';
  4. update pre_forum_attachment_3 set remote = '1';
  5. update pre_forum_attachment_4 set remote = '1';
  6. update pre_forum_attachment_5 set remote = '1';
  7. update pre_forum_attachment_6 set remote = '1';
  8. update pre_forum_attachment_7 set remote = '1';
  9. update pre_forum_attachment_8 set remote = '1';
  10. update pre_forum_attachment_9 set remote = '1';
复制代码
其他几个依次为pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic
语句:
  1. update pre_portal_article_title set remote=1;
  2. update pre_portal_attachment set remote=1;
  3. update pre_portal_topic_pic set remote=1;
复制代码
由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic(家园表——这个表的remote字段比较特别,home本地图片—0;home远程图片—1;论坛本地图片—2;论坛远程图片—3)
  1. update pre_home_pic set remote=remote+1;
复制代码
注意:执行语句前,请备份数据库,远程附件转换本地附件只需要把里面的1改为0即可
  1. update pre_home_album set picflag=picflag+1 where picflag=1;
复制代码



本教程由无限星辰工作室www.xmspace.net独家原创,转账请注明地址和作者,谢谢!

本教程由无限星辰工作室CRX349独家整理和提供,转载请注明地址,谢谢。本文地址:https://www.xmspace.net/thread-25-1-1.html
无限星辰工作室  好集导航 Discuz全集下载  星辰站长网  集热爱361  一品文学  手机小游戏合集   海外空间网 星辰api  星辰支付二维码管理平台 阿里云服务器 腾讯云服务器
服务Discuz!建站|DiscuzQ配置|二开|小程序|APP|搬家|挂马清理|防护|Win/Linux环境搭建|优化|运维|
服务理念:专业 诚信 友好QQ842062626 服务项目 Q群315524225

发表于 2013-5-17 01:15:02 | 显示全部楼层 |阅读模式

回复 | 使用道具 举报

该帖共收到 0 条回复!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

美图秀

    • fastadmin 后台界面使用字段数组类型
    • Discuz!x3.5 修改标题高亮颜色
    • Discuz!x3.5 应用中心 下载应用一直下载中
    • 帖子定时显示
    • 论坛辅助审核
拖动客服框
Online Service
点击这里给我发消息
点击这里联系我们
微信扫一扫
在线客服
快速回复 返回顶部 返回列表