From dd415b8ca671bf106c8d2f9d9d0c8f9b566b94e3 Mon Sep 17 00:00:00 2001 From: radiskull Date: Wed, 16 Nov 2011 16:36:24 +0000 Subject: [PATCH] =?UTF-8?q?debug=20anzeige=20aus=20item=20genommen=20anmel?= =?UTF-8?q?den/abmelden=20von=20offenen=20Clank=C3=A4mpfen=20eingebaut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ag/clan/kampf_info.php | 184 ++++++++++++++++++++++++++++++++++++++--- ag/item.php | 3 - 2 files changed, 174 insertions(+), 13 deletions(-) diff --git a/ag/clan/kampf_info.php b/ag/clan/kampf_info.php index 4ea4043..34c751d 100644 --- a/ag/clan/kampf_info.php +++ b/ag/clan/kampf_info.php @@ -9,6 +9,7 @@ include_once(ROOT_PATH.'/include/clan.inc.php'); include_once(ROOT_PATH.'/include/fehlerausgabe.inc.php'); include_once(ROOT_PATH.'/include/parse.inc.php'); +include_once(ROOT_PATH.'/include/char.inc.php'); //Get-Section if(isset($_GET['action'])) { @@ -18,8 +19,20 @@ if(isset($_GET['action'])) { } $challangedclan_id = validateUnsignedInteger($_GET['challangedclan_id'], null); $inquirychallenge_clanid = validateUnsignedInteger($_GET['clanid'], null); +$clan_challange_id = validateUnsignedInteger($_GET['challenge'], null); +$char_id = validateUnsignedInteger($_GET['char'], null); //unkritisch +if($action == null) { + $action = $_POST['action']; +} +if($char_id == null) { + $char_id = validateUnsignedInteger($_POST['char'], null); +} +$slot = validateUnsignedInteger($_POST['slot'], null); +if($clan_challange_id == null) { + $clan_challange_id = validateUnsignedInteger($_POST['challenge'], null); +} function displayChallengeClan($user, $clan_id) { if($clan_id == -1 || $clan_id == NULL) { @@ -49,7 +62,7 @@ function displayChallengeAccepted($user, $clan_id) { } acceptChallengeRequest($clan_id, $user); echo 'Herausforderung wurde angenommen!

'; - echo displayHistoryBackLink(); + echo 'zurück'; } function displayDenyChallenge($clan_id) { @@ -63,13 +76,150 @@ function displayDenyChallenge($clan_id) { Herausforderung wirklich ablehnen? - ja';?> - nein';?> + ja';?> + + nein';?> + +
+ + + + + + '; + echo ''; + if($other_clan_chars[$i] != null) { + echo ''; + } else { + echo ''; + } + echo ''; + } + ?> + + + + '; + echo ''; + if($user_clan_chars[$i] != null) { + $char = getChar($user_clan_chars[$i]); + echo ''; + if(isUserOwnerOf($user['id'], $char['id'])) { + echo ''; + } + } else { + echo ''; + $slots[] = $i; + } + echo ''; + } + ?> + + + + + + + + + + + + + + + + + + +
Slot '.$i.'besetztfrei
Slot '.$i.''.$char['name'].'abmeldenfrei
Teilnahme
Charakter: +
Slot: +
zurück';?> +
+
+
'; + echo 'zurück'; + } +} + +function displayLeaveChallenge($user, $clan_challenge_id, $char_id) { + $user_clan = getClan($user['clan']); + $open_challenge_ids = getOpenChallengeIDs($user_clan['id']); + + if(!in_array($clan_challenge_id, $open_challenge_ids)) { + displayErrorMessage(NULL, 'Wollte da jemand schummeln? ;)', displayHistoryBackLink()); + exit; + } + + $success = leaveChallenge($clan_challenge_id, $user, $char_id); + if($success != null) { + displayErrorMessage(NULL, $success, displayHistoryBackLink()); + exit; + } else { + echo 'Der Charakter wurde erfoglreich abgemeldet.

'; + echo 'zurück'; + } +} + function getFightType($id) { switch ($id) { case DAVY_BACK_FIGHT: @@ -83,13 +233,12 @@ function getFightType($id) { function displayClanFightMenu($user) { $user_clan = getClan($user['clan']); -// $clans = getAllClans(); $clans_tmp = getClanFightCapableClanIds(); foreach ($clans_tmp as $clan_tmp_id) { $clans[] = getClan($clan_tmp_id); } - $challenges = getOpenChallengeRequests($user_clan['id']); - $test = getOpenChallengeIDs($user_clan['id']); + $open_challenge_requests = getOpenChallengeRequests($user_clan['id']); + $open_challenge_ids = getOpenChallengeIDs($user_clan['id']); ?>
@@ -124,7 +273,7 @@ function displayClanFightMenu($user) { '; echo ''; @@ -139,12 +288,21 @@ function displayClanFightMenu($user) { '; + foreach ($open_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 ''; + echo ''; + echo ''; + echo ''; + } } ?>
Option
'.$clan['clanname'].''.formatTimestamp($challenge['challenged_time']).''.getFightType($challenge['type']).''.$challenge['anzahl_chars'].'offene Herausforderungen
'.$cllng.'
'.$challenged_clan['clanname'].''.anzeigen.'
-
+