Exemple #1
0
function ShowRecordsPage()
{
    global $USER, $PLANET, $LNG, $resource, $db, $CONF;
    require_once ROOT_PATH . "cache/CacheRecords.php";
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $template->page_header();
    $template->page_topnav();
    $template->page_leftmenu();
    $template->page_planetmenu();
    $template->page_footer();
    foreach ($RecordsArray as $ElementID => $ElementIDArray) {
        if ($ElementID >= 1 && $ElementID <= 39 || $ElementID == 44) {
            $Builds[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        } elseif ($ElementID >= 41 && $ElementID <= 99 && $ElementID != 44) {
            $MoonsBuilds[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        } elseif ($ElementID >= 101 && $ElementID <= 199) {
            $Techno[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        } elseif ($ElementID >= 201 && $ElementID <= 399) {
            $Fleet[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        } elseif ($ElementID >= 401 && $ElementID <= 599) {
            $Defense[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        }
    }
    $Records = array($LNG['rec_build'] => $Builds, $LNG['rec_specb'] => $MoonsBuilds, $LNG['rec_techn'] => $Techno, $LNG['rec_fleet'] => $Fleet, $LNG['rec_defes'] => $Defense);
    $template->assign_vars(array('Records' => $Records, 'update' => sprintf($LNG['rec_last_update_on'], date("d. M Y, H:i:s", $CONF['stat_last_update'])), 'level' => $LNG['rec_level'], 'player' => $LNG['rec_playe']));
    $template->show("records_overview.tpl");
}
Exemple #2
0
function ShowTechTreePage()
{
    global $resource, $requeriments, $LNG, $reslist, $USER, $PLANET;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $template->page_header();
    $template->page_topnav();
    $template->page_leftmenu();
    $template->page_planetmenu();
    $template->page_footer();
    $RequeriList = array();
    foreach ($LNG['tech'] as $Element => $ElementName) {
        if (in_array($Element, $reslist['dmfunc'])) {
            continue;
        }
        if (!isset($resource[$Element])) {
            $TechTreeList[] = $ElementName;
        } else {
            if (isset($requeriments[$Element])) {
                foreach ($requeriments[$Element] as $RegID => $RedCount) {
                    $RequeriList[$Element][] = array('id' => $RegID, 'count' => $RedCount, 'own' => isset($PLANET[$resource[$RegID]]) ? $PLANET[$resource[$RegID]] : $USER[$resource[$RegID]]);
                }
            }
            $TechTreeList[] = array('id' => $Element, 'name' => $ElementName, 'need' => $RequeriList);
        }
    }
    $template->assign_vars(array('TechTreeList' => $TechTreeList, 'tt_requirements' => $LNG['tt_requirements'], 'LNG' => $LNG['tech'], 'tt_lvl' => $LNG['tt_lvl']));
    $template->show("techtree_overview.tpl");
}
 public function __construct()
 {
     global $USER, $PLANET, $dpath, $resource, $LNG, $db, $reslist;
     $template = new template();
     $template->page_header();
     $template->page_topnav();
     $template->page_leftmenu();
     $template->page_planetmenu();
     $template->page_footer();
     $template->loadscript('galaxy.js');
     $maxfleet = $db->num_rows($db->query("SELECT fleet_id FROM " . FLEETS . " WHERE `fleet_owner` = '" . $USER['id'] . "' AND `fleet_mission` != 10;"));
     $mode = request_var('mode', 0);
     $galaxyLeft = request_var('galaxyLeft', '');
     $galaxyRight = request_var('galaxyRight', '');
     $systemLeft = request_var('systemLeft', '');
     $systemRight = request_var('systemRight', '');
     $galaxy = min(max(abs(request_var('galaxy', $PLANET['galaxy'])), 1), MAX_GALAXY_IN_WORLD);
     $system = min(max(abs(request_var('system', $PLANET['system'])), 1), MAX_SYSTEM_IN_GALAXY);
     $planet = min(max(abs(request_var('planet', $PLANET['planet'])), 1), MAX_PLANET_IN_SYSTEM);
     $current = request_var('current', 0);
     if ($mode == 1) {
         if (!empty($galaxyLeft)) {
             $galaxy = max($galaxy - 1, 1);
         } elseif (!empty($galaxyRight)) {
             $galaxy = min($galaxy + 1, MAX_GALAXY_IN_WORLD);
         }
         if (!empty($systemLeft)) {
             $system = max($system - 1, 1);
         } elseif (!empty($systemRight)) {
             $system = min($system + 1, MAX_SYSTEM_IN_GALAXY);
         }
     }
     if (!($galaxy == $PLANET['galaxy'] && $system == $PLANET['system']) && $mode != 0) {
         if ($PLANET['deuterium'] < 10) {
             $template->message($LNG['gl_no_deuterium_to_view_galaxy'], "game.php?page=galaxy&mode=0", 2);
             exit;
         } else {
             $PLANET['deuterium'] -= 10;
         }
     }
     $PlanetRess = new ResourceUpdate();
     $PlanetRess->CalcResource();
     $PlanetRess->SavePlanetToDB();
     unset($reslist['defense'][array_search(502, $reslist['defense'])]);
     $MissleSelector[0] = $LNG['gl_all_defenses'];
     foreach ($reslist['defense'] as $Element) {
         $MissleSelector[$Element] = $LNG['tech'][$Element];
     }
     $Result = $this->ShowGalaxyRows($galaxy, $system);
     $template->assign_vars(array('GalaxyRows' => $Result['Result'], 'planetcount' => sprintf($LNG['gl_populed_planets'], $Result['planetcount']), 'mode' => $mode, 'galaxy' => $galaxy, 'system' => $system, 'planet' => $planet, 'current' => $current, 'currentmip' => pretty_number($PLANET[$resource[503]]), 'maxfleetcount' => $maxfleet, 'fleetmax' => $USER['computer_tech'] + 1 + $USER['rpg_commandant'] * COMMANDANT, 'grecyclers' => pretty_number($PLANET[$resource[219]]), 'recyclers' => pretty_number($PLANET[$resource[209]]), 'spyprobes' => pretty_number($PLANET[$resource[210]]), 'missile_count' => sprintf($LNG['gl_missil_to_launch'], $PLANET[$resource[503]]), 'spio_anz' => $USER['spio_anz'], 'settings_fleetactions' => $USER['settings_fleetactions'], 'current_galaxy' => $PLANET['galaxy'], 'current_system' => $PLANET['system'], 'current_planet' => $PLANET['planet'], 'planet_type' => $PLANET['planet_type'], 'MissleSelector' => $MissleSelector, 'gl_solar_system' => $LNG['gl_solar_system'], 'gl_galaxy' => $LNG['gl_galaxy'], 'gl_missil_launch_action' => $LNG['gl_missil_launch_action'], 'gl_objective' => $LNG['gl_objective'], 'gl_missil_launch' => $LNG['gl_missil_launch'], 'gl_pos' => $LNG['gl_pos'], 'gl_planet' => $LNG['gl_planet'], 'gl_alliance' => $LNG['gl_alliance'], 'gl_actions' => $LNG['gl_actions'], 'gl_name_activity' => $LNG['gl_name_activity'], 'gl_player_estate' => $LNG['gl_player_estate'], 'gl_debris' => $LNG['gl_debris'], 'gl_moon' => $LNG['gl_moon'], 'gl_show' => $LNG['gl_show'], 'gl_out_space' => $LNG['gl_out_space'], 'gl_legend' => $LNG['gl_legend'], 'gl_strong_player' => $LNG['gl_strong_player'], 'gl_s' => $LNG['gl_s'], 'gl_week_player' => $LNG['gl_week_player'], 'gl_w' => $LNG['gl_w'], 'gl_vacation' => $LNG['gl_vacation'], 'gl_v' => $LNG['gl_v'], 'gl_banned' => $LNG['gl_banned'], 'gl_b' => $LNG['gl_b'], 'gl_inactive_seven' => $LNG['gl_inactive_seven'], 'gl_i' => $LNG['gl_i'], 'gl_inactive_twentyeight' => $LNG['gl_inactive_twentyeight'], 'gl_I' => $LNG['gl_I'], 'gl_avaible_grecyclers' => $LNG['gl_avaible_grecyclers'], 'gl_avaible_recyclers' => $LNG['gl_avaible_recyclers'], 'gl_avaible_spyprobes' => $LNG['gl_avaible_spyprobes'], 'gl_fleets' => $LNG['gl_fleets'], 'gl_avaible_missiles' => $LNG['gl_avaible_missiles'], 'gl_moon' => $LNG['gl_moon'], 'gl_diameter' => $LNG['gl_diameter'], 'gl_features' => $LNG['gl_features'], 'gl_temperature' => $LNG['gl_temperature'], 'gl_actions' => $LNG['gl_actions'], 'gl_debris_field' => $LNG['gl_debris_field'], 'gl_resources' => $LNG['gl_resources'], 'gl_collect' => $LNG['gl_collect'], 'gl_with' => $LNG['gl_with'], 'gl_alliance_page' => $LNG['gl_alliance_page'], 'gl_see_on_stats' => $LNG['gl_see_on_stats'], 'gl_alliance_web_page' => $LNG['gl_alliance_web_page'], 'gl_spy' => $LNG['gl_spy'], 'gl_buddy_request' => $LNG['gl_buddy_request'], 'gl_missile_attack' => $LNG['gl_missile_attack'], 'gl_player' => $LNG['gl_player'], 'gl_playercard' => $LNG['gl_playercard'], 'gl_phalanx' => $LNG['gl_phalanx'], 'gl_points' => $LNG['gl_points'], 'gl_ajax_status_ok' => $LNG['gl_ajax_status_ok'], 'gl_ajax_status_fail' => $LNG['gl_ajax_status_fail'], 'write_message' => $LNG['write_message']));
     $template->show('galaxy_overview.tpl');
 }
Exemple #4
0
function ShowTopKB()
{
    global $USER, $PLANET, $LNG, $db;
    $mode = request_var('mode', '');
    $template = new template();
    switch ($mode) {
        case "showkb":
            $template->page_header();
            $template->page_footer();
            includeLang('FLEET');
            $ReportID = request_var('rid', '');
            if (file_exists(ROOT_PATH . 'raports/topkb_' . $ReportID . '.php')) {
                require_once ROOT_PATH . 'raports/topkb_' . $ReportID . '.php';
                $RaportRAW = $db->uniquequery("SELECT `angreifer`, `defender` FROM " . TOPKB . " WHERE `rid` = '" . $db->sql_escape($ReportID) . "';");
            } else {
                $RaportRAW = $db->uniquequery("SELECT * FROM " . TOPKB . " WHERE `rid` = '" . $db->sql_escape($ReportID) . "';");
                $raport = stripslashes($RaportRAW['raport']);
                foreach ($LNG['tech_rc'] as $id => $s_name) {
                    $str_replace1 = array("[ship[" . $id . "]]");
                    $str_replace2 = array($s_name);
                    $raport = str_replace($str_replace1, $str_replace2, $raport);
                }
            }
            foreach ($LNG['tech_rc'] as $id => $s_name) {
                $ship[] = "[ship[" . $id . "]]";
                $shipname[] = $s_name;
            }
            $template->assign_vars(array('attacker' => $RaportRAW['angreifer'], 'defender' => $RaportRAW['defender'], 'report' => $raport));
            $template->show("topkb_report.tpl");
            break;
        default:
            $PlanetRess = new ResourceUpdate();
            $PlanetRess->CalcResource();
            $PlanetRess->SavePlanetToDB();
            $template->page_header();
            $template->page_topnav();
            $template->page_leftmenu();
            $template->page_planetmenu();
            $template->page_footer();
            $top = $db->query("SELECT * FROM " . TOPKB . " ORDER BY gesamtunits DESC LIMIT 100;");
            while ($data = $db->fetch_array($top)) {
                $TopKBList[] = array('result' => $data['fleetresult'], 'time' => date("D d M H:i:s", $data['time']), 'units' => pretty_number($data['gesamtunits']), 'rid' => $data['rid'], 'attacker' => $data['angreifer'], 'defender' => $data['defender'], 'result' => $data['fleetresult']);
            }
            $db->free_result($top);
            $template->assign_vars(array('tkb_units' => $LNG['tkb_units'], 'tkb_datum' => $LNG['tkb_datum'], 'tkb_owners' => $LNG['tkb_owners'], 'tkb_platz' => $LNG['tkb_platz'], 'tkb_top' => $LNG['tkb_top'], 'tkb_gratz' => $LNG['tkb_gratz'], 'tkb_legende' => $LNG['tkb_legende'], 'tkb_gewinner' => $LNG['tkb_gewinner'], 'tkb_verlierer' => $LNG['tkb_verlierer'], 'TopKBList' => $TopKBList));
            $template->show("topkb_overview.tpl");
            break;
    }
}
Exemple #5
0
function ShowSearchPage()
{
    global $USER, $PLANET, $dpath, $LNG, $db;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $template->page_header();
    $template->page_topnav();
    $template->page_leftmenu();
    $template->page_planetmenu();
    $template->page_footer();
    $type = request_var('type', '');
    $searchtext = request_var('searchtext', '');
    switch ($type) {
        case 'playername':
            $search = $db->query("SELECT a.id, a.username, a.ally_id, a.ally_name, a.galaxy, a.system, a.planet, b.name, c.total_rank FROM " . USERS . " as a LEFT JOIN " . PLANETS . " as b ON b.id = a.id_planet LEFT JOIN " . STATPOINTS . " as c ON c.stat_type = 1 AND c.id_owner = a.id WHERE a.username LIKE '%" . $db->sql_escape($searchtext, true) . "%' LIMIT 25;");
            while ($s = $db->fetch_array($search)) {
                $SearchResult[] = array('planetname' => $s['name'], 'username' => $s['username'], 'userid' => $s['id'], 'allyname' => $s['ally_name'], 'allyid' => $s['ally_id'], 'galaxy' => $s['galaxy'], 'system' => $s['system'], 'planet' => $s['planet'], 'rank' => $s['total_rank']);
            }
            $db->free_result($search);
            break;
        case 'planetname':
            $search = $db->query("SELECT a.name, a.galaxy, a.planet, a.system, b.ally_name, b.id, b.ally_id, b.username, c.total_rank FROM " . PLANETS . " as a LEFT JOIN " . USERS . " as b ON b.id = a.id_owner LEFT JOIN  " . STATPOINTS . " as c ON c.stat_type = 1 AND c.id_owner = b.id  WHERE a.name LIKE '%" . $db->sql_escape($searchtext, true) . "%' LIMIT 25;");
            while ($s = $db->fetch_array($search)) {
                $SearchResult[] = array('planetname' => $s['name'], 'username' => $s['username'], 'userid' => $s['id'], 'allyname' => $s['ally_name'], 'allyid' => $s['ally_id'], 'galaxy' => $s['galaxy'], 'system' => $s['system'], 'planet' => $s['planet'], 'rank' => $s['total_rank']);
            }
            $db->free_result($search);
            break;
        case "allytag":
            $search = $db->query("SELECT a.ally_name, a.ally_tag, a.ally_members, b.total_points FROM " . ALLIANCE . " as a, " . STATPOINTS . " as b WHERE b.stat_type = 1 AND b.id_owner = a.id AND a.ally_tag LIKE '%" . $db->sql_escape($searchtext, true) . "%' LIMIT 25;");
            while ($s = $db->fetch_array($search)) {
                $SearchResult[] = array('allypoints' => pretty_number($s['total_points']), 'allytag' => $s['ally_tag'], 'allymembers' => $s['ally_members'], 'allyname' => $s['ally_name']);
            }
            $db->free_result($search);
            break;
        case "allyname":
            $search = $db->query("SELECT a.ally_name, a.ally_tag, a.ally_members, b.total_points FROM " . ALLIANCE . " as a, " . STATPOINTS . " as b WHERE b.stat_type = 1 AND b.id_owner = a.id AND a.ally_name LIKE '%" . $db->sql_escape($searchtext, true) . "%' LIMIT 25;");
            while ($s = $db->fetch_array($search)) {
                $SearchResult[] = array('allypoints' => pretty_number($s['total_points']), 'allytag' => $s['ally_tag'], 'allymembers' => $s['ally_members'], 'allyname' => $s['ally_name']);
            }
            $db->free_result($search);
            break;
    }
    $SeachTypes = array("playername" => $LNG['sh_player_name'], "planetname" => $LNG['sh_planet_name'], "allytag" => $LNG['sh_alliance_tag'], "allyname" => $LNG['sh_alliance_name']);
    $template->assign_vars(array('SearchResult' => $SearchResult, 'SeachTypes' => $SeachTypes, 'SeachInput' => $searchtext, 'SeachType' => $type, 'sh_search' => $LNG['sh_search'], 'sh_search_in_the_universe' => $LNG['sh_search_in_the_universe'], 'sh_buddy_request' => $LNG['sh_buddy_request'], 'sh_write_message' => $LNG['sh_write_message'], 'sh_name' => $LNG['sh_name'], 'sh_alliance' => $LNG['sh_alliance'], 'sh_planet' => $LNG['sh_planet'], 'sh_coords' => $LNG['sh_coords'], 'sh_position' => $LNG['sh_position'], 'sh_tag' => $LNG['sh_tag'], 'sh_members' => $LNG['sh_members'], 'sh_points' => $LNG['sh_points']));
    $template->show("search_body.tpl");
}
Exemple #6
0
function ShowFAQPage()
{
    global $USER, $PLANET, $LNG;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $template->page_header();
    $template->page_topnav();
    $template->page_leftmenu();
    $template->page_planetmenu();
    $template->page_footer();
    includeLang('FAQ');
    $template->assign_vars(array('FAQList' => $LNG['faq'], 'faq_overview' => $LNG['faq_overview']));
    $template->show("faq_overview.tpl");
}
function ShowChangelogPage()
{
    global $USER, $PLANET, $LNG;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $template->page_header();
    $template->page_topnav();
    $template->page_leftmenu();
    $template->page_planetmenu();
    $template->page_footer();
    includeLang('CHANGELOG');
    $template->assign_vars(array('ChangelogList' => array_map('makebr', $LNG['changelog']), 'Version' => $LNG['Version'], 'Description' => $LNG['Description']));
    $template->show("changelog_overview.tpl");
}
Exemple #8
0
function ShowImperiumPage()
{
    global $LNG, $USER, $PLANET, $resource, $reslist, $db;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $template->loadscript("trader.js");
    $template->page_topnav();
    $template->page_header();
    $template->page_leftmenu();
    $template->page_planetmenu();
    $template->page_footer();
    $SQLArray = array_merge($reslist['build'], $reslist['fleet'], $reslist['defense']);
    $Query = "";
    foreach ($SQLArray as $id => $gid) {
        $Query .= ",`" . $resource[$gid] . "`";
    }
    if ($USER['planet_sort'] == 0) {
        $Order = "`id` ";
    } elseif ($USER['planet_sort'] == 1) {
        $Order = "`galaxy`, `system`, `planet`, `planet_type` ";
    } elseif ($USER['planet_sort'] == 2) {
        $Order = "`name` ";
    }
    $Order .= $USER['planet_sort_order'] == 1 ? "DESC" : "ASC";
    $PlanetsRAW = $db->query("\r\n\tSELECT `id`,`name`,`galaxy`,`system`,`planet`,`planet_type`,\r\n\t`image`,`field_current`,`field_max`,`metal`,`crystal`,`deuterium`,\r\n\t`energy_used`,`energy_max` " . $Query . " FROM " . PLANETS . " WHERE `id_owner` = '" . $USER['id'] . "' AND `destruyed` = '0' ORDER BY " . $Order . ";");
    while ($Planet = $db->fetch_array($PlanetsRAW)) {
        $InfoList = array('id' => $Planet['id'], 'name' => $Planet['name'], 'image' => $Planet['image'], 'galaxy' => $Planet['galaxy'], 'system' => $Planet['system'], 'planet' => $Planet['planet'], 'field_current' => $Planet['field_current'], 'field_max' => CalculateMaxPlanetFields($Planet), 'metal' => pretty_number($Planet['metal']), 'crystal' => pretty_number($Planet['crystal']), 'deuterium' => pretty_number($Planet['deuterium']), 'energy_used' => pretty_number($Planet['energy_max'] + $Planet['energy_used']), 'energy_max' => pretty_number($Planet['energy_max']));
        foreach ($reslist['build'] as $gid) {
            $BuildsList[$gid] = pretty_number($Planet[$resource[$gid]]);
        }
        foreach ($reslist['fleet'] as $gid) {
            $FleetsList[$gid] = pretty_number($Planet[$resource[$gid]]);
        }
        foreach ($reslist['defense'] as $gid) {
            $DefensesList[$gid] = pretty_number($Planet[$resource[$gid]]);
        }
        $PlanetsList[] = array('InfoList' => $InfoList, 'BuildsList' => $BuildsList, 'FleetsList' => $FleetsList, 'DefensesList' => $DefensesList);
    }
    foreach ($reslist['tech'] as $gid) {
        $ResearchList[$gid] = pretty_number($USER[$resource[$gid]]);
    }
    $template->assign_vars(array('colspan' => count($PlanetsList) + 1, 'PlanetsList' => $PlanetsList, 'ResearchList' => $ResearchList, 'iv_imperium_title' => $LNG['iv_imperium_title'], 'iv_planet' => $LNG['iv_planet'], 'iv_name' => $LNG['iv_name'], 'iv_coords' => $LNG['iv_coords'], 'iv_fields' => $LNG['iv_fields'], 'iv_resources' => $LNG['iv_resources'], 'Metal' => $LNG['Metal'], 'Crystal' => $LNG['Crystal'], 'Deuterium' => $LNG['Deuterium'], 'Energy' => $LNG['Energy'], 'iv_buildings' => $LNG['iv_buildings'], 'iv_technology' => $LNG['iv_technology'], 'iv_ships' => $LNG['iv_ships'], 'iv_defenses' => $LNG['iv_defenses'], 'tech' => $LNG['tech'], 'build' => $reslist['build'], 'fleet' => $reslist['fleet'], 'defense' => $reslist['defense'], 'research' => $reslist['tech']));
    $template->show("empire_overview.tpl");
}
 public function __construct()
 {
     global $USER, $PLANET, $resource, $reslist, $LNG, $db, $ExtraDM;
     $action = request_var('action', '');
     $Offi = request_var('offi', 0);
     $Extra = request_var('extra', 0);
     $PlanetRess = new ResourceUpdate();
     $PlanetRess->CalcResource();
     if ($action == "send" && $USER['urlaubs_modus'] == 0) {
         if (!empty($Offi) && !CheckModule(8)) {
             $this->UpdateOfficier($Offi);
         } elseif (!empty($Extra) && !CheckModule(18)) {
             $this->UpdateExtra($Extra);
         }
     }
     $PlanetRess->SavePlanetToDB();
     $template = new template();
     $template->loadscript('officier.js');
     $template->page_header();
     $template->page_topnav();
     $template->page_leftmenu();
     $template->page_planetmenu();
     $template->page_footer();
     if (!CheckModule(8)) {
         foreach ($reslist['dmfunc'] as $Element) {
             if ($USER[$resource[$Element]] > TIMESTAMP) {
                 $template->execscript("GetOfficerTime(" . $Element . ", " . ($USER[$resource[$Element]] - TIMESTAMP) . ");");
             }
             $ExtraDMList[] = array('id' => $Element, 'active' => $USER[$resource[$Element]] - TIMESTAMP, 'price' => pretty_number($ExtraDM[$Element]['darkmatter']), 'isok' => $USER['darkmatter'] - $ExtraDM[$Element]['darkmatter'] >= 0 ? true : false, 'time' => pretty_time($ExtraDM[$Element]['time'] * 3600), 'name' => $LNG['tech'][$Element], 'desc' => sprintf($LNG['res']['descriptions'][$Element], $ExtraDM[$Element]['add'] * 100));
         }
     }
     if (!CheckModule(18)) {
         foreach ($reslist['officier'] as $Element) {
             if (($Result = $this->IsOfficierAccessible($Element)) === 0) {
                 continue;
             }
             $OfficierList[] = array('id' => $Element, 'level' => $USER[$resource[$Element]], 'name' => $LNG['tech'][$Element], 'desc' => $LNG['res']['descriptions'][$Element], 'Result' => $Result);
         }
     }
     $template->assign_vars(array('ExtraDMList' => $ExtraDMList, 'OfficierList' => $OfficierList, 'user_darkmatter' => floor($USER['darkmatter'] / DM_PRO_OFFICIER_LEVEL), 'of_max_lvl' => $LNG['of_max_lvl'], 'of_recruit' => $LNG['of_recruit'], 'of_darkmatter' => sprintf($LNG['of_points_per_thousand_darkmatter'], DM_PRO_OFFICIER_LEVEL, $LNG['Darkmatter']), 'of_available_points' => $LNG['of_available_points'], 'alv_points' => $LNG['alv_points'], 'of_lvl' => $LNG['of_lvl'], 'in_dest_durati' => $LNG['in_dest_durati'], 'of_still' => $LNG['of_still'], 'of_active' => $LNG['of_active'], 'of_update' => $LNG['of_update'], 'in_dest_durati' => $LNG['in_dest_durati'], 'of_dm_trade' => sprintf($LNG['of_dm_trade'], $LNG['Darkmatter'])));
     $template->show("officier_overview.tpl");
 }
Exemple #10
0
function ShowBannedPage()
{
    global $USER, $PLANET, $LNG, $db;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $template->page_header();
    $template->page_topnav();
    $template->page_leftmenu();
    $template->page_planetmenu();
    $template->page_footer();
    $query = $db->query("SELECT * FROM " . BANNED . " ORDER BY `id`;");
    while ($u = $db->fetch_array($query)) {
        $PrangerList[] = array('player' => $u['who'], 'theme' => $u['theme'], 'from' => date("d. M Y H:i:s", $u['time']), 'to' => date("d. M Y H:i:s", $u['longer']), 'admin' => $u['author'], 'mail' => $u['email'], 'info' => sprintf($LNG['bn_writemail'], $u['author']));
    }
    $db->free_result($query);
    $template->assign_vars(array('PrangerList' => $PrangerList, 'bn_no_players_banned' => $LNG['bn_no_players_banned'], 'bn_exists' => $LNG['bn_exists'], 'bn_players_banned' => $LNG['bn_players_banned'], 'bn_players_banned_list' => $LNG['bn_players_banned_list'], 'bn_player' => $LNG['bn_player'], 'bn_reason' => $LNG['bn_reason'], 'bn_from' => $LNG['bn_from'], 'bn_until' => $LNG['bn_until'], 'bn_by' => $LNG['bn_by']));
    $template->show("banned_overview.tpl");
}
 public function __construct()
 {
     global $PLANET, $USER, $LNG, $resource, $reslist, $CONF, $db, $pricelist;
     include_once ROOT_PATH . 'includes/functions/IsTechnologieAccessible.' . PHP_EXT;
     include_once ROOT_PATH . 'includes/functions/GetElementPrice.' . PHP_EXT;
     $template = new template();
     $template->page_header();
     $template->page_topnav();
     $template->page_leftmenu();
     $template->page_planetmenu();
     $template->page_footer();
     if ($PLANET[$resource[31]] == 0) {
         $template->message($LNG['bd_lab_required']);
         exit;
     }
     $bContinue = $this->CheckLabSettingsInQueue($PLANET) ? true : false;
     $PLANET[$resource[31] . '_inter'] = $this->CheckAndGetLabLevel($USER, $PLANET);
     $TheCommand = request_var('cmd', '');
     $Element = request_var('tech', 0);
     $PlanetRess = new ResourceUpdate();
     if ($USER['urlaubs_modus'] == 0 && !empty($TheCommand) && $bContinue) {
         switch ($TheCommand) {
             case 'cancel':
                 if (empty($USER['b_tech'])) {
                     break;
                 }
                 $costs = GetBuildingPrice($USER, $PLANET, $USER['b_tech_id']);
                 if ($PLANET['id'] == $USER['b_tech_planet']) {
                     $PLANET['metal'] += $costs['metal'];
                     $PLANET['crystal'] += $costs['crystal'];
                     $PLANET['deuterium'] += $costs['deuterium'];
                 } else {
                     $db->query("UPDATE " . PLANETS . " SET `metal` = `metal` + '" . $costs['metal'] . "', `crystal` = `crystal` + '" . $costs['crystal'] . "', `deuterium` = `deuterium` + '" . $costs['deuterium'] . "' WHERE `id` = '" . $USER['b_tech_planet'] . "';");
                 }
                 $USER['darkmatter'] += $costs['darkmatter'];
                 $USER['b_tech_id'] = 0;
                 $USER['b_tech'] = 0;
                 $USER['b_tech_planet'] = 0;
                 break;
             case 'search':
                 if (!empty($USER['b_tech']) || empty($Element) || !in_array($Element, $reslist['tech']) || $USER[$resource[$Element]] >= $pricelist[$Element]['max'] || !IsTechnologieAccessible($USER, $PLANET, $Element) || !IsElementBuyable($USER, $PLANET, $Element)) {
                     break;
                 }
                 $costs = GetBuildingPrice($USER, $PLANET, $Element);
                 $PLANET['metal'] -= $costs['metal'];
                 $PLANET['crystal'] -= $costs['crystal'];
                 $PLANET['deuterium'] -= $costs['deuterium'];
                 $USER['darkmatter'] -= $costs['darkmatter'];
                 $USER['b_tech_id'] = $Element;
                 $USER['b_tech'] = TIMESTAMP + GetBuildingTime($USER, $PLANET, $Element);
                 $USER['b_tech_planet'] = $PLANET['id'];
                 break;
         }
     }
     $PlanetRess->CalcResource();
     $PlanetRess->SavePlanetToDB();
     $ScriptInfo = array();
     foreach ($reslist['tech'] as $ID => $Element) {
         if (IsTechnologieAccessible($USER, $PLANET, $Element)) {
             $CanBeDone = IsElementBuyable($USER, $PLANET, $Element);
             if (isset($pricelist[$Element]['max']) && $USER[$resource[$Element]] >= $pricelist[$Element]['max']) {
                 $TechnoLink = "<font color=\"#FF0000\">" . $LNG['bd_maxlevel'] . "</font>";
             } elseif ($USER['b_tech_id'] == 0) {
                 $LevelToDo = 1 + $USER[$resource[$Element]];
                 if ($CanBeDone && $this->CheckLabSettingsInQueue($PLANET)) {
                     $TechnoLink = "<a href=\"game.php?page=buildings&amp;mode=research&amp;cmd=search&amp;tech=" . $Element . "\"><font color=\"#00FF00\">" . $LNG['bd_research'] . ($LevelToDo == 1 ? "" : "<br>" . $LNG['bd_lvl'] . " " . $LevelToDo) . "</font></a>";
                 } else {
                     $TechnoLink = "<font color=\"#FF0000\">" . $LNG['bd_research'] . ($LevelToDo == 1 ? "" : "<br>" . $LNG['bd_lvl'] . " " . $LevelToDo) . "</font>";
                 }
             } else {
                 if ($USER['b_tech_id'] == $Element) {
                     if ($USER['b_tech_planet'] == $PLANET['id']) {
                         $template->loadscript('research.js');
                         $ScriptInfo = array('tech_time' => $USER['b_tech'], 'tech_name' => '', 'game_name' => $CONF['game_name'], 'tech_lang' => $LNG['tech'][$USER['b_tech_id']], 'tech_home' => $USER['b_tech_planet'], 'tech_id' => $USER['b_tech_id'], 'bd_cancel' => $LNG['bd_cancel'], 'bd_ready' => $LNG['bd_ready'], 'bd_continue' => $LNG['bd_continue']);
                     } else {
                         $THEPLANET = $db->uniquequery("SELECT `name` FROM " . PLANETS . " WHERE `id` = '" . $USER['b_tech_planet'] . "';");
                         $template->loadscript('research.js');
                         $ScriptInfo = array('tech_time' => $USER['b_tech'], 'tech_name' => $LNG['bd_on'] . '<br>' . $THEPLANET['name'], 'tech_home' => $USER['b_tech_planet'], 'tech_id' => $USER['b_tech_id'], 'game_name' => $CONF['game_name'], 'tech_lang' => $LNG['tech'][$USER['b_tech_id']], 'bd_cancel' => $LNG['bd_cancel'], 'bd_ready' => $LNG['bd_ready'], 'bd_continue' => $LNG['bd_continue']);
                     }
                     $TechnoLink = '<div id="research"></div>';
                 } else {
                     $TechnoLink = '<center>-</center>';
                 }
             }
             $ResearchList[] = array('id' => $Element, 'maxinfo' => isset($pricelist[$Element]['max']) && $pricelist[$Element]['max'] != 255 ? sprintf($LNG['bd_max_lvl'], $pricelist[$Element]['max']) : '', 'name' => $LNG['tech'][$Element], 'descr' => $LNG['res']['descriptions'][$Element], 'price' => GetElementPrice($USER, $PLANET, $Element), 'time' => pretty_time(GetBuildingTime($USER, $PLANET, $Element)), 'restprice' => $this->GetRestPrice($Element), 'elvl' => $Element == 106 ? $USER['rpg_espion'] * ESPION . " (" . $LNG['tech'][610] . ")" : ($Element == 108 ? $USER['rpg_commandant'] * COMMANDANT . " (" . $LNG['tech'][611] . ")" : false), 'lvl' => $USER[$resource[$Element]], 'link' => $TechnoLink);
         }
     }
     $template->assign_vars(array('ResearchList' => $ResearchList, 'IsLabinBuild' => !$bContinue, 'ScriptInfo' => json_encode($ScriptInfo), 'bd_building_lab' => $LNG['bd_building_lab'], 'bd_remaining' => $LNG['bd_remaining'], 'bd_lvl' => $LNG['bd_lvl'], 'fgf_time' => $LNG['fgf_time']));
     $template->show('buildings_research.tpl');
 }
Exemple #12
0
function ShowResourcesPage()
{
    global $LNG, $ProdGrid, $resource, $reslist, $CONF, $db, $ExtraDM, $USER, $PLANET;
    if ($PLANET['planet_type'] == 3 || $USER['urlaubs_modus'] == 1) {
        $CONF['metal_basic_income'] = 0;
        $CONF['crystal_basic_income'] = 0;
        $CONF['deuterium_basic_income'] = 0;
    }
    $SubQry = "";
    if ($_POST && $USER['urlaubs_modus'] == 0) {
        foreach ($_POST as $Field => $Value) {
            $FieldName = $Field . "_porcent";
            if (isset($PLANET[$FieldName]) && in_array($Value, $reslist['procent'])) {
                $Value = $Value / 10;
                $PLANET[$FieldName] = $Value;
                $SubQry .= ", `" . $FieldName . "` = '" . $Value . "'";
            }
        }
        if (isset($SubQry)) {
            $QryUpdatePlanet = "UPDATE " . PLANETS . " SET ";
            $QryUpdatePlanet .= "`id` = '" . $PLANET['id'] . "' ";
            $QryUpdatePlanet .= $SubQry;
            $QryUpdatePlanet .= "WHERE ";
            $QryUpdatePlanet .= "`id` = '" . $PLANET['id'] . "';";
            $db->query($QryUpdatePlanet);
        }
        redirectTo("game.php?page=resources");
        exit;
    }
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $template->page_header();
    $template->page_topnav();
    $template->page_leftmenu();
    $template->page_planetmenu();
    $template->page_footer();
    if ($PLANET['energy_max'] == 0 && $PLANET['energy_used'] > 0) {
        $post_porcent = 0;
    } elseif ($PLANET['energy_max'] > 0 && abs($PLANET['energy_used']) > $PLANET['energy_max']) {
        $post_porcent = floor($PLANET['energy_max'] / ($PLANET['energy_used'] * -1) * 100);
    } elseif ($PLANET['energy_max'] == 0 && abs($PLANET['energy_used']) > $PLANET['energy_max']) {
        $post_porcent = 0;
    } else {
        $post_porcent = 100;
    }
    if ($post_porcent > 100) {
        $post_porcent = 100;
    }
    $BuildTemp = $PLANET['temp_max'];
    $BuildEnergy = $USER[$resource[113]];
    $metal = array();
    $crystal = array();
    $deuterium = array();
    $deu_en = array();
    $energy = array();
    $energy_en = array();
    foreach ($reslist['prod'] as $ProdID) {
        if ($PLANET[$resource[$ProdID]] > 0 && isset($ProdGrid[$ProdID])) {
            $BuildLevelFactor = $PLANET[$resource[$ProdID] . "_porcent"];
            $BuildLevel = $PLANET[$resource[$ProdID]];
            $metal[$ProdID] = floor(eval($ProdGrid[$ProdID]['formule']['metal']) * (0.01 * $post_porcent) * $CONF['resource_multiplier']);
            $crystal[$ProdID] = floor(eval($ProdGrid[$ProdID]['formule']['crystal']) * (0.01 * $post_porcent) * $CONF['resource_multiplier']);
            if ($ProdID < 4) {
                $deuterium[$ProdID] = floor(eval($ProdGrid[$ProdID]['formule']['deuterium']) * (0.01 * $post_porcent) * $CONF['resource_multiplier']);
                $energy[$ProdID] = floor(eval($ProdGrid[$ProdID]['formule']['energy']) * $CONF['resource_multiplier']);
            } else {
                if ($ProdID == 12 && $PLANET['deuterium'] == 0) {
                    continue;
                }
                $deu_en[$ProdID] = floor(eval($ProdGrid[$ProdID]['formule']['deuterium']) * $CONF['resource_multiplier']);
                $energy_en[$ProdID] = floor(eval($ProdGrid[$ProdID]['formule']['energy']) * $CONF['resource_multiplier']);
            }
            $thisdeu = isset($deuterium[$ProdID]) ? $deuterium[$ProdID] : $deu_en[$ProdID];
            $thisenergy = isset($energy[$ProdID]) ? $energy[$ProdID] : $energy_en[$ProdID];
            $CurrPlanetList[] = array('name' => $resource[$ProdID], 'type' => $LNG['tech'][$ProdID], 'level' => $ProdID > 200 ? $LNG['rs_amount'] : $LNG['rs_lvl'], 'level_type' => $PLANET[$resource[$ProdID]], 'metal_type' => colorNumber(pretty_number($metal[$ProdID])), 'crystal_type' => colorNumber(pretty_number($crystal[$ProdID])), 'deuterium_type' => colorNumber(pretty_number($thisdeu)), 'energy_type' => colorNumber(pretty_number($thisenergy)), 'optionsel' => $PLANET[$resource[$ProdID] . "_porcent"] * 10);
        }
    }
    $metal_total = $PLANET['metal_perhour'] + $CONF['metal_basic_income'] * $CONF['resource_multiplier'];
    $crystal_total = $PLANET['crystal_perhour'] + $CONF['crystal_basic_income'] * $CONF['resource_multiplier'];
    $deuterium_total = $PLANET['deuterium_perhour'] + $CONF['deuterium_basic_income'] * $CONF['resource_multiplier'];
    $energy_total = $PLANET['energy_max'] + $CONF['energy_basic_income'] * $CONF['resource_multiplier'] - abs($PLANET['energy_used']);
    foreach ($reslist['procent'] as $procent) {
        $OptionSelector[$procent] = $procent . "%";
    }
    $template->assign_vars(array('bonus_metal' => colorNumber(pretty_number(array_sum($metal) * ($USER['rpg_geologue'] * GEOLOGUE + $USER['metal_proc_tech'] * 0.02 + (TIMESTAMP - $USER[$resource[703]] <= 0 ? $ExtraDM[703]['add'] : 0)))), 'bonus_crystal' => colorNumber(pretty_number(array_sum($crystal) * ($USER['rpg_geologue'] * GEOLOGUE + $USER['crystal_proc_tech'] * 0.02 + (TIMESTAMP - $USER[$resource[703]] <= 0 ? $ExtraDM[703]['add'] : 0)))), 'bonus_deuterium' => colorNumber(pretty_number(array_sum($deuterium) * ($USER['rpg_geologue'] * GEOLOGUE + $USER['deuterium_proc_tech'] * 0.02 + (TIMESTAMP - $USER[$resource[703]] <= 0 ? $ExtraDM[703]['add'] : 0)))), 'bonus_energy' => colorNumber(pretty_number(array_sum($energy_en) * ($USER['rpg_ingenieur'] * INGENIEUR + (TIMESTAMP - $USER[$resource[704]] <= 0 ? $ExtraDM[704]['add'] : 0)))), 'CurrPlanetList' => $CurrPlanetList, 'Production_of_resources_in_the_planet' => str_replace('%s', $PLANET['name'], $LNG['rs_production_on_planet']), 'metal_basic_income' => $CONF['metal_basic_income'] * $CONF['resource_multiplier'], 'crystal_basic_income' => $CONF['crystal_basic_income'] * $CONF['resource_multiplier'], 'deuterium_basic_income' => $CONF['deuterium_basic_income'] * $CONF['resource_multiplier'], 'energy_basic_income' => $CONF['energy_basic_income'] * $CONF['resource_multiplier'], 'metalmax' => colorNumber($PLANET['metal_max'] / 1000, pretty_number($PLANET['metal_max'] / 1000) . "k"), 'crystalmax' => colorNumber($PLANET['crystal_max'] / 1000, pretty_number($PLANET['crystal_max'] / 1000) . "k"), 'deuteriummax' => colorNumber($PLANET['deuterium_max'] / 1000, pretty_number($PLANET['deuterium_max'] / 1000) . "k"), 'metal_total' => colorNumber(pretty_number($metal_total)), 'crystal_total' => colorNumber(pretty_number($crystal_total)), 'option' => $OptionSelector, 'deuterium_total' => colorNumber(pretty_number($deuterium_total)), 'energy_total' => colorNumber(pretty_number($energy_total)), 'daily_metal' => colorNumber(pretty_number(floor($metal_total * 24))), 'weekly_metal' => colorNumber(pretty_number(floor($metal_total * 24 * 7))), 'daily_crystal' => colorNumber(pretty_number(floor($crystal_total * 24))), 'weekly_crystal' => colorNumber(pretty_number(floor($crystal_total * 24 * 7))), 'daily_deuterium' => colorNumber(pretty_number(floor($deuterium_total * 24))), 'weekly_deuterium' => colorNumber(pretty_number(floor($deuterium_total * 24 * 7))), 'Metal' => $LNG['Metal'], 'Crystal' => $LNG['Crystal'], 'Deuterium' => $LNG['Deuterium'], 'Energy' => $LNG['Energy'], 'rs_basic_income' => $LNG['rs_basic_income'], 'rs_storage_capacity' => $LNG['rs_storage_capacity'], 'rs_sum' => $LNG['rs_sum'], 'rs_daily' => $LNG['rs_daily'], 'rs_weekly' => $LNG['rs_weekly'], 'rs_calculate' => $LNG['rs_calculate'], 'rs_ress_bonus' => $LNG['rs_ress_bonus']));
    $template->show("resources_overview.tpl");
}
 public function DefensesBuildingPage()
 {
     global $USER, $PLANET, $LNG, $resource, $dpath, $reslist;
     include_once ROOT_PATH . 'includes/functions/IsTechnologieAccessible.' . PHP_EXT;
     include_once ROOT_PATH . 'includes/functions/GetElementPrice.' . PHP_EXT;
     $template = new template();
     if ($PLANET[$resource[21]] == 0) {
         $template->message($LNG['bd_shipyard_required']);
         exit;
     }
     $fmenge = $_POST['fmenge'];
     $cancel = $_POST['auftr'];
     $action = request_var('action', '');
     $PlanetRess = new ResourceUpdate();
     $PlanetRess->CalcResource();
     $NotBuilding = true;
     if (!empty($PLANET['b_building_id'])) {
         $CurrentQueue = $PLANET['b_building_id'];
         $QueueArray = explode(";", $CurrentQueue);
         for ($i = 0; $i < count($QueueArray); $i++) {
             $ListIDArray = explode(",", $QueueArray[$i]);
             if ($ListIDArray[0] == 21 || $ListIDArray[0] == 15) {
                 $NotBuilding = false;
             }
         }
     }
     if (isset($fmenge) && $NotBuilding == true && $USER['urlaubs_modus'] == 0) {
         $ebuild = explode(";", $PLANET['b_hangar_id']);
         if (count($ebuild) - 1 >= MAX_FLEET_OR_DEFS_IN_BUILD) {
             $template->message(sprintf($LNG['bd_max_builds'], MAX_FLEET_OR_DEFS_IN_BUILD), "?page=buildings&mode=fleet", 3);
             exit;
         }
         $Missiles[502] = $PLANET[$resource[502]];
         $Missiles[503] = $PLANET[$resource[503]];
         $SiloSize = $PLANET[$resource[44]];
         $MaxMissiles = $SiloSize * 10;
         $BuildQueue = $PLANET['b_hangar_id'];
         $BuildArray = explode(";", $BuildQueue);
         for ($QElement = 0; $QElement < count($BuildArray); $QElement++) {
             $ElmentArray = explode(",", $BuildArray[$QElement]);
             $Missiles[$ElmentArray[0]] += $ElmentArray[1];
         }
         foreach ($fmenge as $Element => $Count) {
             $Element = in_array($Element, $reslist['defense']) ? $Element : NULL;
             $Count = is_numeric($Count) ? $Count : 0;
             $Count = max(min($Count, MAX_FLEET_OR_DEFS_PER_ROW), 0);
             $MaxElements = $this->GetMaxConstructibleElements($Element);
             if (empty($Element) || empty($Count) || empty($MaxElements) || !IsTechnologieAccessible($USER, $PLANET, $Element)) {
                 continue;
             }
             if ($Element == 502 || $Element == 503) {
                 $ActuMissiles = $Missiles[502] + 2 * $Missiles[503];
                 $MissilesSpace = $MaxMissiles - $ActuMissiles;
                 if ($Element == 502) {
                     $Count = min($Count, $MissilesSpace);
                 } else {
                     $Count = min($Count, floor($MissilesSpace / 2));
                 }
                 $Count = min($Count, $MaxElements);
                 $Missiles[$Element] += $Count;
             } elseif (in_array($Element, $reslist['one'])) {
                 $Count = $PLANET[$resource[$Element]] == 0 && strpos($PLANET['b_hangar_id'], $Element . ',') === false ? 1 : 0;
             } else {
                 $Count = min($Count, $MaxElements);
             }
             if ($Count < 1) {
                 continue;
             }
             $Ressource = $this->GetElementRessources($Element, $Count);
             $PLANET['metal'] -= $Ressource['metal'];
             $PLANET['crystal'] -= $Ressource['crystal'];
             $PLANET['deuterium'] -= $Ressource['deuterium'];
             $USER['darkmatter'] -= $Ressource['darkmatter'];
             $PLANET['b_hangar_id'] .= $Element . ',' . floattostring($Count) . ';';
         }
     }
     if ($action == "delete" && is_array($cancel) && $USER['urlaubs_modus'] == 0) {
         $this->CancelAuftr($cancel);
     }
     $PlanetRess->SavePlanetToDB();
     if (!empty($PLANET['b_hangar_id'])) {
         $template->loadscript('bcmath.js');
         $template->loadscript('shipyard.js');
         $template->execscript("ShipyardList();BuildlistShipyard();");
     }
     $template->page_header();
     $template->page_topnav();
     $template->page_leftmenu();
     $template->page_planetmenu();
     $template->page_footer();
     foreach ($reslist['defense'] as $Element) {
         if (!IsTechnologieAccessible($USER, $PLANET, $Element)) {
             continue;
         }
         $DefenseList[] = array('id' => $Element, 'name' => $LNG['tech'][$Element], 'descriptions' => $LNG['res']['descriptions'][$Element], 'price' => GetElementPrice($USER, $PLANET, $Element, false), 'restprice' => $this->GetRestPrice($Element), 'time' => pretty_time(GetBuildingTime($USER, $PLANET, $Element)), 'IsAvailable' => IsElementBuyable($USER, $PLANET, $Element, false), 'Available' => pretty_number($PLANET[$resource[$Element]]), 'AlreadyBuild' => in_array($Element, $reslist['one']) && (strpos($PLANET['b_hangar_id'], $Element . ",") !== false || $PLANET[$resource[$Element]] != 0) ? true : false);
     }
     if (!empty($PLANET['b_hangar_id'])) {
         $ElementQueue = explode(';', $PLANET['b_hangar_id']);
         $NbrePerType = "";
         $NamePerType = "";
         $TimePerType = "";
         foreach ($ElementQueue as $ElementLine => $Element) {
             if ($Element != '') {
                 $Element = explode(',', $Element);
                 $ElementTime = GetBuildingTime($USER, $PLANET, $Element[0]);
                 $QueueTime += $ElementTime * $Element[1];
                 $TimePerType .= $ElementTime . ',';
                 $NamePerType .= "'" . html_entity_decode($LNG['tech'][$Element[0]], ENT_NOQUOTES, "UTF-8") . "',";
                 $NbrePerType .= "'" . $Element[1] . "',";
             }
         }
         $template->assign_vars(array('a' => $NbrePerType, 'b' => $NamePerType, 'c' => $TimePerType, 'b_hangar_id_plus' => $PLANET['b_hangar'], 'pretty_time_b_hangar' => pretty_time(max($QueueTime - $PLANET['b_hangar'], 0)), 'bd_completed' => $LNG['bd_completed'], 'bd_cancel_warning' => $LNG['bd_cancel_warning'], 'bd_cancel_send' => $LNG['bd_cancel_send'], 'bd_actual_production' => $LNG['bd_actual_production'], 'bd_operating' => $LNG['bd_operating']));
         $Buildlist = $template->fetch('shipyard_buildlist.tpl');
     }
     $template->assign_vars(array('DefenseList' => $DefenseList, 'NotBuilding' => $NotBuilding, 'bd_available' => $LNG['bd_available'], 'bd_remaining' => $LNG['bd_remaining'], 'fgf_time' => $LNG['fgf_time'], 'bd_build_ships' => $LNG['bd_build_ships'], 'bd_building_shipyard' => $LNG['bd_building_shipyard'], 'bd_protection_shield_only_one' => $LNG['bd_protection_shield_only_one'], 'BuildList' => $Buildlist, 'maxlength' => strlen(MAX_FLEET_OR_DEFS_PER_ROW)));
     $template->show("shipyard_defense.tpl");
 }
Exemple #14
0
function ShowTraderPage()
{
    global $USER, $PLANET, $LNG, $db;
    $ress = request_var('ress', '');
    $action = request_var('action', '');
    $metal = round(request_var('metal', 0.0), 0);
    $crystal = round(request_var('crystal', 0.0), 0);
    $deut = round(request_var('deuterium', 0.0), 0);
    $PlanetRess = new ResourceUpdate();
    $template = new template();
    $template->loadscript("trader.js");
    $template->page_topnav();
    $template->page_header();
    $template->page_leftmenu();
    $template->page_planetmenu();
    $template->page_footer();
    if ($ress != '') {
        switch ($ress) {
            case 'metal':
                if ($action == "trade") {
                    if ($USER['darkmatter'] < DARKMATTER_FOR_TRADER) {
                        $template->message(sprintf($LNG['tr_empty_darkmatter'], $LNG['Darkmatter']), "game." . PHP_EXT . "?page=trader", 1);
                    } elseif ($crystal < 0 || $deut < 0) {
                        $template->message($LNG['tr_only_positive_numbers'], "game." . PHP_EXT . "?page=trader", 1);
                    } else {
                        $trade = $crystal * 2 + $deut * 4;
                        $PlanetRess->CalcResource();
                        if ($PLANET['metal'] > $trade) {
                            $PLANET['metal'] -= $trade;
                            $PLANET['crystal'] += $crystal;
                            $PLANET['deuterium'] += $deut;
                            $USER['darkmatter'] -= DARKMATTER_FOR_TRADER;
                            $template->message($LNG['tr_exchange_done'], "game." . PHP_EXT . "?page=trader", 1);
                        } else {
                            $template->message($LNG['tr_not_enought_metal'], "game." . PHP_EXT . "?page=trader", 1);
                        }
                        $PlanetRess->SavePlanetToDB();
                    }
                } else {
                    $template->assign_vars(array('tr_resource' => $LNG['tr_resource'], 'tr_sell_metal' => $LNG['tr_sell_metal'], 'tr_amount' => $LNG['tr_amount'], 'tr_exchange' => $LNG['tr_exchange'], 'tr_quota_exchange' => $LNG['tr_quota_exchange'], 'Metal' => $LNG['Metal'], 'Crystal' => $LNG['Crystal'], 'Deuterium' => $LNG['Deuterium'], 'mod_ma_res_a' => "2", 'mod_ma_res_b' => "4", 'ress' => $ress));
                    $template->show("trader_metal.tpl");
                }
                break;
            case 'crystal':
                if ($action == "trade") {
                    if ($USER['darkmatter'] < DARKMATTER_FOR_TRADER) {
                        $template->message(sprintf($LNG['tr_empty_darkmatter'], $LNG['Darkmatter']), "game." . PHP_EXT . "?page=trader", 1);
                    } elseif ($metal < 0 || $deut < 0) {
                        $template->message($LNG['tr_only_positive_numbers'], "game." . PHP_EXT . "?page=trader", 1);
                    } else {
                        $trade = $metal * 0.5 + $deut * 2;
                        $PlanetRess->CalcResource();
                        if ($PLANET['crystal'] > $trade) {
                            $PLANET['metal'] += $metal;
                            $PLANET['crystal'] -= $trade;
                            $PLANET['deuterium'] += $deut;
                            $USER['darkmatter'] -= DARKMATTER_FOR_TRADER;
                            $template->message($LNG['tr_exchange_done'], "game." . PHP_EXT . "?page=trader", 1);
                        } else {
                            $template->message($LNG['tr_not_enought_crystal'], "game." . PHP_EXT . "?page=trader", 1);
                        }
                        $PlanetRess->SavePlanetToDB();
                    }
                } else {
                    $template->assign_vars(array('tr_resource' => $LNG['tr_resource'], 'tr_sell_crystal' => $LNG['tr_sell_crystal'], 'tr_amount' => $LNG['tr_amount'], 'tr_exchange' => $LNG['tr_exchange'], 'tr_quota_exchange' => $LNG['tr_quota_exchange'], 'Metal' => $LNG['Metal'], 'Crystal' => $LNG['Crystal'], 'Deuterium' => $LNG['Deuterium'], 'mod_ma_res_a' => "0.5", 'mod_ma_res_b' => "2", 'ress' => $ress));
                    $template->show("trader_crystal.tpl");
                }
                break;
            case 'deuterium':
                if ($action == "trade") {
                    if ($USER['darkmatter'] < DARKMATTER_FOR_TRADER) {
                        $template->message(sprintf($LNG['tr_empty_darkmatter'], $LNG['Darkmatter']), "game." . PHP_EXT . "?page=trader", 1);
                    } elseif ($metal < 0 || $crystal < 0) {
                        message($LNG['tr_only_positive_numbers'], "game." . PHP_EXT . "?page=trader", 1);
                    } else {
                        $trade = $metal * 0.25 + $crystal * 0.5;
                        $PlanetRess->CalcResource();
                        if ($PLANET['deuterium'] > $trade) {
                            $PLANET['metal'] += $metal;
                            $PLANET['crystal'] += $crystal;
                            $PLANET['deuterium'] -= $trade;
                            $USER['darkmatter'] -= DARKMATTER_FOR_TRADER;
                            $template->message($LNG['tr_exchange_done'], "game." . PHP_EXT . "?page=trader", 1);
                        } else {
                            $template->message($LNG['tr_not_enought_deuterium'], "game." . PHP_EXT . "?page=trader", 1);
                        }
                        $PlanetRess->SavePlanetToDB();
                    }
                } else {
                    $template->assign_vars(array('tr_resource' => $LNG['tr_resource'], 'tr_sell_deuterium' => $LNG['tr_sell_deuterium'], 'tr_amount' => $LNG['tr_amount'], 'tr_exchange' => $LNG['tr_exchange'], 'tr_quota_exchange' => $LNG['tr_quota_exchange'], 'Metal' => $LNG['Metal'], 'Crystal' => $LNG['Crystal'], 'Deuterium' => $LNG['Deuterium'], 'mod_ma_res_a' => "0.25", 'mod_ma_res_b' => "0.5", 'ress' => $ress));
                    $template->show("trader_deuterium.tpl");
                }
                break;
        }
    } else {
        $PlanetRess->CalcResource();
        $PlanetRess->SavePlanetToDB();
        $template->assign_vars(array('tr_cost_dm_trader' => sprintf($LNG['tr_cost_dm_trader'], pretty_number(DARKMATTER_FOR_TRADER), $LNG['Darkmatter']), 'tr_call_trader_who_buys' => $LNG['tr_call_trader_who_buys'], 'tr_call_trader' => $LNG['tr_call_trader'], 'tr_exchange_quota' => $LNG['tr_exchange_quota'], 'tr_call_trader_submit' => $LNG['tr_call_trader_submit'], 'Metal' => $LNG['Metal'], 'Crystal' => $LNG['Crystal'], 'Deuterium' => $LNG['Deuterium']));
        $template->show("trader_overview.tpl");
    }
}
Exemple #15
0
function ShowBattleSimPage()
{
    global $USER, $PLANET, $reslist, $pricelist, $LNG, $db;
    $action = request_var('action', '');
    $Slots = request_var('slots', 1);
    if (isset($_REQUEST['im'])) {
        $Array = $_REQUEST['im'];
        foreach ($Array as $ID => $Count) {
            $BattleArray[0][1][$ID] = $Count;
        }
    } else {
        $BattleArray = $_REQUEST['battleinput'];
    }
    if ($action == 'send') {
        $Counts = array(0, 0);
        foreach ($BattleArray as $BattleSlotID => $BattleSlot) {
            if (isset($BattleSlot[0]) && (array_sum($BattleSlot[0]) > 0 || $BattleSlotID == 0)) {
                $Att = mt_rand(1, 1000);
                $attack[$Att]['fleet'] = array('fleet_start_galaxy' => 1, 'fleet_start_system' => 33, 'fleet_start_planet' => 7, 'fleet_end_galaxy' => 1, 'fleet_end_system' => 33, 'fleet_end_planet' => 7, 'metal' => 0, 'crystal' => 0, 'deuterium' => 0);
                $attack[$Att]['user'] = array('username' => $LNG['bs_atter'] . ' Nr.' . ($BattleSlotID + 1), 'military_tech' => $BattleSlot[0][109], 'defence_tech' => $BattleSlot[0][110], 'shield_tech' => $BattleSlot[0][111], 0, 'dm_defensive' => 0, 'dm_attack' => 0);
                foreach ($BattleSlot[0] as $ID => $Count) {
                    if (!in_array($ID, $reslist['fleet']) || $BattleSlot[0][$ID] <= 0) {
                        unset($BattleSlot[0][$ID]);
                    }
                }
                if ($Counts[0] == 0 && $BattleSlotID != 0) {
                    exit('ERROR');
                }
                $Counts[0] = $Counts[0] + array_sum($BattleSlot[1]);
                $attack[$Att]['detail'] = $BattleSlot[0];
            }
            if (isset($BattleSlot[1]) && (array_sum($BattleSlot[1]) > 0 || $BattleSlotID == 0)) {
                $Def = mt_rand(1, 1000);
                $defense[$Def]['fleet'] = array('fleet_start_galaxy' => 1, 'fleet_start_system' => 33, 'fleet_start_planet' => 7, 'fleet_end_galaxy' => 1, 'fleet_end_system' => 33, 'fleet_end_planet' => 7, 'metal' => 0, 'crystal' => 0, 'deuterium' => 0);
                $defense[$Def]['user'] = array('username' => $LNG['bs_deffer'] . ' Nr.' . ($BattleSlotID + 1), 'military_tech' => $BattleSlot[1][109], 'defence_tech' => $BattleSlot[1][110], 'shield_tech' => $BattleSlot[1][111], 0, 'dm_defensive' => 0, 'dm_attack' => 0);
                foreach ($BattleSlot[1] as $ID => $Count) {
                    if (!in_array($ID, $reslist['fleet']) && !in_array($ID, $reslist['defense'])) {
                        unset($BattleSlot[1][$ID]);
                    }
                }
                if ($Countd[1] == 0 && $BattleSlotID != 0) {
                    exit('ERROR');
                }
                $Countd[1] = $Countd[1] + array_sum($BattleSlot[1]);
                $defense[$Def]['def'] = $BattleSlot[1];
            }
        }
        includeLang('FLEET');
        require_once ROOT_PATH . 'includes/classes/missions/calculateAttack.' . PHP_EXT;
        require_once ROOT_PATH . 'includes/classes/missions/calculateSteal.' . PHP_EXT;
        require_once ROOT_PATH . 'includes/classes/missions/GenerateReport.' . PHP_EXT;
        $start = microtime(true);
        $result = calculateAttack($attack, $defense);
        $totaltime = microtime(true) - $start;
        if ($result['won'] == "a") {
            $steal = calculateSteal($attack, array('metal' => $BattleArray[0][1][1], 'crystal' => $BattleArray[0][1][2], 'deuterium' => $BattleArray[0][1][3]), true);
        } else {
            $steal = array('metal' => 0, 'crystal' => 0, 'deuterium' => 0);
        }
        $FleetDebris = $result['debree']['att'][0] + $result['debree']['def'][0] + $result['debree']['att'][1] + $result['debree']['def'][1];
        $StrAttackerUnits = sprintf($LNG['sys_attacker_lostunits'], $result['lost']['att']);
        $StrDefenderUnits = sprintf($LNG['sys_defender_lostunits'], $result['lost']['def']);
        $StrRuins = sprintf($LNG['sys_gcdrunits'], $result['debree']['def'][0] + $result['debree']['att'][0], $LNG['Metal'], $result['debree']['def'][1] + $result['debree']['att'][1], $LNG['Crystal']);
        $DebrisField = $StrAttackerUnits . "<br>" . $StrDefenderUnits . "<br>" . $StrRuins;
        $MoonChance = min(round($FleetDebris / 100000, 0), 20);
        $AllSteal = array_sum($steal);
        $RaportInfo = sprintf($LNG['bs_derbis_raport'], ceil($FleetDebris / $pricelist[219]['capacity']), $LNG['tech'][219], ceil($FleetDebris / $pricelist[209]['capacity']), $LNG['tech'][209]) . "<br>";
        $RaportInfo .= sprintf($LNG['bs_steal_raport'], ceil($AllSteal / $pricelist[202]['capacity']), $LNG['tech'][202], ceil($AllSteal / $pricelist[203]['capacity']), $LNG['tech'][203], ceil($AllSteal / $pricelist[217]['capacity']), $LNG['tech'][217]) . "<br>";
        $INFO['moon']['battlesim'] = $RaportInfo;
        $INFO['steal'] = $steal;
        $INFO['fleet_start_time'] = TIMESTAMP;
        $INFO['moon']['des'] = 0;
        $INFO['moon']['chance'] = $MoonChance;
        $raport = GenerateReport($result, $INFO);
        $rid = md5(microtime(true));
        file_put_contents(ROOT_PATH . 'raports/raport_' . $rid . '.php', '<?php' . "\n" . '$raport = ' . $raport . ';' . "\n" . '?>');
        $SQLQuery = "INSERT INTO " . RW . " SET ";
        $SQLQuery .= "`time` = '" . TIMESTAMP . "', ";
        $SQLQuery .= "`owners` = '" . $USER['id'] . ",0', ";
        $SQLQuery .= "`rid` = '" . $rid . "', ";
        $SQLQuery .= "`raport` = '';";
        $db->query($SQLQuery);
        echo $rid;
        exit;
    }
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    foreach ($reslist['fleet'] as $ID) {
        $GetFleet[$ID] = $LNG['tech'][$ID];
    }
    foreach ($reslist['defense'] as $ID) {
        if ($ID >= 501) {
            break;
        }
        $GetDef[$ID] = $LNG['tech'][$ID];
    }
    $template = new template();
    $template->loadscript('battlesim.js');
    $template->page_header();
    $template->page_topnav();
    $template->page_leftmenu();
    $template->page_planetmenu();
    $template->page_footer();
    $template->assign_vars(array('lm_battlesim' => $LNG['lm_battlesim'], 'bs_names' => $LNG['bs_names'], 'bs_atter' => $LNG['bs_atter'], 'bs_deffer' => $LNG['bs_deffer'], 'bs_steal' => $LNG['bs_steal'], 'bs_techno' => $LNG['bs_techno'], 'bs_send' => $LNG['bs_send'], 'bs_cancel' => $LNG['bs_cancel'], 'bs_wait' => $LNG['bs_wait'], 'Metal' => $LNG['Metal'], 'Crystal' => $LNG['Crystal'], 'Deuterium' => $LNG['Deuterium'], 'attack_tech' => $LNG['tech'][109], 'shield_tech' => $LNG['tech'][110], 'tank_tech' => $LNG['tech'][111], 'GetFleet' => $GetFleet, 'GetDef' => $GetDef, 'Slots' => $Slots, 'battleinput' => $BattleArray));
    $template->show("battlesim.tpl");
}
Exemple #16
0
function ShowOverviewPage()
{
    global $CONF, $LNG, $PLANET, $USER, $db, $resource;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $template->getplanets();
    $AdminsOnline = $AllPlanets = $Moon = array();
    foreach ($template->UserPlanets as $ID => $CPLANET) {
        if ($ID == $_SESSION['planet'] || $CPLANET['planet_type'] == 3) {
            continue;
        }
        if (!empty($CPLANET['b_building']) && $CPLANET['b_building'] > TIMESTAMP) {
            $Queue = explode(';', $CPLANET['b_building_id']);
            $CurrBuild = explode(',', $Queue[0]);
            $BuildPlanet = $LNG['tech'][$CurrBuild[0]] . " (" . $CurrBuild[1] . ")<br><span style=\"color:#7F7F7F;\">(" . pretty_time($CurrBuild[3] - TIMESTAMP) . ")</span>";
        } else {
            $BuildPlanet = $LNG['ov_free'];
        }
        $AllPlanets[] = array('id' => $CPLANET['id'], 'name' => $CPLANET['name'], 'image' => $CPLANET['image'], 'build' => $BuildPlanet);
    }
    if ($PLANET['id_luna'] != 0) {
        $Moon = $db->uniquequery("SELECT `id`, `name` FROM " . PLANETS . " WHERE `id` = '" . $PLANET['id_luna'] . "';");
    }
    if (!empty($PLANET['b_building'])) {
        $Queue = explode(';', $PLANET['b_building_id']);
        $CurrBuild = explode(',', $Queue[0]);
        $Build = $LNG['tech'][$CurrBuild[0]] . ' (' . $CurrBuild[1] . ')<br><div id="blc">"' . pretty_time($PLANET['b_building'] - TIMESTAMP) . '</div>';
        $template->execscript('BuildTime();');
    } else {
        $Build = $LNG['ov_free'];
    }
    $Teamspeak = '';
    if ($CONF['ts_modon'] == 1) {
        if ($CONF['ts_version'] == 2) {
            include_once ROOT_PATH . "includes/libs/teamspeak/class.teamspeak2." . PHP_EXT;
            $ts = new cyts();
            if ($ts->connect($CONF['ts_server'], $CONF['ts_tcpport'], $CONF['ts_udpport'], $CONF['ts_timeout'])) {
                $tsdata = $ts->info_serverInfo();
                $tsdata2 = $ts->info_globalInfo();
                $ts->disconnect();
                $trafges = pretty_number($tsdata2["total_bytessend"] / 1024 / 1024 + $tsdata2["total_bytesreceived"] / 1024 / 1024);
                $Teamspeak = sprintf($LNG['ov_teamspeak_v2'], $CONF['ts_server'], $CONF['ts_udpport'], $USER['username'], $tsdata["server_currentusers"], $tsdata["server_maxusers"], $tsdata["server_currentchannels"], $trafges);
            } else {
                $Teamspeak = $LNG['ov_teamspeak_not_online'];
            }
        } elseif ($CONF['ts_version'] == 3) {
            $ip = $CONF['ts_server'];
            $port = $CONF['ts_tcpport'];
            $t_port = $CONF['ts_udpport'];
            $sid = $CONF['ts_timeout'];
            require_once ROOT_PATH . "includes/libs/teamspeak/class.teamspeak3." . PHP_EXT;
            $tsAdmin = new ts3admin($ip, $t_port);
            if ($tsAdmin->connect()) {
                $tsAdmin->selectServer($sid);
                #$tsAdmin->login($username, $password); Insert the SA Account Details, if Teamspeak banned you.
                $sinfo = $tsAdmin->serverInfo();
                $tsAdmin->logout();
                $tsAdmin->quit();
                $trafges = round($sinfo['connection_bytes_received_total'] / 1024 / 1024 + $sinfo['connection_bytes_sent_total'] / 1024 / 1024, 2);
                $Debug = $tsAdmin->getDebugLog();
                if ($Debug == "Error while fetching: 'error id=518 msg=not logged in'<br>") {
                    $Teamspeak = sprintf($LNG['ov_teamspeak_v3'], $ip, $port, $USER['username'], $sinfo['virtualserver_password'], $sinfo['virtualserver_clientsonline'] - 1, $sinfo['virtualserver_maxclients'], $sinfo['virtualserver_channelsonline'], $trafges);
                } else {
                    $Teamspeak = $Debug;
                }
            } else {
                $Teamspeak = $LNG['ov_teamspeak_not_online'];
            }
        }
    }
    $OnlineAdmins = $db->query("SELECT `id`,`username` FROM " . USERS . " WHERE `onlinetime` >= '" . (TIMESTAMP - 10 * 60) . "' AND `authlevel` > '0';");
    while ($AdminRow = $db->fetch_array($OnlineAdmins)) {
        $AdminsOnline[$AdminRow['id']] = $AdminRow['username'];
    }
    $db->free_result($OnlineAdmins);
    $template->loadscript('mbContainer.js');
    $template->loadscript('overview.js');
    $template->execscript('GetFleets(true);');
    $template->page_header();
    $template->page_topnav();
    $template->page_leftmenu();
    $template->page_planetmenu();
    $template->page_footer();
    $template->assign_vars(array('user_rank' => sprintf($LNG['ov_userrank_info'], pretty_number($USER['total_points']), $LNG['ov_place'], $USER['total_rank'], $USER['total_rank'], $LNG['ov_of'], $CONF['users_amount']), 'is_news' => $CONF['OverviewNewsFrame'], 'news' => makebr($CONF['OverviewNewsText']), 'planetname' => $PLANET['name'], 'planetimage' => $PLANET['image'], 'galaxy' => $PLANET['galaxy'], 'system' => $PLANET['system'], 'planet' => $PLANET['planet'], 'buildtime' => $PLANET['b_building'], 'userid' => $USER['id'], 'username' => $USER['username'], 'build' => $Build, 'Moon' => $Moon, 'AllPlanets' => $AllPlanets, 'AdminsOnline' => $AdminsOnline, 'Teamspeak' => $Teamspeak, 'messages' => $USER['new_message'] > 0 ? $USER['new_message'] == 1 ? $LNG['ov_have_new_message'] : sprintf($LNG['ov_have_new_messages'], pretty_number($USER['new_message'])) : false, 'planet_diameter' => pretty_number($PLANET['diameter']), 'planet_field_current' => $PLANET['field_current'], 'planet_field_max' => CalculateMaxPlanetFields($PLANET), 'planet_temp_min' => $PLANET['temp_min'], 'planet_temp_max' => $PLANET['temp_max'], 'ov_news' => $LNG['ov_news'], 'fcm_moon' => $LNG['fcm_moon'], 'ov_server_time' => $LNG['ov_server_time'], 'ov_planet' => $LNG['ov_planet'], 'ov_planetmenu' => $LNG['ov_planetmenu'], 'ov_diameter' => $LNG['ov_diameter'], 'ov_distance_unit' => $LNG['ov_distance_unit'], 'ov_developed_fields' => $LNG['ov_developed_fields'], 'ov_max_developed_fields' => $LNG['ov_max_developed_fields'], 'ov_fields' => $LNG['ov_fields'], 'ov_temperature' => $LNG['ov_temperature'], 'ov_aprox' => $LNG['ov_aprox'], 'ov_temp_unit' => $LNG['ov_temp_unit'], 'ov_to' => $LNG['ov_to'], 'ov_position' => $LNG['ov_position'], 'ov_points' => $LNG['ov_points'], 'ov_events' => $LNG['ov_events'], 'ov_admins_online' => $LNG['ov_admins_online'], 'ov_no_admins_online' => $LNG['ov_no_admins_online'], 'ov_userbanner' => $LNG['ov_userbanner'], 'ov_teamspeak' => $LNG['ov_teamspeak'], 'ov_your_planet' => $LNG['ov_your_planet'], 'ov_coords' => $LNG['ov_coords'], 'ov_planet_name' => $LNG['ov_planet_name'], 'ov_actions' => $LNG['ov_actions'], 'ov_abandon_planet' => $LNG['ov_abandon_planet'], 'ov_planet_rename' => $LNG['ov_planet_rename'], 'ov_planet_rename_action' => $LNG['ov_planet_rename_action'], 'ov_password' => $LNG['ov_password'], 'ov_with_pass' => $LNG['ov_with_pass'], 'ov_security_confirm' => $LNG['ov_security_confirm'], 'ov_security_request' => $LNG['ov_security_request'], 'ov_delete_planet' => $LNG['ov_delete_planet'], 'ov_planet_abandoned' => $LNG['ov_planet_abandoned'], 'path' => PROTOCOL . $_SERVER['HTTP_HOST'] . HTTP_ROOT));
    $template->show("overview_body.tpl");
}
Exemple #17
0
 private function ShowSupportTickets()
 {
     global $USER, $PLANET, $db, $LNG;
     $query = $db->query("SELECT ID,time,text,subject,status FROM " . SUPP . " WHERE `player_id` = '" . $USER['id'] . "';");
     while ($ticket = $db->fetch_array($query)) {
         $TicketsList[$ticket['ID']] = array('status' => $ticket['status'], 'subject' => $ticket['subject'], 'date' => date("j. M Y H:i:s", $ticket['time']), 'text' => html_entity_decode($ticket['text'], ENT_NOQUOTES, "UTF-8"));
     }
     $db->free_result($query);
     $template = new template();
     $template->loadscript('support.js');
     $template->page_header();
     $template->page_topnav();
     $template->page_leftmenu();
     $template->page_planetmenu();
     $template->page_footer();
     $template->assign_vars(array('TicketsList' => $TicketsList, 'text' => $LNG['text'], 'supp_header' => $LNG['supp_header'], 'ticket_id' => $LNG['ticket_id'], 'subject' => $LNG['subject'], 'status' => $LNG['status'], 'ticket_posted' => $LNG['ticket_posted'], 'supp_send' => $LNG['supp_send'], 'supp_close' => $LNG['supp_close'], 'supp_open' => $LNG['supp_open'], 'supp_admin_answer' => $LNG['supp_admin_answer'], 'supp_player_answer' => $LNG['supp_player_answer'], 'supp_ticket_close' => $LNG['supp_ticket_close'], 'subject' => $LNG['subject'], 'status' => $LNG['status'], 'ticket_new' => $LNG['ticket_new']));
     $template->show("support_overview.tpl");
 }
 public function __construct()
 {
     global $USER, $PLANET, $CONF, $LNG, $LANG, $db;
     $mode = request_var('mode', '');
     $exit = request_var('exit_modus', '');
     $db_deaktjava = request_var('db_deaktjava', '');
     $PlanetRess = new ResourceUpdate();
     $PlanetRess->CalcResource();
     $PlanetRess->SavePlanetToDB();
     $template = new template();
     $template->page_header();
     $template->page_topnav();
     $template->page_leftmenu();
     $template->page_planetmenu();
     $template->page_footer();
     $SQLQuery = "";
     switch ($mode) {
         case "exit":
             if ($exit == 'on' and $USER['urlaubs_until'] <= TIMESTAMP) {
                 $SQLQuery .= "UPDATE " . USERS . " SET `urlaubs_modus` = '0', `urlaubs_until` = '0' WHERE `id` = '" . $USER['id'] . "' LIMIT 1;UPDATE " . PLANETS . " SET `last_update` = '" . TIMESTAMP . "', `energy_used` = '10', `energy_max` = '10', `metal_mine_porcent` = '10', `crystal_mine_porcent` = '10', `deuterium_sintetizer_porcent` = '10', `solar_plant_porcent` = '10', `fusion_plant_porcent` = '10', `solar_satelit_porcent` = '10' WHERE `id_owner` = '" . $USER["id"] . "';";
             }
             if ($db_deaktjava == 'on') {
                 $SQLQuery .= "UPDATE " . USERS . " SET `db_deaktjava` = '" . TIMESTAMP . "' WHERE `id` = '" . $USER['id'] . "' LIMIT 1;";
             } else {
                 $SQLQuery .= "UPDATE " . USERS . " SET `db_deaktjava` = '0' WHERE `id` = '" . $USER['id'] . "' LIMIT 1;";
             }
             $db->multi_query($SQLQuery);
             $template->message($LNG['op_options_changed'], '?page=options', 1);
             break;
         case "change":
             $design = request_var('design', '');
             $noipcheck = request_var('noipcheck', '');
             $USERname = request_var('db_character', $USER['username'], UTF8_SUPPORT);
             $db_email = request_var('db_email', $USER['email']);
             $spio_anz = max(request_var('spio_anz', 5), 1);
             $settings_tooltiptime = request_var('settings_tooltiptime', 1);
             $settings_fleetactions = max(request_var('settings_fleetactions', 1), 1);
             $settings_planetmenu = request_var('settings_planetmenu', '');
             $settings_esp = request_var('settings_esp', '');
             $settings_wri = request_var('settings_wri', '');
             $settings_bud = request_var('settings_bud', '');
             $settings_mis = request_var('settings_mis', '');
             $settings_rep = request_var('settings_rep', '');
             $settings_tnstor = request_var('settings_tnstor', '');
             $urlaubs_modus = request_var('urlaubs_modus', '');
             $SetSort = request_var('settings_sort', 0);
             $SetOrder = request_var('settings_order', 0);
             $dpath = request_var('dpath', '');
             $db_password = request_var('db_password', '');
             $newpass1 = request_var('newpass1', '');
             $newpass2 = request_var('newpass2', '');
             $hof = request_var('hof', '');
             $adm_pl_prot = request_var('adm_pl_prot', '');
             $langs = request_var('langs', 'de');
             $design = $design == 'on' ? 1 : 0;
             $hof = $hof == 'on' ? 1 : 0;
             $noipcheck = $noipcheck == 'on' ? 1 : 0;
             $settings_esp = $settings_esp == 'on' ? 1 : 0;
             $settings_wri = $settings_wri == 'on' ? 1 : 0;
             $settings_bud = $settings_bud == 'on' ? 1 : 0;
             $settings_mis = $settings_mis == 'on' ? 1 : 0;
             $settings_rep = $settings_rep == 'on' ? 1 : 0;
             $settings_tnstor = $settings_tnstor == 'on' ? 1 : 0;
             $settings_planetmenu = $settings_planetmenu == 'on' ? 1 : 0;
             $db_deaktjava = $db_deaktjava == 'on' ? TIMESTAMP : 0;
             $langs = array_key_exists($langs, $LNG['langs']) ? $langs : $LANG;
             if ($urlaubs_modus == 'on') {
                 if (!$this->CheckVMode()) {
                     $template->message($LNG['op_cant_activate_vacation_mode'], '?page=options', 3);
                     exit;
                 }
                 $SQLQuery .= "UPDATE " . USERS . " SET \r\n\t\t\t\t\t\t\t\t\t`urlaubs_modus` = '1',\r\n\t\t\t\t\t\t\t\t\t`urlaubs_until` = '" . (TIMESTAMP + VACATION_MIN_TIME) . "'\r\n\t\t\t\t\t\t\t\t\tWHERE `id` = '" . $USER["id"] . "';";
                 "UPDATE " . PLANETS . " SET\r\n\t\t\t\t\t\t\t\t\t`energy_used` = '0',\r\n\t\t\t\t\t\t\t\t\t`energy_max` = '0',\r\n\t\t\t\t\t\t\t\t\t`metal_mine_porcent` = '0',\r\n\t\t\t\t\t\t\t\t\t`crystal_mine_porcent` = '0',\r\n\t\t\t\t\t\t\t\t\t`deuterium_sintetizer_porcent` = '0',\r\n\t\t\t\t\t\t\t\t\t`solar_plant_porcent` = '0',\r\n\t\t\t\t\t\t\t\t\t`fusion_plant_porcent` = '0',\r\n\t\t\t\t\t\t\t\t\t`solar_satelit_porcent` = '0',\r\n\t\t\t\t\t\t\t\t\t`metal_perhour`    =    '0',\r\n                                    `crystal_perhour`    =    '0',\r\n                                    `deuterium_perhour`    =    '0'\r\n                                    WHERE `id_owner` = '" . $USER["id"] . "';";
             }
             $SQLQuery .= "UPDATE " . USERS . " SET\r\n\t\t\t\t\t\t\t\t`dpath` = '" . $db->sql_escape($dpath) . "',\r\n\t\t\t\t\t\t\t\t`design` = '" . $design . "',\r\n\t\t\t\t\t\t\t\t`noipcheck` = '" . $noipcheck . "',\r\n\t\t\t\t\t\t\t\t`planet_sort` = '" . $SetSort . "',\r\n\t\t\t\t\t\t\t\t`planet_sort_order` = '" . $SetOrder . "',\r\n\t\t\t\t\t\t\t\t`spio_anz` = '" . $spio_anz . "',\r\n\t\t\t\t\t\t\t\t`settings_tooltiptime` = '" . $settings_tooltiptime . "',\r\n\t\t\t\t\t\t\t\t`settings_fleetactions` = '" . $settings_fleetactions . "',\r\n\t\t\t\t\t\t\t\t`settings_planetmenu` = '" . $settings_planetmenu . "',\r\n\t\t\t\t\t\t\t\t`settings_esp` = '" . $settings_esp . "',\r\n\t\t\t\t\t\t\t\t`settings_wri` = '" . $settings_wri . "',\r\n\t\t\t\t\t\t\t\t`settings_bud` = '" . $settings_bud . "',\r\n\t\t\t\t\t\t\t\t`settings_mis` = '" . $settings_mis . "',\r\n\t\t\t\t\t\t\t\t`settings_tnstor` = '" . $settings_tnstor . "',\r\n\t\t\t\t\t\t\t\t`db_deaktjava` = '" . $db_deaktjava . "',\r\n\t\t\t\t\t\t\t\t`lang` = '" . $langs . "',\r\n\t\t\t\t\t\t\t\t`hof` = '" . $hof . "',\r\n\t\t\t\t\t\t\t\t`settings_rep` = '" . $settings_rep . "' \r\n\t\t\t\t\t\t\t\tWHERE `id` = '" . $USER["id"] . "';";
             if ($USER['authlevel'] > 0) {
                 if ($adm_pl_prot == 'on') {
                     $SQLQuery .= "UPDATE " . PLANETS . " SET `id_level` = '" . $USER['authlevel'] . "' WHERE `id_owner` = '" . $USER['id'] . "';";
                 } else {
                     $SQLQuery .= "UPDATE " . PLANETS . " SET `id_level` = '0' WHERE `id_owner` = '" . $USER['id'] . "';";
                 }
             }
             if (!empty($db_email) && $db_email != $USER['email'] && md5($db_password) == $USER['password']) {
                 if (!ValidateAddress($db_email)) {
                     $template->message($LNG['op_not_vaild_mail'], '?page=options', 3);
                     exit;
                 }
                 $query = $db->uniquequery("SELECT id FROM " . USERS . " WHERE email = '" . $db->sql_escape($db_email) . "' OR email_2 = '" . $db->sql_escape($db_email) . "';");
                 if (!empty($query)) {
                     $template->message(sprintf($LNG['op_change_mail_exist'], $db_email), '?page=options', 3);
                     exit;
                 }
                 $SQLQuery .= "UPDATE " . USERS . " SET `email` = '" . $db->sql_escape($db_email) . "', `setmail` = '" . (TIMESTAMP + 604800) . "' WHERE `id` = '" . $USER['id'] . "';";
             }
             if (!empty($newpass1) && md5($db_password) == $USER["password"] && $newpass1 == $newpass2) {
                 $newpass = md5($newpass1);
                 $SQLQuery .= "UPDATE " . USERS . " SET `password` = '" . $newpass . "' WHERE `id` = '" . $USER['id'] . "';";
                 session_destroy();
                 $template->message($LNG['op_password_changed'], "index.php", 3);
             } elseif ($USER['username'] != $USERname) {
                 if (!CheckName($USERname)) {
                     $template->message($LNG['op_user_name_no_alphanumeric'], '?page=options', 3);
                 } elseif ($USER['uctime'] >= TIMESTAMP - 60 * 60 * 24 * 7) {
                     $template->message($LNG['op_change_name_pro_week'], '?page=options', 3);
                 } else {
                     $query = $db->uniquequery("SELECT id FROM " . USERS . " WHERE username='******';");
                     if (!empty($query)) {
                         $template->message(sprintf($LNG['op_change_name_exist'], $USERname), '?page=options', 3);
                     } else {
                         $SQLQuery .= "UPDATE " . USERS . " SET `username` = '" . $db->sql_escape($USERname) . "', `uctime` = '" . TIMESTAMP . "' WHERE `id`= '" . $USER['id'] . "';";
                         session_destroy();
                         $template->message($LNG['op_username_changed'], 'index.php', 3);
                     }
                 }
             } else {
                 $template->message($LNG['op_options_changed'], '?page=options', 3);
             }
             $db->multi_query($SQLQuery);
             break;
         default:
             if ($USER['urlaubs_modus'] == 1) {
                 $template->assign_vars(array('vacation_until' => date("d.m.Y H:i:s", $USER['urlaubs_until']), 'op_save_changes' => $LNG['op_save_changes'], 'op_end_vacation_mode' => $LNG['op_end_vacation_mode'], 'op_vacation_mode_active_message' => $LNG['op_vacation_mode_active_message'], 'op_dlte_account_descrip' => $LNG['op_dlte_account_descrip'], 'op_dlte_account' => $LNG['op_dlte_account'], 'opt_delac_data' => $USER['db_deaktjava'], 'is_deak_vacation' => $USER['urlaubs_until'] <= TIMESTAMP ? true : false));
                 $template->show("options_overview_vmode.tpl");
             } else {
                 $template->assign_vars(array('opt_usern_data' => $USER['username'], 'opt_mail1_data' => $USER['email'], 'opt_mail2_data' => $USER['email_2'], 'opt_dpath_data' => $USER['dpath'], 'opt_dpath_data_sel' => substr($USER['dpath'], 13, -1), 'opt_probe_data' => $USER['spio_anz'], 'opt_toolt_data' => $USER['settings_tooltiptime'], 'opt_fleet_data' => $USER['settings_fleetactions'], 'opt_sskin_data' => $USER['design'], 'opt_noipc_data' => $USER['noipcheck'], 'opt_allyl_data' => $USER['settings_planetmenu'], 'opt_delac_data' => $USER['db_deaktjava'], 'opt_stor_data' => $USER['settings_tnstor'], 'user_settings_rep' => $USER['settings_rep'], 'user_settings_esp' => $USER['settings_esp'], 'user_settings_wri' => $USER['settings_wri'], 'user_settings_mis' => $USER['settings_mis'], 'user_settings_bud' => $USER['settings_bud'], 'opt_hof' => $USER['hof'], 'langs' => $USER['lang'], 'adm_pl_prot_data' => $PLANET['id_level'], 'user_authlevel' => $USER['authlevel'], 'Selectors' => array('Sort' => array(0 => $LNG['op_sort_normal'], 1 => $LNG['op_sort_koords'], 2 => $LNG['op_sort_abc']), 'SortUpDown' => array(0 => $LNG['op_sort_up'], 1 => $LNG['op_sort_down']), 'Skins' => array_diff(scandir(ROOT_PATH . 'styles/skins/'), array('..', '.', '.svn', '.htaccess', 'index.htm', 'darkness')), 'lang' => GetLangs()), 'planet_sort' => $USER['planet_sort'], 'planet_sort_order' => $USER['planet_sort_order'], 'uctime' => TIMESTAMP - $USER['uctime'] >= 60 * 60 * 24 * 7 ? true : false, 'op_admin_planets_protection' => $LNG['op_admin_planets_protection'], 'op_admin_title_options' => $LNG['op_admin_title_options'], 'op_user_data' => $LNG['op_user_data'], 'op_username' => $LNG['op_username'], 'op_old_pass' => $LNG['op_old_pass'], 'op_new_pass' => $LNG['op_new_pass'], 'op_repeat_new_pass' => $LNG['op_repeat_new_pass'], 'op_email_adress_descrip' => $LNG['op_email_adress_descrip'], 'op_email_adress' => $LNG['op_email_adress'], 'op_permanent_email_adress' => $LNG['op_permanent_email_adress'], 'op_general_settings' => $LNG['op_general_settings'], 'op_lang' => $LNG['op_lang'], 'op_sort_planets_by' => $LNG['op_sort_planets_by'], 'op_sort_kind' => $LNG['op_sort_kind'], 'op_skin_example' => $LNG['op_skin_example'], 'op_show_skin' => $LNG['op_show_skin'], 'op_active_build_messages' => $LNG['op_active_build_messages'], 'op_deactivate_ipcheck_descrip' => $LNG['op_deactivate_ipcheck_descrip'], 'op_deactivate_ipcheck' => $LNG['op_deactivate_ipcheck'], 'op_galaxy_settings' => $LNG['op_galaxy_settings'], 'op_spy_probes_number_descrip' => $LNG['op_spy_probes_number_descrip'], 'op_spy_probes_number' => $LNG['op_spy_probes_number'], 'op_seconds' => $LNG['op_seconds'], 'op_toolt_data' => $LNG['op_toolt_data'], 'op_max_fleets_messages' => $LNG['op_max_fleets_messages'], 'op_show_planetmenu' => $LNG['op_show_planetmenu'], 'op_shortcut' => $LNG['op_shortcut'], 'op_show' => $LNG['op_show'], 'op_spy' => $LNG['op_spy'], 'op_write_message' => $LNG['op_write_message'], 'op_add_to_buddy_list' => $LNG['op_add_to_buddy_list'], 'op_missile_attack' => $LNG['op_missile_attack'], 'op_send_report' => $LNG['op_send_report'], 'op_vacation_delete_mode' => $LNG['op_vacation_delete_mode'], 'op_activate_vacation_mode_descrip' => $LNG['op_activate_vacation_mode_descrip'], 'op_activate_vacation_mode' => $LNG['op_activate_vacation_mode'], 'op_dlte_account_descrip' => $LNG['op_dlte_account_descrip'], 'op_dlte_account' => $LNG['op_dlte_account'], 'op_save_changes' => $LNG['op_save_changes'], 'op_small_storage' => $LNG['op_small_storage']));
                 $template->show("options_overview.tpl");
             }
             break;
     }
 }
 public function __construct()
 {
     global $ProdGrid, $LNG, $resource, $reslist, $CONF, $db, $PLANET, $USER;
     include_once ROOT_PATH . 'includes/functions/IsTechnologieAccessible.' . PHP_EXT;
     include_once ROOT_PATH . 'includes/functions/GetElementPrice.' . PHP_EXT;
     CheckPlanetUsedFields($PLANET);
     $TheCommand = request_var('cmd', '');
     $Element = request_var('building', 0);
     $ListID = request_var('listid', 0);
     $PlanetRess = new ResourceUpdate();
     $PlanetRess->CalcResource();
     if (!empty($Element) && $USER['urlaubs_modus'] == 0 && (IsTechnologieAccessible($USER, $PLANET, $Element) && in_array($Element, $reslist['allow'][$PLANET['planet_type']]) && ($Element == 31 && $USER["b_tech_planet"] == 0 || $Element != 31) && (($Element == 15 || $Element == 21) && empty($PLANET['b_hangar_id']) || ($Element != 15 || $Element != 21))) || $TheCommand == "cancel" || $TheCommand == "remove") {
         switch ($TheCommand) {
             case 'cancel':
                 $this->CancelBuildingFromQueue($PlanetRess);
                 break;
             case 'remove':
                 $this->RemoveBuildingFromQueue($ListID, $PlanetRess);
                 break;
             case 'insert':
                 $this->AddBuildingToQueue($Element, true);
                 break;
             case 'destroy':
                 $this->AddBuildingToQueue($Element, false);
                 break;
         }
     }
     $PlanetRess->SavePlanetToDB();
     $Queue = $this->ShowBuildingQueue();
     $template = new template();
     $template->page_header();
     $template->page_topnav();
     $template->page_leftmenu();
     $template->page_planetmenu();
     $template->page_footer();
     $CanBuildElement = count($Queue) < MAX_BUILDING_QUEUE_SIZE ? true : false;
     $BuildingPage = "";
     $CurrentMaxFields = CalculateMaxPlanetFields($PLANET);
     $RoomIsOk = $PLANET["field_current"] < $CurrentMaxFields - count($Queue) ? true : false;
     $BuildEnergy = $USER[$resource[113]];
     $BuildLevelFactor = 10;
     $BuildTemp = $PLANET['temp_max'];
     foreach ($reslist['allow'][$PLANET['planet_type']] as $ID => $Element) {
         if (!IsTechnologieAccessible($USER, $PLANET, $Element)) {
             continue;
         }
         $HaveRessources = IsElementBuyable($USER, $PLANET, $Element, true, false);
         if (in_array($Element, $reslist['prod'])) {
             $BuildLevel = $PLANET[$resource[$Element]];
             $Need = floor(eval($ProdGrid[$Element]['formule']['energy']) * $CONF['resource_multiplier']) * (1 + $USER['rpg_ingenieur'] * 0.05);
             $BuildLevel += 1;
             $Prod = floor(eval($ProdGrid[$Element]['formule']['energy']) * $CONF['resource_multiplier']) * (1 + $USER['rpg_ingenieur'] * 0.05);
             $EnergyNeed = $Prod - $Need;
         } else {
             unset($EnergyNeed);
         }
         $parse['click'] = '';
         $NextBuildLevel = $PLANET[$resource[$Element]] + 1;
         if ($RoomIsOk && $CanBuildElement) {
             $parse['click'] = $HaveRessources == true ? "<a href=\"game.php?page=buildings&amp;cmd=insert&amp;building=" . $Element . "\"><span style=\"color:#00FF00\">" . ($PLANET['b_building'] != 0 ? $LNG['bd_add_to_list'] : ($NextBuildLevel == 1 ? $LNG['bd_build'] : $LNG['bd_build_next_level'] . $NextBuildLevel)) . "</span></a>" : "<span style=\"color:#FF0000\">" . ($NextBuildLevel == 1 ? $LNG['bd_build'] : $LNG['bd_build_next_level'] . $NextBuildLevel) . "</span>";
         } elseif ($RoomIsOk && !$CanBuildElement) {
             $parse['click'] = "<span style=\"color:#FF0000\">" . ($NextBuildLevel == 1 ? $LNG['bd_build'] : $LNG['bd_build_next_level'] . $NextBuildLevel) . "</span>";
         } else {
             $parse['click'] = "<span style=\"color:#FF0000\">" . $LNG['bd_no_more_fields'] . "</span>";
         }
         if ($Element == 31 && $USER['b_tech'] > TIMESTAMP) {
             $parse['click'] = "<span style=\"color:#FF0000\">" . $LNG['bd_working'] . "</span>";
         } elseif (($Element == 15 || $Element == 21) && !empty($PLANET['b_hangar_id'])) {
             $parse['click'] = "<span style=\"color:#FF0000\">" . $LNG['bd_working'] . "</span>";
         }
         $BuildInfoList[] = array('id' => $Element, 'name' => $LNG['tech'][$Element], 'descriptions' => $LNG['res']['descriptions'][$Element], 'level' => $PLANET[$resource[$Element]], 'destroyress' => array_map('pretty_number', GetBuildingPrice($USER, $PLANET, $Element, true, true)), 'destroytime' => pretty_time(GetBuildingTime($USER, $PLANET, $Element, true)), 'price' => GetElementPrice($USER, $PLANET, $Element, true), 'time' => pretty_time(GetBuildingTime($USER, $PLANET, $Element)), 'EnergyNeed' => isset($EnergyNeed) ? sprintf($EnergyNeed < 0 ? $LNG['bd_need_engine'] : $LNG['bd_more_engine'], pretty_number(abs($EnergyNeed)), $LNG['Energy']) : "", 'BuildLink' => $parse['click'], 'restprice' => $this->GetRestPrice($Element));
     }
     if ($PLANET['b_building'] != 0) {
         $template->execscript('ReBuildView();Buildlist();');
         $template->loadscript('buildlist.js');
         $template->assign_vars(array('data' => json_encode(array('bd_cancel' => $LNG['bd_cancel'], 'bd_continue' => $LNG['bd_continue'], 'bd_finished' => $LNG['bd_finished'], 'build' => $Queue))));
     }
     $template->assign_vars(array('BuildInfoList' => $BuildInfoList, 'bd_lvl' => $LNG['bd_lvl'], 'bd_next_level' => $LNG['bd_next_level'], 'Metal' => $LNG['Metal'], 'Crystal' => $LNG['Crystal'], 'Deuterium' => $LNG['Deuterium'], 'Darkmatter' => $LNG['Darkmatter'], 'bd_dismantle' => $LNG['bd_dismantle'], 'fgf_time' => $LNG['fgf_time'], 'bd_remaining' => $LNG['bd_remaining'], 'bd_jump_gate_action' => $LNG['bd_jump_gate_action']));
     $template->show("buildings_overview.tpl");
 }
function ShowStatisticsPage()
{
    global $USER, $PLANET, $CONF, $dpath, $LNG, $db;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $template->page_header();
    $template->page_topnav();
    $template->page_leftmenu();
    $template->page_planetmenu();
    $template->page_footer();
    $who = request_var('who', 1);
    $type = request_var('type', 1);
    $range = request_var('range', 1);
    switch ($type) {
        case 2:
            $Order = "fleet_rank";
            $Points = "fleet_points";
            $Counts = "fleet_count";
            $Rank = "fleet_rank";
            $OldRank = "fleet_old_rank";
            break;
        case 3:
            $Order = "tech_rank";
            $Points = "tech_points";
            $Counts = "tech_count";
            $Rank = "tech_rank";
            $OldRank = "tech_old_rank";
            break;
        case 4:
            $Order = "build_rank";
            $Points = "build_points";
            $Counts = "build_count";
            $Rank = "build_rank";
            $OldRank = "build_old_rank";
            break;
        case 5:
            $Order = "defs_rank";
            $Points = "defs_points";
            $Counts = "defs_count";
            $Rank = "defs_rank";
            $OldRank = "defs_old_rank";
            break;
        default:
            $Order = "total_rank";
            $Points = "total_points";
            $Counts = "total_count";
            $Rank = "total_rank";
            $OldRank = "total_old_rank";
            break;
    }
    switch ($who) {
        case 1:
            $MaxUsers = $db->uniquequery("SELECT COUNT(*) AS `count` FROM " . USERS . " WHERE `db_deaktjava` = '0';");
            $range = min($range, $MaxUsers['count']);
            $LastPage = ceil($MaxUsers['count'] / 100);
            for ($Page = 0; $Page < $LastPage; $Page++) {
                $PageValue = $Page * 100 + 1;
                $PageRange = $PageValue + 99;
                $Selector['range'][$PageValue] = $PageValue . "-" . $PageRange;
            }
            $start = max(floor(($range - 1) / 100) * 100, 0);
            $stats_sql = 'SELECT DISTINCT s.*, u.id, u.username, u.ally_id, u.ally_name FROM ' . STATPOINTS . ' as s
			INNER JOIN ' . USERS . ' as u ON u.id = s.id_owner
			WHERE s.`stat_type` = 1 ' . ($CONF['stat'] == 2 ? 'AND u.`authlevel` < ' . $CONF['stat_level'] . ' ' : '') . '
			ORDER BY `' . $Order . '` ASC LIMIT ' . $start . ',100;';
            $query = $db->query($stats_sql);
            while ($StatRow = $db->fetch_array($query)) {
                $RangeList[] = array('id' => $StatRow['id'], 'name' => $StatRow['username'], 'points' => pretty_number($StatRow[$Points]), 'allyid' => $StatRow['ally_id'], 'rank' => $StatRow[$Rank], 'allyname' => $StatRow['ally_name'], 'ranking' => $StatRow[$OldRank] - $StatRow[$Rank]);
            }
            $db->free_result($query);
            break;
        case 2:
            $MaxAllys = $db->uniquequery("SELECT COUNT(*) AS `count` FROM " . ALLIANCE . ";");
            $range = min($range, $MaxAllys['count']);
            $LastPage = ceil($MaxAllys['count'] / 100);
            for ($Page = 0; $Page < $LastPage; $Page++) {
                $PageValue = $Page * 100 + 1;
                $PageRange = $PageValue + 99;
                $Selector['range'][$PageValue] = $PageValue . "-" . $PageRange;
            }
            $start = max(floor(($range - 1) / 100) * 100, 0);
            $stats_sql = 'SELECT DISTINCT s.*, a.id, a.ally_members, a.ally_name FROM ' . STATPOINTS . ' as s
			INNER JOIN ' . ALLIANCE . ' as a ON a.id = s.id_owner
			WHERE `stat_type` = 2
			ORDER BY `' . $Order . '` ASC LIMIT ' . $start . ',100;';
            $query = $db->query($stats_sql);
            while ($StatRow = $db->fetch_array($query)) {
                $RangeList[] = array('id' => $StatRow['id'], 'name' => $StatRow['ally_name'], 'members' => $StatRow['ally_members'], 'rank' => $StatRow[$Rank], 'mppoints' => pretty_number(floor($StatRow[$Points] / $StatRow['ally_members'])), 'points' => pretty_number($StatRow[$Points]), 'ranking' => $StatRow[$OldRank] - $StatRow[$Rank]);
            }
            $db->free_result($query);
            break;
    }
    $Selector['who'] = array(1 => $LNG['st_player'], 2 => $LNG['st_alliance']);
    $Selector['type'] = array(1 => $LNG['st_points'], 2 => $LNG['st_fleets'], 3 => $LNG['st_researh'], 4 => $LNG['st_buildings'], 5 => $LNG['st_defenses']);
    $template->assign_vars(array('Selectors' => $Selector, 'who' => $who, 'type' => $type, 'range' => floor(($range - 1) / 100) * 100 + 1, 'RangeList' => $RangeList, 'CUser_ally' => $USER['ally_id'], 'CUser_id' => $USER['id'], 'st_members' => $LNG['st_members'], 'st_per_member' => $LNG['st_per_member'], 'st_position' => $LNG['st_position'], 'st_player' => $LNG['st_player'], 'st_alliance' => $LNG['st_alliance'], 'st_write_message' => $LNG['st_write_message'], 'st_points' => $LNG['st_points'], 'st_per' => $LNG['st_per'], 'st_statistics' => $LNG['st_statistics'], 'st_updated' => $LNG['st_updated'], 'stat_date' => date("d. M Y, H:i:s", $CONF['stat_last_update']), 'st_show' => $LNG['st_show'], 'st_in_the_positions' => $LNG['st_in_the_positions']));
    $template->show("stat_overview.tpl");
}
Exemple #21
0
function ShowMessagesPage()
{
    global $USER, $PLANET, $CONF, $dpath, $LNG, $db;
    $MessCategory = request_var('messcat', 0);
    $MessPageMode = request_var('mode', '');
    $DeleteWhat = request_var('deletemessages', '');
    $Send = request_var('send', 0);
    $OwnerID = request_var('id', 0);
    $Subject = request_var('subject', '', true);
    $MessageType = array(0, 1, 2, 3, 4, 5, 15, 50, 99, 100, 999);
    $TitleColor = array(0 => '#FFFF00', 1 => '#FF6699', 2 => '#FF3300', 3 => '#FF9900', 4 => '#773399', 5 => '#009933', 15 => '#6495ed', 50 => '#666600', 99 => '#007070', 100 => '#ABABAB', 999 => '#CCCCCC');
    $template = new template();
    switch ($MessPageMode) {
        case 'write':
            $template->page_header();
            $template->page_footer();
            $OwnerRecord = $db->uniquequery("SELECT a.galaxy, a.system, a.planet, b.username, b.id_planet FROM " . PLANETS . " as a, " . USERS . " as b WHERE b.id = '" . $OwnerID . "' AND a.id = b.id_planet;");
            if (!$OwnerRecord) {
                $template->message($LNG['mg_error'], false, 0, true);
            }
            if ($Send) {
                $Owner = $OwnerID;
                $Message = makebr(request_var('text', '', true));
                $From = $USER['username'] . ' [' . $USER['galaxy'] . ':' . $USER['system'] . ':' . $USER['planet'] . ']';
                SendSimpleMessage($OwnerID, $USER['id'], '', 1, $From, $Subject, $Message);
                exit($LNG['mg_message_send']);
            }
            $template->assign_vars(array('mg_send_new' => $LNG['mg_send_new'], 'mg_send_to' => $LNG['mg_send_to'], 'mg_send' => $LNG['mg_send'], 'mg_message' => $LNG['mg_message'], 'mg_characters' => $LNG['mg_characters'], 'mg_subject' => $LNG['mg_subject'], 'mg_empty_text' => $LNG['mg_empty_text'], 'subject' => empty($Subject) ? $LNG['mg_no_subject'] : $Subject, 'id' => $OwnerID, 'username' => $OwnerRecord['username'], 'galaxy' => $OwnerRecord['galaxy'], 'system' => $OwnerRecord['system'], 'planet' => $OwnerRecord['planet']));
            $template->show("message_send_form.tpl");
            break;
        default:
            $PlanetRess = new ResourceUpdate();
            $PlanetRess->CalcResource();
            $PlanetRess->SavePlanetToDB();
            $template->loadscript('message.js');
            $template->page_header();
            $template->page_topnav();
            $template->page_leftmenu();
            $template->page_planetmenu();
            $template->page_footer();
            $UsrMess = $db->query("SELECT `message_type`, `message_unread` FROM " . MESSAGES . " WHERE `message_owner` = '" . $USER['id'] . "' OR `message_type` = '50';");
            $GameOps = $db->query("SELECT `username`, `email` FROM " . USERS . " WHERE `authlevel` != '0' ORDER BY `username` ASC;");
            $MessOut = $db->uniquequery("SELECT COUNT(*) as count FROM " . MESSAGES . " WHERE message_sender = '" . $USER['id'] . "';");
            while ($Ops = $db->fetch_array($GameOps)) {
                $OpsList[] = array('username' => $Ops['username'], 'email' => $Ops['email']);
            }
            $db->free_result($GameOps);
            while ($CurMess = $db->fetch_array($UsrMess)) {
                $UnRead[$CurMess['message_type']] += $CurMess['message_unread'];
                $TotalMess[$CurMess['message_type']] += 1;
            }
            $db->free_result($UsrMess);
            $UnRead[50] += $USER['new_gmessage'];
            $UnRead[100] = is_array($UnRead) ? array_sum($UnRead) : 0;
            $TotalMess[100] = is_array($TotalMess) ? array_sum($TotalMess) - $TotalMess[50] : 0;
            $TotalMess[999] = $MessOut['count'];
            foreach ($TitleColor as $MessageID => $MessageColor) {
                $MessageList[$MessageID] = array('color' => $MessageColor, 'unread' => !empty($UnRead[$MessageID]) ? $UnRead[$MessageID] : 0, 'total' => !empty($TotalMess[$MessageID]) ? $TotalMess[$MessageID] : 0, 'lang' => $LNG['mg_type'][$MessageID]);
            }
            $template->assign_vars(array('MessageList' => $MessageList, 'OpsList' => $OpsList, 'mg_overview' => $LNG['mg_overview'], 'mg_game_operators' => $LNG['mg_game_operators']));
            $template->show("message_overview.tpl");
            break;
    }
}
 public function __construct()
 {
     global $CONF, $dpath, $LNG, $db, $USER, $PLANET;
     $mode = request_var('mode', '');
     $msg = request_var('msg', '', true);
     $ctype = request_var('chat_type', '');
     $MessageID = request_var('id', 0);
     switch ($mode) {
         case "delete":
             $this->DelMeassageFromChat($MessageID);
             break;
         case "send":
             $this->SetMeassageInChat($ctype, $msg);
             break;
         case "call":
             $this->GetMessages($ctype);
             break;
         default:
             $template = new template();
             $template->execscript("showMessage();;setInterval(showMessage,10000);");
             $template->loadscript("chat.js");
             $template->page_header();
             $template->page_footer();
             if (empty($ctype)) {
                 $PlanetRess = new ResourceUpdate();
                 $PlanetRess->CalcResource();
                 $PlanetRess->SavePlanetToDB();
                 $template->page_topnav();
                 $template->page_leftmenu();
                 $template->page_planetmenu();
             }
             $template->assign_vars(array('ctype' => $ctype, 'chat_send' => $LNG['chat_send'], 'chat_disc' => $LNG['chat_disc'], 'chat_message' => $LNG['chat_message'], 'chat_bbcode' => $LNG['chat_bbcode'], 'chat_fontcolor' => $LNG['chat_fontcolor'], 'chat_color_white' => $LNG['chat_color_white'], 'chat_color_blue' => $LNG['chat_color_blue'], 'chat_color_yellow' => $LNG['chat_color_yellow'], 'chat_color_green' => $LNG['chat_color_green'], 'chat_color_pink' => $LNG['chat_color_pink'], 'chat_color_red' => $LNG['chat_color_red'], 'chat_color_orange' => $LNG['chat_color_orange']));
             $template->show("chat_overview.tpl");
             break;
     }
 }
 public static function MissilesAjax()
 {
     global $USER, $PLANET, $LNG, $CONF, $db, $reslist, $resource;
     include_once ROOT_PATH . 'includes/functions/IsVacationMode.' . PHP_EXT;
     $iraks = $PLANET['interplanetary_misil'];
     $TargetGalaxy = request_var('galaxy', 0);
     $TargetSystem = request_var('system', 0);
     $TargetPlanet = request_var('planet', 0);
     $anz = min(request_var('SendMI', 0), $iraks);
     $pziel = request_var('Target', "");
     $PlanetRess = new ResourceUpdate($USER, $PLANET);
     $Target = $db->uniquequery("SELECT `id_owner`, `id_level` FROM " . PLANETS . " WHERE `galaxy` = '" . $TargetGalaxy . "' AND `system` = '" . $TargetSystem . "' AND `planet` = '" . $TargetPlanet . "' AND `planet_type` = '1';");
     $Distance = abs($TargetSystem - $PLANET['system']);
     require_once ROOT_PATH . 'includes/classes/class.GalaxyRows.' . PHP_EXT;
     $GalaxyRows = new GalaxyRows();
     if (IsVacationMode($USER)) {
         $error = $LNG['fl_vacation_mode_active'];
     } elseif ($PLANET['silo'] < 4) {
         $error = $LNG['ma_silo_level'];
     } elseif ($USER['impulse_motor_tech'] == 0) {
         $error = $LNG['ma_impulse_drive_required'];
     } elseif ($TargetGalaxy != $PLANET['galaxy'] || $Distance > $GalaxyRows->GetMissileRange($USER[$resource[117]])) {
         $error = $LNG['ma_not_send_other_galaxy'];
     } elseif (!$Target) {
         $error = $LNG['ma_planet_doesnt_exists'];
     } elseif (!in_array($pziel, $reslist['defense']) && $pziel != 0) {
         $error = $LNG['ma_wrong_target'];
     } elseif ($iraks == 0) {
         $error = $LNG['ma_no_missiles'];
     } elseif ($anz == 0) {
         $error = $LNG['ma_add_missile_number'];
     } elseif ($Target['id_level'] > $USER['authlevel'] && $CONF['adm_attack'] == 0) {
         $error = $LNG['fl_admins_cannot_be_attacked'];
     }
     $TargetUser = GetUserByID($Target['id_owner'], array('onlinetime'));
     $UserPoints = $USER;
     $User2Points = $db->uniquequery("SELECT `total_points` FROM " . STATPOINTS . " WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $Target['id_owner'] . "';");
     $IsNoobProtec = CheckNoobProtec($UserPoints, $User2Points, $TargetUser['onlinetime']);
     if ($IsNoobProtec['NoobPlayer']) {
         $error = $LNG['fl_week_player'];
     } elseif ($IsNoobProtec['StrongPlayer']) {
         $error = $LNG['fl_strong_player'];
     }
     $template = new template();
     $template->page_header();
     $template->page_topnav();
     $template->page_leftmenu();
     $template->page_planetmenu();
     $template->page_footer();
     if ($error != "") {
         $template->message($error);
         exit;
     }
     $SpeedFactor = parent::GetGameSpeedFactor();
     $Duration = max(round(30 + 60 * $Distance / $SpeedFactor), 30);
     $DefenseLabel = $pziel == 0 ? $LNG['ma_all'] : $LNG['tech'][$pziel];
     if (connection_aborted()) {
         exit;
     }
     $sql = "INSERT INTO " . FLEETS . " SET\r\n\t\t\t\tfleet_owner = '" . $USER['id'] . "',\r\n\t\t\t\tfleet_mission = '10',\r\n\t\t\t\tfleet_amount = '" . $anz . "',\r\n\t\t\t\tfleet_array = '503," . $anz . "',\r\n\t\t\t\tfleet_start_time = '" . (TIMESTAMP + $Duration) . "',\r\n\t\t\t\tfleet_start_galaxy = '" . $PLANET['galaxy'] . "',\r\n\t\t\t\tfleet_start_system = '" . $PLANET['system'] . "',\r\n\t\t\t\tfleet_start_planet ='" . $PLANET['planet'] . "',\r\n\t\t\t\tfleet_start_type = '1',\r\n\t\t\t\tfleet_end_time = '" . (TIMESTAMP + $Duration + 50) . "',\r\n\t\t\t\tfleet_end_stay = '0',\r\n\t\t\t\tfleet_end_galaxy = '" . $TargetGalaxy . "',\r\n\t\t\t\tfleet_end_system = '" . $TargetSystem . "',\r\n\t\t\t\tfleet_end_planet = '" . $TargetPlanet . "',\r\n\t\t\t\tfleet_end_type = '1',\r\n\t\t\t\tfleet_target_obj = '" . $db->sql_escape($pziel) . "',\r\n\t\t\t\tfleet_resource_metal = '0',\r\n\t\t\t\tfleet_resource_crystal = '0',\r\n\t\t\t\tfleet_resource_deuterium = '0',\r\n\t\t\t\tfleet_target_owner = '" . $Target["id_owner"] . "',\r\n\t\t\t\tfleet_group = '0',\r\n\t\t\t\tfleet_mess = '0',\r\n\t\t\t\tstart_time = " . TIMESTAMP . ";\r\n\t\t\t\tUPDATE " . PLANETS . " SET \r\n\t\t\t\tinterplanetary_misil = (interplanetary_misil - " . $anz . ") WHERE id = '" . $PLANET['id'] . "';";
     $db->multi_query($sql);
     $template->message("<b>" . $anz . "</b>" . $LNG['ma_missiles_sended'] . $DefenseLabel, "game.php?page=overview", 3);
 }
Exemple #24
0
function ShowBuddyPage()
{
    global $USER, $PLANET, $LNG, $db;
    $template = new template();
    $bid = request_var('bid', 0);
    $uid = request_var('u', 0);
    $mode = request_var('mode', 0);
    $sm = request_var('sm', 0);
    switch ($mode) {
        case 1:
            switch ($sm) {
                case 1:
                    $db->query("DELETE FROM " . BUDDY . " WHERE `id`='" . $bid . "';");
                    redirectTo("game." . PHP_EXT . "?page=buddy");
                    break;
                case 2:
                    $db->query("UPDATE " . BUDDY . " SET `active` = '1' WHERE `id` ='" . $bid . "';");
                    redirectTo("game." . PHP_EXT . "?page=buddy");
                    break;
                case 3:
                    $test = $db->fetch_array($db->query("SELECT `id` FROM " . BUDDY . " WHERE (`sender`='" . $USER['id'] . "' AND `owner`='" . $uid . "') OR (`owner`='" . $USER['id'] . "' AND `sender`='" . $uid . "');"));
                    if (!isset($test)) {
                        $text = request_var('text', '', UTF8_SUPPORT);
                        $db->query("INSERT INTO " . BUDDY . " SET `sender` = '" . $USER['id'] . "', `owner` = '" . $uid . "', `active` = '0', `text` = '" . $db->sql_escape($text) . "';");
                        exit($LNG['bu_request_send']);
                    } else {
                        exit($LNG['bu_request_exists']);
                    }
                    break;
            }
            break;
        case 2:
            if ($u == $USER['id']) {
                $template->message($LNG['bu_cannot_request_yourself'], 'game.php?page=buddy', 2, true);
            } else {
                $template->page_header();
                $template->page_footer();
                $Player = $db->uniquequery("SELECT `username` FROM " . USERS . " WHERE `id`='" . $uid . "';");
                $template->assign_vars(array('bu_player' => $LNG['bu_player'], 'bu_request_message' => $LNG['bu_request_message'], 'bu_back' => $LNG['bu_back'], 'bu_send' => $LNG['bu_send'], 'username' => $Player['username'], 'id' => $uid));
                $template->show("buddy_send_form.tpl");
            }
            break;
        default:
            $PlanetRess = new ResourceUpdate();
            $PlanetRess->CalcResource();
            $PlanetRess->SavePlanetToDB();
            $template->page_header();
            $template->page_topnav();
            $template->page_leftmenu();
            $template->page_planetmenu();
            $template->page_footer();
            $BuddyListRAW = $db->query("SELECT a.`active`, a.`sender`, a.`id` as buddyid, a.`text`, b.`id`, b.`username`, b.`onlinetime`, b.`galaxy`, b.`system`, b.`planet`, b.`ally_id`, b.`ally_name` FROM " . BUDDY . " as a, " . USERS . " as b WHERE (a.`sender` = '" . $USER['id'] . "' AND b.`id` = a.`owner`) OR (a.`owner` = '" . $USER['id'] . "' AND b.`id` = a.`sender`);");
            while ($BuddyList = $db->fetch_array($BuddyListRAW)) {
                if ($BuddyList['active'] == 0) {
                    if ($BuddyList['sender'] == $USER['id']) {
                        $MyRequestList[] = array('playerid' => $BuddyList['id'], 'name' => $BuddyList['username'], 'allyid' => $BuddyList['ally_id'], 'allyname' => $BuddyList['ally_name'], 'text' => $BuddyList['text'], 'galaxy' => $BuddyList['galaxy'], 'system' => $BuddyList['system'], 'planet' => $BuddyList['planet'], 'buddyid' => $BuddyList['buddyid']);
                    } else {
                        $OutRequestList[] = array('playerid' => $BuddyList['id'], 'name' => $BuddyList['username'], 'allyid' => $BuddyList['ally_id'], 'allyname' => $BuddyList['ally_name'], 'text' => $BuddyList['text'], 'galaxy' => $BuddyList['galaxy'], 'system' => $BuddyList['system'], 'planet' => $BuddyList['planet'], 'buddyid' => $BuddyList['buddyid']);
                    }
                } else {
                    $MyBuddyList[] = array('playerid' => $BuddyList['id'], 'name' => $BuddyList['username'], 'allyid' => $BuddyList['ally_id'], 'allyname' => $BuddyList['ally_name'], 'onlinetime' => floor((TIMESTAMP - $BuddyList['onlinetime']) / 60), 'galaxy' => $BuddyList['galaxy'], 'system' => $BuddyList['system'], 'planet' => $BuddyList['planet'], 'buddyid' => $BuddyList['buddyid']);
                }
            }
            $db->free_result($BuddyListRAW);
            $template->assign_vars(array('MyBuddyList' => $MyBuddyList, 'MyRequestList' => $MyRequestList, 'OutRequestList' => $OutRequestList, 'bu_buddy_list' => $LNG['bu_buddy_list'], 'bu_requests' => $LNG['bu_requests'], 'bu_player' => $LNG['bu_player'], 'bu_alliance' => $LNG['bu_alliance'], 'bu_coords' => $LNG['bu_coords'], 'bu_text' => $LNG['bu_text'], 'bu_action' => $LNG['bu_action'], 'bu_my_requests' => $LNG['bu_my_requests'], 'bu_partners' => $LNG['bu_partners'], 'bu_estate' => $LNG['bu_estate'], 'bu_no_request' => $LNG['bu_no_request'], 'bu_no_buddys' => $LNG['bu_no_buddys'], 'bu_no_buddys' => $LNG['bu_no_buddys'], 'bu_minutes' => $LNG['bu_minutes'], 'bu_accept' => $LNG['bu_accept'], 'bu_decline' => $LNG['bu_decline'], 'bu_cancel_request' => $LNG['bu_cancel_request'], 'bu_disconnected' => $LNG['bu_disconnected'], 'bu_delete' => $LNG['bu_delete'], 'bu_online' => $LNG['bu_online'], 'bu_connected' => $LNG['bu_connected']));
            $template->show("buddy_overview.tpl");
            break;
    }
}