now the clan timer will continously update

main
hecht 13 years ago
parent b80441cf35
commit f1e637413f

@ -529,15 +529,25 @@ function isClanLocked($clanid) {
// INSERT // INSERT
$sql = 'INSERT INTO clan_locked(clanid, locked_until) values('.$clanid.', TIMESTAMPADD(HOUR, 24, CURRENT_TIMESTAMP))'; $sql = 'INSERT INTO clan_locked(clanid, locked_until) values('.$clanid.', TIMESTAMPADD(HOUR, 24, CURRENT_TIMESTAMP))';
// echo $sql.'<br>'; // echo $sql.'<br>';
mysql_query($sql); $res = mysql_query($sql);
if(!$res)
echo $sql . '<br>';
mysql_query('UPDATE clan_challenge_requests SET active = FALSE WHERE (clan_challenged = '.$clanid.' OR clan_requester = '.$clanid); 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.')'); 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 } else if($lock['members'] < MIN_MEMBERS){ // we have to update the actual row
// UPDATE // UPDATE
$sql = 'UPDATE clan_locked set locked_until = TIMESTAMPADD(HOUR, 24, CURRENT_TIMESTAMP) WHERE clanid = ' .$clanid; $sql = 'UPDATE clan_locked set locked_until = TIMESTAMPADD(HOUR, 24, CURRENT_TIMESTAMP) WHERE clanid = ' .$clanid;
// echo $sql.'<br>'; // echo $sql.'<br>';
mysql_query($sql); $res = mysql_query($sql);
if(!$res)
echo $sql . '<br>';
} }
} else if($lock['members'] < MIN_MEMBERS) {
$sql = 'UPDATE clan_locked set locked_until = TIMESTAMPADD(HOUR, 24, CURRENT_TIMESTAMP) WHERE clanid = ' .$clanid;
// echo $sql.'<br>';
$res = mysql_query($sql);
if(!$res)
echo $sql . '<br>';
} }
return true; return true;
} }

Loading…
Cancel
Save