From f1e637413ff352d823176ef922c752e236db483e Mon Sep 17 00:00:00 2001 From: hecht Date: Wed, 21 Dec 2011 20:44:07 +0000 Subject: [PATCH] now the clan timer will continously update --- ag/include/clan_fights.inc.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ag/include/clan_fights.inc.php b/ag/include/clan_fights.inc.php index 1ab2a00..af65502 100644 --- a/ag/include/clan_fights.inc.php +++ b/ag/include/clan_fights.inc.php @@ -529,15 +529,25 @@ function isClanLocked($clanid) { // INSERT $sql = 'INSERT INTO clan_locked(clanid, locked_until) values('.$clanid.', TIMESTAMPADD(HOUR, 24, CURRENT_TIMESTAMP))'; // echo $sql.'
'; - mysql_query($sql); + $res = mysql_query($sql); + if(!$res) + echo $sql . '
'; mysql_query('UPDATE clan_challenge_requests SET active = FALSE WHERE (clan_challenged = '.$clanid.' OR clan_requester = '.$clanid); mysql_query('DELETE FROM clan_challenges WHERE calculated = FALSE AND clan_challenge_id IN (SELECT clan_challenge_id from clan_challenge_clans WHERE clan_id = '.$clanid.')'); } else if($lock['members'] < MIN_MEMBERS){ // we have to update the actual row // UPDATE $sql = 'UPDATE clan_locked set locked_until = TIMESTAMPADD(HOUR, 24, CURRENT_TIMESTAMP) WHERE clanid = ' .$clanid; // echo $sql.'
'; - mysql_query($sql); + $res = mysql_query($sql); + if(!$res) + echo $sql . '
'; } + } else if($lock['members'] < MIN_MEMBERS) { + $sql = 'UPDATE clan_locked set locked_until = TIMESTAMPADD(HOUR, 24, CURRENT_TIMESTAMP) WHERE clanid = ' .$clanid; + // echo $sql.'
'; + $res = mysql_query($sql); + if(!$res) + echo $sql . '
'; } return true; }