找回密码
 注册
【阿里云】2核2G云新老同享 99元/年,续费同价华为云精选云产品特惠做网站就用糖果主机Jtti,新加坡服务器,美国服务器,香港服务器
查看: 1724|回复: 29

DZ2.5升级4.0.0 成功方法

[复制链接]
发表于 2005 年 10 月 20 日 21:54:31 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
转自落伍,自己稍加修改.

本方法仅供本地测试用  数据升级有风险
请购买正式商业版 会有升级服务保证数据安全


好多人升级到3.1.2的时候把 3.1.2的文件传上去覆盖原来的2.5
这样就出问题了
为什么呢?
因为3.1.2也是商业版 传一个商业版 没破解的上去 升级的时候 就出现了 没有授权的提示

所以  升级的时候 什么都不要上传 就把2.5to3.1.2<upgrade312.php>的文件传上去
  1. <?php
  2. // Upgrade Discuz! Board from 2.5F to 3.1.2
  3. header("Content-Type: text/html; charset=gb2312");
  4. set_time_limit(1000);
  5. define('IN_DISCUZ', TRUE);
  6. if(file_exists('./config.php')) {
  7.        require "./config.php";
  8. } else {
  9.        require "./config.inc.php";
  10. }
  11. require "./include/db_mysql.php";
  12. error_reporting(E_ERROR | E_WARNING | E_PARSE);
  13. @set_magic_quotes_runtime(0);
  14. $action = ($HTTP_POST_VARS[action]) ? $HTTP_POST_VARS[action] : $HTTP_GET_VARS[action];
  15. $step = $HTTP_GET_VARS[step];
  16. $start = $HTTP_GET_VARS[start];
  17. $upgrade1 = <<<EOT
  18. DROP TABLE cdb_caches;
  19. DROP TABLE cdb_plugins;
  20. DROP TABLE cdb_plugins_settings;
  21. DELETE FROM cdb_settings WHERE variable = 'attachimgcheck' LIMIT 1;
  22. DELETE FROM cdb_settings WHERE variable = 'attachsoftdownload' LIMIT 1;
  23. DELETE FROM cdb_settings WHERE variable = 'attach_max' LIMIT 1;
  24. DELETE FROM cdb_settings WHERE variable = 'attach_newpost' LIMIT 1;
  25. DELETE FROM cdb_settings WHERE variable = 'attach_editpost' LIMIT 1;
  26. DELETE FROM cdb_settings WHERE variable = 'attach_replypost' LIMIT 1;
  27. DELETE FROM cdb_settings WHERE variable = 'statcacherefresh' LIMIT 1;
  28. DELETE FROM cdb_settings WHERE variable = 'delayeditpost' LIMIT 1;
  29. DELETE FROM cdb_settings WHERE variable = 'delaykarma' LIMIT 1;
  30. DELETE FROM cdb_settings WHERE variable = 'useimagemessage' LIMIT 1;
  31. UPDATE cdb_settings SET value = '3.1' WHERE variable = 'version' LIMIT 1 ;
  32. INSERT INTO cdb_settings ( variable , value ) VALUES ('dotfolders', '0');
  33. ALTER TABLE cdb_settings ORDER BY variable;
  34. ALTER TABLE cdb_adminsessions CHANGE uid sid CHAR( 6 ) BINARY DEFAULT '' NOT NULL,DROP ip,DROP PRIMARY KEY;
  35. ALTER TABLE cdb_admingroups CHANGE admingid admingid TINYINT( 1 ) UNSIGNED DEFAULT '0',DROP admintitle,DROP adminglobal,DROP allowhighlight,DROP allowdigest,DROP allowclose,DROP allowmove,DROP allowtop,DROP allowmerge,DROP allowsplit;
  36. ALTER TABLE cdb_announcements DROP posturl;
  37. ALTER TABLE cdb_karmalog DROP kid,CHANGE score score TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL,DROP INDEX pid,DROP INDEX dateline;
  38. DROP TABLE IF EXISTS cdb_profilefields;
  39. CREATE TABLE cdb_profilefields (
  40.   fieldid smallint(6) unsigned NOT NULL auto_increment,
  41.   available tinyint(1) NOT NULL default '0',
  42.   invisible tinyint(1) NOT NULL default '0',
  43.   title varchar(50) NOT NULL default '',
  44.   description varchar(255) NOT NULL default '',
  45.   size tinyint(3) unsigned NOT NULL default '0',
  46.   displayorder smallint(6) NOT NULL default '0',
  47.   required tinyint(1) NOT NULL default '0',
  48.   showinthread tinyint(1) NOT NULL default '0',
  49.   selective tinyint(1) NOT NULL default '0',
  50.   choices text NOT NULL,
  51.   PRIMARY KEY  (fieldid)
  52. ) TYPE=MyISAM;
  53. ALTER TABLE cdb_attachments DROP uid,DROP dateline,DROP INDEX tid,DROP INDEX pid,CHANGE downloads downloads SMALLINT( 6 ) DEFAULT '0' NOT NULL;
  54. EOT;
  55. $upgrade2 = <<<EOT
  56. ALTER TABLE cdb_members CHANGE adminid adminid TINYINT( 1 ) DEFAULT '0' NOT NULL;
  57. EOT;
  58. $upgrade3 = <<<EOT
  59. ALTER TABLE cdb_posts CHANGE aid aid MEDIUMINT( 8 ) UNSIGNED DEFAULT '0' NOT NULL,ADD INDEX dotfolder ( tid , authorid );
  60. EOT;
  61. if(!$action) {
  62.        echo"<title>Discuz!升级程序: 2.5F 到 3.12(共六步)</title>";
  63.        echo"本程序用于升级 Discuz! 2.5F 到 Discuz! 3.12,请确认之前已经顺利安装 Discuz! 2.5F<br><br><br>";
  64.        echo"<b><font color=\"red\">本升级程序只能从 2.5F 升级到 3.1.2,运行之前,请确认已经上传 3.1.2 的全部文件和目录</font></b><br>";
  65.        echo"<b><font color=\"red\">升级前请打开浏览器 JavaScript 支持,整个过程是自动完成的,不需人工点击和干预.<br><b>升级之前务必备份数据库资料,否则可能产生无法恢复的后果!</b><br><br>本次升级可能需要耗时很多,并可能占用大量CPU资源,根据您的数据量有关,请在服务器空闲时进行.<br>请确保服务器上 PHP 没有在安全模式,或没有脚本运行时间的硬性限制,否则请在本地机器升级后上传数据库。</font></b><br><br>";
  66.        echo"正确的升级方法为:<br>1. 关闭原有论坛,上传 Discuz! 3.1.2 版的全部文件和目录,覆盖服务器上的 2.5F<br>2. 根据安装说明,设置目录announcement、customavatars、forumdata/accesslogs属性777<br>3. 上传本程序到 Discuz! 目录中;<br>4. 运行本程序,直到出现升级完成的提示;<br><br>";
  67.        echo"<a href=\"$PHP_SELF?action=upgrade&step=1\">如果您已确认完成上面的步骤,请点这里升级</a>";
  68. } else {
  69.        $tables = array('attachments', 'announcements', 'banned', 'caches', 'favorites', 'forumlinks', 'forums', 'karmalog', 'members', 'memo',
  70.        'news', 'polls', 'posts', 'searchindex', 'sessions', 'settings', 'styles', 'smilies', 'stats', 'subscriptions', 'templates', 'themes',
  71.        'threads', 'pm', 'pms', 'usergroups', 'words', 'buddys', 'stylevars');
  72.        foreach($tables as $tablename) {
  73.                ${"table_".$tablename} = $tablepre.$tablename;
  74.        }
  75.        unset($tablename);
  76.        $db = new dbstuff;
  77.        $db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
  78.        $db->select_db($dbname);
  79.        unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
  80.        if($step == 1) {
  81.                $query = $db->query("SELECT value FROM ".$tablepre."settings WHERE variable='version'");
  82.                if(($db->result($query, 0)) != '2.5') {
  83.                        echo"<title>发生错误!</title>";
  84.                        exit('您当前数据库数据版本不是2.5,无法升级<br><a href="javascript:history.go(-1)">返回</a>');        //debug
  85.                }
  86.                echo"<title>$step .Discuz!升级程序: 2.5F 到 3.12(共六步)</title>";
  87.                runquery($upgrade1);
  88.                echo "第 $step 步升级成功<br>";
  89.                redirect("$PHP_SELF?action=upgrade&step=".($step + 1));
  90.        } elseif($step == 2) {
  91.                echo"<title>$step .Discuz!升级程序: 2.5F 到 3.12(共六步)</title>";
  92.                runquery($upgrade2);
  93.                echo "第 $step 步升级成功<br>";
  94.                redirect("$PHP_SELF?action=upgrade&step=".($step + 1));
  95.        } elseif($step == 3) {
  96.                echo"<title>$step .Discuz!升级程序: 2.5F 到 3.12(共六步)</title>";
  97.                runquery($upgrade3);
  98.                echo "第 $step 步升级成功<br>";
  99.                redirect("$PHP_SELF?action=upgrade&step=".($step + 1));
  100.        } elseif($step == 4) {
  101.                echo"<title>$step .Discuz!升级程序: 2.5F 到 3.12(共六步)</title>";
  102.                $tagArray = array(
  103.                        'fly'=>'\'\', 0, \'fly\', \'<marquee width="90%" behavior="alternate" scrollamount="3">{1}</marquee>\', \'[fly]This is sample text[/fly]\', \'Make text move horizontal, the same effect as html tag <marquee>. NOTE: Only Internet Explorer supports this feature\', 1, 1',
  104.                        'wmv'=>'\'\', 0, \'wmv\', \'<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="500" height="350" >\r\n<param name="ShowStatusBar" value="-1">\r\n<param name="Filename" value="{1}">\r\n<embed type="application/x-oleobject" codebase="[url]http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5[/url],1,52,701" flename="wmv" src="{1}" width="500" height="350">\r\n</embed></object>\', \'[wmv]mms://your.com/example.wmv[/wmv]\', \'Embed Windows media file in thread page\', 1, 1',
  105.                        'rm'=>'\'\', 0, \'rm\', \'<object classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" width="500" height="300" id="Player" viewastext>\r\n<param name="_ExtentX" value="12726">\r\n<param name="_ExtentY" value="8520">\r\n<param name="AUTOSTART" value="0">\r\n<param name="SHUFFLE" value="0">\r\n<param name="PREFETCH" value="0">\r\n<param name="NOLABELS" value="0">\r\n<param name="CONTROLS" value="ImageWindow">\r\n<param name="CONSOLE" value="_master">\r\n<param name="LOOP" value="0">\r\n<param name="NUMLOOP" value="0">\r\n<param name="CENTER" value="0">\r\n<param name="MAINTAINASPECT" value="{1}">\r\n<param name="BACKGROUNDCOLOR" value="#000000">\r\n</object><br><object classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" width="500" height="50" id="Player" viewastext>\r\n<param name="_ExtentX" value="18256">\r\n<param name="_ExtentY" value="794">\r\n<param name="AUTOSTART" value="-1">\r\n<param name="SHUFFLE" value="0">\r\n<param name="PREFETCH" value="0">\r\n<param name="NOLABELS" value="0">\r\n<param name="CONTROLS" value="controlpanel">\r\n<param name="CONSOLE" value="_master">\r\n<param name="LOOP" value="0">\r\n<param name="NUMLOOP" value="0">\r\n<param name="CENTER" value="0">\r\n<param name="MAINTAINASPECT" value="0">\r\n<param name="BACKGROUNDCOLOR" value="#000000">\r\n<param name="SRC" value="{1}"></object>\', \'[rm]rtsp://your.com/example.rm[/rm]\', \'Embed Real Movie in thread page\', 1, 1'
  106.                );
  107.                foreach ($tagArray AS $value=>$content) {
  108.                        $query = $db->query("SELECT * FROM ".$tablepre."bbcodes WHERE tag='$value'");
  109.                        $exists = mysql_num_rows($query);
  110.                        if ($exists == 0) {
  111.                                $InsertQuery = $db->query("INSERT INTO ".$tablepre."bbcodes (id, available, tag, replacement, example, explanation, params, nest) VALUES ($content);");
  112.                        }
  113.                }
  114.                echo "第 $step 步升级成功<br>";
  115.                redirect("$PHP_SELF?action=upgrade&step=".($step + 1));
  116.        } elseif($step == 5) {
  117.                $many = 2000;
  118.                $start = intval($start);
  119.                $start = $start < 1 ? 0 : $start;
  120.                $end = $start + $many;
  121.                $continue = 0;
  122.                echo"<title>$step .Discuz!升级程序: 2.5F 到 3.12(共六步)</title>";
  123.                echo "正在进行第 $step 步(转换POSTS表):<br>";
  124.                echo "如果您的附件很多本步可能需要时间较长<br>";
  125.                echo "当前影响第 $start 行到 $end 行数据。<br>";
  126.                $query = $db->query("SELECT * FROM ".$tablepre."attachments LIMIT $start,$many;");
  127.                while($a = $db->fetch_array($query)) {
  128.                        $query2 = $db->query("UPDATE ".$tablepre."posts SET aid='$a[aid]' WHERE pid='$a[pid]';");
  129.                        $continue = 1;
  130.                }
  131.                if ($continue) {
  132.                        echo "操作继续。<br>";
  133.                        redirect("$PHP_SELF?action=upgrade&step=$step&start=$end");
  134.                } else {
  135.                        echo "第 $step 步升级成功<br>";
  136.                        redirect("$PHP_SELF?action=upgrade&step=".($step + 1));
  137.                }
  138.        } elseif($step == 6) {
  139.                @unlink('./forumdata/cache/cache_settings.php');
  140.                echo"<title>$step .Discuz!升级程序: 2.5F 到 3.12(共六步)</title>";
  141.                echo "恭喜您升级成功,请删除本程序。<a href='./index.php' target=_blank>点击这里进入您的论坛</a>";
  142.        }
  143. }
  144. function runquery($query) {
  145.        global $db, $tablepre;
  146.        $expquery = explode(";", $query);
  147.        foreach($expquery as $sql) {
  148.                $sql = trim($sql);
  149.                if($sql != "" && $sql[0] != "#") {
  150.                        $db->query(str_replace("cdb_", $tablepre, $sql));
  151.                }
  152.        }
  153. }
  154. function redirect($url) {
  155.        echo"<script>";
  156.        echo"function redirect() {window.location.replace('$url');}\n";
  157.        echo"setTimeout('redirect();', 2000);\n";
  158.        echo"</script>";
  159.        echo"<br><br><a href=\"$url\">如果您的浏览器没有自动跳转,请点击这里</a>";
  160. }
  161. ?>
