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 '
Kampf | Ansehen |
---|
';
- 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']);
+
?>
-
+
+
Herausforderungen |
@@ -496,6 +436,7 @@ function displayClanFightMenu($user) {
}
?>
+
offene Herausforderungen |
@@ -512,7 +453,9 @@ function displayClanFightMenu($user) {
echo '';
echo ' '.$challenged_clan['clanname'].' | ';
echo ''.anzeigen.' | ';
- echo ''.abbrechen.' | ';
+ if($authorized) {
+ echo ''.abbrechen.' | ';
+ }
echo '
';
}
}
@@ -532,8 +475,6 @@ function displayClanFightMenu($user) {
if($pci != $user_clan['id']) {
$challenged_clan = getClan($pci);
echo ' '.$challenged_clan['clanname'].' | ';
- //TODO: hier muss javascript fenster aufgerufen werden
- //echo ''.anzeigen.' |
';
echo ''.anzeigen.' | ';
}
}
@@ -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 '
'.$challenged_clan['clanname'].' | ';
- echo ''.anzeigen.' |
';
+ echo ''.anzeigen.' | ';
}
}
}
@@ -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);
}