$row['clanname'], 'id' => $row['clan_id'], 'elo' => $row['elo_change'], 'xp' => $row['exp_change'], 'points' => $row['points']); } return $clans; } function displayChar($char) { if($char['visible'] < time()) { echo '
'; if($char['event_char_id'] != $char['winner']) { echo ''; echo ''; } else { echo ''; } echo '
'; echo $char['char_name']; } else { echo '
'; echo ''; echo '
'; echo '
???'; } } function displayHeader($top, $bottom, $challenge, $clans) { $border = 0; $challenge_id = $challenge['clan_challenge_id']; $event_id = $challenge['event_id']; $chars = getEventChars($challenge_id, $event_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 rechten Seite echo ''; echo ''; //untere Teil echo ''; //Darstellen der Bilder auf der linken Seite echo ''; //Darstellen der Bilder auf der rechten Seite echo ''; echo ''; echo '
Clankampf
'.$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($challenge, $clans, $user) { $event_id = $challenge['event_id']; $fight_ids = getEventFightIds($event_id); $row = 0; //checken in welchem clan nun der User sitzt, für die Anzeige von EXP, ELO usw. if($user['clan'] == $clans[0]['id']) { $i = 0; } else { $i = 1; } 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); // Check if the fight is already "visible" if($event_fight['visible'] < time()) { echo ''; echo ''; echo ''; $row++; } else if($event_fight['starting'] < time()) { //has it started? echo ''; echo ''; echo ''; } } if($challenge['enddate'] < time()) { //sieger rausfinden if($clans[0]['points'] > $clans[0]['points']) { $winner = $clans[0]['name']; } else { $winner = $clans[1]['name']; } 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 '
'; echo $host_char['char_name'].'vs'; echo $guest_char['char_name'].'
Gewinner: '.$winner.'
Clan-EXP: '.$clans[$i]['xp'].'
ELO-Punkte: '.$clans[$i]['elo'].'
'; } } function displayOverview($challenge_id, $user) { $user_clan = getClan($user['clan']); $challenge = getChallenge($challenge_id); $clan_ids = getParticipatingClanIDs($challenge_id); $clans = getChallengeClans($challenge_id); if(!in_array($user['clan'] , $clan_ids)) { 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; } switch ($challenge['anzahl_chars']) { case 3: //not implemented yet!! break; case 4: //not implemented yet!! break; case 5: displayHeader(2, 3, $challenge, $clans); break; } displayBody($challenge, $clans, $user); } switch ($action) { case 'showsomething': break; default: displayOverview($challenge_id, $user_ida); break; } ?>