From 1f9aa9648673f17b7cf2d520e4fb8e2d58b85b03 Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 29 Nov 2018 22:53:55 +0100 Subject: [PATCH] Accounts Editor: Fix if accounts.coins does not exists --- system/pages/admin/accounts.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/system/pages/admin/accounts.php b/system/pages/admin/accounts.php index 9af616d1..b0e39f71 100644 --- a/system/pages/admin/accounts.php +++ b/system/pages/admin/accounts.php @@ -34,6 +34,7 @@ function verify_number($number, $name, $max_length) echo_error($name . ' cannot be longer than ' . $max_length . ' digits.'); } +$hasCoinsColumn = $db->hasColumn('accounts', 'coins'); ?> @@ -113,8 +114,10 @@ if ($id > 0) { verify_number($p_days, 'Prem days', 11); //tibia coins - $t_coins = $_POST['t_coins']; - verify_number($t_coins, 'Tibia coins', 12); + if($hasCoinsColumn) { + $t_coins = $_POST['t_coins']; + verify_number($t_coins, 'Tibia coins', 12); + } //prem points $p_points = $_POST['p_points']; @@ -149,7 +152,9 @@ if ($id > 0) { $account->setCustomField('key', $key); $account->setEMail($email); $account->setPremDays($p_days); - $account->setCustomField('coins', $t_coins); + if($hasCoinsColumn) { + $account->setCustomField('coins', $t_coins); + } $account->setRLName($rl_name); $account->setLocation($rl_loca); @@ -271,12 +276,14 @@ else if ($id > 0 && isset($account) && $account->isLoaded()) autocomplete="off" maxlength="11" value="getPremDays(); ?>"/> +
+ hasColumn('players', 'blessings')): ?>