复制代码


升级之后
再把破解的4.0.0传上去覆盖 再用DZ4.0里带的升级程序upgrade5.php升级

升级过程中 可能因为 你的论坛装过一些插件 跟升级程序中的表重复
你可以删除个别表 然后继续升级
如果最后有数据库错误,那试试用下面的导入<我的就是用了这部才成功>
  1. DROP TABLE IF EXISTS cdb_plugins;
  2. CREATE TABLE cdb_plugins (
  3.   pluginid smallint(6) unsigned NOT NULL auto_increment,
  4.   available tinyint(1) NOT NULL default '0',
  5.   adminid tinyint(1) unsigned NOT NULL default '0',
  6.   name varchar(40) NOT NULL default '',
  7.   identifier varchar(40) NOT NULL default '',
  8.   description varchar(255) NOT NULL default '',
  9.   datatables varchar(255) NOT NULL default '',
  10.   `directory` varchar(100) NOT NULL default '',
  11.   copyright varchar(100) NOT NULL default '',
  12.   modules text NOT NULL,
  13.   PRIMARY KEY  (pluginid),
  14.   UNIQUE KEY identifier (identifier)
  15. ) Type=MyISAM;
复制代码

演示:http://huanghua.mireene.com/bbs/
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
 楼主| 发表于 2005 年 10 月 20 日 21:54:31 | 显示全部楼层
