Discuz!X2.0本地附件和遠程附件之間的轉化終極教程版
來源:易賢網 閱讀:844 次 日期:2014-08-18 11:21:07
溫馨提示:易賢網小編為您整理了“Discuz!X2.0本地附件和遠程附件之間的轉化終極教程版”,方便廣大網友查閱!

折騰了一天,終于弄清楚了本地附件轉換到遠程附件的問題了,目前,相冊,論壇附件,圖片,空間,一切都正常了。

下面來給大家分享經驗:

本地附件轉到遠程附件:

論壇上有一些帖子,代碼教程是:

  remote=remote+1;

如果你只在數據庫了操作了一次,問題還不大,如果你重復操作了,那么你的問題就大了,你會發(fā)現相冊里的圖片你都找不到,而且甚至FTP目錄里都找不到這個文件名的文件,所以下面我就來談我的方法:

我使用的工具:帝國備份王

這個可以先把數據庫備份了,然后再來進行sql升級操作,都在這個備份王里面完成。

1、先備份數據庫

2、附件的移動

3、開始sql語句升級

本地附件轉移到遠程附件,在帝國備份王里執(zhí)行如下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;

更多信息請查看IT技術專欄

更多信息請查看CMS教程
由于各方面情況的不斷調整與變化,易賢網提供的所有考試信息和咨詢回復僅供參考,敬請考生以權威部門公布的正式信息和咨詢?yōu)闇剩?/div>
相關閱讀CMS教程

2025國考·省考課程試聽報名

  • 報班類型
  • 姓名
  • 手機號
  • 驗證碼
關于我們 | 聯系我們 | 人才招聘 | 網站聲明 | 網站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點 | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網安備53010202001879號 人力資源服務許可證:(云)人服證字(2023)第0102001523號
聯系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關注公眾號:hfpxwx
咨詢QQ:1093837350(9:00—18:00)版權所有:易賢網