diff --git a/ag/clan/kampf_anzeige.php b/ag/clan/kampf_anzeige.php
index baec13c..d99c386 100644
--- a/ag/clan/kampf_anzeige.php
+++ b/ag/clan/kampf_anzeige.php
@@ -81,6 +81,7 @@ function displayHeader($top, $bottom, $challenge, $clans) {
$challenge_id = $challenge['clan_challenge_id'];
$event_id = $challenge['event_id'];
$chars = getEventChars($challenge_id, $event_id);
+ $number_chars = count($chars);
$left = $clans[0]['id'];
$right = $clans[1]['id'];
@@ -102,7 +103,7 @@ function displayHeader($top, $bottom, $challenge, $clans) {
echo '
';
$width = 100 / $top;
$max = 0;
- for ($i = 0; $max != $top; $i++) {
+ for ($i = 0; $max != $top && $i <= $number_chars; $i++) {
if($chars[$i]['clan_id'] == $left) {
echo '';
displayChar($chars[$i]);
@@ -115,7 +116,7 @@ function displayHeader($top, $bottom, $challenge, $clans) {
echo ' | ';
$max = 0;
$i = 0;
- for ($i = 0; $max != $top; $i++) {
+ for ($i = 0; $max != $top && $i <= $number_chars; $i++) {
if($chars[$i]['clan_id'] == $right) {
echo '';
displayChar($chars[$i]);
@@ -134,7 +135,7 @@ function displayHeader($top, $bottom, $challenge, $clans) {
$max = 0;
$i = 0;
$width = 100 / $bottom;
- for ($i = 0; $max != ($bottom+$showed); $i++) {
+ for ($i = 0; $max != ($bottom+$showed) && $i <= $number_chars; $i++) {
if($chars[$i]['clan_id'] == $left) {
if($max >= $showed) {
echo ' | ';
@@ -149,7 +150,7 @@ function displayHeader($top, $bottom, $challenge, $clans) {
echo ' | ';
$max = 0;
$i = 0;
- for ($i = 0; $max != ($bottom+$showed); $i++) {
+ for ($i = 0; $max != ($bottom+$showed) && $i <= $number_chars; $i++) {
if($chars[$i]['clan_id'] == $right) {
if($max >= $showed) {
echo '';
diff --git a/ag/clan/kampf_info.php b/ag/clan/kampf_info.php
index b9acec5..c83dca1 100644
--- a/ag/clan/kampf_info.php
+++ b/ag/clan/kampf_info.php
@@ -43,18 +43,18 @@ if($clan_challange_id == null) {
function displayChallengeClan($user, $clan_id) {
if($clan_id == -1 || $clan_id == NULL) {
displayErrorMessage(NULL,'Es wurde kein Clan ausgewählt!', displayHistoryBackLink());
- exit;
+ return;
}
if($user['clan'] == $clan_id) {
displayErrorMessage(NULL,'Man kann sich nicht selbst herausfordern!', displayHistoryBackLink());
- exit;
+ return;
}
//TODO: es sollte hier unbedingt ne Auswahl geben wieviel Leute nun kämpfen dürfen :)
$result = challengeClan($user, $clan_id, 5);
if ($result != NULL) {
displayErrorMessage(NULL, $result, displayHistoryBackLink());
- exit;
+ return;
} else {
echo 'Clan wurde erfolgreich herausgefordert.
';
echo 'weiter';
@@ -64,7 +64,7 @@ function displayChallengeClan($user, $clan_id) {
function displayChallengeAccepted($user, $clan_id) {
if(!is_numeric($clan_id)) {
displayErrorMessage(NULL, 'Wollte da jemand schummeln? ;)', displayHistoryBackLink());
- exit;
+ return;
}
acceptChallengeRequest($clan_id, $user);
echo 'Herausforderung wurde angenommen!
';
@@ -106,7 +106,7 @@ function denyChallenge($type, $clan_id, $user) {
displayClanFightMenu($user_ida);
} else {
displayErrorMessage(NULL, $success, displayHistoryBackLink());
- exit;
+ return;
}
}
@@ -116,6 +116,7 @@ function displayShowChallenge($clan_challenge_id, $user) {
if(!in_array($clan_challenge_id, $open_challenge_ids)) {
displayClanFightMenu($user);
+ return;
}
//initialisieren von wichtigen variablen
@@ -221,7 +222,7 @@ function displayJoinChallenge($user, $clan_challenge_id, $char_id, $slot) {
$success = joinChallenge($clan_challenge_id, $user, $char_id, $slot);
if($success != null) {
displayErrorMessage(NULL, $success, displayHistoryBackLink());
- exit;
+ return;
} else {
echo 'Der Charakter wurde erfoglreich angemeldet.
';
echo 'weiter';
@@ -234,13 +235,13 @@ function displayLeaveChallenge($user, $clan_challenge_id, $char_id) {
if(!in_array($clan_challenge_id, $open_challenge_ids)) {
displayErrorMessage(NULL, 'Wollte da jemand schummeln? ;)', displayHistoryBackLink());
- exit;
+ return;
}
$success = leaveChallenge($clan_challenge_id, $user, $char_id);
if($success != null) {
displayErrorMessage(NULL, $success, displayHistoryBackLink());
- exit;
+ return;
} else {
echo 'Der Charakter wurde erfoglreich abgemeldet.
';
echo 'weiter';
@@ -277,7 +278,7 @@ function cancelThisChallenge($user, $clan_challange_id) {
$success = cancelChallenge($clan_challange_id, $user);
if($success != null) {
displayErrorMessage(NULL, $success, displayHistoryBackLink());
- exit;
+ return;
} else {
displayClanFightMenu($user);
}
|
|
|
|