* cache $db->hasTable and $db->hasColumn functions

* changed tableExist and fieldExist to $db->hasTable(table) +
$db->hasColumn(table, column)
* new configurable: database_log - can log database queries and show in
website source when logged as super admin
* removed debug_level configurable, enabled by default when logged on
super admin
* added OTS_Account:getCountry()
* added posibility to load OTS_Player partially, and without skills
* (internal) changed depracated $ots->createObject() functions with
their OTS_ equivalents
* (internal) removed unused code
This commit is contained in:
slawkens1
2018-01-06 05:44:33 +01:00
parent 31537687c1
commit 1025fad0e6
65 changed files with 446 additions and 417 deletions

View File

@@ -1,7 +1,7 @@
<?php
// add new item_id field for runes
if(!fieldExist('item_id', TABLE_PREFIX . 'spells'))
if(!$db->hasColumn(TABLE_PREFIX . 'spells', 'item_id'))
$db->query("ALTER TABLE `" . TABLE_PREFIX . "spells` ADD `item_id` INT(11) NOT NULL DEFAULT 0 AFTER `conjure_count`;");
// change unique index from spell to name
@@ -12,7 +12,7 @@ $db->query("ALTER TABLE `" . TABLE_PREFIX . "spells` ADD UNIQUE INDEX (`name`);"
$db->query("ALTER TABLE `" . TABLE_PREFIX . "spells` MODIFY `type` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '1 - instant, 2 - conjure, 3 - rune';");
// new items table
if(!tableExist(TABLE_PREFIX . 'items'))
if(!$db->hasTable(TABLE_PREFIX . 'items'))
$db->query("
CREATE TABLE `" . TABLE_PREFIX . "items`
(
@@ -25,7 +25,7 @@ CREATE TABLE `" . TABLE_PREFIX . "items`
) ENGINE = MyISAM;");
// new weapons table
if(!tableExist(TABLE_PREFIX . 'weapons'))
if(!$db->hasTable(TABLE_PREFIX . 'weapons'))
$db->query("
CREATE TABLE `" . TABLE_PREFIX . "weapons`
(