diff --git a/ag/clan/kampf_info.php b/ag/clan/kampf_info.php index 5b15f82..7e4ad14 100644 --- a/ag/clan/kampf_info.php +++ b/ag/clan/kampf_info.php @@ -68,7 +68,7 @@ function displayChallengeAccepted($user, $clan_id) { function displayDenyChallenge($clan_id) { if(!is_numeric($clan_id)) { displayErrorMessage(NULL, 'Wollte da jemand schummeln? ;)', displayHistoryBackLink()); - exit; + return; } ?> @@ -91,7 +91,7 @@ function displayShowChallenge($clan_challenge_id, $user) { if(!in_array($clan_challenge_id, $open_challenge_ids)) { displayErrorMessage(NULL, 'Wollte da jemand schummeln? ;)', displayHistoryBackLink()); - exit; + return; } //initialisieren von wichtigen variablen @@ -191,6 +191,69 @@ function displayShowChallenge($clan_challenge_id, $user) { '; + echo ''; + 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 ''; + echo ''; + echo ''; + } + echo '
KampfAnsehen
'; + 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 'anschauen
'; +} + function displayJoinChallenge($user, $clan_challenge_id, $char_id, $slot) { $success = joinChallenge($clan_challenge_id, $user, $char_id, $slot); if($success != null) { @@ -242,6 +305,7 @@ function displayClanFightMenu($user) { } $open_challenge_requests = getOpenChallengeRequests($user_clan['id']); $open_challenge_ids = getOpenChallengeIDs($user_clan['id']); + $old_challenge_ids = getHistoricalChallengeIDs($user_clan['id']); ?>
@@ -291,39 +355,76 @@ function displayClanFightMenu($user) { '; - echo ''; - echo ''; - echo ''; + if(count($open_challenge_ids) == 0) { + ?>'; + echo ''; + echo ''; + echo ''; + } + } + } + ?> + + + + + '; + echo ''; + echo ''; + echo ''; + } } } ?> +
offene Herausforderungen
'.$challenged_clan['clanname'].''.anzeigen.'
Keine '.$challenged_clan['clanname'].''.anzeigen.'
Beendete Herausforderungen
Keine '.$challenged_clan['clanname'].''.anzeigen.'
\ No newline at end of file +?> diff --git a/ag/include/event.inc.php b/ag/include/event.inc.php index 73a96e8..25b1bec 100644 --- a/ag/include/event.inc.php +++ b/ag/include/event.inc.php @@ -284,4 +284,22 @@ function getEventFightIdsByChar($event_id, $event_char_id) { return $result; } -?> \ No newline at end of file +function getEventFightRoundData($event_id, $event_fight_id, $round) { + $sql = 'SELECT * FROM event_fight_rounds WHERE event_id = ' . $event_id . ' AND event_fight_id = ' . $event_fight_id . ' AND `round` = ' .$round; + + $qry = mysql_query($sql); + if(!$qry) { + echo $sql . '
'; + return; + } + while($row = mysql_fetch_assoc($qry)) { + $result[$row['event_char_id']] = $row; + } + return $result; + + +} + + + +?>