Now an adjusted clan-fight menu is shown if a clan is locked. Containing the active and historical fights. Also a timer is presented showing how long the clan will be locked.

main
hecht 13 years ago
parent 1af670a914
commit 3c68f15b37

@ -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&uuml;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) {
$user_clan = getClan($user['clan']);
$clans_tmp = getClanFightCapableClanIds();
@ -498,7 +562,9 @@ function displayClanFightMenu($user) {
<?php
}
switch($action) {
if(!isClanLocked($user_ida['clan'])) {
switch($action) {
case 'challengeclan':
displayChallengeClan($user_ida, $challangedclan_id);
break;
@ -534,5 +600,14 @@ switch($action) {
break;
default:
displayClanFightMenu($user_ida);
}
} else {
switch($action) {
case 'showoldchallenge':
displayShowOldChallenge($clan_challange_id, $user_ida);
break;
default:
displayClanFightMenuWithClanLocked($user_ida);
}
}
?>

@ -427,6 +427,9 @@ function getParticipatingCharIDs($clan_challenge_id, $clan_id) {
}
function getClanLockedTime($clan_id) {
if(!isClanLocked($clan_id)) {
return 0;
}
$sql = 'SELECT TIMESTAMPDIFF(SECOND, NOW(), locked_until) FROM clan_locked WHERE clanid = ' . $clan_id;
$row = mysql_fetch_row(mysql_query($sql));
if($row)

@ -166,7 +166,7 @@ function displayCount($value){
function generateTimerHtml($timerId, $timeInSeconds, $htmlOnExpire) {
?>
<div align='center' id='timer_<?php echo $timerId; ?>'>
<span id='timer_<?php echo $timerId; ?>'>
<?php
if($timeInSeconds <= 0){
echo $htmlOnExpire;
@ -204,7 +204,7 @@ function generateTimerHtml($timerId, $timeInSeconds, $htmlOnExpire) {
<?php
}
?>
</div>
</span>
<?php
}

Loading…
Cancel
Save