diff --git a/core/class.config.php b/core/class.config.php index a55cb35..463245c 100644 --- a/core/class.config.php +++ b/core/class.config.php @@ -12,7 +12,7 @@ class Config { var $data = array(); - var $configFile = 'config/config.php'; //Default Config File + var $configFile = "config/config.php"; //Default Config File var $path_protectedconf = "config/config-protected.php"; function __construct() diff --git a/images/wallpapers/Mangosweb_wall.jpg b/images/wallpapers/Mangosweb_wall.jpg deleted file mode 100644 index 69888b0..0000000 Binary files a/images/wallpapers/Mangosweb_wall.jpg and /dev/null differ diff --git a/inc/account/account.login.php b/inc/account/account.login.php index 91cb3fa..e652e9b 100644 --- a/inc/account/account.login.php +++ b/inc/account/account.login.php @@ -43,7 +43,7 @@ { $login = $_POST['login']; $pass = $Account->sha_password($login, $_POST['pass']); - $EMAIL = $DB->selectCell("SELECT `email` FROM `account` WHERE `username` LIKE '".$_POST['login']."' LIMIT 1"); + $account_id = $DB->selectCell("SELECT `id` FROM `account` WHERE `username` LIKE '".$_POST['login']."' LIMIT 1"); // initiate the login array, and send it in $params = array('username' => $login, 'sha_pass_hash' => $pass); @@ -52,6 +52,12 @@ // If account login was successful if($Login == 1) { + // Make sure account exists in mw_account_extend table, if not then insert one of type "member" aka registered user + $mw_account = $DB->selectCell("SELECT account_id FROM mw_account_extend WHERE account_id = '".$account_id."'"); + if(!$mw_account) + { + $DB->query("INSERT INTO mw_account_extend (account_id, account_level) VALUES ($account_id, 2)"); + } // Once finished, redirect to the page we came from redirect($_SERVER['HTTP_REFERER'],1); } diff --git a/inc/admin/template_files/admin.email.php b/inc/admin/template_files/admin.email.php index 3d124be..e4c3f13 100644 --- a/inc/admin/template_files/admin.email.php +++ b/inc/admin/template_files/admin.email.php @@ -51,7 +51,7 @@ staffid : "991234" } }); - +
diff --git a/inc/admin/template_files/admin.news.php b/inc/admin/template_files/admin.news.php index 3d0c5f8..ab06ba5 100644 --- a/inc/admin/template_files/admin.news.php +++ b/inc/admin/template_files/admin.news.php @@ -9,6 +9,49 @@ /****************************************************************************/ ?> +
diff --git a/inc/server/server.info.php b/inc/server/server.info.php deleted file mode 100644 index 9e89b9e..0000000 --- a/inc/server/server.info.php +++ /dev/null @@ -1,75 +0,0 @@ - */ -/* Copyright (C) <2017> */ -/* < http://www.mistvale.com > */ -/* */ -/* Original MangosWeb Enhanced (C) 2010-2011 KeysWow */ -/* Original MangosWeb (C) 2007, Sasha, Nafe, TGM, Peec */ -/****************************************************************************/ - -if(INCLUDED!==true)exit; - -$pathway_info[] = array('title'=>'Server Info', 'link' =>''); - -$init = 'id_'.$user['cur_selected_realmd']; -$config_details = getMangosConfig($MW->getConfig->mangos_conf_external->$init->mangos_world_conf); - -$write_straight = array( - 'PlayerLimit' => 'Simultanous Players Connected Limit', - 'MaxPlayerLevel' => 'Max Character Level', - 'MaxPrimaryTradeSkill' => 'Number of Allowed Primary Trade Skills', - 'MinPetitionSigns' => 'Number of Signers Needed For Guild Petition', -); - -$write_true_false = array( - 'AllowTwoSide.Accounts' => 'Allow Both Horde and Alliance on Same Account', - 'AllowTwoSide.Interaction.Chat' => 'Allow Chat between Horde and Alliance', - 'AllowTwoSide.Interaction.Channel' => 'Allow Channels with Both Horde and Alliance', - 'AllowTwoSide.Interaction.Group' => 'Allow Groups with Both Horde and Alliance', - 'AllowTwoSide.Interaction.Guild' => 'Allow Guilds with Both Horde and Alliance', - 'AllowTwoSide.Interaction.Auction' => 'Allow Auction/Trade between Horde and Alliance', - 'AllowTwoSide.WhoList' => 'Show Both Horde and Alliance on /who List', -); - -$write_blizzlike = array( - 'Rate.Health' => 'Health Recovery Rate', - 'Rate.Mana' => 'Mana Recovery Rate', - 'Rate.Rage.Income' => 'Rage Increase Rate', - 'Rate.Rage.Loss' => 'Rage Decrease Rate', - 'Rate.Drop.Item.Poor' => 'Item Drop Rate Poor', - 'Rate.Drop.Item.Normal' => 'Item Drop Rate Normal', - 'Rate.Drop.Item.Uncommon' => 'Item Drop Rate Uncommon', - 'Rate.Drop.Item.Rare' => 'Item Drop Rate Rare', - 'Rate.Drop.Item.Epic' => 'Item Drop Rate Epic', - 'Rate.Drop.Item.Legendary' => 'Item Drop Rate Legendary', - 'Rate.Drop.Item.Artifact' => 'Item Drop Rate Artifact', - 'Rate.Drop.Item.Referenced' => 'Item Drop Rate Referenced', - 'Rate.Drop.Money' => 'Money Drop Rate', - 'Rate.XP.Kill' => 'Experience Rate from Kills', - 'Rate.XP.Quest' => 'Experience Rate from Quests', - 'Rate.XP.Explore' => 'Experience Rate from Exploration', - 'Rate.Creature.Normal.Damage' => 'Damage from Normal Creatures', - 'Rate.Creature.Elite.Elite.Damage' => 'Damage from Elites', - 'Rate.Creature.Elite.RAREELITE.Damage' => 'Damage from Rare Elites', - 'Rate.Creature.Elite.WORLDBOSS.Damage' => 'Damage from World Bosses', - 'Rate.Creature.Elite.RARE.Damage' => 'Damage from Rare Mobs', - 'Rate.Creature.Normal.HP' => 'HP of Normal Creatures', - 'Rate.Creature.Elite.Elite.HP' => 'HP of Elites', - 'Rate.Creature.Elite.RAREELITE.HP' => 'HP of Rare Elites', - 'Rate.Creature.Elite.WORLDBOSS.HP' => 'HP of World Bosses', - 'Rate.Creature.Elite.RARE.HP' => 'HP of Rare Mobs', - 'Rate.Rest.InGame' => 'Rest Exp Growth Rate In-game', - 'Rate.Rest.Offline.InTavernOrCity' => 'Rest Exp Growth Rate at Cities/Inns', - 'Rate.Rest.Offline.InWilderness' => 'Rest Exp Growth Rate in Wilderness', - 'Rate.Talent' => 'Talent Points Gain', -); - -$write_skillchances = array( - 'SkillChance.Orange' => 'Orange', - 'SkillChance.Yellow' => 'Yellow', - 'SkillChance.Green' => 'Green', - 'SkillChance.Grey' => 'Grey', -); - -?> diff --git a/inc/server/server.statistic.php b/inc/server/server.statistic.php index 142b2b1..f370105 100644 --- a/inc/server/server.statistic.php +++ b/inc/server/server.statistic.php @@ -8,38 +8,54 @@ /* Original MangosWeb (C) 2007, Sasha, Nafe, TGM, Peec */ /****************************************************************************/ -if(INCLUDED!==true)exit; +if(INCLUDED!==true) { + echo "Not Included!"; exit; +} -$pathway_info[] = array('title'=>$lang['statistic'],'link'=>''); +$realm = $DB->selectRow("SELECT * FROM realmlist WHERE `id`='".$user['cur_selected_realm']."' LIMIT 1"); +$pathway_info[] = array('title' => 'Server Statistics', 'link' => '?p=server&sub=statistic'); +$pathway_info[] = array('title' => $realm['name'], 'link' => ''); //initialize $num_chars variable $num_chars = 0; -$realm_param = $user['cur_selected_realmd']; -$rc = $CHDB->selectCol("SELECT race AS ARRAY_KEY, count(race) AS `num` FROM `characters` GROUP BY race"); +//$realm_param = get_realm_byid($_COOKIE['cur_selected_realm']);; +$rc = $CDB->select("SELECT race, count(race) AS `num` FROM `characters` GROUP BY race"); -foreach($rc as $data) +foreach($rc as $row) { - $num_chars+=$data; + $data[$row['race']] = $row['num']; } + // Loop thru classes, add 0 if its not defined in array. -for($i = 1; $i <= 11; $i++)if (!isset($rc[$i]))$rc[$i] = 0; +for($i = 1; $i <= 11; $i++) +{ + if(!isset($data[$i])) + { + $data[$i] = 0; + } + + $num_chars += $data[$i]; + + // echo "data[$i] = ".$data[$i]." - num_chars = $num_chars
"; +} //Check if 0 entries to avoid PHP warnings if 0 chars in database. -if ($num_chars > 0){ - $num_ally = $rc[1]+$rc[3]+$rc[4]+$rc[7]+$rc[11]; - $num_horde = $rc[2]+$rc[5]+$rc[6]+$rc[8]+$rc[10]; +if ($num_chars > 0) +{ + $num_ally = $data[1]+$data[3]+$data[4]+$data[7]+$data[11]; + $num_horde = $data[2]+$data[5]+$data[6]+$data[8]+$data[10]; $pc_ally = round($num_ally/$num_chars*100,2); $pc_horde = round($num_horde/$num_chars*100,2); - $pc_human = round($rc[1]/$num_chars*100,2); - $pc_orc = round($rc[2]/$num_chars*100,2); - $pc_dwarf = round($rc[3]/$num_chars*100,2); - $pc_ne = round($rc[4]/$num_chars*100,2); - $pc_undead = round($rc[5]/$num_chars*100,2); - $pc_tauren = round($rc[6]/$num_chars*100,2); - $pc_gnome = round($rc[7]/$num_chars*100,2); - $pc_troll = round($rc[8]/$num_chars*100,2); - $pc_be = round($rc[10]/$num_chars*100,2); - $pc_dranei = round($rc[11]/$num_chars*100,2); + $pc_human = round($data[1]/$num_chars*100,2); + $pc_orc = round($data[2]/$num_chars*100,2); + $pc_dwarf = round($data[3]/$num_chars*100,2); + $pc_ne = round($data[4]/$num_chars*100,2); + $pc_undead = round($data[5]/$num_chars*100,2); + $pc_tauren = round($data[6]/$num_chars*100,2); + $pc_gnome = round($data[7]/$num_chars*100,2); + $pc_troll = round($data[8]/$num_chars*100,2); + $pc_be = round($data[10]/$num_chars*100,2); + $pc_dranei = round($data[11]/$num_chars*100,2); } ?> diff --git a/index.php b/index.php index 17f2682..12827ef 100644 --- a/index.php +++ b/index.php @@ -121,7 +121,7 @@ if($CDB->status() != 1) { echo "Cannot connect to the Character database. Please make sure you have this realm setup successfully in the Admin Panel. - Delete your cookies to reset realm selection back to default"; + Delete your cookies to reset realm selection back to default. "; die(); } diff --git a/install/index.php b/install/index.php index 6580725..36ab7c1 100644 --- a/install/index.php +++ b/install/index.php @@ -200,17 +200,17 @@ function output_message($type, $text) die(); } // Check if provided info is correct - @mysql_connect($_POST['db_host'].":".$_POST['db_port'], $_POST['db_username'], $_POST['db_password']) + $link = @mysqli_connect($_POST['db_host'], $_POST['db_username'], $_POST['db_password'], $_POST['db_name'], $_POST['db_port']) or die('
Couldn\'t connect to MySQL Database. Please Go Back and re-enter MySQL Database Information.

