From fda7d9d645f30d19e7c7a5c272878f0381f6ab89 Mon Sep 17 00:00:00 2001 From: radiskull Date: Wed, 7 Dec 2011 22:02:24 +0000 Subject: [PATCH] =?UTF-8?q?Clankampmen=C3=BC=20f=C3=BCr=20Leader=20und=20M?= =?UTF-8?q?itglieder=20angepasst=20Kampf-Anzeige=20f=C3=BCr=20Clank=C3=A4m?= =?UTF-8?q?pfe=20eingebaut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ag/clan/kampf_anzeige.php | 22 +++++++- ag/clan/kampf_info.php | 104 +++++++++----------------------------- 2 files changed, 44 insertions(+), 82 deletions(-) diff --git a/ag/clan/kampf_anzeige.php b/ag/clan/kampf_anzeige.php index de37052..94dd0b0 100644 --- a/ag/clan/kampf_anzeige.php +++ b/ag/clan/kampf_anzeige.php @@ -47,7 +47,7 @@ function getChallengeClans($challenge_id) { return $clans; } -function displayChar($char) { +/*function displayChar($char) { if($char['visible'] < time()) { echo '
'; echo ''; @@ -59,6 +59,26 @@ function displayChar($char) { } else { echo '
???'; } +}*/ + +function displayChar($char) { + if($char['visible'] < time()) { + echo '
'; + + if($char['event_char_id'] != $char['winner']) { + echo ''; + echo ''; + } else { + echo ''; + } + echo '
'; + echo $char['char_name']; + } else { + echo '
'; + echo ''; + echo '
'; + echo '
???'; + } } function displayHeader($top, $bottom, $challenge, $clans) { diff --git a/ag/clan/kampf_info.php b/ag/clan/kampf_info.php index fffcb0c..f6ea986 100644 --- a/ag/clan/kampf_info.php +++ b/ag/clan/kampf_info.php @@ -218,69 +218,6 @@ function displayShowChallenge($clan_challenge_id, $user) { '; - echo 'KampfAnsehen'; - foreach($fight_ids as $fight_id) { - $event_fight = getEventFight($event_id, $fight_id); - $round_data = getEventFightRoundData($event_id, $event_fight['event_fight_id'], 0); // get participants of fight - $host_char_id = NULL; - $guest_char_id = NULL; - foreach($round_data as $key => $value) { - if($event_fight['host'] == $key) { - $host_char_id = $key; - } else { - $guest_char_id = $key; - } - } - - // Key now lets read out the event_chars ... - - $host_char = getEventChar($event_id, $host_char_id); - $guest_char = getEventChar($event_id, $guest_char_id); - - // TODO: Check if the fight is already "visible" - - echo ''; - echo ''; - if($host_char['char_id'] !== NULL) - echo displayCharLink($host_char['char_id'], $host_char['char_name']); - else - echo $host_char['char_name']; - echo ' vs. '; - if($guest_char['char_id'] !== NULL) - echo displayCharLink($guest_char['char_id'], $guest_char['char_name']); - else - echo $guest_char['char_name']; - echo ''; - echo 'anschauen'; - echo ''; - } - echo ''; -} - function displayJoinChallenge($user, $clan_challenge_id, $char_id, $slot) { $success = joinChallenge($clan_challenge_id, $user, $char_id, $slot); if($success != null) { @@ -399,20 +336,20 @@ function displayClanFightMenuWithClanLocked($user) { } ?> - Beendete Herausforderungen + Beendete Herausforderungen Keine'; + echo 'Keine'; } else { foreach ($old_challenge_ids as $oci) { $participating_clan_ids = getParticipatingClanIDs($oci); foreach ($participating_clan_ids as $pci) if($pci != $user_clan['id']) { $challenged_clan = getClan($pci); - echo ' '.$challenged_clan['clanname'].''; - echo ''.anzeigen.''; + echo ' '.$challenged_clan['clanname'].''; + echo ''.anzeigen.''; } } } @@ -436,6 +373,8 @@ function displayClanFightMenu($user) { $open_challenge_ids = getOpenChallengeIDs($user_clan['id']); $old_challenge_ids = getHistoricalChallengeIDs($user_clan['id']); + $authorized = isAuthorizedClanfightCoordinator($user_clan['id'], $user['id']); + ?>
- +
+ @@ -496,6 +436,7 @@ function displayClanFightMenu($user) { } ?> + @@ -512,7 +453,9 @@ function displayClanFightMenu($user) { echo ''; echo ''; echo ''; - echo ''; + if($authorized) { + echo ''; + } echo ''; } } @@ -532,8 +475,6 @@ function displayClanFightMenu($user) { if($pci != $user_clan['id']) { $challenged_clan = getClan($pci); echo ''; - //TODO: hier muss javascript fenster aufgerufen werden - //echo ''; echo ''; } } @@ -544,16 +485,23 @@ function displayClanFightMenu($user) { Keine'; } else { - foreach ($old_challenge_ids as $oci) { - $participating_clan_ids = getParticipatingClanIDs($oci); + if($count > 20) { + $max = 20; + } else { + $max = $count; + } + + for ($i = 0; $i < $max; $i++) { + $participating_clan_ids = getParticipatingClanIDs($old_challenge_ids[$i]); foreach ($participating_clan_ids as $pci) if($pci != $user_clan['id']) { $challenged_clan = getClan($pci); echo ''; - echo ''; + echo ''; } } } @@ -585,9 +533,6 @@ if(!isClanLocked($user_ida['clan'])) { case 'showchallenge': displayShowChallenge($clan_challange_id, $user_ida); break; - case 'showoldchallenge': - displayShowOldChallenge($clan_challange_id, $user_ida); - break; case 'joinchallenge': displayJoinChallenge($user_ida, $clan_challange_id, $char_id, $slot); break; @@ -605,9 +550,6 @@ if(!isClanLocked($user_ida['clan'])) { } } else { switch($action) { - case 'showoldchallenge': - displayShowOldChallenge($clan_challange_id, $user_ida); - break; default: displayClanFightMenuWithClanLocked($user_ida); }
Herausforderungen
offene Herausforderungen
'.$challenged_clan['clanname'].''.anzeigen.''.abbrechen.''.abbrechen.'
'.$challenged_clan['clanname'].''.anzeigen.'
'.anzeigen.'
'.$challenged_clan['clanname'].''.anzeigen.'
'.anzeigen.'