【腾讯云】2核2G云服务器新老同享 99元/年,续费同价

DZ2.5升级4.0.0 成功方法

转自落伍,自己稍加修改.

本方法仅供本地测试用  数据升级有风险
请购买正式商业版 会有升级服务保证数据安全


好多人升级到3.1.2的时候把 3.1.2的文件传上去覆盖原来的2.5
这样就出问题了
为什么呢?
因为3.1.2也是商业版 传一个商业版 没破解的上去 升级的时候 就出现了 没有授权的提示

所以  升级的时候 什么都不要上传 就把2.5to3.1.2<upgrade312.php>的文件传上去
  1. <?php
  2. // Upgrade Discuz! Board from 2.5F to 3.1.2
  3. header("Content-Type: text/html; charset=gb2312");
  4. set_time_limit(1000);
  5. define('IN_DISCUZ', TRUE);
  6. if(file_exists('./config.php')) {
  7.        require "./config.php";
  8. } else {
  9.        require "./config.inc.php";
  10. }
  11. require "./include/db_mysql.php";
  12. error_reporting(E_ERROR | E_WARNING | E_PARSE);
  13. @set_magic_quotes_runtime(0);
  14. $action = ($HTTP_POST_VARS[action]) ? $HTTP_POST_VARS[action] : $HTTP_GET_VARS[action];
  15. $step = $HTTP_GET_VARS[step];
  16. $start = $HTTP_GET_VARS[start];
  17. $upgrade1 = <<<EOT
  18. DROP TABLE cdb_caches;
  19. DROP TABLE cdb_plugins;
  20. DROP TABLE cdb_plugins_settings;
  21. DELETE FROM cdb_settings WHERE variable = 'attachimgcheck' LIMIT 1;
  22. DELETE FROM cdb_settings WHERE variable = 'attachsoftdownload' LIMIT 1;
  23. DELETE FROM cdb_settings WHERE variable = 'attach_max' LIMIT 1;
  24. DELETE FROM cdb_settings WHERE variable = 'attach_newpost' LIMIT 1;
  25. DELETE FROM cdb_settings WHERE variable = 'attach_editpost' LIMIT 1;
  26. DELETE FROM cdb_settings WHERE variable = 'attach_replypost' LIMIT 1;
  27. DELETE FROM cdb_settings WHERE variable = 'statcacherefresh' LIMIT 1;
  28. DELETE FROM cdb_settings WHERE variable = 'delayeditpost' LIMIT 1;
  29. DELETE FROM cdb_settings WHERE variable = 'delaykarma' LIMIT 1;
  30. DELETE FROM cdb_settings WHERE variable = 'useimagemessage' LIMIT 1;
  31. UPDATE cdb_settings SET value = '3.1' WHERE variable = 'version' LIMIT 1 ;
  32. INSERT INTO cdb_settings ( variable , value ) VALUES ('dotfolders', '0');
  33. ALTER TABLE cdb_settings ORDER BY variable;
  34. ALTER TABLE cdb_adminsessions CHANGE uid sid CHAR( 6 ) BINARY DEFAULT '' NOT NULL,DROP ip,DROP PRIMARY KEY;
  35. ALTER TABLE cdb_admingroups CHANGE admingid admingid TINYINT( 1 ) UNSIGNED DEFAULT '0',DROP admintitle,DROP adminglobal,DROP allowhighlight,DROP allowdigest,DROP allowclose,DROP allowmove,DROP allowtop,DROP allowmerge,DROP allowsplit;
  36. ALTER TABLE cdb_announcements DROP posturl;
  37. ALTER TABLE cdb_karmalog DROP kid,CHANGE score score TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL,DROP INDEX pid,DROP INDEX dateline;
  38. DROP TABLE IF EXISTS cdb_profilefields;
  39. CREATE TABLE cdb_profilefields (
  40.   fieldid smallint(6) unsigned NOT NULL auto_increment,
  41.   available tinyint(1) NOT NULL default '0',
  42.   invisible tinyint(1) NOT NULL default '0',
  43.   title varchar(50) NOT NULL default '',
  44.   description varchar(255) NOT NULL default '',
  45.   size tinyint(3) unsigned NOT NULL default '0',
  46.   displayorder smallint(6) NOT NULL default '0',
  47.   required tinyint(1) NOT NULL default '0',
  48.   showinthread tinyint(1) NOT NULL default '0',
  49.   selective tinyint(1) NOT NULL default '0',
  50.   choices text NOT NULL,
  51.   PRIMARY KEY  (fieldid)
  52. ) TYPE=MyISAM;
  53. ALTER TABLE cdb_attachments DROP uid,DROP dateline,DROP INDEX tid,DROP INDEX pid,CHANGE downloads downloads SMALLINT( 6 ) DEFAULT '0' NOT NULL;
  54. EOT;
  55. $upgrade2 = <<<EOT
  56. ALTER TABLE cdb_members CHANGE adminid adminid TINYINT( 1 ) DEFAULT '0' NOT NULL;
  57. EOT;
  58. $upgrade3 = <<<EOT
  59. ALTER TABLE cdb_posts CHANGE aid aid MEDIUMINT( 8 ) UNSIGNED DEFAULT '0' NOT NULL,ADD INDEX dotfolder ( tid , authorid );
  60. EOT;
  61. if(!$action) {
  62.        echo"<title>Discuz!升级程序: 2.5F 到 3.12(共六步)</title>";
  63.        echo"本程序用于升级 Discuz! 2.5F 到 Discuz! 3.12,请确认之前已经顺利安装 Discuz! 2.5F<br><br><br>";
  64.        echo"<b><font color=\"red\">本升级程序只能从 2.5F 升级到 3.1.2,运行之前,请确认已经上传 3.1.2 的全部文件和目录</font></b><br>";
  65.        echo"<b><font color=\"red\">升级前请打开浏览器 JavaScript 支持,整个过程是自动完成的,不需人工点击和干预.<br><b>升级之前务必备份数据库资料,否则可能产生无法恢复的后果!</b><br><br>本次升级可能需要耗时很多,并可能占用大量CPU资源,根据您的数据量有关,请在服务器空闲时进行.<br>请确保服务器上 PHP 没有在安全模式,或没有脚本运行时间的硬性限制,否则请在本地机器升级后上传数据库。</font></b><br><br>";
  66.        echo"正确的升级方法为:<br>1. 关闭原有论坛,上传 Discuz! 3.1.2 版的全部文件和目录,覆盖服务器上的 2.5F<br>2. 根据安装说明,设置目录announcement、customavatars、forumdata/accesslogs属性777<br>3. 上传本程序到 Discuz! 目录中;<br>4. 运行本程序,直到出现升级完成的提示;<br><br>";
  67.        echo"<a href=\"$PHP_SELF?action=upgrade&step=1\">如果您已确认完成上面的步骤,请点这里升级</a>";
  68. } else {
  69.        $tables = array('attachments', 'announcements', 'banned', 'caches', 'favorites', 'forumlinks', 'forums', 'karmalog', 'members', 'memo',
  70.        'news', 'polls', 'posts', 'searchindex', 'sessions', 'settings', 'styles', 'smilies', 'stats', 'subscriptions', 'templates', 'themes',
  71.        'threads', 'pm', 'pms', 'usergroups', 'words', 'buddys', 'stylevars');
  72.        foreach($tables as $tablename) {
  73.                ${"table_".$tablename} = $tablepre.$tablename;
  74.        }
  75.        unset($tablename);
  76.        $db = new dbstuff;
  77.        $db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
  78.        $db->select_db($dbname);
  79.        unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
  80.        if($step == 1) {
  81.                $query = $db->query("SELECT value FROM ".$tablepre."settings WHERE variable='version'");
  82.                if(($db->result($query, 0)) != '2.5') {
  83.                        echo"<title>发生错误!</title>";
  84.                        exit('您当前数据库数据版本不是2.5,无法升级<br><a href="javascript:history.go(-1)">返回</a>');        //debug
  85.                }
  86.                echo"<title>$step .Discuz!升级程序: 2.5F 到 3.12(共六步)</title>";
  87.                runquery($upgrade1);
  88.                echo "第 $step 步升级成功<br>";
  89.                redirect("$PHP_SELF?action=upgrade&step=".($step + 1));
  90.        } elseif($step == 2) {
  91.                echo"<title>$step .Discuz!升级程序: 2.5F 到 3.12(共六步)</title>";
  92.                runquery($upgrade2);
  93.                echo "第 $step 步升级成功<br>";
  94.                redirect("$PHP_SELF?action=upgrade&step=".($step + 1));
  95.        } elseif($step == 3) {
  96.                echo"<title>$step .Discuz!升级程序: 2.5F 到 3.12(共六步)</title>";
  97.                runquery($upgrade3);
  98.                echo "第 $step 步升级成功<br>";
  99.                redirect("$PHP_SELF?action=upgrade&step=".($step + 1));
  100.        } elseif($step == 4) {
  101.                echo"<title>$step .Discuz!升级程序: 2.5F 到 3.12(共六步)</title>";
  102.                $tagArray = array(
  103.                        'fly'=>'\'\', 0, \'fly\', \'<marquee width="90%" behavior="alternate" scrollamount="3">{1}</marquee>\', \'[fly]This is sample text[/fly]\', \'Make text move horizontal, the same effect as html tag <marquee>. NOTE: Only Internet Explorer supports this feature\', 1, 1',
  104.                        'wmv'=>'\'\', 0, \'wmv\', \'<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="500" height="350" >\r\n<param name="ShowStatusBar" value="-1">\r\n<param name="Filename" value="{1}">\r\n<embed type="application/x-oleobject" codebase="[url]http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5[/url],1,52,701" flename="wmv" src="{1}" width="500" height="350">\r\n</embed></object>\', \'[wmv]mms://your.com/example.wmv[/wmv]\', \'Embed Windows media file in thread page\', 1, 1',
  105.                        'rm'=>'\'\', 0, \'rm\', \'<object classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" width="500" height="300" id="Player" viewastext>\r\n<param name="_ExtentX" value="12726">\r\n<param name="_ExtentY" value="8520">\r\n<param name="AUTOSTART" value="0">\r\n<param name="SHUFFLE" value="0">\r\n<param name="PREFETCH" value="0">\r\n<param name="NOLABELS" value="0">\r\n<param name="CONTROLS" value="ImageWindow">\r\n<param name="CONSOLE" value="_master">\r\n<param name="LOOP" value="0">\r\n<param name="NUMLOOP" value="0">\r\n<param name="CENTER" value="0">\r\n<param name="MAINTAINASPECT" value="{1}">\r\n<param name="BACKGROUNDCOLOR" value="#000000">\r\n</object><br><object classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" width="500" height="50" id="Player" viewastext>\r\n<param name="_ExtentX" value="18256">\r\n<param name="_ExtentY" value="794">\r\n<param name="AUTOSTART" value="-1">\r\n<param name="SHUFFLE" value="0">\r\n<param name="PREFETCH" value="0">\r\n<param name="NOLABELS" value="0">\r\n<param name="CONTROLS" value="controlpanel">\r\n<param name="CONSOLE" value="_master">\r\n<param name="LOOP" value="0">\r\n<param name="NUMLOOP" value="0">\r\n<param name="CENTER" value="0">\r\n<param name="MAINTAINASPECT" value="0">\r\n<param name="BACKGROUNDCOLOR" value="#000000">\r\n<param name="SRC" value="{1}"></object>\', \'[rm]rtsp://your.com/example.rm[/rm]\', \'Embed Real Movie in thread page\', 1, 1'
  106.                );
  107.                foreach ($tagArray AS $value=>$content) {
  108.                        $query = $db->query("SELECT * FROM ".$tablepre."bbcodes WHERE tag='$value'");
  109.                        $exists = mysql_num_rows($query);
  110.                        if ($exists == 0) {
  111.                                $InsertQuery = $db->query("INSERT INTO ".$tablepre."bbcodes (id, available, tag, replacement, example, explanation, params, nest) VALUES ($content);");
  112.                        }
  113.                }
  114.                echo "第 $step 步升级成功<br>";
  115.                redirect("$PHP_SELF?action=upgrade&step=".($step + 1));
  116.        } elseif($step == 5) {
  117.                $many = 2000;
  118.                $start = intval($start);
  119.                $start = $start < 1 ? 0 : $start;
  120.                $end = $start + $many;
  121.                $continue = 0;
  122.                echo"<title>$step .Discuz!升级程序: 2.5F 到 3.12(共六步)</title>";
  123.                echo "正在进行第 $step 步(转换POSTS表):<br>";
  124.                echo "如果您的附件很多本步可能需要时间较长<br>";
  125.                echo "当前影响第 $start 行到 $end 行数据。<br>";
  126.                $query = $db->query("SELECT * FROM ".$tablepre."attachments LIMIT $start,$many;");
  127.                while($a = $db->fetch_array($query)) {
  128.                        $query2 = $db->query("UPDATE ".$tablepre."posts SET aid='$a[aid]' WHERE pid='$a[pid]';");
  129.                        $continue = 1;
  130.                }
  131.                if ($continue) {
  132.                        echo "操作继续。<br>";
  133.                        redirect("$PHP_SELF?action=upgrade&step=$step&start=$end");
  134.                } else {
  135.                        echo "第 $step 步升级成功<br>";
  136.                        redirect("$PHP_SELF?action=upgrade&step=".($step + 1));
  137.                }
  138.        } elseif($step == 6) {
  139.                @unlink('./forumdata/cache/cache_settings.php');
  140.                echo"<title>$step .Discuz!升级程序: 2.5F 到 3.12(共六步)</title>";
  141.                echo "恭喜您升级成功,请删除本程序。<a href='./index.php' target=_blank>点击这里进入您的论坛</a>";
  142.        }
  143. }
  144. function runquery($query) {
  145.        global $db, $tablepre;
  146.        $expquery = explode(";", $query);
  147.        foreach($expquery as $sql) {
  148.                $sql = trim($sql);
  149.                if($sql != "" && $sql[0] != "#") {
  150.                        $db->query(str_replace("cdb_", $tablepre, $sql));
  151.                }
  152.        }
  153. }
  154. function redirect($url) {
  155.        echo"<script>";
  156.        echo"function redirect() {window.location.replace('$url');}\n";
  157.        echo"setTimeout('redirect();', 2000);\n";
  158.        echo"</script>";
  159.        echo"<br><br><a href=\"$url\">如果您的浏览器没有自动跳转,请点击这里</a>";
  160. }
  161. ?>
