From 64446d74f8efc1dbaeca046b91fde619387560b6 Mon Sep 17 00:00:00 2001 From: hecht Date: Wed, 11 Jan 2012 23:22:53 +0000 Subject: [PATCH] - adjusted the ranglist so it is sorted on elo from the beginning (introduced the level) - adjusted the profile so no php syntax error --- ag/clan/c_ranglist.php | 6 ++++-- ag/profil.php | 2 +- cronjob/clan_fight_auswertung.php | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ag/clan/c_ranglist.php b/ag/clan/c_ranglist.php index 9c543f9..a80667f 100644 --- a/ag/clan/c_ranglist.php +++ b/ag/clan/c_ranglist.php @@ -28,13 +28,13 @@ if ($wahl == 'geld') { $wahl_y= 'Niederlagen'; $wahl_z = 'Elo'; } else { - $wahl = 'siege'; + $wahl = 'elo'; $wahl_x= 'Siege'; $wahl_y= 'Niederlagen'; $wahl_z = 'Elo'; } -$sql = 'SELECT i.siege, i.leader, i.niederlagen, i.geld, i.clanname, i.id, u.nickname, (Select count(*) from user u1 where clan = i.id) as member, (Select 10 - count(*) from user u2 where clan = i.id and ((i.leader is null || i.leader != u2.id) and (i.co_leader is null ||i.co_leader != u2.id))) as freeslots, (select sum(spende) as summe from user_clan where clanid = i.id) as summe, elo FROM clan i LEFT JOIN user u ON(i.leader=u.id) ORDER BY i.'.$wahl.' DESC LIMIT 50'; +$sql = 'SELECT i.level, i.siege, i.leader, i.niederlagen, i.geld, i.clanname, i.id, u.nickname, (Select count(*) from user u1 where clan = i.id) as member, (Select 10 - count(*) from user u2 where clan = i.id and ((i.leader is null || i.leader != u2.id) and (i.co_leader is null ||i.co_leader != u2.id))) as freeslots, (select sum(spende) as summe from user_clan where clanid = i.id) as summe, elo FROM clan i LEFT JOIN user u ON(i.leader=u.id) ORDER BY i.'.$wahl.' DESC LIMIT 50'; //echo $sql . '
'; $char_s = mysql_query($sql); ?> @@ -71,6 +71,7 @@ $char_s = mysql_query($sql); # Name Leader + Level Member Slots '.$x.''."\n"; echo ''.$row['clanname'].''."\n"; echo ''.displayUserLink($row['leader'], $row['nickname']).''."\n"; + echo ''.$row['level'].''."\n"; echo ''.$row['member'].''."\n"; echo ''.(getMaximumMembers($row['id']) - $row['member']).''."\n"; diff --git a/ag/profil.php b/ag/profil.php index f5eebb6..6fafff4 100644 --- a/ag/profil.php +++ b/ag/profil.php @@ -192,7 +192,7 @@ function display($user, $usergroups){ $che2 = 'checked="checked"'; } ?> moderat: /> '; } ?> diff --git a/cronjob/clan_fight_auswertung.php b/cronjob/clan_fight_auswertung.php index f3085cb..00750bc 100755 --- a/cronjob/clan_fight_auswertung.php +++ b/cronjob/clan_fight_auswertung.php @@ -55,7 +55,7 @@ if(!semaphoreUP($ressource)) { } else { $ids = getAwatingChallengeIDs(); foreach($ids as $id) { - echo 'Werte Clanfight mit ID ' . $id . ' aus
'; + echo 'Werte Clanfight mit ID ' . $id . ' aus
'.PHP_EOL; $challenge = getChallenge($id); $clan_ids = getParticipatingClanIDs($id); @@ -99,7 +99,7 @@ if(!semaphoreUP($ressource)) { $sql = 'UPDATE clan_challenge_clans SET elo_change = ' .$eloClan2 . ', exp_change = ' . $expClan2 . ' WHERE clan_challenge_id = ' . $id . ' AND clan_id = ' . $clan2['id']; // echo $sql . '
'; mysql_query($sql); - addClanExp($clan2['id'], $expClan1); + addClanExp($clan2['id'], $expClan2); $appendum = null; if($winner == $clan2['id']) {