MySql error log:
- '.mysql_error().'Counld Not select Realm database! Please go back and re-submit realm DB information.
'); output_message('success', 'Successfully Connected to Realm DB.'); // Check if "account" table exsists, so we make (almost) sure mangos is actually installed (which is necesarry for this whole thing to work) - @mysql_query("SELECT * FROM `account` LIMIT 1") or die('
Error!

Account table not found! Cannot Continue with the installation without an Account - table!

MySql error log:
'.mysql_error().'
'); + @mysqli_query($link, "SELECT * FROM `account` LIMIT 1") or die('
Error!

Account table not found! Cannot Continue with the installation without an Account + table!

MySql error log:
'.mysqli_error().'
'); // Everthing should be fine, so first insert info into protected config file $conffile = "../config/config-protected.php"; @@ -239,7 +239,7 @@ function output_message($type, $text) } // Preparing for sql injection... (prashing, etc...) - $checker = @mysql_query("SELECT * FROM `account_extend` LIMIT 1"); + $checker = @mysqli_query($link, "SELECT * FROM `account_extend` LIMIT 1"); if(!isset($_POST['skip'])) { // Dealing with the full install sql file @@ -285,11 +285,11 @@ function output_message($type, $text) // Sql injection foreach ($queries as $query) { - mysql_query($query); + mysqli_query($link, $query); } } - $get_name = mysql_query("SELECT `name` FROM `realmlist` WHERE `id`=1 LIMIT 1") or die('
'.mysql_error().'
'); - $DB_name = mysql_result($get_name,0); + $get_name = mysqli_query($link, "SELECT `name` FROM `realmlist` WHERE `id`=1 LIMIT 1") or die('
'.mysqli_error().'
'); + $DB_name = mysqli_fetch_assoc($get_name); ?>
@@ -394,20 +394,20 @@ function output_message($type, $text) } elseif($step == 5) { - @mysql_connect($_POST['char_db_host'].":".$_POST['char_db_port'], $_POST['char_db_username'], $_POST['char_db_password']) + $char_link = @mysqli_connect($_POST['char_db_host'], $_POST['char_db_username'], $_POST['char_db_password'], $_POST['char_db_name'], $_POST['char_db_port']) or die('
Couldn\'t connect to the character MySQL Database. Please Go Back and re-enter MySQL Database Information.
'); - @mysql_select_db($_POST['char_db_name']) or die('
Couldn\'t select Characters db, most likely the given name is wrong. Please Go Back and correct it.
'); + @mysqli_select_db($char_link, $_POST['char_db_name']) or die('
Couldn\'t select Characters db, most likely the given name is wrong. Please Go Back and correct it.
'); - @mysql_connect($_POST['w_db_host'].":".$_POST['w_db_port'], $_POST['w_db_username'], $_POST['w_db_password']) + $world_link = @mysqli_connect($_POST['w_db_host'], $_POST['w_db_username'], $_POST['w_db_password'], $_POST['w_db_name'], $_POST['w_db_port']) or die('
Couldn\'t connect to the world MySQL Database. Please Go Back and re-enter MySQL Database Information.
'); - @mysql_select_db($_POST['w_db_name']) or die('
Couldn\'t select World db, most likely the given name is wrong. Please Go Back and correct it.
'); + @mysqli_select_db($world_link, $_POST['w_db_name']) or die('
Couldn\'t select World db, most likely the given name is wrong. Please Go Back and correct it.
'); - @mysql_connect($_POST['db_host'].":".$_POST['db_port'], $_POST['db_username'], $_POST['db_password']); - @mysql_select_db($_POST['db_name']) or die('Unable to select Realm Database!'); + $realm_link = @mysqli_connect($_POST['db_host'], $_POST['db_username'], $_POST['db_password'], $_POST['db_name'], $_POST['db_port']); + @mysqli_select_db($realm_link, $_POST['db_name']) or die('Unable to select Realm Database!'); // Extra sql query with db settings $dbinfo = $_POST['char_db_host'].";".$_POST['char_db_port'].";".$_POST['char_db_username'].";".$_POST['char_db_password'].";".$_POST['char_db_name'].";".$_POST['w_db_host'].";".$_POST['w_db_port'].";".$_POST['w_db_username'].";".$_POST['w_db_password'].";".$_POST['w_db_name'].";"; - mysql_query("UPDATE `realmlist` SET `dbinfo` = '".$dbinfo."', `site_enabled`=1 WHERE `id` = 1 LIMIT 1") or die('
'.mysql_error().'
'); + mysqli_query($realm_link, "UPDATE `realmlist` SET `dbinfo` = '".$dbinfo."', `site_enabled`=1 WHERE `id` = 1 LIMIT 1") or die('
'.mysqli_error($realm_link).'
'); output_message('success', 'Successfully Connected to Character and World DB\'s'); ?> @@ -464,26 +464,26 @@ function sha_password($user, $pass) $pass = strtoupper($pass); return SHA1($user.':'.$pass); } - mysql_connect($_POST['db_host'].":".$_POST['db_port'], $_POST['db_username'], $_POST['db_password']); - mysql_select_db($_POST['db_name']); + $realm_link = mysqli_connect($_POST['db_host'], $_POST['db_username'], $_POST['db_password'], $_POST['db_name'], $_POST['db_port']); + mysqli_select_db($realm_link, $_POST['db_name']); - $accountid = mysql_query("SELECT `id` FROM `account` WHERE `username` LIKE '".$_POST['account']."'"); - $checkacc = mysql_num_rows($accountid); + $accountid = mysqli_query($realm_link, "SELECT `id` FROM `account` WHERE `username` LIKE '".$_POST['account']."'"); + $checkacc = mysqli_num_rows($accountid); if ($checkacc == 1) { // Account exsist - $accountid = mysql_fetch_assoc($accountid); - mysql_query("UPDATE `mw_account_extend` SET `account_level` = '4' WHERE `account_id` = ".$accountid['id']." LIMIT 1 ;"); + $accountid = mysqli_fetch_assoc($accountid); + mysqli_query($realm_link, "UPDATE `mw_account_extend` SET `account_level` = '4' WHERE `account_id` = ".$accountid['id']." LIMIT 1 ;"); $return = 1; } else { // No such account, creating one, in this case pwd is needed, so checking whether it's provided... $password = sha_password($_POST['account'], $_POST['pass']); - mysql_query("INSERT INTO `account` (`username`, `sha_pass_hash`) VALUES ('".$_POST['account']."', '".$password."' );"); - $accountid = mysql_query("SELECT `id` FROM `account` WHERE `username` LIKE '".$_POST['account']."'"); - $acct = mysql_fetch_assoc($accountid); - mysql_query("INSERT INTO `mw_account_extend` (`account_id`, `account_level`) VALUES ('".$acct['id']."', '4')"); + mysqli_query($realm_link, "INSERT INTO `account` (`username`, `sha_pass_hash`) VALUES ('".$_POST['account']."', '".$password."' );"); + $accountid = mysqli_query("SELECT `id` FROM `account` WHERE `username` LIKE '".$_POST['account']."'"); + $acct = mysqli_fetch_assoc($accountid); + mysqli_query($realm_link, "INSERT INTO `mw_account_extend` (`account_id`, `account_level`) VALUES ('".$acct['id']."', '4')"); $return = 2; } ?> diff --git a/install/sql/delete_v2_tables.sql b/install/sql/delete_v2_tables.sql deleted file mode 100644 index e9db69e..0000000 --- a/install/sql/delete_v2_tables.sql +++ /dev/null @@ -1,33 +0,0 @@ -SET FOREIGN_KEY_CHECKS=0; -DROP TABLE IF EXISTS `acc_creation_captcha`; -DROP TABLE IF EXISTS `account_extend`; -DROP TABLE IF EXISTS `account_groups`; -DROP TABLE IF EXISTS `account_keys`; -DROP TABLE IF EXISTS `donations_template`; -DROP TABLE IF EXISTS `f_attachs`; -DROP TABLE IF EXISTS `f_categories`; -DROP TABLE IF EXISTS `f_forums`; -DROP TABLE IF EXISTS `f_markread`; -DROP TABLE IF EXISTS `f_posts`; -DROP TABLE IF EXISTS `f_topics`; -DROP TABLE IF EXISTS `gallery`; -DROP TABLE IF EXISTS `gallery_ssotd`; -DROP TABLE IF EXISTS `online`; -DROP TABLE IF EXISTS `paypal_cart_info`; -DROP TABLE IF EXISTS `paypal_payment_info`; -DROP TABLE IF EXISTS `paypal_subscription_info`; -DROP TABLE IF EXISTS `pms`; -DROP TABLE IF EXISTS `site_faq`; -DROP TABLE IF EXISTS `site_regkeys`; -DROP TABLE IF EXISTS `voting`; -DROP TABLE IF EXISTS `voting_points`; -DROP TABLE IF EXISTS `voting_rewards`; -DROP TABLE IF EXISTS `voting_sites`; -DROP TABLE IF EXISTS `world_entrys`; - -ALTER TABLE `realmlist` -DROP COLUMN `dbinfo`, -DROP COLUMN `ra_address`, -DROP COLUMN `ra_port`, -DROP COLUMN `ra_user`, -DROP COLUMN `ra_pass`; \ No newline at end of file diff --git a/install/sql/full_install.sql b/install/sql/full_install.sql index a799ceb..5c16bed 100644 --- a/install/sql/full_install.sql +++ b/install/sql/full_install.sql @@ -5,8 +5,8 @@ SET FOREIGN_KEY_CHECKS=0; DROP TABLE IF EXISTS `mw_account_extend`; CREATE TABLE `mw_account_extend` ( `account_id` int(10) unsigned NOT NULL, - `account_level` smallint(3) NOT NULL DEFAULT '1', - `theme` smallint(3) NOT NULL DEFAULT '0', + `account_level` smallint(3) unsigned NOT NULL DEFAULT '1', + `theme` smallint(3) unsigned NOT NULL DEFAULT '0', `last_visit` int(25) DEFAULT NULL, `registration_ip` varchar(15) NOT NULL DEFAULT '0.0.0.0', `activation_code` varchar(255) DEFAULT NULL, @@ -34,7 +34,7 @@ CREATE TABLE `mw_account_extend` ( -- ---------------------------- DROP TABLE IF EXISTS `mw_account_groups`; CREATE TABLE `mw_account_groups` ( - `account_level` smallint(2) NOT NULL DEFAULT '1', + `account_level` smallint(2) unsigned NOT NULL DEFAULT '1', `title` text, PRIMARY KEY (`account_level`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; @@ -55,7 +55,7 @@ DROP TABLE IF EXISTS `mw_account_keys`; CREATE TABLE `mw_account_keys` ( `id` int(11) unsigned NOT NULL, `key` varchar(40) CHARACTER SET utf8 DEFAULT NULL, - `assign_time` int(11) DEFAULT NULL, + `assign_time` int(11) unsigned DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; @@ -80,7 +80,7 @@ DROP TABLE IF EXISTS `mw_db_version`; CREATE TABLE `mw_db_version` ( `dbver` varchar(20) NOT NULL DEFAULT '', `dbdate` int(10) unsigned NOT NULL DEFAULT '0', - `entry` int(5) NOT NULL DEFAULT '1', + `entry` int(5) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`entry`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; @@ -94,7 +94,7 @@ INSERT INTO `mw_db_version` VALUES ('1.0a', '1292781212', '1'); -- ---------------------------- DROP TABLE IF EXISTS `mw_donate_packages`; CREATE TABLE `mw_donate_packages` ( - `id` smallint(5) NOT NULL AUTO_INCREMENT, + `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `desc` varchar(255) DEFAULT NULL, `cost` varchar(11) NOT NULL DEFAULT '1.00', `points` int(11) NOT NULL DEFAULT '1', @@ -110,17 +110,17 @@ CREATE TABLE `mw_donate_packages` ( -- ---------------------------- DROP TABLE IF EXISTS `mw_donate_transactions`; CREATE TABLE `mw_donate_transactions` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `trans_id` varchar(255) DEFAULT NULL, - `account` int(8) DEFAULT NULL, - `item_number` int(11) DEFAULT NULL, + `account` int(8) unsigned DEFAULT NULL, + `item_number` int(11) unsigned DEFAULT NULL, `buyer_email` varchar(255) DEFAULT NULL, `payment_type` varchar(255) DEFAULT NULL, `payment_status` varchar(255) DEFAULT NULL, `pending_reason` varchar(255) DEFAULT NULL, `reason_code` varchar(255) DEFAULT NULL, `amount` varchar(10) DEFAULT NULL, - `item_given` tinyint(1) NOT NULL DEFAULT '0', + `item_given` tinyint(1) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; @@ -133,7 +133,7 @@ CREATE TABLE `mw_donate_transactions` ( -- ---------------------------- DROP TABLE IF EXISTS `mw_faq`; CREATE TABLE `mw_faq` ( - `id` smallint(3) NOT NULL AUTO_INCREMENT, + `id` smallint(3) unsigned NOT NULL AUTO_INCREMENT, `question` text NOT NULL, `answer` text NOT NULL, PRIMARY KEY (`id`) @@ -148,11 +148,11 @@ CREATE TABLE `mw_faq` ( -- ---------------------------- DROP TABLE IF EXISTS `mw_gallery`; CREATE TABLE `mw_gallery` ( - `id` int(3) NOT NULL AUTO_INCREMENT, + `id` int(3) unsigned NOT NULL AUTO_INCREMENT, `img` text NOT NULL, `comment` text NOT NULL, `autor` text NOT NULL, - `date` date NOT NULL, + `date` int(11) unsigned NOT NULL, `cat` varchar(255) NOT NULL, UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=cp1251 ROW_FORMAT=DYNAMIC; @@ -160,35 +160,21 @@ CREATE TABLE `mw_gallery` ( -- ---------------------------- -- Records of mw_gallery -- ---------------------------- -INSERT INTO `mw_gallery` VALUES ('1', 'Mangosweb_wall.jpg', 'Test Wallpaper', 'MangosWeb', '0000-00-00', 'wallpaper'); -INSERT INTO `mw_gallery` VALUES ('2', 'Mangosweb_scr.jpg', 'Test Screenshot', 'MangosWeb', '0000-00-00', 'screenshot'); - --- ---------------------------- --- Table structure for `mw_gallery_ssotd` --- ---------------------------- -DROP TABLE IF EXISTS `mw_gallery_ssotd`; -CREATE TABLE `mw_gallery_ssotd` ( - `image` varchar(50) NOT NULL, - `date` varchar(8) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of mw_gallery_ssotd --- ---------------------------- -INSERT INTO `mw_gallery_ssotd` VALUES ('Mangosweb_scr.jpg', '10.10.19'); +INSERT INTO `mw_gallery` VALUES ('1', 'Mangosweb_wall.jpg', 'Test Wallpaper', 'MangosWeb', '1485927282', 'wallpaper'); +INSERT INTO `mw_gallery` VALUES ('2', 'Mangosweb_scr.jpg', 'Test Screenshot', 'MangosWeb', '1485927282', 'screenshot'); -- ---------------------------- -- Table structure for `mw_menu_items` -- ---------------------------- DROP TABLE IF EXISTS `mw_menu_items`; CREATE TABLE `mw_menu_items` ( - `menu_id` int(3) NOT NULL DEFAULT '1', + `menu_id` int(3) unsigned NOT NULL DEFAULT '1', `link_title` varchar(100) DEFAULT NULL, `link` varchar(255) DEFAULT NULL, - `order` int(3) NOT NULL DEFAULT '1', + `order` int(3) unsigned NOT NULL DEFAULT '1', `account_level` int(3) NOT NULL DEFAULT '1', `guest_only` int(3) NOT NULL DEFAULT '0', - `id` int(3) NOT NULL AUTO_INCREMENT, + `id` int(3) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; @@ -215,18 +201,18 @@ INSERT INTO `mw_menu_items` VALUES ('4', 'Top Kills', '?p=server&sub=topkills', -- ---------------------------- DROP TABLE IF EXISTS `mw_news`; CREATE TABLE `mw_news` ( - `id` smallint(3) NOT NULL AUTO_INCREMENT, + `id` smallint(3) unsigned NOT NULL AUTO_INCREMENT, `title` text, `message` longtext, `posted_by` text, - `post_time` int(15) DEFAULT NULL, + `post_time` int(15) unsigned DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; -- ---------------------------- -- Records of mw_news -- ---------------------------- -INSERT INTO `mw_news` VALUES ('1', 'Welcome!', '

Thank you for installing MangosWeb v3!

Please login with your Admin account username and password to configure the CMS further.

', 'Wilson212', '1288727884'); +INSERT INTO `mw_news` VALUES ('1', 'Welcome!', '

Thank you for installing MangosWeb v3!

Please login with your Admin account username and password to configure the CMS further.

', 'Mistvale.com Dev', '1485753669'); -- ---------------------------- @@ -235,10 +221,10 @@ INSERT INTO `mw_news` VALUES ('1', 'Welcome!', '

Thank you for inst DROP TABLE IF EXISTS `mw_online`; CREATE TABLE `mw_online` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `user_id` int(10) NOT NULL DEFAULT '0', + `user_id` int(10) unsigned NOT NULL DEFAULT '0', `user_name` varchar(200) NOT NULL DEFAULT 'Guest', `user_ip` varchar(15) NOT NULL DEFAULT '0.0.0.0', - `logged` int(10) NOT NULL DEFAULT '0', + `logged` int(10) unsigned NOT NULL DEFAULT '0', `currenturl` varchar(255) NOT NULL DEFAULT './', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; @@ -272,7 +258,7 @@ CREATE TABLE `mw_pms` ( -- ---------------------------- DROP TABLE IF EXISTS `mw_regkeys`; CREATE TABLE `mw_regkeys` ( - `id` smallint(9) NOT NULL AUTO_INCREMENT, + `id` smallint(9) unsigned NOT NULL AUTO_INCREMENT, `key` varchar(255) NOT NULL DEFAULT '0', `used` smallint(3) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) @@ -287,7 +273,7 @@ CREATE TABLE `mw_regkeys` ( -- ---------------------------- DROP TABLE IF EXISTS `mw_secret_questions`; CREATE TABLE `mw_secret_questions` ( - `id` int(3) NOT NULL AUTO_INCREMENT, + `id` int(3) unsigned NOT NULL AUTO_INCREMENT, `question` varchar(60) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; @@ -306,14 +292,14 @@ INSERT INTO `mw_secret_questions` VALUES ('5', 'What is the name of your first p -- ---------------------------- DROP TABLE IF EXISTS `mw_shop_items`; CREATE TABLE `mw_shop_items` ( - `id` smallint(3) NOT NULL AUTO_INCREMENT, + `id` smallint(3) unsigned NOT NULL AUTO_INCREMENT, `item_number` varchar(255) NOT NULL DEFAULT '0', - `itemset` int(10) NOT NULL DEFAULT '0', + `itemset` int(10) unsigned NOT NULL DEFAULT '0', `gold` int(25) NOT NULL DEFAULT '0', - `quanity` int(25) NOT NULL DEFAULT '1', + `quanity` int(25) unsigned NOT NULL DEFAULT '1', `desc` varchar(255) DEFAULT NULL, `wp_cost` varchar(5) NOT NULL DEFAULT '0', - `realms` int(100) NOT NULL DEFAULT '1', + `realms` int(100) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; @@ -326,12 +312,12 @@ CREATE TABLE `mw_shop_items` ( -- ---------------------------- DROP TABLE IF EXISTS `mw_vote_sites`; CREATE TABLE `mw_vote_sites` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `hostname` varchar(255) NOT NULL, `votelink` varchar(255) NOT NULL, `image_url` varchar(255) DEFAULT NULL, `points` int(11) DEFAULT NULL, - `reset_time` int(16) NOT NULL DEFAULT '1', + `reset_time` int(16) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; @@ -344,7 +330,7 @@ CREATE TABLE `mw_vote_sites` ( -- ---------------------------- DROP TABLE IF EXISTS `mw_voting`; CREATE TABLE `mw_voting` ( - `id` int(10) NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `user_ip` varchar(30) NOT NULL, `site` int(10) unsigned NOT NULL DEFAULT '0', `time` int(10) unsigned NOT NULL DEFAULT '0', @@ -355,9 +341,6 @@ CREATE TABLE `mw_voting` ( -- Records of mw_voting -- ---------------------------- --- ---------------------------- --- Insert account data from "account" table --- ---------------------------- INSERT INTO `mw_account_extend` (`account_id`) SELECT account.id FROM account; -- ---------------------------- diff --git a/install/sql/updates/4.X_to_4.0.5.sql b/install/sql/updates/4.X_to_4.0.5.sql new file mode 100644 index 0000000..4582afe --- /dev/null +++ b/install/sql/updates/4.X_to_4.0.5.sql @@ -0,0 +1,8 @@ +-- Drop unused table mw_gallery_ssotd +DROP TABLE `mw_gallery_ssotd`; + +-- Modify `mw_gallery` to use a unix timestamp instead of date and preserve existing data +ALTER TABLE `mw_gallery` ADD COLUMN `date_2` INT(11) unsigned NOT NULL; +UPDATE `mw_gallery` SET `date_2` = UNIX_TIMESTAMP(`date`); +ALTER TABLE `mw_gallery` DROP COLUMN `date`; +ALTER TABLE `mw_gallery` CHANGE `date_2` `date` INT(11) unsigned NOT NULL; \ No newline at end of file diff --git a/install/sql/updates/update_1.0a.sql b/install/sql/updates/update_1.0a.sql deleted file mode 100644 index e94ad36..0000000 --- a/install/sql/updates/update_1.0a.sql +++ /dev/null @@ -1,41 +0,0 @@ -SET FOREIGN_KEY_CHECKS=0; -ALTER TABLE `mw_account_groups` DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; -ALTER TABLE `mw_account_extend` DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; -ALTER TABLE `mw_donate_packages` DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; -ALTER TABLE `mw_donate_transactions` DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; -ALTER TABLE `mw_faq` DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; -ALTER TABLE `mw_donate_packages` DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; -ALTER TABLE `mw_menu_items` DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; -ALTER TABLE `mw_news` DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; -ALTER TABLE `mw_online` DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; -ALTER TABLE `mw_shop_items` DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; - -DROP TABLE IF EXISTS `mw_voting`; -CREATE TABLE `mw_voting` ( - `id` int(10) NOT NULL AUTO_INCREMENT, - `user_ip` varchar(30) NOT NULL, - `site` int(10) unsigned NOT NULL DEFAULT '0', - `time` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `mw_vote_sites`; -CREATE TABLE `mw_vote_sites` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `hostname` varchar(255) NOT NULL, - `votelink` varchar(255) NOT NULL, - `image_url` varchar(255) DEFAULT NULL, - `points` int(11) DEFAULT NULL, - `reset_time` int(16) NOT NULL DEFAULT '1', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -DROP TABLE IF EXISTS `mw_db_version`; -CREATE TABLE `mw_db_version` ( - `dbver` varchar(20) NOT NULL DEFAULT '', - `dbdate` int(10) unsigned NOT NULL DEFAULT '0', - `entry` int(5) NOT NULL DEFAULT '1', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -INSERT INTO `mw_db_version` VALUES ('1.0a', '1292781212', '1'); \ No newline at end of file diff --git a/modules/ssotd/thumbnail.inc.php b/modules/ssotd/thumbnail.inc.php index e01be75..a94ef21 100644 --- a/modules/ssotd/thumbnail.inc.php +++ b/modules/ssotd/thumbnail.inc.php @@ -164,7 +164,6 @@ public function __construct($fileName) { if($this->error == true) { $this->showErrorImage(); - break; } } @@ -458,10 +457,10 @@ public function crop($startX,$startY,$width,$height) { * @param int $quality * @param string $name */ - public function show($quality=100,$name = '') { + public function show($quality=100,$name = null) { switch($this->format) { case 'GIF': - if($name != '') { + if($name != null) { ImageGif($this->newImage,$name); } else { @@ -470,16 +469,16 @@ public function show($quality=100,$name = '') { } break; case 'JPG': - if($name != '') { - ImageJpeg($this->newImage,$name,$quality); + if($name != null) { + ImageIpeg($this->newImage,$name,$quality); } else { header('Content-type: image/jpeg'); - ImageJpeg($this->newImage,'',$quality); + ImageJpeg($this->newImage,null,$quality); } break; case 'PNG': - if($name != '') { + if($name != null) { ImagePng($this->newImage,$name); } else { diff --git a/templates/blizzlike/body_right.php b/templates/blizzlike/body_right.php index 9fb80bc..ad28a3f 100644 --- a/templates/blizzlike/body_right.php +++ b/templates/blizzlike/body_right.php @@ -66,13 +66,6 @@ get('module_fp_ssotd') == 1) { - $date_ssotd = $DB->selectCell("SELECT `date` FROM `mw_gallery_ssotd` LIMIT 1"); - $today_ssotd = date("y.m.d"); - if ($date_ssotd != $today_ssotd) - { - $rand_ssotd = $DB->selectCell("SELECT `img` FROM `mw_gallery` WHERE cat ='screenshot' ORDER BY RAND() LIMIT 1"); - $DB->query("UPDATE mw_gallery_ssotd SET image = '$rand_ssotd', date = '$today_ssotd'"); - } $screen_otd = $DB->selectCell("SELECT `img` FROM `mw_gallery` WHERE cat ='screenshot' ORDER BY RAND() LIMIT 1"); ?>

diff --git a/templates/blizzlike/server/server.info.php b/templates/blizzlike/server/server.info.php deleted file mode 100644 index 61645f6..0000000 --- a/templates/blizzlike/server/server.info.php +++ /dev/null @@ -1,38 +0,0 @@ -
- - - - -$value): ?> - - - -$value): ?> - - - -$value): ?> - - - -$value): ?> - - -
Server Info
Horde and Alliance Interaction
Server Rates
Skill Chance Values
'
- \ No newline at end of file diff --git a/templates/blizzlike/server/server.statistic.php b/templates/blizzlike/server/server.statistic.php index 13f2c4b..d083bfa 100644 --- a/templates/blizzlike/server/server.statistic.php +++ b/templates/blizzlike/server/server.statistic.php @@ -1,54 +1,59 @@
- +
- - 0 Characters - +
- - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + @@ -56,8 +61,8 @@
AllianceHordeAllianceHorde
- : (%) + Alliance: (%) - : (%) + Horde: (%)
(%) (%) (%) (%)
(%) (%) (%) (%)
(%) (%) (%) (%)
(%) (%) (%) (%)
(%) (%) (%) (%)
- -_______________________________________________________________________________________ - +
\ No newline at end of file