复制代码


升级之后
再把破解的4.0.0传上去覆盖 再用DZ4.0里带的升级程序upgrade5.php升级

升级过程中 可能因为 你的论坛装过一些插件 跟升级程序中的表重复
你可以删除个别表 然后继续升级
如果最后有数据库错误,那试试用下面的导入<我的就是用了这部才成功>
  1. DROP TABLE IF EXISTS cdb_plugins;
  2. CREATE TABLE cdb_plugins (
  3.   pluginid smallint(6) unsigned NOT NULL auto_increment,
  4.   available tinyint(1) NOT NULL default '0',
  5.   adminid tinyint(1) unsigned NOT NULL default '0',
  6.   name varchar(40) NOT NULL default '',
  7.   identifier varchar(40) NOT NULL default '',
  8.   description varchar(255) NOT NULL default '',
  9.   datatables varchar(255) NOT NULL default '',
  10.   `directory` varchar(100) NOT NULL default '',
  11.   copyright varchar(100) NOT NULL default '',
  12.   modules text NOT NULL,
  13.   PRIMARY KEY  (pluginid),
  14.   UNIQUE KEY identifier (identifier)
  15. ) Type=MyISAM;
复制代码

演示:http://huanghua.mireene.com/bbs/
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

 楼主| 发表于 2005 年 10 月 20 日 21:57:52 | 显示全部楼层
