$row['clanname'], 'id' => $row['clan_id']); } return $clans; } function displayChar($char) { if($char['visible'] < time()) { echo '
'; echo '
'; echo ''; echo '
'; if($char['event_char_id'] != $char['winner']) { echo '
'; echo ''; echo '
'; } echo '
'; echo $char['char_name']; } else { echo '
???'; } } function displayHeader($top, $bottom, $challenge) { $border = 0; $challenge_id = $challenge['clan_challenge_id']; $event_id = $challenge['event_id']; $chars = getEventChars($challenge_id, $event_id); $clans = getChallengeClans($challenge_id); echo ''; echo ''; echo ''; //erste spalte echo ''; //zweite spalte echo ''; //dritte spalte echo ''; echo ''; //obere Teil echo ''; //Darstellen der Bilder auf der linken Seite echo ''; //Darstellen der Bilder auf der linken Seite echo ''; echo ''; //untere Teil echo ''; //Darstellen der Bilder auf der linken Seite echo ''; //Darstellen der Bilder auf der linken Seite echo ''; echo ''; echo '
Clankampf am ...
'.$clans[0]['name'].'VS.'.$clans[1]['name'].'
'; $width = 100 / $top; for ($i = 0; $i < $top; $i++) { echo ''; } echo '
'; if($clans[0]['id'] == $chars[$i]['clan_id']) { displayChar($chars[$i]); } echo '
'; $max = (count($chars)/2)+$top; $min = (count($chars)/2); for ($i = $min; $i < $max; $i++) { echo ''; } echo '
'; if($clans[1]['id'] == $chars[$i]['clan_id']) { displayChar($chars[$i]); } echo '
'; $min = $top; $max = count($chars) / 2; $width = 100 / $bottom; for ($i = $min; $i < $max; $i++) { echo ''; } echo '
'; if($clans[0]['id'] == $chars[$i]['clan_id']) { displayChar($chars[$i]); } echo '
'; $min = (count($chars)/2)+$top; $max = count($chars); for ($i = $min; $i < $max; $i++) { echo ''; } echo '
'; if($clans[1]['id'] == $chars[$i]['clan_id']) { displayChar($chars[$i]); } echo '
'; } function getColor($row) { if($row % 2 == 0) { $color = '#018B8B'; //$color = '#FFFFFF'; } else { $color = '#029393'; //$color = '#FF00FF'; } return $color; } function displayBody($event_id) { $fight_ids = getEventFightIds($event_id); $row = 0; echo ''; foreach($fight_ids as $fight_id) { $event_fight = getEventFight($event_id, $fight_id); $round_data = getEventFightRoundData($event_id, $event_fight['event_fight_id'], 0); // get participants of fight $host_char_id = NULL; $guest_char_id = NULL; foreach($round_data as $key => $value) { if($event_fight['host'] == $key) { $host_char_id = $key; } else { $guest_char_id = $key; } } // Key now lets read out the event_chars ... $host_char = getEventChar($event_id, $host_char_id); $guest_char = getEventChar($event_id, $guest_char_id); // TODO: Check if the fight is already "visible" echo ''; echo ''; echo ''; $row++; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo ''; echo $host_char['char_name'].''; echo 'vs'; echo ''; echo $guest_char['char_name'].''; echo '
Clan-EXP: 1337
Clan-Geld: 1337
ELO-Punkte: 1337
'; } function displayOverview($challenge_id, $user) { $user_clan = getClan($user['clan']); $challenge = getChallenge($challenge_id); $clans = getParticipatingClanIDs($challenge_id); if(!in_array($user['clan'] , $clans)) { displayErrorMessage(NULL, 'Wollte da jemand schummeln? ;)', displayHistoryBackLink()); return; } if($challenge['calculated'] == FALSE) { displayErrorMessage(NULL, 'Der Clankampf ist noch nicht soweit!!', displayHistoryBackLink()); return; } $event_id = $challenge['event_id']; $event = getEvent($event_id); if($event['event_type'] != EVENT_CLAN_FIGHT) { displayErrorMessage(NULL, 'Das Event is garkein Clan-Kampf!!', displayHistoryBackLink()); return; } //TODO: Kampfbeteiligte ermitteln //$participating_chars = getEventChars($event_id); $number_participants = count($participating_chars) / 2; switch ($challenge['anzahl_chars']) { case 3: //not implemented yet!! break; case 4: //not implemented yet!! break; case 5: displayHeader(2, 3, $challenge); break; } displayBody($event_id); } switch ($action) { case 'showsomething': break; default: displayOverview($challenge_id, $user_ida); break; } ?>