diff --git a/ag/clan/kampf_anzeige.php b/ag/clan/kampf_anzeige.php
index 714bf2a..e0cd835 100644
--- a/ag/clan/kampf_anzeige.php
+++ b/ag/clan/kampf_anzeige.php
@@ -58,9 +58,8 @@ function validatePicture($picture) {
}
function displayChar($char) {
- if($char['visible'] < time()) {
+ if(strtotime($char['visible']) < time()) {
echo '
';
-
if($char['event_char_id'] != $char['winner']) {
echo '
';
echo '
';
@@ -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 '
';
echo 'Clankampf |
';
@@ -100,24 +101,28 @@ function displayHeader($top, $bottom, $challenge, $clans) {
//Darstellen der Bilder auf der linken Seite
echo '';
$width = 100 / $top;
- for ($i = 0; $i < $top; $i++) {
- echo '';
- if($clans[0]['id'] == $chars[$i]['clan_id']) {
+ $max = 0;
+ for ($i = 0; $max != $top; $i++) {
+ if($chars[$i]['clan_id'] == $left) {
+ echo ' | ';
displayChar($chars[$i]);
+ echo ' | ';
+ $max++;
}
- echo '';
}
echo '
| ';
//Darstellen der Bilder auf der rechten Seite
echo '';
- $max = (count($chars)/2)+$top;
- $min = (count($chars)/2);
- for ($i = $min; $i < $max; $i++) {
- echo '';
- if($clans[1]['id'] == $chars[$i]['clan_id']) {
+ $max = 0;
+ $i = 0;
+ While($max != $top) {
+ if($chars[$i]['clan_id'] == $right) {
+ echo ' | ';
displayChar($chars[$i]);
+ echo ' | ';
+ $max++;
}
- echo '';
+ $i++;
}
echo '
| ';
echo '';
@@ -126,27 +131,36 @@ function displayHeader($top, $bottom, $challenge, $clans) {
echo '';
//Darstellen der Bilder auf der linken Seite
echo '';
- $min = $top;
- $max = count($chars) / 2;
+ $used = $top;
+ $max = 0;
+ $i = 0;
$width = 100 / $bottom;
- for ($i = $min; $i < $max; $i++) {
- echo '';
- 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 ' | ';
+ displayChar($chars[$i]);
+ echo ' | ';
+ }
+ $max++;
}
- echo '';
+ $i++;
}
echo '
| ';
//Darstellen der Bilder auf der rechten Seite
echo '';
- $min = (count($chars)/2)+$top;
- $max = count($chars);
- for ($i = $min; $i < $max; $i++) {
- echo '';
- 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 ' | ';
+ displayChar($chars[$i]);
+ echo ' | ';
+ }
+ $max++;
}
- echo '';
+ $i++;
}
echo '
| ';
echo '
';
@@ -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 '';
echo '';
echo $host_char['char_name'].'';
@@ -206,7 +220,7 @@ function displayBody($challenge, $clans, $user) {
echo $guest_char['char_name'].'';
echo ' |
';
$row++;
- } else if($event_fight['starting'] < time()) {
+ } else if(strtotime($event_fight['starting']) < time()) {
//has it started?
echo '';
echo $host_char['char_name'].' | ';
@@ -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'];