下面是引用260009610于2005-10-20 21:55发表的:
没用过DZ2.5 [s:20]

看到有人需要就发了..
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2005 年 10 月 20 日 21:59:02 | 显示全部楼层
[s:15]  [s:16] 嘿嘿
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2005 年 10 月 20 日 21:59:30 | 显示全部楼层
Warning: mkdir(): No such file or directory in /web/home/huanghua/html/sources/source.php on line 1347 [s:13]
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2005 年 10 月 20 日 21:59:39 | 显示全部楼层
pw3.0.1要先转dz2.5再升级?
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

 楼主| 发表于 2005 年 10 月 20 日 22:02:56 | 显示全部楼层
【腾讯云】2核2G云服务器新老同享 99元/年,续费同价
下面是引用yanhua于2005-10-20 21:59发表的:
Warning: mkdir(): No such file or directory in /web/home/huanghua/html/sources/source.php on line 1347 [s:13]

我的这里正常啊
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2005 年 10 月 20 日 22:04:00 | 显示全部楼层
厉害~早点放就不用那么辛苦了……偶D会员啊……555
[s:15]  [s:16]  [s:19]
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2005 年 10 月 20 日 22:06:12 | 显示全部楼层
下面是引用tao于2005-10-20 22:04发表的:
厉害~早点放就不用那么辛苦了……偶D会员啊……555
[s:15]  [s:16]  [s:19]
TAO你到我群里AD做咩
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

 楼主| 发表于 2005 年 10 月 20 日 22:07:27 | 显示全部楼层
下面是引用squarecn于2005-10-20 21:59发表的:
pw3.0.1要先转dz2.5再升级?

是要先转2.5的,直接转要是商业用户才可以的
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|金光论坛

GMT+8, 2024 年 11 月 20 日 22:26 , Processed in 0.019013 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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