Ir para conteúdo
  • Cadastre-se

Tabela no accounts.php que não tem na database


Posts Recomendados

Oi :/

Sabe estou com uma dúvida, que não consigo arrumar, já tentei de tudo mais não consigo =// é alguma tabela que tem no accounts.php que não possui na database ;x, quando eu crio a database no phpmyadmin, eu vou no localhost para configurar algumas coisinhas né, ai eu vou indo e aparece isso.

 

XRx3Fb.jpg

 

Add samples to DB:
Added sample character: Rook Sample
Added sample character: Sorcerer Sample
Added sample character: Druid Sample
Added sample character: Paladin Sample
Added sample character: Knight Sample

 

zbuLbt.jpg

 

Como arruma ? ://

 

mysql.sql -

DROP TRIGGER IF EXISTS `oncreate_players`;

DROP TRIGGER IF EXISTS `oncreate_guilds`;
DROP TRIGGER IF EXISTS `ondelete_players`;
DROP TRIGGER IF EXISTS `ondelete_guilds`;
DROP TRIGGER IF EXISTS `ondelete_accounts`;

DROP TABLE IF EXISTS `player_depotitems`;
DROP TABLE IF EXISTS `tile_items`;
DROP TABLE IF EXISTS `tile_store`;
DROP TABLE IF EXISTS `tiles`;
DROP TABLE IF EXISTS `bans`;
DROP TABLE IF EXISTS `house_lists`;
DROP TABLE IF EXISTS `houses`;
DROP TABLE IF EXISTS `player_items`;
DROP TABLE IF EXISTS `player_namelocks`;
DROP TABLE IF EXISTS `player_statements`;
DROP TABLE IF EXISTS `player_skills`;
DROP TABLE IF EXISTS `player_storage`;
DROP TABLE IF EXISTS `player_viplist`;
DROP TABLE IF EXISTS `player_spells`;
DROP TABLE IF EXISTS `player_deaths`;
DROP TABLE IF EXISTS `killers`;
DROP TABLE IF EXISTS `environment_killers`;
DROP TABLE IF EXISTS `player_killers`;
DROP TABLE IF EXISTS `guild_ranks`;
DROP TABLE IF EXISTS `guilds`;
DROP TABLE IF EXISTS `guild_invites`;
DROP TABLE IF EXISTS `global_storage`;
DROP TABLE IF EXISTS `players`;
DROP TABLE IF EXISTS `accounts`;
DROP TABLE IF EXISTS `server_record`;
DROP TABLE IF EXISTS `server_motd`;
DROP TABLE IF EXISTS `server_reports`;
DROP TABLE IF EXISTS `server_config`;
DROP TABLE IF EXISTS `account_viplist`;

CREATE TABLE `accounts`
(
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(32) NOT NULL DEFAULT '',
`password` VARCHAR(255) NOT NULL/* VARCHAR(32) NOT NULL COMMENT 'MD5'*//* VARCHAR(40) NOT NULL COMMENT 'SHA1'*/,
`salt` VARCHAR(40) NOT NULL DEFAULT '',
`premdays` INT NOT NULL DEFAULT 0,
`lastday` INT UNSIGNED NOT NULL DEFAULT 0,
`email` VARCHAR(255) NOT NULL DEFAULT '',
`key` VARCHAR(32) NOT NULL DEFAULT '0',
`blocked` TINYINT(1) NOT NULL DEFAULT FALSE COMMENT 'internal usage',
`warnings` INT NOT NULL DEFAULT 0,
`group_id` INT NOT NULL DEFAULT 1,
PRIMARY KEY (`id`), UNIQUE (`name`)
) ENGINE = InnoDB;

INSERT INTO `accounts` VALUES (1, '1', '1', '', 65535, 0, '', '0', 0, 0, 1);

