public function __construct() { ess::$b->page->add_title("Hall of Fame"); kf_menu::page_id("hall_of_fame"); $data = hall_of_fame::get_all_status(); $this->css(); echo ' <div class="bg1_c small"> <h1 class="bg1">Hall of Fame<span class="left2"></span><span class="right2"></span></h1> <div class="bg1">'; foreach ($data as $name => $group) { echo ' <div class="hof_group">'; switch ($name) { case "rank": echo ' <p class="hof_desc">Første spiller til å oppnå rangering:</p>'; break; case "rank_kill": echo ' <p class="hof_desc">Første spiller til å drepe en rangert spiller:</p>'; break; case "ff_owner": echo ' <p class="hof_desc">Første spiller til å eie:</p>'; break; case "cash_num": echo ' <p class="hof_desc">Første spiller til å oppnå pengerangering:</p>'; break; case "familie": echo ' <p class="hof_desc">Første broderskap i spillet:</p>'; break; case "familie_rank": echo ' <p class="hof_desc">Høyest rangert broderskap i spillet:</p>'; break; } foreach ($group as $id => $info) { $time = $info ? ' <span class="hof_time">' . ess::$b->date->get($info[0])->format(date::FORMAT_NOTIME) . '</span>' : ''; $subject = $info ? hall_of_fame::get_subject_html($name, $info[1]) : 'Ikke oppnådd'; $text = $this->get_text($name, $id, $info[1]); echo ' <p>' . $text . ' <span class="hof_subject">' . $subject . $time . '</span></p>'; } echo ' </div>'; } echo ' </div> </div>'; ess::$b->page->load(); }
protected static function generate_page() { /*<div class="default_hidden" id="content"><a href="#top">Til toppen av siden</a></div> <div class="default_hidden"><a href="#content">Til toppen av innholdet</a></div>*/ $extra_classes = ''; // vise juleheader? $d = ess::$b->date->get(); if ($d->format("m") == 12) { $extra_classes .= ' juleheader'; } echo '<!DOCTYPE html> <html lang="no"> <head> <title>' . ess::$b->page->generate_title() . '</title>' . ess::$b->page->generate_head() . '</head> <body class="' . self::$class_browser . self::$class_crew . (self::$locked ? ' is_lock' : '') . $extra_classes . '" id="default_th">' . ess::$b->page->body_start . ' <!--<div class="default_hidden print" id="top"> <h1><a href="' . ess::$s['absolute_path'] . '">kofradia.no</a></h1> <p class="default_hidden"><a href="#content">Til innholdet</a></p> </div>--> <div id="default_header_wrap"> <div id="default_header_img"></div> <div id="default_header">'; $boxes = theme_helper::get_extended_access_boxes(); if ($boxes) { echo ' <div id="cboxes"' . (!access::has("mod") ? ' class="nocus"' : '') . '>'; foreach ($boxes as $box) { echo ' <p class="box"><a href="' . $box[0] . '">' . $box[1] . '</a></p>'; } echo ' </div>'; } echo self::get_extended_access_login(); echo self::get_extended_access_links(); echo self::get_extended_access_search(); echo ' <p id="toplink"><a href="' . ess::$s['path'] . '/" title="Gå til forsiden"></a></p> <p id="fb_link"><a href="http://www.facebook.com/kofradia" target="_blank"><span>Du finner oss på Facebook</span></a></p>'; //<p id="donate_link"><a href="'.ess::$s['relative_path'].'/donasjon" title="Doner »"><span>Donér »</span></a></p>'; $blog_links = self::get_blog_links(); if ($blog_links) { echo ' <p id="blog_link">' . implode("<br />", $blog_links) . '</p>'; } echo ' <ul id="default_topmenu"> <li><a href="' . ess::$s['relative_path'] . '/loggut?sid=' . login::$info['ses_id'] . '" onclick="return confirm(\'Er du sikker på at du vil logge ut?\\n\\nTips! Trykk Esc knappen tre ganger for å logge ut uten å måtte trykke på denne knappen!\')"><b>Logg ut</b></a></li> <li><a href="' . ess::$s['relative_path'] . '/innboks">Meldinger</a></li>'; if (!self::$locked) { echo ' <li><a href="' . ess::$s['relative_path'] . '/kontakter">Kontakter</a></li> <li><a href="' . ess::$s['relative_path'] . '/finn_spiller">Finn spiller</a></li>'; } echo ' <li><a href="' . ess::$s['relative_path'] . '/min_side?u&a=set">Innstillinger</a></li>'; if (!self::$locked) { echo ' <li><a href="' . ess::$s['relative_path'] . '/irc/client/" target="_blank">Chat</a></li>'; } echo ' </ul> <div id="status_info"></div> <p id="default_profilbilde"> <span id="default_profilbilde_wrap"> <a href="' . ess::$s['relative_path'] . '/min_side?' . (!login::$user->player->active ? "up_id=" . login::$user->player->id . '&' : '') . 'a=profil&b=profilbilde" class="profile_image_edit"><img src="/static/icon/image.png" /> endre</a> <a href="' . ess::$s['relative_path'] . '/p/' . login::$user->player->data['up_name'] . '"><img src="' . htmlspecialchars(login::$user->player->get_profile_image()) . '" alt="Ditt profilbilde" class="profile_image" /></a> </span> </p> <p id="default_playername">' . game::profile_link() . '</p>' . self::get_oppdrag_status() . ' </div> <div id="default_header_subline"> <p id="server_klokka"><span>' . self::$date_now->format(date::FORMAT_WEEKDAY) . ' ' . self::$date_now->format(date::FORMAT_NOTIME) . ' - ' . self::$date_now->format("H:i:s") . '</span></p> <div id="pm_new">' . (self::$num_pm > 0 ? '<p class="notification_box"><a href="' . ess::$s['relative_path'] . '/innboks"><b>' . self::$num_pm . ' ' . fword("ny</b> melding", "nye</b> meldinger", self::$num_pm) . '</a></p>' : '') . '</div> <div id="log_new">' . (self::$num_log > 0 ? '<p class="notification_box"><a href="' . ess::$s['relative_path'] . '/min_side?log"><b>' . self::$num_log . ' ' . fword("ny</b> hendelse", "nye</b> hendelser", self::$num_log) . '</a></p>' : '') . '</div>'; if (login::$user->data['u_log_crew_new'] > 0 && isset(login::$extended_access)) { echo ' <p class="notification_box"><a href="' . ess::$s['relative_path'] . '/min_side?u&a=crewlog"><b>' . login::$user->data['u_log_crew_new'] . '</b> ' . fword("ny hendelse som crew", "nye hendelser som crew", login::$user->data['u_log_crew_new']) . '</a></p>'; } if (!self::$locked) { echo ' <div id="def_ui2"> <p>' . login::$user->player->getRank()->getName() . '</p> <p><span class="farge">Sted: </span> <span id="status_bydel">' . game::$bydeler[login::$user->player->data['up_b_id']]['name'] . '</span></p> <p><span class="farge">Har ute</span> <span id="status_cash">' . game::format_cash(login::$user->player->data['up_cash']) . '</span></p> <p><span class="farge">Plassering: </span> nr. <span id="status_rankpos">' . login::$user->player->data['upr_rank_pos'] . '</span></p> </div>'; } echo ' </div> </div> <div id="default_left">'; if (!login::$user->player->active) { echo ' <div id="default_info_dead"> <a href="' . ess::$s['relative_path'] . '/lock?f=player">' . (login::$user->player->data['up_deactivated_dead'] == 2 ? ' <span>Din spiller blødde ihjel pga. lite energi.</span>' : (login::$user->player->data['up_deactivated_dead'] ? ' <span>Din spiller har blitt drept.</span>' : ' <span>Din spiller er deaktivert.</span>')) . ' <span class="link">Ny spiller »</span> </a> </div>'; } echo ' <nav>' . kf_menu::build_menu() . ' </nav> </div>'; if (defined("DISABLE_RIGHT_COL")) { $content_right = ''; } else { $content_right = ess::$b->page->generate_content_right(); # self::$locked ..? } echo ' <div id="default_main">'; if ($content_right) { echo ' <div id="default_right">' . $content_right . '</div>'; } echo ' <div id="default_content_wrap"' . (!$content_right ? ' class="noright"' : '') . '>' . self::get_status_bars() . ' <section id="default_content">' . ess::$b->page->content . '</section> </div> </div> <div id="default_bottom_1"> <p><a href="/">Kofradia</a> © - Beskyttet av <a href="http://www.lovdata.no/all/nl-19610512-002.html" target="_blank">åndsverkloven</a> - Utviklet av <a href="http://www.henrist.net/" target="_blank">Henrik Steen</a></p> <p><a href="' . ess::$s['relative_path'] . '/betingelser">Betingelser for bruk</a> - Besøk <a href="irc://irc.quakenet.org/kofradia" target="_blank">#Kofradia</a> på QuakeNet<!-- <a href="' . ess::$s['relative_path'] . '/forum/topic?id=85">(Hjelp)</a>--> - <a href="' . ess::$s['relative_path'] . '/credits">Takk til</a></p> </div> <div id="default_bottom_2">'; $profiler = \Kofradia\DB::getProfiler(); echo ' <p>Script: ' . round(microtime(true) - SCRIPT_START - $profiler->time, 4) . ' sek - Database: ' . round($profiler->time, 4) . ' sek (' . $profiler->num . ' spørring' . ($profiler->num == 1 ? '' : 'er') . ')<span id="js_time"></span></p>'; $revision = self::get_revision_info(); if ($revision) { echo ' <p>Versjon <a href="https://github.com/hswno/kofradia/commit/' . $revision['commit'] . '" title="' . htmlspecialchars($revision['message']) . '">' . mb_substr($revision['commit'], 0, 8) . '</a> oppdatert ' . ess::$b->date->get($revision['date'])->format() . '. <a href="&rpath;/github">Logg</a></p>'; } else { echo ' <p>Versjonsinformasjon er utilgjengelig.</p>'; } echo ' <p>Tid og dato ved visning: <b>' . self::$date_now->format(date::FORMAT_SEC) . '</b>.</p> </div>' . ess::$b->page->body_end; // debug time /*$time = SCRIPT_START; ess::$b->dt("end"); $dt = 'start'; foreach (ess::$b->time_debug as $row) { $dt .= ' -> '.round(($row[1]-$time)*1000, 2).' -> '.$row[0]; $time = $row[1]; }*/ /*if (MAIN_SERVER) { $text = ess::$b->date->get()->format("Y-m-d\tH:i:s\t")."{$_SERVER['REMOTE_ADDR']}\t{$_SERVER['REQUEST_METHOD']}\t{$_SERVER['REQUEST_URI']}\t".login::$user->player->id."\t".login::$user->player->data['up_name']."\t".round(microtime(true)-SCRIPT_START-ess::$b->db->time, 4)."\t".round(ess::$b->db->time, 4)."\t".ess::$b->db->queries."\t".str_replace(" -> ", "\t", $dt)."\n"; @file_put_contents("/home/smafia/debugtime.log", $text, FILE_APPEND); }*/ /*echo ' <!-- '.$dt.' -->*/ echo ' </body> </html>'; }
public function buildMenu() { return \kf_menu::build_menu(); }
/** * Prestasjoner */ protected static function page_achievements() { ess::$b->page->add_title("Prestasjoner"); kf_menu::page_id("achievements"); // kan ikke se? if (!page_min_side::$pstats) { echo ' <p class="c">Du har ikke tilgang til å se denne siden.</p>'; return; } echo ' <p class="c">Du har oppnådd totalt ' . game::format_num(page_min_side::$active_player->data['up_achievements_points']) . ' prestasjonspoeng.</p> <div class="achievements">'; // hent repetisjoner $rep_all = page_min_side::$active_player->achievements->get_rep_count(); // grupper etter gjentakelsemulighet $list = array("norep" => array(), "rep" => array()); foreach (achievements::$achievements as $a) { $list[$a->data['ac_recurring'] ? 'rep' : 'norep'][] = $a; } foreach ($list as $type => $all) { echo ' <div class="achievements_group"> <p class="ac_group">' . ($type == "rep" ? 'Repeterende prestasjoner:' : 'Enkeltoppnående prestasjoner:') . '</p>'; foreach ($all as $a) { // hent premie $prize = sentences_list($a->get_prizes()); if (empty($prize)) { $prize = ' '; } // sjekk om utført if (isset($rep_all[$a->id])) { if ($a->data['ac_recurring']) { $done = 'Oppnådd ' . fwords("%d gang", "%d ganger", $rep_all[$a->id]['count_upa_id']); $done .= '<br />Sist ' . ess::$b->date->get($rep_all[$a->id]['max_upa_time'])->format(); } else { $done = 'Oppnådd ' . ess::$b->date->get($rep_all[$a->id]['max_upa_time'])->format(); } } else { $done = "Du har ikke oppnådd denne prestasjonen"; } $img = isset($rep_all[$a->id]) && !$a->data['ac_recurring'] ? '<img src="' . STATIC_LINK . '/icon/ruby.png" alt="" title="Oppnådd" /> ' : ''; // fremdrift $progress = ''; $progress_text = ''; $item = new achievement_player_item(page_min_side::$active_player, $a); $item->load_active(); if ($p = $item->get_progress()) { $w = round($p['current'] / $p['target'] * 100, 1); $progress = ' <div class="ac_progress" title="Fremdrift: ' . $p['current'] . ' / ' . $p['target'] . '" style="width: ' . $w . '%"></div>'; $progress_text = ' <p class="ac_progress_text" style="text-align: right;">Fremdrift: ' . $p['current'] . ' / ' . $p['target'] . '</p>'; } echo ' <div class="ac_row">' . $progress . ' <div class="ac_data' . ($progress ? ' ac_data_progress' : '') . '"> <h2>' . htmlspecialchars($a->data['ac_name']) . '</h2>' . ($a->data['ac_text'] ? ' <p class="ac_text">' . $a->data['ac_text'] . '</p>' : '') . ' <p class="ac_prize">Premie: ' . $prize . '</p> <p class="ac_apoints" title="Prestasjonspoeng">' . $img . $a->data['ac_apoints'] . '</p> <p class="ac_status">' . $done . '</p> ' . $progress_text . ' </div> </div>'; } echo ' </div>'; } echo ' </div>'; }