网站之家技术交流论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1469|回复: 0

升级到X2.5 附件变问号的原因以及处理方案

[复制链接]
发表于 2013-5-12 08:41:08 | 显示全部楼层 |阅读模式
首先我们先来查看update.php 文件中处理附件部分代码
  1. elseif($_GET['op'] == 'forumattach') {
  2.                 $nextop = 'moderate';
  3.                 $limit = 10000;
  4.                 $start = !empty($_GET['start']) ? $_GET['start'] : 0;
  5.                $needupgrade = DB::query("SELECT COUNT(*) FROM ".DB::table('forum_attachmentfield'), 'SILENT');
  6.                 $count = DB::result_first("SELECT COUNT(*) FROM ".DB::table('forum_attachment'));
  7.                 if($needupgrade && $count) {
  8.                         if(!$start) {
  9.                                 for($i = 0;$i < 10;$i++) {
  10.                                         DB::query("TRUNCATE ".DB::table('forum_attachment_'.$i));
  11.                                 }
  12.                         }
  13.                         $query = DB::query("SELECT a.*,af.description FROM ".DB::table('forum_attachment')." a
  14.                                 LEFT JOIN ".DB::table('forum_attachmentfield')." af USING(aid)
  15.                                 ORDER BY aid LIMIT $start, $limit");
  16.                         if(DB::num_rows($query)) {
  17.                            
  18.            省略。。。。。。。
复制代码
$needupgrade = DB::query("SELECT COUNT(*) FROM ".DB::table('forum_attachmentfield'), 'SILENT');
代码红色部分,有对forum_attachmentfield 进行处理,因为这个升级程序是兼容 Discuz! X 系列的升级。如果你升级到X2的时候此表还存在,升级到 Discuz! X2.5就会将附件表 forum_attachment_0 到 9 这些表给处理掉。正常情况 Discuz! X2升级到 Discuz!   X2.5 是不用处理附件表。 所以,升级到X2.5附件为 问号的用户,可以直接导入X2 备份的数据将附件表 forum_attachment 和  forum_attachment_0 到 9 表 、forum_attachment_unused 表的数据直接导入

X2.5的附件表 有对 forum_attachment_type 更改 、添加 了forum_attachment_exifi表,导入X2的数据之后 请确保这些表都存在


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|网站之家技术交流论坛 ( 粤ICP备09092995号 )

GMT+8, 2024-5-16 20:38 , Processed in 0.094962 second(s), 8 queries , File On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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