<?php
/**
* Modoer 1.0.x 升级到 1.1
* @author moufer<moufer@163.com>
* @package
* @copyright wa666.cn
* @version $Id$
*/
error_reporting(E_ERROR | E_WARNING | E_PARSE);
@ob_start();
@set_time_limit(1000);
set_magic_quotes_runtime(0);
define('PRODUCT', 'Modoer');
define('IN_MUDDER', TRUE);
define('MUDDER_ROOT', '../');
$timestamp = time();
$_POST = (array)$_POST;
$_GET = (array)$_GET;
if(!get_magic_quotes_gpc()) {
$_POST = add_slashes($_POST);
$_GET = add_slashes($_GET);
$_COOKIE = add_slashes($_COOKIE);
}
@extract($_POST, EXTR_SKIP);
@extract($_GET, EXTR_SKIP);
unset($_POST, $_GET);
$phpself = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
require_once(MUDDER_ROOT.'config.inc.php');
require_once(MUDDER_ROOT.'include/mysql.class.php');
$db = new Db_class($dbhost, $dbuser, $dbpw, $dbname);
header('Content-type: text/html; charset='.$charset);
$oldversion = '1.0.x';
$newversion = '1.1';
$lockname = 'upgrade_10to11.lock';
$lockfile = MUDDER_ROOT.'data/'.$lockname;
$sqlfile = MUDDER_ROOT.'install/'.$sqlname;
file_exists($lockfile) && redirect(PRODUCT.'系统已升级,如需重新升级,请删除 ./data/'.$lockname.' 文件。',1,'stop');
empty($step) && $step = 1;
if($step == 1) {
} elseif($step == 2) {
// 新建表
$array = array(
'modoer_ads'=> "
adid smallint(5) NOT NULL auto_increment,
callid smallint(5) unsigned NOT NULL default '0',
subject varchar(60) NOT NULL default '',
adtype tinyint(3) unsigned NOT NULL default '1',
begintime int(10) NOT NULL default '0',
endtime int(10) NOT NULL default '0',
content mediumtext NOT NULL,
code mediumtext NOT NULL,
isclosed tinyint(1) NOT NULL default '0',
attr varchar(10) NOT NULL default '',
PRIMARY KEY (adid)" ,
'modoer_articledata'=> "
articleid mediumint(8) unsigned NOT NULL default '0',
content longtext NOT NULL,
PRIMARY KEY (articleid)" ,
'modoer_articleclass'=> "
classid smallint(5) unsigned NOT NULL auto_increment,
classname varchar(20) NOT NULL default '',
displayorder smallint(5) NOT NULL default '0',
articlenum mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (classid)" ,
'modoer_articles'=> "
articleid mediumint(8) unsigned NOT NULL auto_increment,
classid smallint(5) unsigned NOT NULL default '0',
shopid mediumint(8) NOT NULL default '0',
dateline int(10) NOT NULL default '0',
att tinyint(1) NOT NULL default '0',
author varchar(20) NOT NULL default '',
subject varchar(60) NOT NULL default '',
keywords varchar(100) NOT NULL default '',
pageview mediumint(8) unsigned NOT NULL default '0',
digg mediumint(8) NOT NULL default '0',
copyfrom varchar(200) NOT NULL default '',
introduce mediumtext NOT NULL,
status tinyint(1) NOT NULL default '1',
checker varchar(30) NOT NULL default '',
PRIMARY KEY (articleid),
KEY classid (classid),
KEY shopid (shopid),
KEY dateline (dateline),
KEY digg (digg)" ,
'modoer_coupons'=> "
couponid mediumint(8) unsigned NOT NULL auto_increment,
shopid mediumint(8) unsigned NOT NULL default '0',
uid mediumint(8) NOT NULL default '0',
username varchar(30) NOT NULL default '',
thumb varchar(255) NOT NULL default '',
picture varchar(255) NOT NULL default '',
starttime int(10) NOT NULL default '0',
endtime int(10) NOT NULL default '0',
subject varchar(100) NOT NULL default '',
des varchar(50) NOT NULL default '',
content text NOT NULL,
effect1 mediumint(8) unsigned NOT NULL default '0',
flag tinyint(1) unsigned NOT NULL default '1',
dateline int(10) unsigned NOT NULL default '0',
pageview int(10) NOT NULL default '0',
PRIMARY KEY (couponid),
KEY shopid (shopid),
KEY uid (uid),
KEY dateline (dateline)" ,
'modoer_datacall'=> "
callid smallint(5) unsigned NOT NULL auto_increment,
module varchar(60) NOT NULL default '',
calltype varchar(60) NOT NULL default '',
name varchar(50) NOT NULL default '',
fun varchar(60) NOT NULL default '',
var varchar(60) NOT NULL default '',
expression text NOT NULL,
tplname varchar(200) NOT NULL default '',
empty_tplname varchar(200) NOT NULL default '',
closed tinyint(1) unsigned NOT NULL default '0',
hash varchar(32) NOT NULL default '',
PRIMARY KEY (callid)" ,
'modoer_itemapply'=> "
applyid mediumint(8) unsigned NOT NULL auto_increment,
shopid mediumint(8) unsigned NOT NULL default '0',
uid mediumint(8) unsigned NOT NULL default '0',
username varchar(20) NOT NULL default '',
status tinyint(1) unsigned NOT NULL default '2',
applyname varchar(100) NOT NULL default '',
contact varchar(255) NOT NULL default '',
pic varchar(255) NOT NULL default '',
content mediumtext NOT NULL,
dateline int(10) unsigned NOT NULL default '0',
checker varchar(30) NOT NULL default '',
returned text NOT NULL,
PRIMARY KEY (applyid)" ,
'modoer_membereffect'=> "
id mediumint(8) unsigned NOT NULL default '0',
idtype varchar(15) NOT NULL default '',
uid mediumint(8) unsigned NOT NULL default '0',
username varchar(20) NOT NULL default '',
dateline int(10) NOT NULL default '0',
effect1 tinyint(1) unsigned NOT NULL default '0',
effect2 tinyint(1) unsigned NOT NULL default '0',
KEY id (id,idtype)" ,
'modoer_menus'=> "
menuid smallint(5) unsigned NOT NULL auto_increment,
isclosed tinyint(1) NOT NULL default '0',
flag varchar(60) NOT NULL default '',
isfolder tinyint(1) unsigned NOT NULL default '0',
clicks int(10) unsigned NOT NULL default '0',
title varchar(100) NOT NULL default '',
scriptnav varchar(60) NOT NULL default '',
mkey varchar(60) NOT NULL default '',
url varchar(255) NOT NULL default '',
icon varchar(60) NOT NULL default '',
listorder smallint(5) NOT NULL default '0',
PRIMARY KEY (menuid)" ,
'modoer_modules'=> "
moduleid smallint(5) unsigned NOT NULL auto_increment,
flag varchar(30) NOT NULL default '',
iscore tinyint(1) NOT NULL default '0',
name varchar(60) NOT NULL default '',
directory varchar(100) NOT NULL default '',
disable tinyint(1) unsigned NOT NULL default '0',
config text NOT NULL,
version varchar(60) NOT NULL default '',
releasetime date NOT NULL default '0000-00-00',
reliant varchar(255) NOT NULL default '',
author varchar(255) NOT NULL default '',
introduce text NOT NULL,
siteurl varchar(255) NOT NULL default '',
email varchar(255) NOT NULL default '',