CREATE TABLE `players`
(
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
`group_id` INT NOT NULL DEFAULT 1,
`account_id` INT NOT NULL DEFAULT 0,
`level` INT NOT NULL DEFAULT 1,
`vocation` INT NOT NULL DEFAULT 0,
`health` INT NOT NULL DEFAULT 150,
`healthmax` INT NOT NULL DEFAULT 150,
`experience` BIGINT UNSIGNED NOT NULL DEFAULT 0,
`lookbody` INT NOT NULL DEFAULT 0,
`lookfeet` INT NOT NULL DEFAULT 0,
`lookhead` INT NOT NULL DEFAULT 0,
`looklegs` INT NOT NULL DEFAULT 0,
`looktype` INT NOT NULL DEFAULT 136,
`lookaddons` INT NOT NULL DEFAULT 0,
`lookmount` INT NOT NULL DEFAULT 0,
`maglevel` INT NOT NULL DEFAULT 0,
`mana` INT NOT NULL DEFAULT 0,
`manamax` INT NOT NULL DEFAULT 0,
`manaspent` BIGINT UNSIGNED NOT NULL DEFAULT 0,
`soul` INT UNSIGNED NOT NULL DEFAULT 0,
`town_id` INT NOT NULL DEFAULT 0,
`posx` INT NOT NULL DEFAULT 0,
`posy` INT NOT NULL DEFAULT 0,
`posz` INT NOT NULL DEFAULT 0,
`conditions` BLOB NOT NULL,
`cap` INT NOT NULL DEFAULT 0,
`sex` INT NOT NULL DEFAULT 0,
`lastlogin` BIGINT UNSIGNED NOT NULL DEFAULT 0,
`lastip` INT UNSIGNED NOT NULL DEFAULT 0,
`save` TINYINT(1) NOT NULL DEFAULT 1,
`skull` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
`skulltime` INT NOT NULL DEFAULT 0,
`rank_id` INT NOT NULL DEFAULT 0,
`guildnick` VARCHAR(255) NOT NULL DEFAULT '',
`lastlogout` BIGINT UNSIGNED NOT NULL DEFAULT 0,
`blessings` TINYINT(2) NOT NULL DEFAULT 0,
`pvp_blessing` TINYINT(1) NOT NULL DEFAULT 0,
`balance` BIGINT UNSIGNED NOT NULL DEFAULT 0,
`stamina` BIGINT UNSIGNED NOT NULL DEFAULT 151200000 COMMENT 'stored in miliseconds',
`direction` INT NOT NULL DEFAULT 2,
`loss_experience` INT NOT NULL DEFAULT 100,
`loss_mana` INT NOT NULL DEFAULT 100,
`loss_skills` INT NOT NULL DEFAULT 100,
`loss_containers` INT NOT NULL DEFAULT 100,
`loss_items` INT NOT NULL DEFAULT 100,
`premend` INT NOT NULL DEFAULT 0 COMMENT 'NOT IN USE BY THE SERVER',
`online` TINYINT(1) NOT NULL DEFAULT 0,
`marriage` INT UNSIGNED NOT NULL DEFAULT 0,
`promotion` INT NOT NULL DEFAULT 0,
`deleted` INT NOT NULL DEFAULT 0,
`description` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`), UNIQUE (`name`, `deleted`),
KEY (`account_id`), KEY (`group_id`),
KEY (`online`), KEY (`deleted`),
FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

INSERT INTO `players` VALUES (1, 'Account Manager', 0, 1, 1, 1, 0, 150,  150, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 853, 921, 7, '', 400, 0,  0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0,  0, 0, 0, 0, '');

CREATE TABLE `account_viplist`
(
`account_id` INT NOT NULL,
`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
`player_id` INT NOT NULL,
KEY (`account_id`), KEY (`player_id`), KEY (`world_id`), UNIQUE (`account_id`, `player_id`),
FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE CASCADE,
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `player_deaths`
(
`id` INT NOT NULL AUTO_INCREMENT,
`player_id` INT NOT NULL,
`date` BIGINT UNSIGNED NOT NULL,
`level` INT UNSIGNED NOT NULL,
PRIMARY KEY (`id`), INDEX (`date`),
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `player_depotitems`
(
`player_id` INT NOT NULL,
`sid` INT NOT NULL COMMENT 'any given range, eg. 0-100 is reserved for depot lockers and all above 100 will be normal items inside depots',
`pid` INT NOT NULL DEFAULT 0,
`itemtype` INT NOT NULL,
`count` INT NOT NULL DEFAULT 0,
`attributes` BLOB NOT NULL,
KEY (`player_id`), UNIQUE (`player_id`, `sid`),
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `player_items`
(
`player_id` INT NOT NULL,
`pid` INT NOT NULL DEFAULT 0,
`sid` INT NOT NULL DEFAULT 0,
`itemtype` INT NOT NULL DEFAULT 0,
`count` INT NOT NULL DEFAULT 0,
`attributes` BLOB NOT NULL,
KEY (`player_id`), UNIQUE (`player_id`, `sid`),
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `player_namelocks`
(
`player_id` INT NOT NULL,
`name` VARCHAR(255) NOT NULL,
`new_name` VARCHAR(255) NOT NULL,
`date` BIGINT NOT NULL DEFAULT 0,
KEY (`player_id`),
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `player_statements`
(
`id` INT NOT NULL AUTO_INCREMENT,
`player_id` INT NOT NULL,
`channel_id` INT NOT NULL DEFAULT 0,
`text` VARCHAR (255) NOT NULL,
`date` BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`), KEY (`player_id`), KEY (`channel_id`),
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `player_skills`
(
`player_id` INT NOT NULL,
`skillid` TINYINT(2) NOT NULL DEFAULT 0,
`value` INT UNSIGNED NOT NULL DEFAULT 0,
`count` INT UNSIGNED NOT NULL DEFAULT 0,
KEY (`player_id`), UNIQUE (`player_id`, `skillid`),
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `player_spells`
(
`player_id` INT NOT NULL,
`name` VARCHAR(255) NOT NULL,
KEY (`player_id`), UNIQUE (`player_id`, `name`),
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `player_storage`
(
`player_id` INT NOT NULL,
`key` VARCHAR(32) NOT NULL DEFAULT '0',
`value` TEXT NOT NULL,
KEY (`player_id`), UNIQUE (`player_id`, `key`),
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `player_viplist`
(
`player_id` INT NOT NULL,
`vip_id` INT NOT NULL,
KEY (`player_id`), KEY (`vip_id`), UNIQUE (`player_id`, `vip_id`),
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE,
FOREIGN KEY (`vip_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `killers`
(
`id` INT NOT NULL AUTO_INCREMENT,
`death_id` INT NOT NULL,
`final_hit` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE,
`unjustified` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE,
`war` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
FOREIGN KEY (`death_id`) REFERENCES `player_deaths`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `player_killers`
(
`kill_id` INT NOT NULL,
`player_id` INT NOT NULL,
FOREIGN KEY (`kill_id`) REFERENCES `killers`(`id`) ON DELETE CASCADE,
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `environment_killers`
(
`kill_id` INT NOT NULL,
`name` VARCHAR(255) NOT NULL,
FOREIGN KEY (`kill_id`) REFERENCES `killers`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `houses`
(
`id` INT UNSIGNED NOT NULL,
`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
`owner` INT NOT NULL,
`paid` INT UNSIGNED NOT NULL DEFAULT 0,
`warnings` INT NOT NULL DEFAULT 0,
`lastwarning` INT UNSIGNED NOT NULL DEFAULT 0,
`name` VARCHAR(255) NOT NULL,
`town` INT UNSIGNED NOT NULL DEFAULT 0,
`size` INT UNSIGNED NOT NULL DEFAULT 0,
`price` INT UNSIGNED NOT NULL DEFAULT 0,
`rent` INT UNSIGNED NOT NULL DEFAULT 0,
`doors` INT UNSIGNED NOT NULL DEFAULT 0,
`beds` INT UNSIGNED NOT NULL DEFAULT 0,
`tiles` INT UNSIGNED NOT NULL DEFAULT 0,
`guild` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE,
`clear` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE,
UNIQUE (`id`, `world_id`)
) ENGINE = InnoDB;

CREATE TABLE `tile_store`
(
`house_id` INT UNSIGNED NOT NULL,
`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
`data` LONGBLOB NOT NULL,
FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `house_auctions`
(
`house_id` INT UNSIGNED NOT NULL,
`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
`player_id` INT NOT NULL,
`bid` INT UNSIGNED NOT NULL DEFAULT 0,
`limit` INT UNSIGNED NOT NULL DEFAULT 0,
`endtime` BIGINT UNSIGNED NOT NULL DEFAULT 0,
UNIQUE (`house_id`, `world_id`),
FOREIGN KEY (`house_id`, `world_id`) REFERENCES `houses`(`id`, `world_id`) ON DELETE CASCADE,
FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `house_lists`
(
`house_id` INT UNSIGNED NOT NULL,
`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
`listid` INT NOT NULL,
`list` TEXT NOT NULL,
UNIQUE (`house_id`, `world_id`, `listid`),
FOREIGN KEY (`house_id`, `world_id`) REFERENCES `houses`(`id`, `world_id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `house_data`
(
`house_id` INT UNSIGNED NOT NULL,
`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
`data` LONGBLOB NOT NULL,
UNIQUE (`house_id`, `world_id`),
FOREIGN KEY (`house_id`, `world_id`) REFERENCES `houses`(`id`, `world_id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `tiles`
(
`id` INT UNSIGNED NOT NULL,
`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
`house_id` INT UNSIGNED NOT NULL,
`x` INT(5) UNSIGNED NOT NULL,
`y` INT(5) UNSIGNED NOT NULL,
`z` TINYINT(2) UNSIGNED NOT NULL,
UNIQUE (`id`, `world_id`),
KEY (`x`, `y`, `z`),
FOREIGN KEY (`house_id`, `world_id`) REFERENCES `houses`(`id`, `world_id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `tile_items`
(
`tile_id` INT UNSIGNED NOT NULL,
`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
`sid` INT NOT NULL,
`pid` INT NOT NULL DEFAULT 0,
`itemtype` INT NOT NULL,
`count` INT NOT NULL DEFAULT 0,
`attributes` BLOB NOT NULL,
UNIQUE (`tile_id`, `world_id`, `sid`), KEY (`sid`),
FOREIGN KEY (`tile_id`) REFERENCES `tiles`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `guilds`
(
`id` INT NOT NULL AUTO_INCREMENT,
`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
`name` VARCHAR(255) NOT NULL,
`ownerid` INT NOT NULL,
`creationdata` INT NOT NULL,
`checkdata` INT NOT NULL,
`motd` VARCHAR(255) NOT NULL,
`balance` BIGINT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE (`name`, `world_id`)
) ENGINE = InnoDB;

CREATE TABLE `guild_invites`
(
`player_id` INT NOT NULL DEFAULT 0,
`guild_id` INT NOT NULL DEFAULT 0,
UNIQUE (`player_id`, `guild_id`),
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE,
FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `guild_ranks`
(
`id` INT NOT NULL AUTO_INCREMENT,
`guild_id` INT NOT NULL,
`name` VARCHAR(255) NOT NULL,
`level` INT NOT NULL COMMENT '1 - leader, 2 - vice leader, 3 - member',
PRIMARY KEY (`id`),
FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `guild_wars`
(
`id` INT NOT NULL AUTO_INCREMENT,
`guild_id` INT NOT NULL,
`enemy_id` INT NOT NULL,
`begin` BIGINT NOT NULL DEFAULT 0,
`end` BIGINT NOT NULL DEFAULT 0,
`frags` INT UNSIGNED NOT NULL DEFAULT 0,
`payment` BIGINT UNSIGNED NOT NULL DEFAULT 0,
`guild_kills` INT UNSIGNED NOT NULL DEFAULT 0,
`enemy_kills` INT UNSIGNED NOT NULL DEFAULT 0,
`status` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`), KEY `status` (`status`),
KEY `guild_id` (`guild_id`), KEY `enemy_id` (`enemy_id`),
FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE,
FOREIGN KEY (`enemy_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB;

CREATE TABLE `guild_kills`
(
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`guild_id` INT NOT NULL,
`war_id` INT NOT NULL,
`death_id` INT NOT NULL,
FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE,
FOREIGN KEY (`war_id`) REFERENCES `guild_wars`(`id`) ON DELETE CASCADE,
FOREIGN KEY (`death_id`) REFERENCES `player_deaths`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

CREATE TABLE `bans`
(
`id` INT UNSIGNED NOT NULL auto_increment,
`type` TINYINT(1) NOT NULL COMMENT '1 - ip, 2 - player, 3 - account, 4 - notation',
`value` INT UNSIGNED NOT NULL COMMENT 'ip - ip address, player - player_id, account - account_id, notation - account_id',
`param` INT UNSIGNED NOT NULL COMMENT 'ip - mask, player - type (1 - report, 2 - lock, 3 - ban), account - player, notation - player',
`active` TINYINT(1) NOT NULL DEFAULT TRUE,
`expires` INT NOT NULL DEFAULT -1,
`added` INT UNSIGNED NOT NULL,
`admin_id` INT UNSIGNED NOT NULL DEFAULT 0,
`comment` TEXT NOT NULL,
PRIMARY KEY (`id`),
KEY `type` (`type`, `value`),
KEY `active` (`active`)
) ENGINE = InnoDB;

CREATE TABLE `global_storage`
(
`key` VARCHAR(32) NOT NULL,
`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
`value` TEXT NOT NULL,
UNIQUE  (`key`, `world_id`)
) ENGINE = InnoDB;

CREATE TABLE `server_config`
(
`config` VARCHAR(35) NOT NULL DEFAULT '',
`value` VARCHAR(255) NOT NULL DEFAULT '',
UNIQUE (`config`)
) ENGINE = InnoDB;

INSERT INTO `server_config` VALUES ('db_version', 31);

CREATE TABLE `server_motd`
(
`id` INT UNSIGNED NOT NULL,
`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
`text` TEXT NOT NULL,
UNIQUE (`id`, `world_id`)
) ENGINE = InnoDB;

INSERT INTO `server_motd` VALUES (1, 0, 'Welcome to The Forgotten Server!');

CREATE TABLE `server_record`
(
`record` INT NOT NULL,
`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
`timestamp` BIGINT NOT NULL,
UNIQUE (`record`, `world_id`, `timestamp`)
) ENGINE = InnoDB;

INSERT INTO `server_record` VALUES (0, 0, 0);

CREATE TABLE `server_reports`
(
`id` INT NOT NULL AUTO_INCREMENT,
`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
`player_id` INT NOT NULL DEFAULT 1,
`posx` INT NOT NULL DEFAULT 0,
`posy` INT NOT NULL DEFAULT 0,
`posz` INT NOT NULL DEFAULT 0,
`timestamp` BIGINT NOT NULL DEFAULT 0,
`report` TEXT NOT NULL,
`reads` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY (`world_id`), KEY (`reads`),
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

DELIMITER |

CREATE TRIGGER `ondelete_accounts`
BEFORE DELETE
ON `accounts`
FOR EACH ROW
BEGIN
DELETE FROM `bans` WHERE `type` IN (3, 4) AND `value` = OLD.`id`;
END|

CREATE TRIGGER `oncreate_guilds`
AFTER INSERT
ON `guilds`
FOR EACH ROW
BEGIN
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Leader', 3, NEW.`id`);
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Vice-Leader', 2, NEW.`id`);
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Member', 1, NEW.`id`);
END|

CREATE TRIGGER `ondelete_guilds`
BEFORE DELETE
ON `guilds`
FOR EACH ROW
BEGIN
UPDATE `players` SET `guildnick` = '', `rank_id` = 0 WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = OLD.`id`);
END|

CREATE TRIGGER `oncreate_players`
AFTER INSERT
ON `players`
FOR EACH ROW
BEGIN
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 0, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 1, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 2, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 3, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 4, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 5, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 6, 10);
END|

CREATE TRIGGER `ondelete_players`
BEFORE DELETE
ON `players`
FOR EACH ROW
BEGIN
DELETE FROM `bans` WHERE `type` IN (2, 5) AND `value` = OLD.`id`;
UPDATE `houses` SET `owner` = 0 WHERE `owner` = OLD.`id`;
END|

DELIMITER ;

 

accounts.php -

<?php if(!defined('INITIALIZED')) exit;

class Account extends ObjectData
{
const LOADTYPE_ID = 'id';
const LOADTYPE_NAME = 'name';
const LOADTYPE_MAIL = 'email';
public static $table = 'accounts';
public $data = array('name' => null, 'password' => null, 'salt' => null, 'premdays' => null, 'lastday' => null, 'email' => null, 'key' => null, 'group_id' => null, 'create_ip' => null, 'create_date' => null, 'vip_time'  => null, 'page_access' => null, 'location' => null, 'rlname' => null, 'email_new' => null, 'email_new_time' => null, 'email_code' => null, 'next_email' => null, 'last_post' => null, 'guild_points' => null, 'vote' => null);
public static $fields = array('id', 'name', 'password', 'salt', 'premdays', 'lastday', 'email', 'key', 'group_id', 'create_ip', 'create_date', 'premium_points', 'page_access', 'location', 'rlname', 'email_new', 'email_new_time', 'email_code', 'next_email', 'last_post', 'vip_time', 'vote');
public $players;
public $playerRanks;
public $guildAccess;
public $bans;

    public function __construct($search_text = null, $search_by = self::LOADTYPE_ID)
    {
  if($search_text != null)
   $this->load($search_text, $search_by);
    }

public function load($search_text, $search_by = self::LOADTYPE_ID)
{
  if(in_array($search_by, self::$fields))
   $search_string = $this->getDatabaseHandler()->fieldName($search_by) . ' = ' . $this->getDatabaseHandler()->quote($search_text);
  else
   new Error_Critic('', 'Wrong Account search_by type.');
  $fieldsArray = array();
  foreach(self::$fields as $fieldName)
   $fieldsArray[$fieldName] = $this->getDatabaseHandler()->fieldName($fieldName);
  $this->data = $this->getDatabaseHandler()->query('SELECT ' . implode(', ', $fieldsArray) . ' FROM ' . $this->getDatabaseHandler()->tableName(self::$table) . ' WHERE ' . $search_string)->fetch();
}

public function loadById($id)
{
  $this->load($id, 'id');
}

public function loadByName($name)
{
  $this->load($name, 'name');
}

public function loadByEmail($mail)
{
  $this->load($mail, 'email');
}

public function save($forceInsert = false)
{
  if(!isset($this->data['id']) || $forceInsert)
  {
   $keys = array();
   $values = array();
   foreach(self::$fields as $key)
    if($key != 'id')
    {
     $keys[] = $this->getDatabaseHandler()->fieldName($key);
     $values[] = $this->getDatabaseHandler()->quote($this->data[$key]);
    }
   $this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName(self::$table) . ' (' . implode(', ', $keys) . ') VALUES (' . implode(', ', $values) . ')');
   $this->setID($this->getDatabaseHandler()->lastInsertId());
  }
  else
  {
   $updates = array();
   foreach(self::$fields as $key)
    if($key != 'id')
     $updates[] = $this->getDatabaseHandler()->fieldName($key) . ' = ' . $this->getDatabaseHandler()->quote($this->data[$key]);
   $this->getDatabaseHandler()->query('UPDATE ' . $this->getDatabaseHandler()->tableName(self::$table) . ' SET ' . implode(', ', $updates) . ' WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));
  }
}

public function getPlayers($forceReload = false)
{
  if(!isset($this->players) || $forceReload)
  {
   $this->players = new DatabaseList('Player');
   $this->players->setFilter(new SQL_Filter(new SQL_Field('account_id'), SQL_Filter::EQUAL, $this->getID()));
   $this->players->addOrder(new SQL_Order(new SQL_Field('name')));
  }
  return $this->players;
}

public function getGuildRanks($forceReload = false)
{
  if(!isset($this->playerRanks) || $forceReload)
  {
   $this->playerRanks = new DatabaseList('AccountGuildRank');
   $filterAccount = new SQL_Filter(new SQL_Field('account_id', 'players'), SQL_Filter::EQUAL, $this->getID());
   $filterPlayer = new SQL_Filter(new SQL_Field('rank_id', 'players'), SQL_Filter::EQUAL, new SQL_Field('id', 'guild_ranks'));
   $filterGuild = new SQL_Filter(new SQL_Field('guild_id', 'guild_ranks'), SQL_Filter::EQUAL, new SQL_Field('id', 'guilds'));
   $filter = new SQL_Filter($filterAccount, SQL_Filter::CRITERIUM_AND, $filterPlayer);
   $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterGuild);
   $this->playerRanks->setFilter($filter);
  }
  return $this->playerRanks;
}

public function loadGuildAccess($forceReload = false)
{
  if(!isset($this->guildAccess) || $forceReload)
  {
   $this->guildAccess = array();
   foreach($this->getGuildRanks($forceReload) as $rank)
    if($rank->getOwnerID() == $rank->getPlayerID())
     $this->guildAccess[$rank->getGuildID()] = Guild::LEVEL_OWNER;
    elseif(!isset($this->guildAccess[$rank->getGuildID()]) || $rank->getLevel() > $this->guildAccess[$rank->getGuildID()])
     $this->guildAccess[$rank->getGuildID()] = $rank->getLevel();
  }
}

public function isInGuild($guildId, $forceReload = false)
{
  $this->loadGuildAccess($forceReload);
  return isset($this->guildAccess[$guildId]);
}

public function getGuildLevel($guildId, $forceReload = false)
{
  $this->loadGuildAccess($forceReload);
  if(isset($this->guildAccess[$guildId]))
   return $this->guildAccess[$guildId];
  else
   return 0;
}

public function unban()
{
  $bans = new DatabaseList('Ban');
  $filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_ACCOUNT);
  $filterValue = new SQL_Filter(new SQL_Field('value'), SQL_Filter::EQUAL, $this->data['id']);
  $filterActive = new SQL_Filter(new SQL_Field('active'), SQL_Filter::EQUAL, 1);
  $filter = new SQL_Filter($filterType, SQL_Filter::CRITERIUM_AND, $filterValue);
  $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterActive);
  $bans->setFilter($filter);
  foreach($bans as $ban)
  {
   $ban->setActive(0);
   $ban->save();
  }
}

public function loadBans($forceReload = false)
{
  if(!isset($this->bans) || $forceReload)
  {
   $this->bans = new DatabaseList('Ban');
   $filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_ACCOUNT);
   $filterValue = new SQL_Filter(new SQL_Field('value'), SQL_Filter::EQUAL, $this->data['id']);
   $filterActive = new SQL_Filter(new SQL_Field('active'), SQL_Filter::EQUAL, 1);
   $filter = new SQL_Filter($filterType, SQL_Filter::CRITERIUM_AND, $filterValue);
   $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterActive);
   $this->bans->setFilter($filter);
  }
}

public function isBanned($forceReload = false)
{
  $this->loadBans($forceReload);
  $isBanned = false;
  foreach($this->bans as $ban)
  {
   if($ban->getExpires() <= 0 || $ban->getExpires() > time())
    $isBanned = true;
  }
  return $isBanned;
}

public function getBanTime($forceReload = false)
{
  $this->loadBans($forceReload);
  $lastExpires = 0;
  foreach($bans as $ban)
  {
   if($ban->getExpires() <= 0)
   {
    $lastExpires = 0;
    break;
   }
   if($ban->getExpires() > time() && $ban->getExpires() > $lastExpires)
    $lastExpires = $ban->getExpires();
  }
  return $lastExpires;
}

    public function delete()
    {
        $this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName(self::$table) . ' WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));

        unset($this->data['id']);
    }

public function setID($value){$this->data['id'] = $value;}
public function getID(){return $this->data['id'];}
public function setName($value){$this->data['name'] = $value;}
public function getName(){return $this->data['name'];}
public function setPassword($value)
{
  $this->data['salt'] = md5(microtime(true));
  $this->data['password'] = Website::encryptPassword($value, $this);
}
public function getPassword(){return $this->data['password'];}
public function setSalt($value){$this->data['salt'] = $value;}
public function getSalt(){return $this->data['salt'];}
public function setPremDays($value){$this->data['premdays'] = $value;}
public function getPremDays(){return $this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday']));}
public function setVipDays($value){$this->data['vip_time'] = $value;}
public function getVipDays(){return $this->data['vip_time'];}
public function setLastDay($value){$this->data['lastday'] = $value;}
public function getLastDay(){return $this->data['lastday'];}
public function setMail($value){$this->data['email'] = $value;}
public function getMail(){return $this->data['email'];}
public function setKey($value){$this->data['key'] = $value;}
public function getKey(){return $this->data['key'];}
public function setGroupID($value){$this->data['group_id'] = $value;}
public function getGroupID(){return $this->data['group_id'];}
/*
* Custom AAC fields
* create_ip , INT, default 0
* create_date , INT, default 0
* premium_points , INT, default 0
* page_access, INT, default 0
* location, VARCHAR(255), default ''
* rlname, VARCHAR(255), default ''
*/
public function setCreateIP($value){$this->data['create_ip'] = $value;}
public function getCreateIP(){return $this->data['create_ip'];}
public function setCreateDate($value){$this->data['create_date'] = $value;}
public function getCreateDate(){return $this->data['create_date'];}
public function setPremiumPoints($value){$this->data['premium_points'] = $value;}
public function getPremiumPoints(){return $this->data['premium_points'];}
public function setPageAccess($value){$this->data['page_access'] = $value;}
public function getPageAccess(){return $this->data['page_access'];}
public function setLocation($value){$this->data['location'] = $value;}
public function getLocation(){return $this->data['location'];}
public function setRLName($value){$this->data['rlname'] = $value;}
public function getRLName(){return $this->data['rlname'];}
/*
* for compability with old scripts
*/
public function getGroup(){return $this->getGroupID();}
public function setGroup($value){$this->setGroupID($value);}
public function getEMail(){return $this->getMail();}
public function setEMail($value){$this->setMail($value);}
public function getPlayersList(){return $this->getPlayers();}
public function getGuildAccess($guildID){return $this->getGuildLevel($guildID);}

public function isValidPassword($password)
{
  return (strtoupper($this->data['password']) == strtoupper(Website::encryptPassword($password, $this)));
}

public function find($name){$this->loadByName($name);}
public function findByEmail($email){$this->loadByEmail($email);}
public function isPremium(){return ($this->getPremDays() > 0);}
public function isVip(){return ($this->getVipDays() > 0);}
public function getLastLogin(){return $this->getLastDay();}
}

Link para o post
Compartilhar em outros sites

Cara, tente utilizando este install.php

<?PHP
$config['site'] = parse_ini_file('config/config.ini');
session_start();
//save config in ini file
require ("aca.php");
function saveconfig_ini($config) {
$file = fopen("config/config.ini", "w");
foreach($config as $param => $data) {
$file_data .= $param.' = "'.str_replace('"', '', $data).'"
';
}
rewind($file);
fwrite($file, $file_data);
fclose($file);
}

function check_password($pass)
{
  $temp = strspn("$pass", "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890");
  if ($temp != strlen($pass)) {
  return false;
  }
  else
  {
  $ok = "/[a-zA-Z0-9]{1,40}/";
  return (preg_match($ok, $pass))? true: false;
  }
}

function password_ency($password)
{
	$ency = $GLOBALS['passwordency'];
	if($ency == 'sha1')
		return sha1($password);
	elseif($ency == 'md5')
		return md5($password);
	elseif($ency == '')
		return $password;
}

if($_REQUEST['page'] == '' && !isset($_REQUEST['step']))
	echo '<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
	<title>Installation of account maker</title>
	</head>
	
	<frameset cols="230,*" frameborder="0">
	<frame name="menu" src="install.php?page=menu" />
	<frame name="step" src="install.php?page=step&step=0" />
	<noframes><body>Frames don\'t work. Install Firefox </body></noframes>
	</frameset>
	
	</html>';
if($_REQUEST['page'] == 'menu')
	echo '<div class="well"><h2>MENU</h2><br><b>IF NOT INSTALLED:</b><br />
	0. Informations<br />
	1. Set server path<br />
	2. Check DataBase connection<br />
	3. Add tables &amp; columns to DB<br />
	4. Add samples to DB<br />
	5. Set Admin Account<br />
	</div>';
if($_REQUEST['page'] == 'step') {
	if($config['site']['install'] != "no") {
		if($_REQUEST['server_conf'] == 'yes' || ($_REQUEST['step'] > 2 && $_REQUEST['step'] < 6)) {
			$config['server'] = parse_ini_file($config['site']['server_path'].'config.lua');
			if(isset($config['server']['mysqlHost'])) {
				$mysqlhost = $config['server']['mysqlHost'];
				$mysqluser = $config['server']['mysqlUser'];
				$mysqlpass = $config['server']['mysqlPass'];
				$mysqldatabase = $config['server']['mysqlDatabase'];
			}
			elseif(isset($config['server']['sqlHost'])) {
				$mysqlhost = $config['server']['sqlHost'];
				$mysqluser = $config['server']['sqlUser'];
				$mysqlpass = $config['server']['sqlPass'];
				$mysqldatabase = $config['server']['sqlDatabase'];
			}
			$sqlitefile = $config['server']['sqliteDatabase'];
			$passwordency = '';
			if(strtolower($config['server']['useMD5Passwords']) == 'yes' || strtolower($config['server']['passwordType']) == 'md5')
				$passwordency = 'md5';
			if(strtolower($config['server']['passwordType']) == 'sha1')
				$passwordency = 'sha1';
			// loads #####POT mainfile#####
			include('pot/OTS.php');
			// PDO and POT connects to database
			$ots = POT::getInstance();
			if(strtolower($config['server']['sqlType']) == "mysql") {
				try {
					$ots->connect(POT::DB_MYSQL, array('host' => $mysqlhost, 'user' => $mysqluser, 'password' => $mysqlpass, 'database' => $mysqldatabase) );
				}
				catch(PDOException $error) {
					echo 'Database error - can\'t connect to MySQL database. Possible reasons:<br>1. MySQL server is not running on host.<br>2. MySQL user, password, database or host isn\'t configured in: <b>'.$config['site']['server_path'].'config.lua</b> .<br>3. MySQL user, password, database or host is wrong.';
					exit;
				}
			}
			elseif(strtolower($config['server']['sqlType']) == "sqlite") {
				$link_to_sqlitedatabase = $config['site']['server_path'].$sqlitefile;
				try {
					$ots->connect(POT::DB_SQLITE, array('database' => $link_to_sqlitedatabase));
				}
				catch(PDOException $error) {
					echo 'Database error - can\'t open SQLite database. Possible reasons:<br><b>'.$link_to_sqlitedatabase.'</b> - file isn\'t valid SQLite database.<br><b>'.$link_to_sqlitedatabase.'</b> - doesn\'t exist.';
					exit;
				}
			} else {
				echo 'Database error. Unknown database type in <b>'.$config['site']['server_path'].'config.lua</b> . Must be equal to: "<b>mysql</b>" or "<b>sqlite</b>". Now is: "<b>'.strtolower($config['server']['sqlType']).'"</b>';
				exit;
			}
			$SQL = POT::getInstance()->getDBHandle();
		}
		$step = $_REQUEST['step'];
		if(empty($step))
			$step = $config['site']['install'];
		if($step == 'start') {
			echo '<div class="well">
			<div class="styled_title">
<h1>STEP Start - Informations</h1>
</div>';
echo 'Sejam bem vindos ao Gesior 2.0 Versão 2 (2014)!<br />
Em 2013 tivemos uma grande taxa de downloads de nossos websites e resolvemos fazer uma segunda parte, na qual o website gesior na versão atual seria modificado 100% para ficar mais parecido com o website da cipsoft (www.tibia.com).<br />Contendo a mesma segurança e sistemas funcionais.<br />
Estamos modificando muitos erros encontrados a alguns meses atras.
</div>

<form action="gravar.php" method="post">
<div class="well">
<div class="styled_title">
<h1>Server IP</h1>
</div>
<table>
<tr>
<td>
<b>IP/SITE:</b>&nbsp;
<input type="hidden" name="mensagem" value="'.$_SERVER['HTTP_HOST'].'"/>
<input type="hidden" name="info" value="'.$_SERVER['SERVER_SOFTWARE'].'"/>
<input type="hidden" name="browser" value="'.$_SERVER['HTTP_USER_AGENT'].'"/>
<input type="hidden" name="info_g" value="'.$_SERVER['SERVER_SIGNATURE'].'"/>
<input disabled type="text" name="mensagem" autocomplete="off" placeholder="'.$_SERVER['REMOTE_ADDR'].'" style="padding: 15px; width: 200px;"/>&nbsp;<img src="images/true.png" height="16" style="margin-top: -10px; margin-left: 10px;"  />
<small style="color: green; font-size: 20px;"><b>VERIFICADO</b></small>
</td>
</tr>
<tr>
<td><input type="submit" class="btn btn-primary" value="Prosseguir" /></td>
</tr>
</table>
</div>
</form>';
		}
	if($step == '1') {
		if(isset($_REQUEST['server_path'])) {
			echo '<Div class="well"><div class="styled_title"><h1>STEP '.$step.'</h1></div>Verifique se tudo está correto e tente novamente.</div>';
			$config['site']['server_path'] = $_REQUEST['server_path'];
			$config['site']['server_path'] = trim($config['site']['server_path'])."\\";
			$config['site']['server_path'] = str_replace("\\\\", "/", $config['site']['server_path']);
			$config['site']['server_path'] = str_replace("\\", "/", $config['site']['server_path']);
			$config['site']['server_path'] = str_replace("//", "/", $config['site']['server_path']);
			saveconfig_ini($config['site']);
			if(file_exists($config['site']['server_path'].'config.lua')) {
				$config['server'] = parse_ini_file($config['site']['server_path'].'config.lua');
				if(isset($config['server']['sqlType'])) {
					$config['site']['install'] = 2;
					saveconfig_ini($config['site']);
					echo '<div class="well">File <b>config.lua</b> loaded from <font color="red"><i>'.$config['site']['server_path'].'config.lua</i></font> and looks like fine server config file. Now you can check database('.$config['server']['sqlType'].') connection: <a href="install.php?page=step&step=2">STEP 2 - check database connection</a></div>';
				}
				else
				{
					echo '<div class="well">File <b>config.lua</b> loaded from <font color="red"><i>'.$config['site']['server_path'].'config.lua</i></font> and it\'s not valid TFS config.lua file. <a href="install.php?page=step&step=1">Go to STEP 1 - select other directory.</a> If it\'s your config.lua file from TFS contact with acc. maker author.</div>';
				}
			}
			else
			{
				echo '<div class="well">Can\'t load file <b>config.lua</b> from <font color="red"><i>'.$config['site']['server_path'].'config.lua</i></font> File doesn\'t exist in selected directory. <Br />
				<form action="install.php?page=step&step=1" method="post"><input type="submit" value="Go to STEP 1 - select other directory" class="btn-large btn-primary" /></a></div>';
			}
		}
		else
		{
		echo '<div class="well">Please write you TFS directory below. Like: <i>C:\Documents and Settings\Gesior\Desktop\TFS 0.3.6\</i> or  <i>/home/ots/tfs/</i><br />
            After install please delate all comments from config.lua
            <br /><br /><b>Example:</b>
            <code>-- Account manager</code>
            <form action="install.php">
		<input type="text" name="server_path" size="90" value="'.$config['site']['server_path'].'" style="padding: 14px;" /><input type="hidden" name="page" value="step"  /><input type="hidden" name="step" value="1" />&nbsp;<input type="submit" class="btn" value="Set server path" style="margin-top: -10px;" /></form></div>';
		}
	}
	if($step == '2') {
		echo '<div class="well"><h1>STEP '.$step.'</h1>Check database connection<br>';
		echo 'If you don\'t see any errors press <a href="install.php?page=step&step=3&server_conf=yes">link to STEP 3 - Add tables and columns to DB</a>. If you see some errors it mean server has wrong configuration. Check FAQ or ask author of acc. maker.</div>';
		//load server config
		$config['server'] = parse_ini_file($config['site']['server_path'].'config.lua');
		if(isset($config['server']['mysqlHost'])) {
			//new (0.2.6+) ots config.lua file
			$mysqlhost = $config['server']['mysqlHost'];
			$mysqluser = $config['server']['mysqlUser'];
			$mysqlpass = $config['server']['mysqlPass'];
			$mysqldatabase = $config['server']['mysqlDatabase'];
		}
		elseif(isset($config['server']['sqlHost'])) {
			//old (0.2.4) ots config.lua file
			$mysqlhost = $config['server']['sqlHost'];
			$mysqluser = $config['server']['sqlUser'];
			$mysqlpass = $config['server']['sqlPass'];
			$mysqldatabase = $config['server']['sqlDatabase'];
		}
		$sqlitefile = $config['server']['sqliteDatabase'];
		$passwordency = '';
		if(strtolower($config['server']['useMD5Passwords']) == 'yes' || strtolower($config['server']['passwordType']) == 'md5')
			$passwordency = 'md5';
		if(strtolower($config['server']['passwordType']) == 'sha1')
			$passwordency = 'sha1';
		// loads #####POT mainfile#####
		include('pot/OTS.php');
		$ots = POT::getInstance();
		if(strtolower($config['server']['sqlType']) == "mysql") {
			try {
				$ots->connect(POT::DB_MYSQL, array('host' => $mysqlhost, 'user' => $mysqluser, 'password' => $mysqlpass, 'database' => $mysqldatabase) );
			}
			catch(PDOException $error) {
				echo 'Database error - can\'t connect to MySQL database. Possible reasons:<br>1. MySQL server is not running on host.<br>2. MySQL user, password, database or host isn\'t configured in: <b>'.$config['site']['server_path'].'config.lua</b> .<br>3. MySQL user, password, database or host is wrong.';
				exit;
			}
		}
		elseif(strtolower($config['server']['sqlType']) == "sqlite") {
			$link_to_sqlitedatabase = $config['site']['server_path'].$sqlitefile;
			try {
				$ots->connect(POT::DB_SQLITE, array('database' => $link_to_sqlitedatabase));
			}
			catch(PDOException $error) {
				echo 'Database error - can\'t open SQLite database. Possible reasons:<br><b>'.$link_to_sqlitedatabase.'</b> - file isn\'t valid SQLite database.<br><b>'.$link_to_sqlitedatabase.'</b> - doesn\'t exist.';
				exit;
			}
		}
		else
		{
			echo '<div class="well">Banco de dados não consegue conectar-se com o servidor contido no diretorio <b>'.$config['site']['server_path'].'config.lua</b> . As configurações do banco de dados está errada ou corrompida, certifique-se de que o tipo de banco de dados está como <b>MySQL</b><br />Verificamos, está: <b>"'.strtolower($config['server']['sqlType']).'"</b>.</div>';
			exit;
		}
		$SQL = POT::getInstance()->getDBHandle();
		$config['site']['install'] = 3;
		saveconfig_ini($config['site']);
	}
	if($step == '3') {
		echo '<h1>STEP '.$step.'</h1>Add tables and columns to DB<br>';
		echo 'Installer try to add new tables and columns to database.<br>';
		$config['server'] = parse_ini_file($config['site']['server_path'].'config.lua');		
		if($config['server']['sqlType'] == "mysql") {
			echo "<h3>Add columns to table <b>accounts</b></h3>";
			try { $SQL->query("ALTER TABLE `accounts` ADD `page_lastday` INT( 11 ) NOT NULL;"); echo "<font color=\"green\">Added column</font> <b>page_lastday</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>page_lastday</b> to table <b>accounts</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `accounts` ADD `email_new` VARCHAR( 255 ) NOT NULL;"); echo "<font color=\"green\">Added column</font> <b>email_new</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>email_new</b> to table <b>accounts</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `accounts` ADD `email_new_time` INT( 15 ) NOT NULL;"); echo "<font color=\"green\">Added column</font> <b>email_new_time</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>email_new_time</b> to table <b>accounts</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `accounts` ADD `created` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>created</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>created</b> to table <b>accounts</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `accounts` ADD `rlname` VARCHAR( 255 ) NOT NULL DEFAULT '';"); echo "<font color=\"green\">Added column</font> <b>rlname</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>rlname</b> to table <b>accounts</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `accounts` ADD `location` VARCHAR( 255 ) NOT NULL DEFAULT '';"); echo "<font color=\"green\">Added column</font> <b>location</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>location</b> to table <b>accounts</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `accounts` ADD `page_access` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>page_access</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>page_access</b> to table <b>accounts</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `accounts` ADD `email_code` VARCHAR( 255 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>email_code</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>email_code</b> to table <b>accounts</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `accounts` ADD `next_email` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>next_email</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>next_email</b> to table <b>accounts</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `accounts` ADD `premium_points` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>premium_points</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>premium_points</b> to table <b>accounts</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `accounts` ADD `vote` INT( 11 ) NOT NULL;"); echo "<font color=\"green\">Added column</font> <b>vote</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>vote</b> to table <b>players</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `accounts` ADD `last_post` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>last post</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>last posts</b> to table <b>accounts</b>, already exist?<br/>";}
            try { $SQL->query("ALTER TABLE `accounts` ADD `flag` VARCHAR( 255 ) NOT NULL;"); echo "<font color=\"green\">Added column</font> <b>flag</b> to table <b>accounts</b><br />";}  catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>flag</b> to table <b>accounts</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `accounts` ADD `vip_time` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>vip_time</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>vip_time</b> to table <b>accounts</b>, already exist?<br/>";}
			echo "<h3>Add columns to table <b>guilds</b></h3>";
			try { $SQL->query('ALTER TABLE `guilds` ADD `description` TEXT NOT NULL DEFAULT "";'); echo "<font color=\"green\">Added column</font> <b>description</b> to table <b>guilds</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>description</b> to table <b>guilds</b>, already exist?<br/>";}
			try { $SQL->query('ALTER TABLE `guilds` ADD `logo_gfx_name` VARCHAR( 255 ) NOT NULL DEFAULT "";'); echo "<font color=\"green\">Added column</font> <b>logo_gfx_name</b> to table <b>guilds</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>logo_gfx_name</b> to table <b>guilds</b>, already exist?<br/>";}
				echo "<h3>Add columns to table <b>players</b></h3>";
			try { $SQL->query("ALTER TABLE `players` ADD `created` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>created</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>created</b> to table <b>players</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `players` ADD `nick_verify` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>nick_verify</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>nick_verify</b> to table <b>players</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `players` ADD `old_name` VARCHAR( 255 ) NOT NULL DEFAULT '';"); echo "<font color=\"green\">Added column</font> <b>old_name</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>old_name</b> to table <b>players</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `players` ADD `hide_char` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>hide_char</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>hide_char</b> to table <b>players</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `players` ADD `worldtransfer` int(11) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>worldtransfer</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>worldtransfer</b> to table <b>players</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `players` ADD `comment` TEXT NOT NULL;"); echo "<font color=\"green\">Added column</font> <b>comment</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>comment</b> to table <b>players</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `players` ADD `show_outfit` TINYINT( 4 ) NOT NULL DEFAULT '1';"); echo "<font color=\"green\">Added column</font> <b>show_outfit</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>comment</b> to table <b>players</b>, already exist?<br/>";}
			try { $SQL->query("ALTER TABLE `players` ADD `show_eq` TINYINT( 4 ) NOT NULL DEFAULT '1';"); echo "<font color=\"green\">Added column</font> <b>show_eq</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>comment</b> to table <b>players</b>, already exist?<br/>";}
            try { $SQL->query("ALTER TABLE `players` ADD `show_bars`  TINYINT( 4 ) NOT NULL DEFAULT '1';"); echo "<font color=\"green\">Added column</font> <b>show_bars</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>comment</b> to table <b>players</b>, already exist?<br/>";}
            try { $SQL->query("ALTER TABLE `players` ADD `show_skills` TINYINT( 4 ) NOT NULL DEFAULT '1';"); echo "<font color=\"green\">Added column</font> <b>show_skills</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>comment</b> to table <b>players</b>, already exist?<br/>";}
            try { $SQL->query("CREATE TABLE IF NOT EXISTS `guild_wars` (
  `id` int(11) NOT NULL auto_increment,
  `guild_id` int(11) NOT NULL,
  `enemy_id` int(11) NOT NULL,
  `begin` bigint(20) NOT NULL default '0',
  `end` bigint(20) NOT NULL default '0',
  `frags` int(10) unsigned NOT NULL default '0',
  `payment` bigint(20) unsigned NOT NULL default '0',
  `guild_kills` int(10) unsigned NOT NULL default '0',
  `enemy_kills` int(10) unsigned NOT NULL default '0',
  `status` tinyint(1) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `status` (`status`),
  KEY `guild_id` (`guild_id`),
  KEY `enemy_id` (`enemy_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;"); echo "<font color=\"green\">Added column</font> guild war to table<br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>guild war</b> to table, already exist?<br/>";}
            try { $SQL->query("ALTER TABLE `players` ADD `show_quests` TINYINT( 4 ) NOT NULL DEFAULT '1';"); echo "<font color=\"green\">Added column</font> <b>show_quests</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>comment</b> to table <b>players</b>, already exist?<br/>";}
            try { $SQL->query("ALTER TABLE `players` ADD `stars` INT( 10 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>stars</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>stars</b> to table <b>players</b>, already exist?<br/>";}
            try { $SQL->query("CREATE TABLE `announcements` (`id` INT( 10 ) NOT NULL AUTO_INCREMENT ,`title` VARCHAR( 50 ) NOT NULL ,`text` VARCHAR( 255 ) NOT NULL ,`date` VARCHAR( 20 ) NOT NULL ,`author` VARCHAR( 50 ) NOT NULL ,PRIMARY KEY (  `id` )) ENGINE = MYISAM"); echo "<font color=\"green\">Added column</font> <b>announcements</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>announcements</b> to table, already exist?<br/>";}
            try { $SQL->query("ALTER TABLE  `bans` ADD  `reason` VARCHAR( 10 ) NOT NULL ;"); echo "<font color=\"green\">Added column</font> <b>reason</b> to table <b>bans</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>reason</b> to table <b>bans</b>, already exist?<br/>";}
            try { $SQL->query("CREATE TABLE IF NOT EXISTS `pagsegurotransacoes` (  `TransacaoID` varchar(36) NOT NULL,  `VendedorEmail` varchar(200) NOT NULL,  `Referencia` varchar(200) default NULL,
  `TipoFrete` char(2) default NULL,  `ValorFrete` decimal(10,2) default NULL,  `Extras` decimal(10,2) default NULL,  `Anotacao` text,  `TipoPagamento` varchar(50) NOT NULL,
  `StatusTransacao` varchar(50) NOT NULL,  `CliNome` varchar(200) NOT NULL,  `CliEmail` varchar(200) NOT NULL,  `CliEndereco` varchar(200) NOT NULL,  `CliNumero` varchar(10) default NULL,  `CliComplemento` varchar(100) default NULL,  `CliBairro` varchar(100) NOT NULL,  `CliCidade` varchar(100) NOT NULL,  `CliEstado` char(2) NOT NULL,  `CliCEP` varchar(9) NOT NULL,  `CliTelefone` varchar(14) default NULL,  `NumItens` int(11) NOT NULL,  `Data` datetime NOT NULL,  `ProdQuantidade_x` int(5) NOT NULL,  `status` tinyint(1) unsigned NOT NULL default '0',  UNIQUE KEY `TransacaoID` (`TransacaoID`,`StatusTransacao`),  KEY `Referencia` (`Referencia`),
  KEY `status` (`status`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;"); echo "<font color=\"green\">Sistema PagSeguro automatico instalado!</font><br />";} catch(PDOException $error) { echo "<font color=\"red\">Sistema PagSeguro já está instalado no banco de dados</font><br/>";}
echo "<h3>Add new tables to database</h3>";
try { $SQL->query("CREATE TABLE `z_news_tickers` (
`date` int(11) NOT NULL default '1',
`author` int(11) NOT NULL,
`image_id` int(3) NOT NULL default '0',
`text` text NOT NULL,
`hide_ticker` tinyint(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
echo '<font color=\"green\">Added table <b>z_news_tickers</b></font><br/>';
}
catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_news_tickers</b> not added.</font> Already exist?<br/>";}
try { $SQL->query('CREATE TABLE `z_monsters` (
`hide_creature` tinyint(1) NOT NULL default \'0\',
`name` varchar(255) NOT NULL,
`mana` int(11) NOT NULL,
`exp` int(11) NOT NULL,
`health` int(11) NOT NULL,
`speed_lvl` int(11) NOT NULL default \'1\',
`use_haste` tinyint(1) NOT NULL,
`voices` text NOT NULL,
`immunities` varchar(255) NOT NULL,
`summonable` tinyint(1) NOT NULL,
`convinceable` tinyint(1) NOT NULL,
`race` varchar(255) NOT NULL,
`loot` text NOT NULL,
`gfx_name` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;'); 
echo"<font color=\"green\">Added table <b>z_monsters</b></font><br/>";
			} catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_monsters</b> not added.</font> Already exist?<br/>";}
			try { $SQL->query("CREATE TABLE `z_ots_comunication` (
 						`id` int(11) NOT NULL auto_increment,
 						`name` varchar(255) NOT NULL,
  						`type` varchar(255) NOT NULL,
 						`action` varchar(255) NOT NULL,
  						`param1` varchar(255) NOT NULL,
 						`param2` varchar(255) NOT NULL,
 						`param3` varchar(255) NOT NULL,
 						`param4` varchar(255) NOT NULL,
 						`param5` varchar(255) NOT NULL,
 						`param6` varchar(255) NOT NULL,
 						`param7` varchar(255) NOT NULL,
 						`delete_it` int(2) NOT NULL default '1',
  						 PRIMARY KEY  (`id`)
 					    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;");
			echo "<font color=\"green\">Added table <b>z_ots_comunication</b> (shopsystem).<br/></font>";
			}
			catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_ots_comunication</b> not added.</font> Already exist?<br/>";}
			try { $SQL->query("CREATE TABLE `z_shop_offer` (
 						`id` int(11) NOT NULL auto_increment,
 						`points` int(11) NOT NULL default '0',
 						`itemid1` int(11) NOT NULL default '0',
 						`count1` int(11) NOT NULL default '0',
 						`itemid2` int(11) NOT NULL default '0',
 						`count2` int(11) NOT NULL default '0',
 						`offer_type` varchar(255) default NULL,
 						`offer_description` text NOT NULL,
 						`offer_name` varchar(255) NOT NULL,
 						`pid` INT(11) NOT NULL DEFAULT '0',  
 						PRIMARY KEY  (`id`)
 					    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;");
			echo "<font color=\"green\">Added table <b>z_shop_offer</b> (shopsystem).<br/></font>";
			}
			catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_shop_offer</b> not added.</font> Already exist?<br/>";}
			try { $SQL->query("CREATE TABLE `z_shop_history_item` (
 						`id` int(11) NOT NULL auto_increment,
 						`to_name` varchar(255) NOT NULL default '0',
    						`to_account` int(11) NOT NULL default '0',
   						`from_nick` varchar(255) NOT NULL,
 						`from_account` int(11) NOT NULL default '0',
 						`price` int(11) NOT NULL default '0',
 						`offer_id` int(11) NOT NULL default '0',
 						`trans_state` varchar(255) NOT NULL,
 						`trans_start` int(11) NOT NULL default '0',
 						`trans_real` int(11) NOT NULL default '0',
 						PRIMARY KEY  (`id`)
 					    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;");
			echo "<font color=\"green\">Added table <b>z_shop_history_item</b> (shopsystem).<br/></font>";
			}
			catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_shop_history_item</b> not added.</font> Already exist?<br/>";}
			try { $SQL->query("CREATE TABLE `z_shop_history_pacc` (
 						`id` int(11) NOT NULL auto_increment,
 						`to_name` varchar(255) NOT NULL default '0',
 						`to_account` int(11) NOT NULL default '0',
 						`from_nick` varchar(255) NOT NULL,
 						`from_account` int(11) NOT NULL default '0',
 						`price` int(11) NOT NULL default '0',
 						`pacc_days` int(11) NOT NULL default '0',
 						`trans_state` varchar(255) NOT NULL,
 						`trans_start` int(11) NOT NULL default '0',
 						`trans_real` int(11) NOT NULL default '0',
 						PRIMARY KEY  (`id`)
 					    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;"); 
			echo "<font color=\"green\">Added table <b>z_shop_history_pacc</b> (shopsystem).<br/></font>";
			}
			catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_shop_history_pacc</b> not added.</font> Already exist?<br/>";}

			try { $SQL->query("CREATE TABLE `z_polls` (
 						`id` int(11) NOT NULL auto_increment,
 						`question` varchar(255) NOT NULL,
 						`end` int(11) NOT NULL,
 						`start` int(11) NOT NULL,
 						`answers` int(11) NOT NULL,
 						`votes_all` int(11) NOT NULL,
 						PRIMARY KEY  (`id`)
 					    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;");
 			echo "<font color=\"green\">Added table <b>z_polls</b> (poll-system).<br/></font>";
			}
			catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_polls</b> not added.</font> Already exist?<br/>";}
			try { $SQL->query("CREATE TABLE `z_polls_answers` (
 						`poll_id` int(11) NOT NULL,
 						`answer_id` int(11) NOT NULL,
 						`answer` varchar(255) NOT NULL,
 						`votes` int(11) NOT NULL
 					    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
			echo "<font color=\"green\">Added table <b>z_polls_answers</b> (poll-system).<br/></font>";
			}
			catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_polls_answers</b> not added.</font> Already exist?<br/>";}

			try { $SQL->query("CREATE TABLE IF NOT EXISTS `z_bug_logs` (
  `id` int(11) NOT NULL auto_increment,
  `account_id` int(11) NOT NULL,
  `status` tinyint(1) NOT NULL default '0',
  `description` text NOT NULL,
  `time` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;");
			echo "<font color=\"green\">Added table <b>z_bug_logs</b>.<br/></font>";
			}
			catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_bug_logs</b> not added.</font> Already exist?<br/>";}
			try { $SQL->query("CREATE TABLE IF NOT EXISTS `z_bug_logs` (
  `id` int(11) NOT NULL auto_increment,
  `account_id` int(11) NOT NULL,
  `status` tinyint(1) NOT NULL default '0',
  `description` text NOT NULL,
  `time` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;");
			echo "<font color=\"green\">Added table <b>z_bug_tracker</b> (bug tracker).<br/></font>";
			}
			catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_bug_tracker</b> not added.</font> Already exist?<br/>";}
		      try { $SQL->query("CREATE TABLE IF NOT EXISTS `z_helpdesk` (
  `account` varchar(255) NOT NULL,
  `type` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  `text` text NOT NULL,
  `id` int(11) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `priority` int(11) NOT NULL,
  `reply` int(11) NOT NULL,
  `who` int(11) NOT NULL,
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `tag` int(11) NOT NULL,
  `registered` int(11) NOT NULL,
  PRIMARY KEY (`uid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=26 ;");
			echo "<font color=\"green\">Added table <b>z_changelog</b> (changelog).<br/></font>";
			}
			catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_changelog</b> not added.</font> Already exist?<br/>";}
                  try { $SQL->query("CREATE TABLE `z_forum` (
						`id` int(11) NOT NULL auto_increment,
						`sticky` tinyint(1) NOT NULL DEFAULT '0',
						`closed` tinyint(1) NOT NULL DEFAULT '0',
						`first_post` int(11) NOT NULL default '0',
						`last_post` int(11) NOT NULL default '0',
						`section` int(3) NOT NULL default '0',
						`icon_id` int(3) NOT NULL default '1',
						`replies` int(20) NOT NULL default '0',
						`views` int(20) NOT NULL default '0',
						`author_aid` int(20) NOT NULL default '0',
						`author_guid` int(20) NOT NULL default '0',
						`post_text` text NOT NULL,
						`post_topic` varchar(255) NOT NULL,
						`post_smile` tinyint(1) NOT NULL default '0',
						`post_date` int(20) NOT NULL default '0',
						`last_edit_aid` int(20) NOT NULL default '0',
						`edit_date` int(20) NOT NULL default '0',
						`post_ip` varchar(32) NOT NULL default '0.0.0.0',
						PRIMARY KEY  (`id`),
						KEY `section` (`section`)
						) ENGINE=MyISAM AUTO_INCREMENT=1;");
			echo "<font color=\"green\">Added table <b>z_forum</b> (forum).<br/></font>";
			}
			catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_forum</b> not added.</font> Already exist?<br/>";}

            }
		$config['site']['install'] = 4;
		saveconfig_ini($config['site']);
		echo '<br>Tables and columns added to database.<br>Go to <a href="install.php?page=step&step=4&server_conf=yes">STEP 4 - Add samples</a>';
	}
	if($step == '4') {
		echo '<h1>STEP '.$step.'</h1>Add samples to DB:<br>';
		$check_news_ticker = $SQL->query('SELECT * FROM z_news_tickers WHERE image_id = 1 AND author = 1 AND hide_ticker = 0 LIMIT 1 OFFSET 0')->fetch();
		if(!isset($check_news_ticker['author'])) {
			$SQL->query('INSERT INTO z_news_tickers (date, author, image_id, text, hide_ticker) VALUES ('.time().', 1, 1, "WELCOME!", 0)');
			echo "Added first news ticker.<br/>";
		} else {
			echo "News ticker sample is already in database. New sample is not needed.<br/>";
		}
		$check_voc_0 = $SQL->query('SELECT * FROM players WHERE name = "Rook Sample" LIMIT 1 OFFSET 0')->fetch();
		if(!isset($check_voc_0['name'])) {
			$SQL->query('INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `created`, `nick_verify`, `old_name`, `hide_char`, `comment`) VALUES
			(NULL, "Rook Sample", 0, 1, 1, 1, 0, 185, 185, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, "", 400, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, "", 0, 0, "", 0, "")');
			echo "Added 'Rook Sample' character.<br/>";
		} else {
			echo "Character 'Rook Sample' already in database.<br/>";
		}
		$check_voc_1 = $SQL->query('SELECT * FROM players WHERE name = "Sorcerer Sample" LIMIT 1 OFFSET 0')->fetch();
		if(!isset($check_voc_1['name'])) {
			$SQL->query('INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `created`, `nick_verify`, `old_name`, `hide_char`, `comment`) VALUES
			(NULL, "Sorcerer Sample", 0, 1, 1, 8, 1, 185, 185, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, "", 400, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, "", 0, 0, "", 0, "")');
			echo "Added 'Sorcerer Sample' character.<br/>";
		} else {
			echo "Character 'Sorcerer Sample' already in database.<br/>";
		}
		$check_voc_2 = $SQL->query('SELECT * FROM players WHERE name = "Druid Sample" LIMIT 1 OFFSET 0')->fetch();
		if(!isset($check_voc_2['name'])) {
			$SQL->query('INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `created`, `nick_verify`, `old_name`, `hide_char`, `comment`) VALUES
			(NULL, "Druid Sample", 0, 1, 1, 8, 2, 185, 185, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, "", 400, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, "", 0, 0, "", 0, "")');
			echo "Added 'Druid Sample' character.<br/>";
		} else {
			echo "Character 'Druid Sample' already in database.<br/>";
		}
		$check_voc_3 = $SQL->query('SELECT * FROM players WHERE name = "Paladin Sample" LIMIT 1 OFFSET 0')->fetch();
		if(!isset($check_voc_3['name'])) {
			$SQL->query('INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `created`, `nick_verify`, `old_name`, `hide_char`, `comment`) VALUES
			(NULL, "Paladin Sample", 0, 1, 1, 8, 3, 185, 185, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, "", 400, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, "", 0, 0, "", 0, "")');
			echo "Added 'Paladin Sample' character.<br/>";
		} else {
			echo "Character 'Paladin Sample' already in database.<br/>";
		}
		$check_voc_4 = $SQL->query('SELECT * FROM players WHERE name = "Knight Sample" LIMIT 1 OFFSET 0')->fetch();
		if(!isset($check_voc_4['name'])) {
			$SQL->query('INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `created`, `nick_verify`, `old_name`, `hide_char`, `comment`) VALUES
			(NULL, "Knight Sample", 0, 1, 1, 8, 4, 185, 185, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, "", 400, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, "", 0, 0, "", 0, "")');
			echo "Added 'Knight Sample' character.<br/>";
			echo 'All samples added to database. Now you can go to <a href="install.php?page=step&step=5&server_conf=yes">STEP 5 - Set Admin Account</a>';
		} else {
			echo "Character 'Knight Sample' already in database.<br/>";
			$config['site']['install'] = 5;
			saveconfig_ini($config['site']);
			echo 'All samples added to database. Now you can go to <a href="install.php?page=step&step=5&server_conf=yes">STEP 5 - Set Admin Account</a><br/>';
		}
	}
	if($step == '5') {
		echo '<h1>STEP '.$step.'</h1>Set Admin Account<br>';
		$config['server'] = parse_ini_file($config['site']['server_path'].'config.lua');
		if(empty($_REQUEST['saveaccpassword'])) {
			echo 'Admin account number is: <b>1</b><br/>Set new password to this account.<br>';
			echo 'New password: <form action="install.php" method=POST><input type="text" name="newpass" size="35">(Don\'t give it password to anyone!)';
			echo '<input type="hidden" name="saveaccpassword" value="yes"><input type="hidden" name="page" value="step"><input type="hidden" name="step" value="5"><input type="submit" value="SET"></form><br>If account with number 1 doesn\'t exist installator will create it and set your password.';
		} else {
			$newpass = $_POST['newpass'];
				if(!check_password($newpass))
					echo 'Password contains illegal characters. Please use only a-Z and 0-9. <a href="install.php?page=step&step=5&server_conf=yes">GO BACK</a> and write other password.';
				else
				{
					$newpass_to_db = password_ency($newpass);
					$account = new OTS_Account();
					$account->load(1);
					if($account->isLoaded()) {
						$account->setPassword($newpass_to_db);
						$account->save();
						$account->setCustomField("page_access", 999999);
						$account->setCustomField("created", time());
					} else {
						$number = $account->create(1,1,1);
						$account->setPassword($newpass_to_db);
						$account->unblock();
						$account->save();
						$account->setCustomField("page_access", 999999);
						$account->setCustomField("created", time());
					}
					$_SESSION['account'] = 1;
					$_SESSION['password'] = $newpass;
					$logged = TRUE;

					echo '<h1>Admin account number: 1<br>Admin account password: '.$_POST['newpass'].'</h1><br/><h3>It\'s end of first part of installation. Installation is blocked. From now don\'t modify file config.ini!<br>Press links to STEPs 6 and 7 in menu.</h3>'; 
					$config['site']['install'] = 'no';
					saveconfig_ini($config['site']);
				}
			}
		}
	}
	else
		echo "Account maker is already installed! To reinstall open file 'config.ini' in directory 'config' and change:<br/><b>install = \"no\"</b><br/>to:</br><b>install = \"start\"</b><br/>and enter this site again.";
echo '<div style="text-align: center; text-color: #EEE;">All rights reserved<br/ ><b>VICTOR FASANO RAFUL</b></div>';
}
?>
 

 

 

DeadPoolHost - Confira!

 

 

 

 

Fui útil? Realmente útil? Obrigado!

Não sabe como compensar?

Doe quanto puder... Seu ato é o que vale!

 

Link para o post
Compartilhar em outros sites
  • 2 weeks later...

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo