From b394bbf80aaa76b17eb5aa66cf1ff7f2fd97a78d Mon Sep 17 00:00:00 2001 From: hecht Date: Fri, 18 Nov 2011 13:52:12 +0000 Subject: [PATCH] Fixes that have been made on the server for the event fights --- ag/include/clan_fights.inc.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ag/include/clan_fights.inc.php b/ag/include/clan_fights.inc.php index f1d92e8..df78689 100644 --- a/ag/include/clan_fights.inc.php +++ b/ag/include/clan_fights.inc.php @@ -523,9 +523,9 @@ function joinChallenge($clan_challenge_id, array $user, $charid, $slot ) { if($rows > 0) { // okay we now have a complete competition and the challenge is closed :) - calculateChallenge($clan_challenge_id); + return calculateChallenge($clan_challenge_id); } - + return NULL; } /** @@ -586,7 +586,7 @@ function calculateChallenge($clan_challenge_id) { } $result = NULL; - + // okay now determine the type of fight switch($challenge['type']) { case DAVY_BACK_FIGHT: @@ -604,7 +604,13 @@ function calculateChallenge($clan_challenge_id) { return 'Der Clanfight Typ "'.$challenge['type'].'" wird nicht unterstützt, bitte melde dich beim Administrator!' ; } - mysql_query('UPDATE clan_challenges set event_id = '.$event_id.', enddate = \''.date("Y-m-d H:i:s",$result).'\' WHERE clan_challenge_id = ' .$clan_challenge_id); + $sql = 'UPDATE clan_challenges set event_id = '.$event_id.', enddate = \''.date("Y-m-d H:i:s",$result).'\' WHERE clan_challenge_id = ' .$clan_challenge_id; + + $res = mysql_query($sql); + if(!$res) { + echo $sql.'
'; + return 'Konnte Datenbank-Anfrage nicht durchführen ... breche Skript ab!'; + } return NULL; }