From 75aa62a113557f5f5cc50679c6d9a98c2995468c Mon Sep 17 00:00:00 2001 From: slawkens1 Date: Sun, 21 May 2017 08:15:16 +0200 Subject: [PATCH] some fixes * updated download links, as clients.halfaway.net isn't working anymore * fixed some bugs while installing when field `email_next` or `hidden` already exist --- config.php | 4 ++-- install/steps/database.php | 22 +++++++++++++--------- install/steps/finish.php | 4 ++-- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/config.php b/config.php index 165fb7ce..d49eb5a6 100644 --- a/config.php +++ b/config.php @@ -225,7 +225,7 @@ $config = array( ); // download link to client. -$config['client_download'] = 'http://clients.halfaway.net/windows.php?tibia='. $config['client'] .''; -$config['client_download_linux'] = 'http://clients.halfaway.net/linux.php?tibia='. $config['client'] .''; +$config['client_download'] = 'http://tibia-clients.com/clients/download/'. $config['client'] .'/exe/windows'; +$config['client_download_linux'] = 'http://tibia-clients.com/clients/download/'. $config['client'] .'/tar/linux'; ?> diff --git a/install/steps/database.php b/install/steps/database.php index 7b574c11..c6f98d82 100644 --- a/install/steps/database.php +++ b/install/steps/database.php @@ -148,12 +148,14 @@ if(!$error) { if(query("ALTER TABLE `accounts` ADD `email_code` VARCHAR(255) NOT NULL DEFAULT '' AFTER `email_new_time`;")) success($locale['step_database_adding_field'] . ' accounts.email_code...'); } - + if(fieldExist('next_email', 'accounts')) { - if(query("ALTER TABLE `accounts` CHANGE `next_email` `email_next` INT(11) NOT NULL DEFAULT 0;")) { - $tmp = str_replace('$FIELD$', 'accounts.next_email', $locale['step_database_changing_field']); - $tmp = str_replace('$FIELD_NEW$', 'accounts.email_next', $tmp); - success($tmp); + if(!fieldExist('email_next', 'accounts')) { + if(query("ALTER TABLE `accounts` CHANGE `next_email` `email_next` INT(11) NOT NULL DEFAULT 0;")) { + $tmp = str_replace('$FIELD$', 'accounts.next_email', $locale['step_database_changing_field']); + $tmp = str_replace('$FIELD_NEW$', 'accounts.email_next', $tmp); + success($tmp); + } } } else if(!fieldExist('email_next', 'accounts')) { @@ -194,10 +196,12 @@ if(!$error) { } if(fieldExist('hide_char', 'players')) { - if(query("ALTER TABLE `players` CHANGE `hide_char` `hidden` TINYINT(1) NOT NULL DEFAULT 0;")) { - $tmp = str_replace('$FIELD$', 'players.hide_char', $locale['step_database_changing_field']); - $tmp = str_replace('$FIELD_NEW$', 'players.hidden', $tmp); - success($tmp); + if(!fieldExist('hidden', 'players')) { + if(query("ALTER TABLE `players` CHANGE `hide_char` `hidden` TINYINT(1) NOT NULL DEFAULT 0;")) { + $tmp = str_replace('$FIELD$', 'players.hide_char', $locale['step_database_changing_field']); + $tmp = str_replace('$FIELD_NEW$', 'players.hidden', $tmp); + success($tmp); + } } } else if(!fieldExist('hidden', 'players')) { diff --git a/install/steps/finish.php b/install/steps/finish.php index 35dbc18b..86e5031d 100644 --- a/install/steps/finish.php +++ b/install/steps/finish.php @@ -146,8 +146,8 @@ else { $value) {