From b9f7a6efb80cb77dea8854c67ef29b883d6772c9 Mon Sep 17 00:00:00 2001 From: hecht Date: Sat, 7 Jan 2012 13:01:34 +0000 Subject: [PATCH] fix, removed debug message (from signup tournament) fix, arena will now be created on demand (even when levelup) adjusted the date in config.inc.php --- ag/arena.php | 7 +------ ag/include/arena.inc.php | 13 +++++++++++++ ag/include/config.inc.php | 2 +- ag/include/exp.inc.php | 7 ++++--- ag/turnier.php | 4 ++-- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/ag/arena.php b/ag/arena.php index ca0c4cd..c82a0e6 100644 --- a/ag/arena.php +++ b/ag/arena.php @@ -313,12 +313,7 @@ function renovate($user, $arena, $vermoegen){ } -$arena = mysql_fetch_assoc(mysql_query('SELECT * FROM arena where besitzer = \''.$user_ida['id'].'\'')); -if(!$arena['name']) { - $sql = 'INSERT arena(besitzer, exp) values (\''.$user_ida['id'].'\', \'0,'.calculateRequiredExpArena(1).'\')'; - mysql_query($sql); - $arena = mysql_fetch_assoc(mysql_query('SELECT * FROM arena where besitzer = \''.$user_ida['id'].'\'')); -} +$arena = getArena($user_id); $auktionensumme = mysql_fetch_assoc(mysql_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = '.$user_ida[id].' GROUP BY bieter')); $auktionensumme = $auktionensumme['summe']; diff --git a/ag/include/arena.inc.php b/ag/include/arena.inc.php index 645c829..a3d3282 100644 --- a/ag/include/arena.inc.php +++ b/ag/include/arena.inc.php @@ -56,4 +56,17 @@ function calculateRenovierungsKosten($arena){ return (1-$arena['zustand'])*($arena['steh']*10+$arena['sitz']*150+$arena['loge']*18000); } +function getArena($user_id) { + $sql = 'SELECT * FROM arena where besitzer = \''.$user_id.'\''; + $qry = mysql_query($sql); + if(mysql_num_rows($qry) == 0) { + $sql = 'INSERT arena(besitzer, exp) values (\''.$user_id.'\', \'0,'.calculateRequiredExpArena(1).'\')'; + mysql_query($sql); + $qry = mysql_query($sql); + } + $arena = mysql_fetch_assoc($qry); + return $arena; +} + + ?> \ No newline at end of file diff --git a/ag/include/config.inc.php b/ag/include/config.inc.php index 16b8170..ce58b54 100644 --- a/ag/include/config.inc.php +++ b/ag/include/config.inc.php @@ -43,7 +43,7 @@ $name = validateName($_COOKIE['name']); $passwort = validateString($_COOKIE['passwort']); $usergroups = getUserGroups($name); -if(!isUserInGroup($usergroups, ADMIN) && time() < mktime(22, 10, 0, 1, 4, 2012)) { +if(!isUserInGroup($usergroups, ADMIN) && time() < mktime(18, 0, 0, 1, 6, 2012)) { $passwort = null; } diff --git a/ag/include/exp.inc.php b/ag/include/exp.inc.php index 324a6d9..635a93b 100644 --- a/ag/include/exp.inc.php +++ b/ag/include/exp.inc.php @@ -7,6 +7,7 @@ */ include_once (ROOT_PATH . '/include/char.inc.php'); +include_once (ROOT_PATH . '/include/arena.inc.php'); function beautifyNumericValue($value, $step){ @@ -174,9 +175,9 @@ function addExpToChar($char_id, $n_exp){ } function addExpToArena($user_id, $n_exp){ - $sql = 'SELECT * from arena where besitzer = '.$user_id; - $qry = mysql_query($sql); - $arena = mysql_fetch_assoc($qry); +// $sql = 'SELECT * from arena where besitzer = '.$user_id; +// $qry = mysql_query($sql); + $arena = getArena($user_id); $arena_exp = explode(',', $arena['exp']); $arena_exp[0] += $n_exp; $lvls = 0; diff --git a/ag/turnier.php b/ag/turnier.php index 852d189..edd37d4 100644 --- a/ag/turnier.php +++ b/ag/turnier.php @@ -107,9 +107,9 @@ function displayDefault($user, $art){ } // sehr speziell und deswegen nicht getChar(); $sql = 'SELECT id, name FROM chars WHERE besitzer='.$user['id'].$special_clue; - echo $sql; $char = mysql_query($sql); - + if(!$char) + echo $sql; ?>