Anzeigebugs beseitigt

main
radiskull 13 years ago
parent fc92c91c0b
commit d06da00865

@ -58,9 +58,8 @@ function validatePicture($picture) {
}
function displayChar($char) {
if($char['visible'] < time()) {
if(strtotime($char['visible']) < time()) {
echo '<div style="position:relative; top:0px; left:0px;width:75;">';
if($char['event_char_id'] != $char['winner']) {
echo '<img src="'.validatePicture($char['char_bild']).'" style="position:absolute; top:0px; left:0px; z-index:1; width:75px;height:75px;border:0px">';
echo '<img src="../design/bilder/avatare/Lose.gif" style="position:relative; top:0px; left:0px; z-index:2;width:75px;height:75px;border:0px">';
@ -82,7 +81,9 @@ function displayHeader($top, $bottom, $challenge, $clans) {
$challenge_id = $challenge['clan_challenge_id'];
$event_id = $challenge['event_id'];
$chars = getEventChars($challenge_id, $event_id);
$left = $clans[0]['id'];
$right = $clans[1]['id'];
echo '<table cellpadding="0" cellspacing="0" width="913" height="0" border="'.$border.'">';
echo '<tr><th valign="top" height="32" colspan="9" align="center">Clankampf</th></tr>';
@ -100,24 +101,28 @@ function displayHeader($top, $bottom, $challenge, $clans) {
//Darstellen der Bilder auf der linken Seite
echo '<td><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="'.$border.'"><tr>';
$width = 100 / $top;
for ($i = 0; $i < $top; $i++) {
echo '<td width="'.$width.'%" valign="middle" align="center">';
if($clans[0]['id'] == $chars[$i]['clan_id']) {
$max = 0;
for ($i = 0; $max != $top; $i++) {
if($chars[$i]['clan_id'] == $left) {
echo '<td width="'.$width.'%" valign="middle" align="center">';
displayChar($chars[$i]);
echo '</td>';
$max++;
}
echo '</td>';
}
echo '</tr></table></td>';
//Darstellen der Bilder auf der rechten Seite
echo '<td><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="'.$border.'"><tr>';
$max = (count($chars)/2)+$top;
$min = (count($chars)/2);
for ($i = $min; $i < $max; $i++) {
echo '<td width="'.$width.'%" valign="middle" align="center">';
if($clans[1]['id'] == $chars[$i]['clan_id']) {
$max = 0;
$i = 0;
While($max != $top) {
if($chars[$i]['clan_id'] == $right) {
echo '<td width="'.$width.'%" valign="middle" align="center">';
displayChar($chars[$i]);
echo '</td>';
$max++;
}
echo '</td>';
$i++;
}
echo '</tr></table></td>';
echo '</tr>';
@ -126,27 +131,36 @@ function displayHeader($top, $bottom, $challenge, $clans) {
echo '<tr height = "150">';
//Darstellen der Bilder auf der linken Seite
echo '<td><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="'.$border.'"><tr>';
$min = $top;
$max = count($chars) / 2;
$used = $top;
$max = 0;
$i = 0;
$width = 100 / $bottom;
for ($i = $min; $i < $max; $i++) {
echo '<td width="'.$width.'%" valign="middle" align="center">';
if($clans[0]['id'] == $chars[$i]['clan_id']) {
displayChar($chars[$i]);
While($max != ($bottom+$used)) {
if($chars[$i]['clan_id'] == $left) {
if($max >= $used) {
echo '<td width="'.$width.'%" valign="middle" align="center">';
displayChar($chars[$i]);
echo '</td>';
}
$max++;
}
echo '</td>';
$i++;
}
echo '</tr></table></td>';
//Darstellen der Bilder auf der rechten Seite
echo '<td><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="'.$border.'"><tr>';
$min = (count($chars)/2)+$top;
$max = count($chars);
for ($i = $min; $i < $max; $i++) {
echo '<td width="'.$width.'%" valign="middle" align="center">';
if($clans[1]['id'] == $chars[$i]['clan_id']) {
displayChar($chars[$i]);
$max = 0;
$i = 0;
While($max != ($bottom+$used)) {
if($chars[$i]['clan_id'] == $right) {
if($max >= $used) {
echo '<td width="'.$width.'%" valign="middle" align="center">';
displayChar($chars[$i]);
echo '</td>';
}
$max++;
}
echo '</td>';
$i++;
}
echo '</tr></table></td>';
echo '</tr>';
@ -195,7 +209,7 @@ function displayBody($challenge, $clans, $user) {
$guest_char = getEventChar($event_id, $guest_char_id);
// Check if the fight is already "visible"
if($event_fight['visible'] < time()) {
if(strtotime($event_fight['visible']) < time()) {
echo '<tr><td width="45%" height="15" valign="middle" bgcolor="'.getColor($row).'" align="right">';
echo '<a href="../event_kampf_anzeige.php?event_id='.$event_id.'&event_fight_id='.$event_fight['event_fight_id'].'">';
echo $host_char['char_name'].'</a>';
@ -206,7 +220,7 @@ function displayBody($challenge, $clans, $user) {
echo $guest_char['char_name'].'</a>';
echo '</td></tr>';
$row++;
} else if($event_fight['starting'] < time()) {
} else if(strtotime($event_fight['starting']) < time()) {
//has it started?
echo '<tr><td width="45%" height="15" valign="middle" bgcolor="'.getColor($row).'" align="right">';
echo $host_char['char_name'].'</td>';
@ -216,7 +230,7 @@ function displayBody($challenge, $clans, $user) {
}
}
if($challenge['enddate'] < time()) {
if(strtotime($challenge['enddate']) < time() ) {
//sieger rausfinden
if($clans[0]['points'] > $clans[0]['points']) {
$winner = $clans[0]['name'];

Loading…
Cancel
Save