@ -358,6 +358,70 @@ function getFightType($id) {
}
}
}
}
function displayClanFightMenuWithClanLocked($user) {
$user_clan = getClan($user['clan']);
$active_clan_challange_ids = getActiveChallengeIDs($user_clan['id']);
$old_challenge_ids = getHistoricalChallengeIDs($user_clan['id']);
?>
< div align = "center" >
< table width = "100%" border = "1" >
< tr >
< th height = "30" colspan = "3" align = "center" > Herausforderungen< / th >
< / tr >
< tr >
< th height = "30" colspan = "3" align = "center" > Dein Clan ist leider dezeit Blockiert ( <?php
$time = getClanLockedTime($user['clan']);
if($time >= 86400) { // 24*60*60
echo 'Voraussetzungen nicht erfü llt!!';
} else {
echo generateTimerHtml('blubb', $time, '< a href = \'\' > Blockade beenden< / a > ');
}
?>)< / th >
< / tr >
< tr >
< th height = "30" colspan = "3" align = "center" > Laufende Herausforderungen< / th >
< / tr >
<?php
if(count($active_clan_challange_ids) == 0) {
echo '< td height = "20" colspan = "3" align = "center" > Keine< / td > ';
} else {
foreach ($active_clan_challange_ids as $acci) {
$participating_clan_ids = getParticipatingClanIDs($acci);
foreach ($participating_clan_ids as $pci)
if($pci != $user_clan['id']) {
$challenged_clan = getClan($pci);
echo '< tr > < td align = "center" > '.$challenged_clan['clanname'].'< / td > ';
//TODO: hier muss javascript fenster aufgerufen werden
echo '< td align = "center" > < a href = "index.php?as=clan/kampf_info&action=showoldchallenge&challenge='.$acci.'" > '.anzeigen.'< / a > < / td > < / tr > ';
}
}
}
?>
< tr >
< th height = "30" colspan = "3" align = "center" > Beendete Herausforderungen< / th >
< / tr >
< tr >
<?php
if(count($old_challenge_ids) == 0) {
echo '< td height = "20" colspan = "3" align = "center" > Keine< / td > ';
} 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 '< tr > < td > '.$challenged_clan['clanname'].'< / td > ';
echo '< td align = "center" > < a href = "index.php?as=clan/kampf_info&action=showoldchallenge&challenge='.$oci.'" > '.anzeigen.'< / a > < / td > < / tr > ';
}
}
}
?>
< / tr >
< / table >
< / div >
<?php
}
function displayClanFightMenu($user) {
function displayClanFightMenu($user) {
$user_clan = getClan($user['clan']);
$user_clan = getClan($user['clan']);
$clans_tmp = getClanFightCapableClanIds();
$clans_tmp = getClanFightCapableClanIds();
@ -498,41 +562,52 @@ function displayClanFightMenu($user) {
<?php
<?php
}
}
switch($action) {
case 'challengeclan':
if(!isClanLocked($user_ida['clan'])) {
displayChallengeClan($user_ida, $challangedclan_id);
switch($action) {
break;
case 'challengeclan':
case 'acceptclanchallenge':
displayChallengeClan($user_ida, $challangedclan_id);
displayChallengeAccepted($user_ida, $inquirychallenge_clanid);
break;
break;
case 'acceptclanchallenge':
case 'q_denyclanchallenge':
displayChallengeAccepted($user_ida, $inquirychallenge_clanid);
displayDenyChallenge($inquirychallenge_clanid, DENY_CHALLENGE);
break;
break;
case 'q_denyclanchallenge':
case 'q_withdrawclanchallenge':
displayDenyChallenge($inquirychallenge_clanid, DENY_CHALLENGE);
displayDenyChallenge($inquirychallenge_clanid, WITHDRAW_CHALLENGE);
break;
break;
case 'q_withdrawclanchallenge':
case 'denychallenge':
displayDenyChallenge($inquirychallenge_clanid, WITHDRAW_CHALLENGE);
denyChallenge($type, $inquirychallenge_clanid, $user_ida);
break;
break;
case 'denychallenge':
case 'showchallenge':
denyChallenge($type, $inquirychallenge_clanid, $user_ida);
displayShowChallenge($clan_challange_id, $user_ida);
break;
break;
case 'showchallenge':
case 'showoldchallenge':
displayShowChallenge($clan_challange_id, $user_ida);
displayShowOldChallenge($clan_challange_id, $user_ida);
break;
break;
case 'showoldchallenge':
case 'joinchallenge':
displayShowOldChallenge($clan_challange_id, $user_ida);
displayJoinChallenge($user_ida, $clan_challange_id, $char_id, $slot);
break;
break;
case 'joinchallenge':
case 'leavechallenge':
displayJoinChallenge($user_ida, $clan_challange_id, $char_id, $slot);
displayLeaveChallenge($user_ida, $clan_challange_id, $char_id);
break;
break;
case 'leavechallenge':
case 'q_cancelclanchallenge':
displayLeaveChallenge($user_ida, $clan_challange_id, $char_id);
displayCancelChallenge($user_ida, $clan_challange_id);
break;
break;
case 'q_cancelclanchallenge':
case 'cancelchallenge':
displayCancelChallenge($user_ida, $clan_challange_id);
cancelThisChallenge($user_ida, $clan_challange_id);
break;
break;
case 'cancelchallenge':
default:
cancelThisChallenge($user_ida, $clan_challange_id);
displayClanFightMenu($user_ida);
break;
default:
displayClanFightMenu($user_ida);
}
} else {
switch($action) {
case 'showoldchallenge':
displayShowOldChallenge($clan_challange_id, $user_ida);
break;
default:
displayClanFightMenuWithClanLocked($user_ida);
}
}
}
?>
?>