当前位置:首页>>Discuz学习教程

Discuz!X2.0本地附件和远程附件之间的转化终极教程版

点击数:1257 更新时间:2017-06-06 14:20:30 来源: 昕竹轩网站设计-返回

折腾了一天,终于弄清楚了本地附件转换到远程附件的问题了,目前,相册,论坛附件,图片,空间,一切都正常了。
  下面来给大家分享经验:
  本地附件转到远程附件:
  论坛上有一些帖子,代码教程是:
  remote=remote+1;
  如果你只在数据库了操作了一次,问题还不大,如果你重复操作了,那么你的问题就大了,你会发现相册里的图片你都找不到,而且甚至FTP目录里都找不到这个文件名的文件,所以下面我就来谈我的方法:
  我使用的工具:帝国备份王
  这个可以先把数据库备份了,然后再来进行sql升级操作,都在这个备份王里面完成。
  1、先备份数据库
  2、附件的移动
  3、开始sql语句升级
  本地附件转移到远程附件,在帝国备份王里执行如下sql,记得要设置数据库名称和编码哦,关键在加粗的第四句,如果盲目的+1,就会出现一些图片无法找到,而且在ftp上也找不到的情况。
  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=remote+1;
  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;
  远程附件转移到本地:
  把以上的 0和1进行互换,0表示本地,1表示远程,
  update pre_portal_article_title set remote=0 where remote=1;
  update pre_portal_attachment set remote=0 where remote=1;
  update pre_portal_topic_pic set remote=0 where remote=1;
  update pre_home_pic set remote=remote-1;
  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;

本资讯信息是来自 昕竹轩工作室 小编 通过网络收集而来的关于discuz网站开发,使用、安装、架设相关的学习资源。
您若也有需要分享的可以直接在我们网站上分享你的内容,让大家都知道。
版权声明,本活动信息隶属网络收集而来若有侵权请联系我们,我们将及时清除信息。

广告位
【责任编辑:CSW8923 (Top) 返回页面顶端
【必备推荐】(Top) 返回页面顶端
【精品案例】更多案例展示
【最新留言】 (Top) 返回页面顶端
共有0条评论
重要提示:
你设置的联系邮箱是*: (当有人给你留言回复之时,联系邮箱可以及时通知你)
我们建议你填写正确的邮箱地址,如果你之前填写邮箱地址是错误的可以通过 【修改资料】 来重新设置
登录 | 免费注册 | 忘记密码 | 邮箱:CSW8923@126.com     服务电话:17895923895   客服QQ:568441621 点击这里给我发消息
Copyright © 2014-2015 Htmcss.Com All Rights Reserved  版权所有昕竹轩网站设计 备案号:闽ICP备16024510号-4
关闭