function ElementBuildListBox($CurrentUser, $CurrentPlanet) { global $lang, $pricelist; // Array del b_hangar_id $ElementQueue = explode(';', $CurrentPlanet['b_hangar_id']); $NbrePerType = ""; $NamePerType = ""; $TimePerType = ""; foreach ($ElementQueue as $ElementLine => $Element) { if ($Element != '') { $Element = explode(',', $Element); $ElementTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element[0]); $QueueTime += $ElementTime * $Element[1]; $TimePerType .= "" . $ElementTime . ","; $NamePerType .= "'" . html_entity_decode($lang['tech'][$Element[0]]) . "',"; $NbrePerType .= "" . $Element[1] . ","; } } $parse = $lang; $parse['a'] = $NbrePerType; $parse['b'] = $NamePerType; $parse['c'] = $TimePerType; $parse['b_hangar_id_plus'] = $CurrentPlanet['b_hangar']; $parse['pretty_time_b_hangar'] = pretty_time($QueueTime - $CurrentPlanet['b_hangar']); $text .= parsetemplate(gettemplate('buildings_script'), $parse); return $text; }
function echo_buildinglist() { /* Se imprime una lista de naves y defensa en contruccion */ global $lang, $user, $planetrow, $pricelist; //Array del b_hangar_id $b_hangar_id = explode(';', $planetrow['b_hangar_id']); $a = $b = $c = ""; foreach ($b_hangar_id as $n => $array) { if ($array != '') { $array = explode(',', $array); //calculamos el tiempo $time = get_building_time($user, $planetrow, $array[0]); $totaltime += $time * $array[1]; $c .= "{$time},"; $b .= "'{$lang['tech'][$array[0]]}',"; $a .= "{$array[1]},"; } } $parse = $lang; $parse['a'] = $a; $parse['b'] = $b; $parse['c'] = $c; $parse['b_hangar_id_plus'] = $planetrow['b_hangar']; $parse['pretty_time_b_hangar'] = pretty_time($totaltime - $planetrow['b_hangar']); // //$planetrow['last_update'] $text .= parsetemplate(gettemplate('buildings_script'), $parse); return $text; }
private function ElementBuildListBox($CurrentUser, $CurrentPlanet) { global $lang, $pricelist, $displays; $displays->newblock("buildinglist"); $ElementQueue = explode(';', $CurrentPlanet['b_hangar_id']); $NbrePerType = ""; $NamePerType = ""; $TimePerType = ""; foreach ($ElementQueue as $ElementLine => $Element) { if ($Element != '') { $Element = explode(',', $Element); $ElementTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element[0]); $QueueTime += $ElementTime * $Element[1]; $TimePerType .= "" . $ElementTime . ","; $NamePerType .= "'" . $lang['tech'][$Element[0]] . "',"; $NbrePerType .= "" . $Element[1] . ","; } } //$parse = $lang; $parse['a'] = $NbrePerType; $parse['b'] = $NamePerType; $parse['c'] = $TimePerType; $parse['b_hangar_id_plus'] = $CurrentPlanet['b_hangar']; $parse['pretty_time_b_hangar'] = pretty_time($QueueTime - $CurrentPlanet['b_hangar']); foreach ($parse as $key => $value) { $displays->assign($key, $value); } }
function ElementBuildListQueue($CurrentUser, $CurrentPlanet) { global $lang, $pricelist; $b_building_id = explode(';', $CurrentPlanet['b_building_queue']); $a = $b = $c = ""; foreach ($b_hangar_id as $n => $array) { if ($array != '') { $array = explode(',', $array); // calculamos el tiempo $time = GetBuildingTime($user, $CurrentPlanet, $array[0]); $totaltime += $time * $array[1]; $c .= "{$time},"; $b .= "'{$lang['tech'][$array[0]]}',"; $a .= "{$array[1]},"; } } $parse = $lang; $parse['a'] = $a; $parse['b'] = $b; $parse['c'] = $c; $parse['b_hangar_id_plus'] = $CurrentPlanet['b_hangar']; $parse['pretty_time_b_hangar'] = pretty_time($totaltime - $CurrentPlanet['b_hangar']); $text .= parsetemplate(gettemplate('buildings_script'), $parse); return $text; }
public function setTemplateVars() { global $language, $data_dir; $this->template->inputLanguage = $language[$_POST["input-extension"]]; $this->template->inputExtension = $_POST["input-extension"]; $this->template->outputLanguage = $language[$_POST["output-extension"]]; $this->template->outputExtension = $_POST["output-extension"]; $corpora = array(); $dir = $data_dir . "/" . $_POST["input-extension"] . "-" . $_POST["output-extension"]; if ($handle = opendir($dir)) { while (false !== ($entry = readdir($handle))) { if (preg_match("/(\\d+)\\.info/", $entry, $match)) { $corpus = array(); $corpus["id"] = $match[1]; $corpus["checkbox_name"] = "corpus-" . $match[1]; $info = file($dir . "/" . $entry); foreach ($info as $line) { if (preg_match("/^(\\S+) = (.+)/", $line, $match)) { $corpus[$match[1]] = $match[2]; } } $corpus["upload_time"] = pretty_time($corpus["upload_time"]); $corpora[] = $corpus; } } } $this->template->corpora = $corpora; $this->template->msg = $this->msg; }
public static function ShowFleetPage() { global $USER, $PLANET, $reslist, $resource, $db, $LNG, $ExtraDM; $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); $PlanetRess->SavePlanetToDB(); $parse = $LNG; $FleetID = request_var('fleetid', 0); $GetAction = request_var('action', ""); $template = new template(); $template->loadscript('flotten.js'); if (!empty($FleetID)) { switch ($GetAction) { case "sendfleetback": parent::SendFleetBack($USER, $FleetID); break; case "getakspage": $template->assign_vars(parent::GetAKSPage($USER, $PLANET, $FleetID)); break; } } $MaxExpedition = $USER[$resource[124]]; if ($MaxExpedition >= 1) { $ExpeditionEnCours = parent::GetCurrentFleets($USER['id'], 15); $EnvoiMaxExpedition = floor(sqrt($MaxExpedition)); } else { $ExpeditionEnCours = 0; $EnvoiMaxExpedition = 0; } $MaxFlottes = parent::GetMaxFleetSlots($USER); $galaxy = request_var('galaxy', $PLANET['galaxy']); $system = request_var('system', $PLANET['system']); $planet = request_var('planet', $PLANET['planet']); $planettype = request_var('planettype', $PLANET['planet_type']); $target_mission = request_var('target_mission', 0); $CurrentFleets = $db->query("SELECT * FROM " . FLEETS . " WHERE `fleet_owner` = '" . $USER['id'] . "' AND `fleet_mission` <> 10 ORDER BY `fleet_end_time` ASC;"); $CountCurrentFleets = $db->num_rows($CurrentFleets); while ($CurrentFleetsRow = $db->fetch_array($CurrentFleets)) { $fleet = explode(";", $CurrentFleetsRow['fleet_array']); foreach ($fleet as $ShipID => $ShipCount) { if (empty($ShipCount)) { continue; } $a = explode(",", $ShipCount); $FleetList[$CurrentFleetsRow['fleet_id']][$LNG['tech'][$a[0]]] = pretty_number($a[1]); } $FlyingFleetList[] = array('id' => $CurrentFleetsRow['fleet_id'], 'mission' => $CurrentFleetsRow['fleet_mission'], 'missionname' => $LNG['type_mission'][$CurrentFleetsRow['fleet_mission']], 'way' => $CurrentFleetsRow['fleet_mess'], 'start_galaxy' => $CurrentFleetsRow['fleet_start_galaxy'], 'start_system' => $CurrentFleetsRow['fleet_start_system'], 'start_planet' => $CurrentFleetsRow['fleet_start_planet'], 'start_time' => date(TDFORMAT, $CurrentFleetsRow['fleet_start_time']), 'end_galaxy' => $CurrentFleetsRow['fleet_end_galaxy'], 'end_system' => $CurrentFleetsRow['fleet_end_system'], 'end_planet' => $CurrentFleetsRow['fleet_end_planet'], 'end_time' => date(TDFORMAT, $CurrentFleetsRow['fleet_end_time']), 'amount' => pretty_number($CurrentFleetsRow['fleet_amount']), 'backin' => pretty_time(floor($CurrentFleetsRow['fleet_end_time'] - TIMESTAMP)), 'FleetList' => $FleetList[$CurrentFleetsRow['fleet_id']]); } $db->free_result($CurrentFleets); foreach ($reslist['fleet'] as $FleetID) { if ($PLANET[$resource[$FleetID]] > 0) { $FleetsOnPlanet[] = array('id' => $FleetID, 'name' => $LNG['tech'][$FleetID], 'speed' => parent::GetFleetMaxSpeed($FleetID, $USER), 'count' => pretty_number($PLANET[$resource[$FleetID]])); } } $template->assign_vars(array('FleetsOnPlanet' => $FleetsOnPlanet, 'FlyingFleetList' => $FlyingFleetList, 'fl_number' => $LNG['fl_number'], 'fl_mission' => $LNG['fl_mission'], 'fl_ammount' => $LNG['fl_ammount'], 'fl_beginning' => $LNG['fl_beginning'], 'fl_departure' => $LNG['fl_departure'], 'fl_destiny' => $LNG['fl_destiny'], 'fl_objective' => $LNG['fl_objective'], 'fl_arrival' => $LNG['fl_arrival'], 'fl_order' => $LNG['fl_order'], 'fl_new_mission_title' => $LNG['fl_new_mission_title'], 'fl_ship_type' => $LNG['fl_ship_type'], 'fl_ship_available' => $LNG['fl_ship_available'], 'fl_fleets' => $LNG['fl_fleets'], 'fl_expeditions' => $LNG['fl_expeditions'], 'fl_speed_title' => $LNG['fl_speed_title'], 'fl_max' => $LNG['fl_max'], 'fl_no_more_slots' => $LNG['fl_no_more_slots'], 'fl_continue' => $LNG['fl_continue'], 'fl_no_ships' => $LNG['fl_no_ships'], 'fl_select_all_ships' => $LNG['fl_select_all_ships'], 'fl_remove_all_ships' => $LNG['fl_remove_all_ships'], 'fl_acs' => $LNG['fl_acs'], 'fl_send_back' => $LNG['fl_send_back'], 'fl_returning' => $LNG['fl_returning'], 'fl_r' => $LNG['fl_r'], 'fl_onway' => $LNG['fl_onway'], 'fl_a' => $LNG['fl_a'], 'fl_info_detail' => $LNG['fl_info_detail'], 'fl_bonus' => $LNG['fl_bonus'], 'fl_bonus_attack' => $LNG['fl_bonus_attack'], 'fl_bonus_defensive' => $LNG['fl_bonus_defensive'], 'fl_bonus_shield' => $LNG['fl_bonus_shield'], 'bonus_comp' => $LNG['tech'][115], 'bonus_impul' => $LNG['tech'][117], 'bonus_hyper' => $LNG['tech'][118], 'galaxy' => $galaxy, 'system' => $system, 'planet' => $planet, 'planettype' => $planettype, 'target_mission' => $target_mission, 'envoimaxexpedition' => $EnvoiMaxExpedition, 'expeditionencours' => $ExpeditionEnCours, 'flyingfleets' => $CountCurrentFleets, 'maxfleets' => $MaxFlottes, 'target_mission' => $target_mission, 'currentexpeditions' => $ExpeditionEnCours, 'maxexpeditions' => $EnvoiMaxExpedition, 'slots_available' => $MaxFlottes <= $MaxFlyingFleets - $MaxFlyingRaks ? false : true, 'AKSPage' => $AKSPage, 'bonus_attack' => $USER[$resource[109]] * 10 + (TIMESTAMP - $USER[$resource[700]] <= 0 ? 100 * $ExtraDM[700]['add'] : 0) * 5, 'bonus_defensive' => $USER[$resource[110]] * 10 + (TIMESTAMP - $USER[$resource[701]] <= 0 ? 100 * $ExtraDM[701]['add'] : 0) * 5, 'bonus_shield' => $USER[$resource[111]] * 10 + (TIMESTAMP - $USER[$resource[700]] <= 0 ? 100 * $ExtraDM[700]['add'] : 0) * 5, 'bonus_combustion' => $USER[$resource[115]] * 10 + (TIMESTAMP - $USER[$resource[706]] <= 0 ? 100 * $ExtraDM[706]['add'] : 0), 'bonus_impulse' => $USER[$resource[117]] * 20 + (TIMESTAMP - $USER[$resource[706]] <= 0 ? 100 * $ExtraDM[706]['add'] : 0), 'bonus_hyperspace' => $USER[$resource[118]] * 30 + (TIMESTAMP - $USER[$resource[706]] <= 0 ? 100 * $ExtraDM[706]['add'] : 0))); $template->show('fleet_table.tpl'); }
function ShowContactPage() { global $lang, $displays, $db; $displays->assignContent('contact'); $QrySelectUser = "******"; $QrySelectUser .= "FROM {{table}} "; $QrySelectUser .= "WHERE `authlevel` != '0' ORDER BY `authlevel` DESC;"; $GameOps = $db->query($QrySelectUser, 'users'); $QryOpen = "SELECT `register_time` "; $QryOpen .= "FROM {{table}} "; $QryOpen .= "WHERE `id` = '1';"; $Open = $db->query($QryOpen, 'users', true); $parse['game_speed'] = pretty_number($db->game_config['game_speed'] / 2500); $parse['fleet_speed'] = pretty_number($db->game_config['fleet_speed'] / 2500); $parse['resource_multiplier'] = pretty_number($db->game_config['resource_multiplier']); $parse['Fleet_Cdr'] = $db->game_config['Fleet_Cdr']; $parse['Defs_Cdr'] = $db->game_config['Defs_Cdr']; $parse['stat_settings'] = pretty_number($db->game_config['stat_settings']); $parse['stat_update_time'] = pretty_time($db->game_config['stat_update_time'] * 60); if ($db->game_config['noobprotection'] == 1) { $parse['noobprotectionmulti'] = $db->game_config['noobprotectionmulti']; $parse['noobprotectiontime'] = pretty_number($db->game_config['noobprotectiontime']); $parse['noobprotectiontitle'] = "<a onMouseOver=\"return overlib('" . $lang['ccd_alert_noobprot1'] . " " . $lang['noobprotectionmulti'] . " " . $lang['ccd_alert_noobprot2'] . " " . $lang['noobprotectionmulti'] . "', BELOW, CENTER, WIDTH, 350, CAPTION, 'Aclaracion!',BGCOLOR,'#344566', FGCOLOR,'#344566',TEXTCOLOR,'white',CLOSECOLOR,'lime', CAPCOLOR,'red');\" onMouseOut=\"return nd();\" class=\"big\">" . $lang['ccd_noobprotect'] . " (*)</a>"; } else { $parse['noobprotectionmulti'] = "<font color=\"red\">Desactivada</color>"; $parse['noobprotectiontime'] = "<font color=\"red\">Desactivada</color>"; $parse['noobprotectiontitle'] = $lang['ccd_noobprotect']; } $parse['MAX_GALAXY_IN_WORLD'] = MAX_GALAXY_IN_WORLD; $parse['MAX_SYSTEM_IN_GALAXY'] = MAX_SYSTEM_IN_GALAXY; $parse['MAX_PLANET_IN_SYSTEM'] = MAX_PLANET_IN_SYSTEM; $parse['MAX_PLAYER_PLANETS'] = MAX_PLAYER_PLANETS; $parse['FIELDS_BY_TERRAFORMER'] = FIELDS_BY_TERRAFORMER; $parse['FIELDS_BY_MOONBASIS_LEVEL'] = FIELDS_BY_MOONBASIS_LEVEL; $parse['MAX_BUILDING_QUEUE_SIZE'] = MAX_BUILDING_QUEUE_SIZE; $parse['MAX_FLEET_OR_DEFS_PER_ROW'] = pretty_number(MAX_FLEET_OR_DEFS_PER_ROW); $parse['BASE_STORAGE_SIZE'] = pretty_number(BASE_STORAGE_SIZE); $parse['gamename'] = $_SERVER['HTTP_HOST']; $parse['servername'] = $db->game_config['game_name']; $parse['openserver'] = gmdate("d/m/Y G:i:s", $Open['register_time']); foreach ($parse as $name => $trans) { $displays->assign($name, $trans); } while ($Ops = mysql_fetch_assoc($GameOps)) { $displays->newBlock("contact"); $Ops["user_level"] = $lang['user_level'][$Ops['authlevel']]; $email = explode("@", $Ops['email']); $Ops["email_script"] = "<SCRIPT LANGUAGE='JavaScript'>user = '******';site = '" . $email[1] . "';document.write('<a href=\"mailto:' + user + '@' + site + '\">'+ user + '@' + site + '</a>');</SCRIPT>"; foreach ($Ops as $name => $trans) { $displays->assign($name, $trans); } unset($Ops); } $displays->display('Contacto'); }
function check_suspicious(&$session, &$session_list_last_id, &$row) { $session[2] = $session[1] - $session[0]; if ($session[2] > SUSPICIOUS_LONG) { $session[2] = pretty_time($session[2]); $session[0] = date(FMT_DATE_TIME_SQL, $session[0]); $session[1] = date(FMT_DATE_TIME_SQL, $session[1]); $session_list_last_id[] = $session; } //$row ? $session = array(0 => $row['visit_time'], 1 => $row['visit_time']); }
function eco_bld_tech($que_type, &$user, &$planet) { global $config, $lang; lng_include('buildings'); lng_include('infos'); if (!mrc_get_level($user, $planet, STRUC_LABORATORY)) { message($lang['no_laboratory'], $lang['tech'][UNIT_TECHNOLOGIES]); } if (eco_unit_busy($user, $planet, UNIT_TECHNOLOGIES)) { message($lang['eco_bld_msg_err_laboratory_upgrading'], $lang['tech'][UNIT_TECHNOLOGIES]); } switch ($action = sys_get_param_escaped('action')) { case 'build': $operation_result = que_build($user, $planet); break; case 'trim': que_delete(QUE_RESEARCH, $user, $planet, false); break; case 'clear': que_delete(QUE_RESEARCH, $user, $planet, true); break; //case 'build':$operation_result = eco_bld_tech_research($user, $planet);break; } $template = gettemplate('buildings_research', true); if (!empty($operation_result)) { $template->assign_block_vars('result', $operation_result); } $fleet_list = flt_get_fleets_to_planet($planet); $ques = que_get($user['id'], QUE_RESEARCH); $que =& $ques['ques'][QUE_RESEARCH][$user['id']][0]; que_tpl_parse($template, QUE_RESEARCH, $user, null, $que); $in_que =& $ques['in_que'][QUE_RESEARCH][$user['id']][0]; foreach (sn_get_groups('tech') as $unit_id) { if (eco_can_build_unit($user, $planet, $unit_id) != BUILD_ALLOWED) { continue; } $level_base = mrc_get_level($user, '', $unit_id, false, true); $level_effective = mrc_get_level($user, '', $unit_id); $level_in_que = $in_que[$unit_id]; $level_bonus = max(0, $level_effective - $level_base); $level_base_and_que = $level_base + $level_in_que; $build_data = eco_get_build_data($user, $planet, $unit_id, $level_base_and_que); $temp[RES_METAL] = floor($planet['metal'] - $build_data[BUILD_CREATE][RES_METAL]); $temp[RES_CRYSTAL] = floor($planet['crystal'] - $build_data[BUILD_CREATE][RES_CRYSTAL]); $temp[RES_DEUTERIUM] = floor($planet['deuterium'] - $build_data[BUILD_CREATE][RES_DEUTERIUM]); $template->assign_block_vars('production', array('ID' => $unit_id, 'NAME' => $lang['tech'][$unit_id], 'DESCRIPTION' => $lang['info'][$unit_id]['description_short'], 'LEVEL_OLD' => $level_base, 'LEVEL_BONUS' => $level_bonus, 'LEVEL_NEXT' => $level_base + $level_in_que + 1, 'LEVEL_QUED' => $level_in_que, 'LEVEL' => $level_base_and_que, 'BUILD_CAN' => $build_data['CAN'][BUILD_CREATE], 'TIME' => pretty_time($build_data[RES_TIME][BUILD_CREATE]), 'METAL' => $build_data[BUILD_CREATE][RES_METAL], 'CRYSTAL' => $build_data[BUILD_CREATE][RES_CRYSTAL], 'DEUTERIUM' => $build_data[BUILD_CREATE][RES_DEUTERIUM], 'METAL_PRINT' => pretty_number($build_data[BUILD_CREATE][RES_METAL], true, $planet['metal']), 'CRYSTAL_PRINT' => pretty_number($build_data[BUILD_CREATE][RES_CRYSTAL], true, $planet['crystal']), 'DEUTERIUM_PRINT' => pretty_number($build_data[BUILD_CREATE][RES_DEUTERIUM], true, $planet['deuterium']), 'METAL_REST' => pretty_number($temp[RES_METAL], true, true), 'CRYSTAL_REST' => pretty_number($temp[RES_CRYSTAL], true, true), 'DEUTERIUM_REST' => pretty_number($temp[RES_DEUTERIUM], true, true), 'METAL_REST_NUM' => $temp[RES_METAL], 'CRYSTAL_REST_NUM' => $temp[RES_CRYSTAL], 'DEUTERIUM_REST_NUM' => $temp[RES_DEUTERIUM], 'METAL_FLEET' => pretty_number($temp[RES_METAL] + $fleet_list['own']['total'][RES_METAL], true, true), 'CRYSTAL_FLEET' => pretty_number($temp[RES_CRYSTAL] + $fleet_list['own']['total'][RES_CRYSTAL], true, true), 'DEUTERIUM_FLEET' => pretty_number($temp[RES_DEUTERIUM] + $fleet_list['own']['total'][RES_DEUTERIUM], true, true), 'BUILD_CAN2' => $build_data['CAN'][BUILD_CREATE])); } // if(count($que['ques'][$que_id][$user['id']][$planet_id]) >= que_get_max_que_length($user, $planet, $que_id, $que_data)) $template->assign_vars(array('QUE_ID' => QUE_RESEARCH, 'FLEET_OWN_COUNT' => $fleet_list['own']['count'], 'ARTIFACT_ID' => ART_HEURISTIC_CHIP, 'ARTIFACT_LEVEL' => mrc_get_level($user, array(), ART_HEURISTIC_CHIP), 'ARTIFACT_NAME' => $lang['tech'][ART_HEURISTIC_CHIP], 'REQUEST_URI' => $_SERVER['REQUEST_URI'], 'PAGE_HEADER' => $page_header = $lang['tech'][UNIT_TECHNOLOGIES] . ($user['user_as_ally'] ? " {$lang['sys_of_ally']} {$user['username']}" : ''), 'CONFIG_RESEARCH_QUE' => $config->server_que_length_research)); display(parsetemplate($template), $page_header); }
function ShowPlanetMenu($CurrentUser) { global $dpath, $lang; $planets = SortUserPlanets($CurrentUser); while ($p = mysql_fetch_array($planets)) { if ($p["destruyed"] == 0) { $ct = $p["field_max"] + $p["terraformer"] * FIELDS_BY_TERRAFORMER; if ($p['planet_type'] == 3) { $ct = $p["field_max"]; } if ($p['b_building'] != 0) { UpdatePlanetBatimentQueueList($CurrentUserPlanet, $CurrentUser); if ($p['b_building'] != 0) { $BuildQueue = $p['b_building_id']; $QueueArray = explode(";", $BuildQueue); $CurrentBuild = explode(",", $QueueArray[0]); $BuildElement = $CurrentBuild[0]; $BuildLevel = $CurrentBuild[1]; $BuildRestTime = pretty_time($CurrentBuild[3] - time()); $construccion = "" . $lang['tech'][$BuildElement] . "<br>(Construyendo nivel " . $BuildLevel . ")<br>Tiempo restante:" . $BuildRestTime . ""; } else { CheckPlanetUsedFields($p); $construccion = $lang['ov_free']; } } else { $construccion = $lang['ov_free']; } $popup = "" . $p['name'] . " [" . $p['galaxy'] . ":" . $p['system'] . ":" . $p['planet'] . "]<br>Campos ocupados: " . $p['field_current'] . "/" . $ct . "<br>" . $construccion . ""; if ($t == 0) { $parse['mplanet'] .= "<th text-decoration:none>"; } if ($p['planet_type'] == 1 && $p["id"] != $CurrentUser["current_planet"]) { $parse['mplanet'] .= "<div align=center><a class=mplanet href=game.php?page={$_GET['page']}&gid={$_GET['gid']}&cp=" . $p['id'] . "&mode=" . $_GET['mode'] . "&re=0 onmouseover=\"return overlib('" . $popup . "', CENTER, OFFSETX, -80, OFFSETY, 20, WIDTH, 200)\" onmouseout=\"return nd();\"><img src=" . $dpath . "/planeten/" . $p['image'] . ".jpg border=0 height=78 width=78><br><font color=#2E9AFE>" . $p['name'] . " </font><font color=#58FA58><br>[" . $p['galaxy'] . ":" . $p['system'] . ":" . $p['planet'] . "]</font></a>"; } elseif ($p['planet_type'] == 3 && $p["id"] != $CurrentUser["current_planet"]) { $parse['mplanet'] .= "<div align=center><a class=mplanet href=game.php?page={$_GET['page']}&gid={$_GET['gid']}&cp=" . $p['id'] . "&mode=" . $_GET['mode'] . "&re=0 onmouseover=\"return overlib('" . $popup . "', CENTER, OFFSETX, -80, OFFSETY, 20, WIDTH, 200)\" onmouseout=\"return nd();\"><img src=" . $dpath . "/planeten/" . $p['image'] . ".jpg border=0 height=78 width=78><br>" . $p['name'] . " (Luna) <font color=#58FA58><br>[" . $p['galaxy'] . ":" . $p['system'] . ":" . $p['planet'] . "]</font></a>"; } else { $parse['mplanet'] .= "<div align=center><a class=mplanet href=# onmouseover=\"return overlib('" . $popup . "', CENTER, OFFSETX, -80, OFFSETY, 20, WIDTH, 200)\" onmouseout=\"return nd();\"><img src=" . $dpath . "/planeten/" . $p['image'] . ".jpg border=0 height=78 width=78><br><font color=#FFFF00>" . $p['name'] . " </font><font color=#FE9A2E><br>[" . $p['galaxy'] . ":" . $p['system'] . ":" . $p['planet'] . "]</font></a></div>"; } if ($t == 6) { $parse['mplanet'] .= "</th>"; $t = 0; } else { $t = $t + 1; } } } $parse['mplanet'] .= "</center></table>"; return parsetemplate(gettemplate('planet_menu'), $parse); }
function ShowOverviewPage() { global $CONF, $LNG, $PLANET, $USER, $db, $resource, $UNI; $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']; } $OnlineAdmins = $db->query("SELECT `id`,`username` FROM " . USERS . " WHERE `universe` = '" . $UNI . "' AND `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->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' => GetTeamspeakData(), '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"); }
function show() { global $USER, $PLANET, $LNG, $UNI, $CONF, $resource, $pricelist; $GetAll = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_planets` WHERE id_owner = " . $USER['id'] . " AND destruyed = '0' ORDER by ordernumber ASC;"); $number = 1; if ($GLOBALS['DATABASE']->numRows($GetAll) > 0) { while ($messageRow = $GLOBALS['DATABASE']->fetch_array($GetAll)) { if ($messageRow['b_building'] - TIMESTAMP > 0) { $Queue = unserialize($messageRow['b_building_id']); $buildInfo['buildings'] = array('id' => $Queue[0][0], 'level' => $Queue[0][1], 'timeleft' => $messageRow['b_building'] - TIMESTAMP, 'time' => $messageRow['b_building'], 'starttime' => pretty_time($messageRow['b_building'] - TIMESTAMP)); } else { $buildInfo['buildings'] = false; } /* As FR#206 (http://tracker.2moons.cc/view.php?id=206), i added the shipyard and research status here, but i add not them the template. */ if (!empty($messageRow['b_hangar_id'])) { $Queue = unserialize($messageRow['b_hangar_id']); //$time = BuildFunctions::getBuildingTime($USER, $messageRow['id'], $Queue[0][0]) * $Queue[0][1]; $time = BuildFunctions::getBuildingTime($USER, 1, $Queue[0][0]) * $Queue[0][1]; $buildInfo['fleet'] = array('id' => $Queue[0][0], 'level' => $Queue[0][1], 'timeleft' => $time - $messageRow['b_hangar'], 'time' => $time, 'starttime' => pretty_time($time - $messageRow['b_hangar'])); } else { $buildInfo['fleet'] = false; } if (!empty($messageRow['b_defense_id'])) { $Queue = unserialize($messageRow['b_defense_id']); //$time = BuildFunctions::getBuildingTime($USER, $messageRow['id'], $Queue[0][0]) * $Queue[0][1]; $time = BuildFunctions::getBuildingTime($USER, 1, $Queue[0][0]) * $Queue[0][1]; $buildInfo['defense'] = array('id' => $Queue[0][0], 'level' => $Queue[0][1], 'timeleft' => $time - $messageRow['b_defense'], 'time' => $time, 'starttime' => pretty_time($time - $messageRow['b_defense'])); } else { $buildInfo['defense'] = false; } if ($USER['b_tech'] - TIMESTAMP > 0) { $Queue = unserialize($USER['b_tech_queue']); $buildInfo['tech'] = array('id' => $Queue[0][0], 'level' => $Queue[0][1], 'timeleft' => $USER['b_tech'] - TIMESTAMP, 'time' => $USER['b_tech'], 'starttime' => pretty_time($USER['b_tech'] - TIMESTAMP)); } else { $buildInfo['tech'] = false; } $messageList[$messageRow['id']] = array('buildInfo' => $buildInfo, 'name' => $messageRow['name'], 'galaxy' => $messageRow['galaxy'], 'system' => $messageRow['system'], 'planet' => $messageRow['planet'], 'plid' => $messageRow['id'], 'gmetal' => pretty_number($messageRow['metal']), 'gcrystal' => pretty_number($messageRow['crystal']), 'gdeuterium' => pretty_number($messageRow['deuterium']), 'gelyrium' => pretty_number($messageRow['elyrium']), 'gmetalpircent' => round($messageRow['metal'] * 100 / $messageRow['metal_max']), 'gcrystalpircent' => round($messageRow['crystal'] * 100 / $messageRow['crystal_max']), 'gdeuteriumpircent' => round($messageRow['deuterium'] * 100 / $messageRow['deuterium_max']), 'gelyriumpircent' => round($messageRow['elyrium'] * 100 / $messageRow['elyrium_max']), 'energypircent' => round(abs($messageRow['energy'] * ($messageRow['energy'] - abs($messageRow['energy_used'])) / 2)), 'field_current' => $messageRow['field_current'], 'field_max' => $messageRow['field_max'], 'teleport_portal' => $messageRow['teleport_portal'], 'image' => $messageRow['image'], 'force_field_timer' => $messageRow['force_field_timer'], 'energy' => $messageRow['energy'], 'energy_used' => $messageRow['energy_used'], 'metal_mine_porcent' => $messageRow['metal_mine_porcent'] * 10, 'crystal_mine_porcent' => $messageRow['crystal_mine_porcent'] * 10, 'deuterium_sintetizer_porcent' => $messageRow['deuterium_sintetizer_porcent'] * 10, 'elyrium_mine_porcent' => $messageRow['elyrium_mine_porcent'] * 10, 'number' => $number++); } } $this->tplObj->assign_vars(array('messageList' => $messageList, 'timinger' => TIMESTAMP)); $this->display("page.gestion.default.tpl"); }
/** * ElementBuildListQueue.php * * @version 1.0 * @copyright 2008 By Chlorel for XNova */ function ElementBuildListQueue($CurrentUser, $CurrentPlanet) { // Jamais appelé pour le moment donc totalement modifiable ! /* alter table `ogame`.`game_planets` change `name` `name` varchar (255) NULL COLLATE latin1_general_ci, change `b_building_id` `b_building_id` text NULL COLLATE latin1_general_ci, change `b_tech_id` `b_tech_id` text NULL COLLATE latin1_general_ci, change `b_hangar_id` `b_hangar_id` text NULL COLLATE latin1_general_ci, change `image` `image` varchar (32) DEFAULT 'normaltempplanet01' NOT NULL COLLATE latin1_general_ci, change `b_building_queue` `b_building_queue` text NULL COLLATE latin1_general_ci, change `unbau` `unbau` varchar (100) NULL COLLATE latin1_general_ci; */ global $lang, $pricelist; // Array del b_hangar_id $b_building_id = explode(';', $CurrentPlanet['b_building_queue']); $a = $b = $c = ""; foreach ($b_hangar_id as $n => $array) { if ($array != '') { $array = explode(',', $array); // calculamos el tiempo $time = GetBuildingTime($user, $CurrentPlanet, $array[0]); $totaltime += $time * $array[1]; $c .= "{$time},"; $Replace = array('ä' => 'ae', 'ü' => 'ü', 'ö' => 'ö'); $Name = strtr($Replace, $lang['tech'][$array[0]]); $b .= "'Test',"; $a .= "{$array[1]},"; } } $parse = $lang; $parse['a'] = $a; $parse['b'] = $b; $parse['c'] = $c; $parse['b_hangar_id_plus'] = $CurrentPlanet['b_hangar']; $parse['pretty_time_b_hangar'] = pretty_time($totaltime - $CurrentPlanet['b_hangar']); // //$CurrentPlanet['last_update'] $text .= parsetemplate(gettemplate('buildings_script'), $parse); #return $text; }
private function GetNextJumpWaitTime($CurMoon) { global $resource; $JumpGateLevel = $CurMoon[$resource[43]]; $LastJumpTime = $CurMoon['last_jump_time']; if ($JumpGateLevel > 0) { $NextJumpTime = $LastJumpTime + JUMPGATE_WAIT_TIME; if ($NextJumpTime >= TIMESTAMP) { $RestWait = $NextJumpTime - TIMESTAMP; $RestString = " " . pretty_time($RestWait); } else { $RestWait = 0; $RestString = ""; } } else { $RestWait = 0; $RestString = ""; } $RetValue['string'] = $RestString; $RetValue['value'] = $RestWait; return $RetValue; }
public function __construct() { global $USER, $CONF, $PLANET, $resource, $reslist, $LNG, $db, $ExtraDM, $OfficerInfo, $pricelist; $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(18)) { $this->UpdateOfficier($Offi); } elseif (!empty($Extra) && !CheckModule(8)) { $this->UpdateExtra($Extra); } } $PlanetRess->SavePlanetToDB(); $template = new template(); $template->loadscript('officier.js'); 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; } $description = $OfficerInfo[$Element]['info'] ? sprintf($LNG['info'][$Element]['description'], is_float($OfficerInfo[$Element]['info']) ? $OfficerInfo[$Element]['info'] * 100 : $OfficerInfo[$Element]['info'], $pricelist[$Element]['max']) : sprintf($LNG['info'][$Element]['description'], $pricelist[$Element]['max']); $OfficierList[] = array('id' => $Element, 'level' => $USER[$resource[$Element]], 'name' => $LNG['tech'][$Element], 'desc' => $description, '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'], '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"); }
private function GetNextJumpWaitTime($CurMoon) { global $resource; $JumpGateLevel = $CurMoon[$resource[43]]; $LastJumpTime = $CurMoon['last_jump_time']; if ($JumpGateLevel > 0) { $WaitBetweenJmp = 60 * 60 * (1 / $JumpGateLevel); $NextJumpTime = $LastJumpTime + $WaitBetweenJmp; if ($NextJumpTime >= time()) { $RestWait = $NextJumpTime - time(); $RestString = " " . pretty_time($RestWait); } else { $RestWait = 0; $RestString = ""; } } else { $RestWait = 0; $RestString = ""; } $RetValue['string'] = $RestString; $RetValue['value'] = $RestWait; return $RetValue; }
function tpl_parse_planet($planet, $que) { global $lang, $config, $time_now; $fleet_list = flt_get_fleets_to_planet($planet); $hangar = explode(';', $planet['b_hangar_id']); foreach ($hangar as $hangar_row) { if ($hangar_row) { $hangar_row = explode(',', $hangar_row); $hangar_que['que'][] = array('id' => $hangar_row[0], 'count' => $hangar_row[1]); $hangar_que[$hangar_row[0]] += $hangar_row[1]; } } $hangar_build_tip = $hangar_que['que'][0]['id'] ? $lang[tech][$hangar_que['que'][0]['id']] : ''; $result = array('ID' => $planet['id'], 'NAME' => $planet['name'], 'IMAGE' => $planet['image'], 'GALAXY' => $planet['galaxy'], 'SYSTEM' => $planet['system'], 'PLANET' => $planet['planet'], 'TYPE' => $planet['planet_type'], 'COORDINATES' => uni_render_coordinates($planet), 'METAL_PERCENT' => $planet['metal_mine_porcent'] * 10, 'CRYSTAL_PERCENT' => $planet['crystal_mine_porcent'] * 10, 'DEUTERIUM_PERCENT' => $planet['deuterium_sintetizer_porcent'] * 10, 'TECH' => $planet['b_tech'] ? $lang['tech'][$planet['b_tech_id']] . ' ' . pretty_time($planet['b_tech'] - $time_now) : 0, 'HANGAR' => $hangar_build_tip, 'hangar_que' => $hangar_que, 'FIELDS_CUR' => $planet['field_current'], 'FIELDS_MAX' => eco_planet_fields_max($planet), 'FILL' => min(100, floor($planet['field_current'] / eco_planet_fields_max($planet) * 100)), 'FLEET_OWN' => $fleet_list['own']['count'], 'FLEET_ENEMY' => $fleet_list['enemy']['count'], 'FLEET_NEUTRAL' => $fleet_list['neutral']['count'], 'fleet_list' => $fleet_list); if (!empty($que)) { $que_item = $que['que'][QUE_STRUCTURES][0]; if ($que_item) { $result['BUILDING_ID'] = $que_item['ID']; $result['BUILDING_TIP'] = $que_item['NAME']; $result['BUILDING'] = int_buildCounter($planet, 'building', $planet['id'], $que); } } return $result; }
function ShowActivePlanetAdmin($user) { global $lang, $db, $displays; if ($user['authlevel'] < 1) { die($displays->message($lang['not_enough_permissions'])); } $query = $db->query("SELECT `id`,`name`,`galaxy`,`system`,`planet`,`points`,`last_update` FROM {{table}} WHERE `last_update` >= '" . (time() - 15 * 60) . "' and `destruyed`='0' ORDER BY `id` ASC", 'planets'); $i = 0; $displays->assignContent("adm/activeplanets_body", $topnav = true, $menu = true, $admin = true); while ($u = mysql_fetch_array($query)) { $displays->newblock("planetas_activos"); $i++; $u['position'] = "[" . $u['galaxy'] . ":" . $u['system'] . ":" . $u['planet'] . "]"; $u['points'] = pretty_number($u['points'] / 1000); $u['activity'] = pretty_time(time() - $u['last_update']); foreach ($u as $key => $value) { $displays->assign($key, $value); } } $lang['online_list'] .= "<tr>"; $lang['online_list'] .= "<th class=\"b\" colspan=\"4\">" . $lang['ap_there_are'] . $i . $lang['ap_with_activity'] . "</th>"; $lang['online_list'] .= "</tr>"; $displays->display(); }
function ShowBuildTime($time) { global $lang; return "<br>" . $lang['fgf_time'] . pretty_time($time); }
define('INSIDE', true); define('INSTALL', false); define('IN_ADMIN', true); $ugamela_root_path = './../'; include $ugamela_root_path . 'extension.inc'; include $ugamela_root_path . 'common.' . $phpEx; if ($user['authlevel'] >= 1) { includeLang('admin'); $parse = $lang; $parse['dpath'] = $dpath; $parse['mf'] = $mf; $PageTPL = gettemplate('admin/activeplanet_body'); $AllActivPlanet = doquery("SELECT * FROM {{table}} WHERE `last_update` >= '" . (time() - 15 * 60) . "' ORDER BY `id` ASC", 'planets'); $Count = 0; while ($ActivPlanet = mysql_fetch_array($AllActivPlanet)) { $parse['online_list'] .= "<tr>"; $parse['online_list'] .= "<td class=b><center><b>" . $ActivPlanet['name'] . "</b></center></td>"; $parse['online_list'] .= "<td class=b><center><b>[" . $ActivPlanet['galaxy'] . ":" . $ActivPlanet['system'] . ":" . $ActivPlanet['planet'] . "]</b></center></td>"; $parse['online_list'] .= "<td class=m><center><b>" . pretty_number($ActivPlanet['points'] / 1000) . "</b></center></td>"; $parse['online_list'] .= "<td class=b><center><b>" . pretty_time(time() - $ActivPlanet['last_update']) . "</b></center></td>"; $parse['online_list'] .= "</tr>"; $Count++; } $parse['online_list'] .= "<tr>"; $parse['online_list'] .= "<th class=\"b\" colspan=\"4\">" . $lang['adm_pl_they'] . " " . $Count . " " . $lang['adm_pl_apla'] . "</th>"; $parse['online_list'] .= "</tr>"; $page = parsetemplate($PageTPL, $parse); display($page, $lang['adm_pl_title'], false, '', true); } else { message($lang['sys_noalloaw'], $lang['sys_noaccess']); }
function ShowOverviewPage($CurrentUser, $CurrentPlanet) { global $xgp_root, $phpEx, $dpath, $game_config, $lang, $planetrow, $user, $resource; include_once $xgp_root . 'includes/functions/InsertJavaScriptChronoApplet.' . $phpEx; include_once $xgp_root . 'includes/classes/class.FlyingFleetsTable.' . $phpEx; $FlyingFleetsTable = new FlyingFleetsTable(); $lunarow = doquery("SELECT * FROM {{table}} WHERE `id_owner` = '" . $CurrentPlanet['id_owner'] . "' AND `galaxy` = '" . $CurrentPlanet['galaxy'] . "' AND `system` = '" . $CurrentPlanet['system'] . "' AND `planet` = '" . $CurrentPlanet['planet'] . "' AND `planet_type`='3'", 'planets', true); if (empty($lunarow)) { unset($lunarow); } CheckPlanetUsedFields($lunarow); $parse = $lang; $parse['planet_id'] = $CurrentPlanet['id']; $parse['planet_name'] = $CurrentPlanet['name']; $parse['galaxy_galaxy'] = $CurrentPlanet['galaxy']; $parse['galaxy_system'] = $CurrentPlanet['system']; $parse['galaxy_planet'] = $CurrentPlanet['planet']; $parse['dpath'] = $dpath; $parse['avatar'] = $user['avatar']; $online_users = doquery("SELECT COUNT(DISTINCT(id)) as `onlinenow` FROM {{table}} WHERE `onlinetime` > '" . (time() - 15 * 60) . "';", 'users', true); $parse['online_users'] = $online_users['onlinenow']; $QueryStat = doquery("SELECT * FROM {{table}} WHERE `id_owner` = '" . $CurrentUser['id'] . "' AND `stat_type` = '1'", "statpoints", true); $parse['puntos_defensa'] = pretty_number($QueryStat['defs_count']); $parse['puntos_edificios'] = pretty_number($QueryStat['build_points']); $parse['puntos_naves'] = pretty_number($QueryStat['fleet_count']); $parse['puntos_investigaciones'] = pretty_number($QueryStat['tech_count']); $StatRecord = doquery("SELECT `total_rank`,`total_points`,`defs_rank`,`build_rank`,`fleet_rank`,`tech_rank` FROM `{{table}}` WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $CurrentUser['id'] . "';", 'statpoints', true); $parse['top_defensa'] = $StatRecord['defs_rank']; $parse['top_edificios'] = $StatRecord['build_rank']; $parse['top_naves'] = $StatRecord['fleet_rank']; $parse['top_investigaciones'] = $StatRecord['tech_rank']; $parse['top_total'] = $StatRecord['total_rank']; $parse['ally_name'] = $ally_name; $parse['ally_tag'] = $ally_tag; if ($Level > 0) { $parse['admin_link'] = "<tr><td><div align=\"center\"><a href=\"javascript:top.location.href='adm/index.php'\"> <font color=\"lime\">" . $lang['lm_administration'] . "</font></a></div></td></tr>"; } else { $parse['admin_link'] = ""; } switch ($_GET['mode']) { case 'renameplanet': if ($_POST['action'] == $lang['ov_planet_rename_action']) { $newname = mysql_escape_string(strip_tags(trim($_POST['newname']))); if (preg_match("/[^A-z0-9_\\- ]/", $newname) == 1) { message($lang['ov_newname_error'], "game.php?page=overview&mode=renameplanet", 2); } if ($newname != "") { doquery("UPDATE {{table}} SET `name` = '" . $newname . "' WHERE `id` = '" . $CurrentUser['current_planet'] . "' LIMIT 1;", "planets"); } } elseif ($_POST['action'] == $lang['ov_abandon_planet']) { return display(parsetemplate(gettemplate('overview/overview_deleteplanet'), $parse)); } elseif ($_POST['kolonieloeschen'] == 1 && intval($_POST['deleteid']) == $CurrentUser['current_planet']) { $filokontrol = doquery("SELECT * FROM {{table}} WHERE fleet_owner = '{$user['id']}' AND fleet_start_galaxy='{$CurrentPlanet['galaxy']}' AND fleet_start_system='{$CurrentPlanet['system']}' AND fleet_start_planet='{$CurrentPlanet['planet']}'", 'fleets'); while ($satir = mysql_fetch_array($filokontrol)) { $kendifilo = $satir['fleet_owner']; $digerfilo = $satir['fleet_target_owner']; $harabeyeri = $satir['fleet_end_type']; $mess = $satir['fleet_mess']; } $filokontrol = doquery("SELECT * FROM {{table}} WHERE fleet_target_owner = '{$user['id']}' AND fleet_end_galaxy='{$CurrentPlanet['galaxy']}' AND fleet_end_system='{$CurrentPlanet['system']}' AND fleet_end_planet='{$CurrentPlanet['planet']}'", 'fleets'); while ($satir = mysql_fetch_array($filokontrol)) { $kendifilo = $satir['fleet_owner']; $digerfilo = $satir['fleet_target_owner']; $gezoay = $satir['fleet_end_type']; $mess = $satir['fleet_mess']; } if ($kendifilo > 0) { message($lang['ov_abandon_planet_not_possible'], 'game.php?page=overview&mode=renameplanet'); } elseif ($digerfilo > 0 && $mess < 1 && $gezoay != 2) { message($lang['ov_abandon_planet_not_possible'], 'game.php?page=overview&mode=renameplanet'); } else { if (md5($_POST['pw']) == $CurrentUser["password"] && $CurrentUser['id_planet'] != $CurrentUser['current_planet']) { doquery("UPDATE {{table}} SET `destruyed` = '" . (time() + 86400) . "' WHERE `id` = '" . mysql_real_escape_string($CurrentUser['current_planet']) . "' LIMIT 1;", 'planets'); doquery("UPDATE {{table}} SET `current_planet` = `id_planet` WHERE `id` = '" . mysql_real_escape_string($CurrentUser['id']) . "' LIMIT 1", "users"); doquery("DELETE FROM {{table}} WHERE `galaxy` = '" . $CurrentPlanet['galaxy'] . "' AND `system` = '" . $CurrentPlanet['system'] . "' AND `planet` = '" . $CurrentPlanet['planet'] . "' AND `planet_type` = 3;", 'planets'); message($lang['ov_planet_abandoned'], 'game.php?page=overview&mode=renameplanet'); } elseif ($CurrentUser['id_planet'] == $CurrentUser["current_planet"]) { message($lang['ov_principal_planet_cant_abanone'], 'game.php?page=overview&mode=renameplanet'); } else { message($lang['ov_wrong_pass'], 'game.php?page=overview&mode=renameplanet'); } } } return display(parsetemplate(gettemplate('overview/overview_renameplanet'), $parse)); break; default: if ($StatRecord['total_points'] >= 0 && $StatRecord['total_points'] < 100000) { $parse['rankgame'] = "Soldado"; $parse['rankimg'] = "rank1.gif"; } elseif ($StatRecord['total_points'] >= 100000 && $StatRecord['total_points'] < 250000) { $parse['rankgame'] = "Cabo Cazador"; $parse['rankimg'] = "rank2.gif"; } elseif ($StatRecord['total_points'] >= 250000 && $StatRecord['total_points'] < 500000) { $parse['rankgame'] = "Sargento Cazador"; $parse['rankimg'] = "rank3.gif"; } elseif ($StatRecord['total_points'] >= 500000 && $StatRecord['total_points'] < 1000000) { $parse['rankgame'] = "Teniente de Crucero"; $parse['rankimg'] = "rank4.gif"; } elseif ($StatRecord['total_points'] >= 1000000 && $StatRecord['total_points'] < 2500000) { $parse['rankgame'] = "Capitán Destructor"; $parse['rankimg'] = "rank5.gif"; } elseif ($StatRecord['total_points'] >= 2500000 && $StatRecord['total_points'] < 5000000) { $parse['rankgame'] = "Almirante Acorazado"; $parse['rankimg'] = "rank6.gif"; } elseif ($StatRecord['total_points'] >= 5000000 && $StatRecord['total_points'] < 10000000) { $parse['rankgame'] = "General Estrella"; $parse['rankimg'] = "rank7.gif"; } elseif ($StatRecord['total_points'] >= 10000000 && $StatRecord['total_points'] < 25000000) { $parse['rankgame'] = "General Supernova"; $parse['rankimg'] = "rank8.gif"; } elseif ($StatRecord['total_points'] >= 25000000 && $StatRecord['total_points'] < 50000000) { $parse['rankgame'] = "General de Flota"; $parse['rankimg'] = "rank9.gif"; } elseif ($StatRecord['total_points'] >= 50000000 && $StatRecord['total_points'] < 100000000) { $parse['rankgame'] = "General Interestelar"; $parse['rankimg'] = "rank10.gif"; } elseif ($StatRecord['total_points'] >= 100000000 && $StatRecord['total_points'] < 500000000) { $parse['rankgame'] = "Cónsul General"; $parse['rankimg'] = "rank11.gif"; } elseif ($StatRecord['total_points'] >= 500000000) { $parse['rankgame'] = "Emperador"; $parse['rankimg'] = "rank12.gif"; } if ($CurrentPlanet['planet'] >= 1 && $CurrentPlanet['planet'] < 4) { $parse['type_of_planet'] = "Desertico"; } elseif ($CurrentPlanet['planet'] >= 4 && $CurrentPlanet['planet'] < 7) { $parse['type_of_planet'] = "Jungla"; } elseif ($CurrentPlanet['planet'] >= 7 && $CurrentPlanet['planet'] < 10) { $parse['type_of_planet'] = "Gaseoso"; } elseif ($CurrentPlanet['planet'] >= 10 && $CurrentPlanet['planet'] < 13) { $parse['type_of_planet'] = "Acuatico"; } elseif ($CurrentPlanet['planet'] >= 13) { $parse['type_of_planet'] = "Congelado"; } $CONSULTA = doquery("SELECT metal,crystal,darkmatter FROM {{table}} WHERE galaxy = '" . $CurrentPlanet['galaxy'] . "' AND system = '" . $CurrentPlanet['system'] . "' AND planet = '" . $CurrentPlanet['planet'] . "'", "galaxy", true); $parse['metal_debris'] = pretty_number($CONSULTA['metal']); $parse['crystal_debris'] = pretty_number($CONSULTA['crystal']); $parse['darkmatter_debris'] = pretty_number($CONSULTA['darkmatter']); if ($CurrentPlanet['recycler'] != 0 && ($CONSULTA['metal'] != 0 || $CONSULTA['crystal'] != 0 || $CONSULTA['darkmatter'] != 0)) { $parse['get_link'] = " (<a href=\"game.php?page=galaxy&mode=8&g=" . $CurrentPlanet['galaxy'] . "&s=" . $CurrentPlanet['system'] . "&p=" . $CurrentPlanet['planet'] . "&t=2\">asdasd</a>)"; } else { $parse['get_link'] = ''; } if ($CurrentUser['new_message'] != 0) { $Have_new_message .= "<tr>"; if ($CurrentUser['new_message'] == 1) { $Have_new_message .= "<th colspan=4><a href=game.{$phpEx}?page=messages>" . $lang['ov_have_new_message'] . "</a></th>"; } elseif ($CurrentUser['new_message'] > 1) { $Have_new_message .= "<th colspan=4><a href=game.{$phpEx}?page=messages>"; $Have_new_message .= str_replace('%m', pretty_number($CurrentUser['new_message']), $lang['ov_have_new_messages']); $Have_new_message .= "</a></th>"; } $Have_new_message .= "</tr>"; } $OwnFleets = doquery("SELECT * FROM {{table}} WHERE `fleet_owner` = '" . $CurrentUser['id'] . "';", 'fleets'); $Record = 0; while ($FleetRow = mysql_fetch_array($OwnFleets)) { $Record++; $StartTime = $FleetRow['fleet_start_time']; $StayTime = $FleetRow['fleet_end_stay']; $id = $FleetRow['fleet_id']; $EndTime = $FleetRow['fleet_end_time']; /////// // ### LUCKY , CODES ARE BELOW $hedefgalaksi = $FleetRow['fleet_end_galaxy']; $hedefsistem = $FleetRow['fleet_end_system']; $hedefgezegen = $FleetRow['fleet_end_planet']; $mess = $FleetRow['fleet_mess']; $filogrubu = $FleetRow['fleet_group']; $id = $FleetRow['fleet_id']; ////// $Label = "fs"; if ($StartTime > time()) { $fpage[$StartTime . $id] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 0, true, $Label, $Record); } if ($FleetRow['fleet_mission'] != 4 && $FleetRow['fleet_mission'] != 10) { $Label = "ft"; if ($StayTime > time()) { $fpage[$StayTime . $id] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 1, true, $Label, $Record); } $Label = "fe"; if ($EndTime > time()) { $fpage[$EndTime . $id] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 2, true, $Label, $Record); } } } mysql_free_result($OwnFleets); //iss ye katilan filo//////////////////////////////////// // ### LUCKY , CODES ARE BELOW $dostfilo = doquery("SELECT * FROM {{table}} WHERE `fleet_end_galaxy` = '" . $hedefgalaksi . "' AND `fleet_end_system` = '" . $hedefsistem . "' AND `fleet_end_planet` = '" . $hedefgezegen . "' AND `fleet_group` = '" . $filogrubu . "';", 'fleets'); $Record1 = 0; while ($FleetRow = mysql_fetch_array($dostfilo)) { $StartTime = $FleetRow['fleet_start_time']; $StayTime = $FleetRow['fleet_end_stay']; $id = $FleetRow['fleet_id']; $EndTime = $FleetRow['fleet_end_time']; /////// $hedefgalaksi = $FleetRow['fleet_end_galaxy']; $hedefsistem = $FleetRow['fleet_end_system']; $hedefgezegen = $FleetRow['fleet_end_planet']; $mess = $FleetRow['fleet_mess']; $filogrubu = $FleetRow['fleet_group']; $id = $FleetRow['fleet_id']; /////// if ($FleetRow['fleet_mission'] == 2 && $FleetRow['fleet_owner'] != $CurrentUser['id']) { $Record1++; // if (($FleetRow['fleet_mission'] == 2) ){ if ($mess > 0) { $StartTime = ""; } else { $StartTime = $FleetRow['fleet_start_time']; } if ($StartTime > time()) { $Label = "ofs"; $fpage[$StartTime . $id] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 0, false, $Label, $Record1); } // } } ///"" if ($FleetRow['fleet_mission'] == 1 && $FleetRow['fleet_owner'] != $CurrentUser['id'] && $filogrubu > 0) { $Record++; if ($mess > 0) { $StartTime = ""; } else { $StartTime = $FleetRow['fleet_start_time']; } if ($StartTime > time()) { $Label = "ofs"; $fpage[$StartTime . $id] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 0, false, $Label, $Record); } } } mysql_free_result($dostfilo); // ////////////////////////////////////////////////// $OtherFleets = doquery("SELECT * FROM {{table}} WHERE `fleet_target_owner` = '" . $CurrentUser['id'] . "';", 'fleets'); $Record = 2000; while ($FleetRow = mysql_fetch_array($OtherFleets)) { if ($FleetRow['fleet_owner'] != $CurrentUser['id']) { if ($FleetRow['fleet_mission'] != 8) { $Record++; $StartTime = $FleetRow['fleet_start_time']; $StayTime = $FleetRow['fleet_end_stay']; if ($StartTime > time()) { $Label = "ofs"; $fpage[$StartTime . $id] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 0, false, $Label, $Record); } if ($FleetRow['fleet_mission'] == 5) { $Label = "oft"; if ($StayTime > time()) { $fpage[$StayTime . $id] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 1, false, $Label, $Record); } } } } } mysql_free_result($OtherFleets); $planets_query = doquery("SELECT * FROM `{{table}}` WHERE id_owner='{$CurrentUser['id']}' AND `destruyed` = 0", "planets"); $Colone = 1; $AllPlanets = "<tr>"; while ($CurrentUserPlanet = mysql_fetch_array($planets_query)) { if ($CurrentUserPlanet["id"] != $CurrentUser["current_planet"] && $CurrentUserPlanet['planet_type'] != 3) { $Coloneshow++; $AllPlanets .= "<th width='80'>" . $CurrentUserPlanet['name'] . "<br>"; $AllPlanets .= "<a href=\"game.php?page=overview&cp=" . $CurrentUserPlanet['id'] . "&re=0\" title=\"" . $CurrentUserPlanet['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $CurrentUserPlanet['image'] . ".gif\" height=\"50\" width=\"50\"></a><br>"; $AllPlanets .= "<center>"; if ($CurrentUserPlanet['b_building'] != 0) { UpdatePlanetBatimentQueueList($CurrentUserPlanet, $CurrentUser); if ($CurrentUserPlanet['b_building'] != 0) { $BuildQueue = $CurrentUserPlanet['b_building_id']; $QueueArray = explode(";", $BuildQueue); $CurrentBuild = explode(",", $QueueArray[0]); $BuildElement = $CurrentBuild[0]; $BuildLevel = $CurrentBuild[1]; $BuildRestTime = pretty_time($CurrentBuild[3] - time()); $AllPlanets .= '' . $lang['tech'][$BuildElement] . ' (' . $BuildLevel . ')'; $AllPlanets .= "<br><font color=\"#7f7f7f\">(" . $BuildRestTime . ")</font>"; } else { CheckPlanetUsedFields($CurrentUserPlanet); $AllPlanets .= $lang['ov_free']; } } else { $AllPlanets .= $lang['ov_free']; } $AllPlanets .= "</center></th>"; if ($Colone <= 5) { $Colone++; } else { $AllPlanets .= "</tr><tr>"; $Colone = 1; } } } mysql_free_result($planets_query); $AllPlanets .= "</tr>"; if ($game_config['OverviewNewsFrame'] == '1') { $parse['NewsFrame'] = "<tr>" . $lang['ov_news_title'] . "<th colspan=\"4\">" . stripslashes($game_config['OverviewNewsText']) . "</th></tr>"; } if ($lunarow['id'] != 0 && $lunarow['destruyed'] != 1 && $CurrentPlanet['planet_type'] != 3) { if ($CurrentPlanet['planet_type'] == 1 or $lunarow['id'] != 0) { $moon = doquery("SELECT `id`,`name`,`image` FROM {{table}} WHERE `galaxy` = '" . $CurrentPlanet['galaxy'] . "' AND `system` = '" . $CurrentPlanet['system'] . "' AND `planet` = '" . $CurrentPlanet['planet'] . "' AND `planet_type` = '3'", 'planets', true); $parse['moon_img'] = "<a href=\"game.php?page=overview&cp=" . $moon['id'] . "&re=0\" title=\"" . $moon['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $moon['image'] . ".png\" height=\"90\" width=\"90\"></a>"; $parse['moon'] = $moon['name'] . ""; } else { $parse['moon_img'] = ""; $parse['moon'] = ""; } } elseif ($CurrentPlanet['planet_type'] == 3) { $moon = doquery("SELECT `id`,`name`,`image` FROM {{table}} WHERE `galaxy` = '" . $CurrentPlanet['galaxy'] . "' AND `system` = '" . $CurrentPlanet['system'] . "' AND `planet` = '" . $CurrentPlanet['planet'] . "' AND `planet_type` = '1'", 'planets', true); $parse['moon_img'] = "<a href=\"game.php?page=overview&cp=" . $moon['id'] . "&re=0\" title=\"" . $moon['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $moon['image'] . ".gif\" height=\"120\" width=\"120\"></a>"; $parse['moon'] = $moon['name'] . ""; } else { $parse['moon_img'] = ""; $parse['moon'] = ""; } $parse['planet_diameter'] = pretty_number($CurrentPlanet['diameter']); $parse['planet_field_current'] = $CurrentPlanet['field_current']; $parse['planet_field_max'] = CalculateMaxPlanetFields($CurrentPlanet); $parse['planet_temp_min'] = $CurrentPlanet['temp_min']; $parse['planet_temp_max'] = $CurrentPlanet['temp_max']; $StatRecord = doquery("SELECT `total_rank`,`total_points` FROM `{{table}}` WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $CurrentUser['id'] . "';", 'statpoints', true); $parse['user_username'] = $CurrentUser['username']; if (count($fpage) > 0) { ksort($fpage); foreach ($fpage as $time => $content) { $flotten .= $content . "\n"; } } // **** INICIA MOD {MOSTRAR TECNOLOGIA EN PROCESO EN VISTA GENERAL} **** if ($CurrentPlanet['b_building'] != 0) { include $xgp_root . 'includes/functions/InsertBuildListScript.' . $phpEx; UpdatePlanetBatimentQueueList($planetrow, $user); if ($CurrentPlanet['b_building'] != 0) { $BuildQueue = explode(";", $CurrentPlanet['b_building_id']); $CurrBuild = explode(",", $BuildQueue[0]); $RestTime = $CurrentPlanet['b_building'] - time(); $PlanetID = $CurrentPlanet['id']; $Build = InsertBuildListScript("buildings"); $Build .= "<table>"; $Build .= " <tr>"; $Build .= " <td colspan=\"2\">" . $lang['tech'][$CurrBuild[0]] . "</td>"; $Build .= " </tr>"; $Build .= " <tr>"; $Build .= " <td align=\"center\" valign=\"middle\"><img src=\"" . $dpath . "gebaeude/" . $CurrBuild[0] . ".gif\" width=\"40\" height=\"40\"></td>"; $Build .= " <td>" . $lang['pr_subiendo'] . " <span style=\"color:#FF8C00;\">Nivel " . $CurrBuild[1] . "</span><br />"; $Build .= " " . $lang['pr_duracion'] . ":<div id=\"blc\" class=\"z\" style=\"color:yellow;\">" . pretty_time($RestTime) . "</div>"; $Build .= " </td>"; $Build .= " </tr>"; $Build .= "</Table>"; $Build .= "\n<script language=\"JavaScript\">"; $Build .= "\n pp = \"" . $RestTime . "\";\n"; $Build .= "\n pk = \"" . 1 . "\";\n"; $Build .= "\n pm = \"cancel\";\n"; $Build .= "\n pl = \"" . $PlanetID . "\";\n"; $Build .= "\n t();\n"; $Build .= "\n</script>\n"; $parse['building'] = $Build; } else { $parse['building'] = $lang['ov_free']; } } else { $parse['building'] = $lang['ov_free']; } $PlanetaQueInv = doquery("SELECT id, name, b_tech, b_tech_id FROM `{{table}}` WHERE `id_owner` = '" . $CurrentUser['id'] . "' AND `b_tech` != '0';", 'planets', true); if ($PlanetaQueInv['b_tech'] != 0) { include $xgp_root . 'includes/functions/InsertTechListScript.' . $phpEx; UpdatePlanetBatimentQueueList($planetrow, $user); $NvlActual = $CurrentUser[$resource[$PlanetaQueInv['b_tech_id']]] + 1; $RestTime = $PlanetaQueInv['b_tech'] - time(); $PlanetID = $PlanetaQueInv['id']; $NomPlaneta = ""; if ($PlanetaQueInv['name'] != $CurrentPlanet['name']) { $NomPlaneta = " de " . $PlanetaQueInv['name']; } $Tech = InsertTechListScript("buildings", $NomPlaneta); $Tech .= "<table>"; $Tech .= " <tr>"; $Tech .= " <td colspan=\"2\">" . $lang['tech'][$PlanetaQueInv['b_tech_id']] . "</td>"; $Tech .= " </tr>"; $Tech .= " <tr>"; $Tech .= " <td align=\"center\" valign=\"middle\"><img src=\"" . $dpath . "gebaeude/" . $PlanetaQueInv['b_tech_id'] . ".gif\" width=\"40\" height=\"40\"></td>"; $Tech .= " <td>" . $lang['pr_investigando'] . " <span style=\"color:#FF8C00;\">Nivel " . $NvlActual . "</span><br />"; $Tech .= " " . $lang['pr_duracion'] . ":<div id=\"tec_blc\" class=\"z\" style=\"color:yellow;\">" . pretty_time($RestTime) . "</div>"; $Tech .= " </td>"; $Tech .= " </tr>"; $Tech .= "</Table>"; $Tech .= "\n<script language=\"JavaScript\">"; $Tech .= "\n tec_pp = \"" . $RestTime . "\";\n"; $Tech .= "\n tec_pk = \"" . 1 . "\";\n"; $Tech .= "\n tec_pm = \"cancel\";\n"; $Tech .= "\n tec_pl = \"" . $PlanetaQueInv['b_tech_id'] . "\";\n"; $Tech .= "\n tec_t();\n"; $Tech .= "\n</script>\n"; $parse['tech_en_proceso'] .= $Tech; } else { $parse['tech_en_proceso'] = $lang['ov_tfree']; } if ($CurrentPlanet['b_hangar'] != 0) { include $xgp_root . 'includes/functions/InsertHangarListScript.' . $phpEx; UpdatePlanetBatimentQueueList($planetrow, $user); $BuildQueue = explode(";", $CurrentPlanet['b_hangar_id']); $CurrBuild = explode(",", $BuildQueue[0]); $RealTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $CurrBuild[0]); $QueueTime = $RealTime * $CurrBuild[1]; $RestTime = $QueueTime - $CurrentPlanet['b_hangar']; $PlanetID = $CurrentPlanet['id']; $Hangar = InsertHangarListScript("overview"); $Hangar .= "<table>"; $Hangar .= " <tr>"; $Hangar .= " <td colspan=\"2\">" . $lang['tech'][$CurrBuild[0]] . "</td>"; $Hangar .= " </tr>"; $Hangar .= " <tr>"; $Hangar .= " <td align=\"center\" valign=\"middle\"><img src=\"" . $dpath . "gebaeude/" . $CurrBuild[0] . ".gif\" width=\"40\" height=\"40\"><br />"; $Hangar .= " </td>"; $Hangar .= " <td>" . $lang['pr_tiempo_prod'] . "<br />"; $Hangar .= " <div id=\"han_blc\" class=\"z\" style=\"color:yellow;\">" . pretty_time($RestTime) . "</div>"; $Hangar .= " </td>"; $Hangar .= " </tr>"; $Hangar .= "</Table>"; $Hangar .= "\n<script language=\"JavaScript\">"; $Hangar .= "\n han_pp = \"" . $RestTime . "\";\n"; $Hangar .= "\n han_pk = \"" . 1 . "\";\n"; $Hangar .= "\n han_pm = \"cancel\";\n"; $Hangar .= "\n han_pl = \"" . $PlanetID . "\";\n"; $Hangar .= "\n han_t();\n"; $Hangar .= "\n</script>\n"; $parse['hangar_en_proceso'] .= $Hangar; } else { $parse['hangar_en_proceso'] = $lang['ov_hree']; } $parse['overview_produccion'] = parsetemplate(gettemplate('overview/overview_produccion'), $parse); // **** FIN MOD {MOSTRAR TECNOLOGIA EN PROCESO EN VISTA GENERAL} **** $parse['fleet_list'] = $flotten; $parse['Have_new_message'] = $Have_new_message; $parse['planet_image'] = $CurrentPlanet['image']; $parse['anothers_planets'] = $AllPlanets; $parse["dpath"] = $dpath; if ($game_config['stat'] == 0) { $parse['user_rank'] = pretty_number($StatRecord['total_points']) . " (" . $lang['ov_place'] . " <a href=\"game.php?page=statistics&range=" . $StatRecord['total_rank'] . "\">" . $StatRecord['total_rank'] . "</a> " . $lang['ov_of'] . " " . $game_config['users_amount'] . ")"; } elseif ($game_config['stat'] == 1 && $CurrentUser['authlevel'] < $game_config['stat_level']) { $parse['user_rank'] = pretty_number($StatRecord['total_points']) . " (" . $lang['ov_place'] . " <a href=\"game.php?page=statistics&range=" . $StatRecord['total_rank'] . "\">" . $StatRecord['total_rank'] . "</a> " . $lang['ov_of'] . " " . $game_config['users_amount'] . ")"; } else { $parse['user_rank'] = "-"; } setlocale(LC_ALL, 'es_ES'); $parse['date_time'] = date("D M j H:i:s", time()); if ($Level > 0) { $parse['admin_link'] = "<tr><td><div align=\"center\"><a href=\"javascript:top.location.href='adm/index.php'\"> <font color=\"lime\">" . $lang['lm_administration'] . "</font></a></div></td></tr>"; } else { $parse['admin_link'] = ""; } if ($user["new_message"] != 0) { $color = "color=\"red\""; } else { $color = "color=\"white\""; } $parse["new_message"] = ' (<font size="1px" ' . $color . ' > ' . $user["new_message"] . ' </font>)'; return display(parsetemplate(gettemplate('overview/overview_body'), $parse)); break; } }
function MyCrazyLittleSearch($SpecifyItems, $WhereItem, $SpecifyWhere, $SpecialSpecify, $Order, $OrderBY, $Limit, $Table, $Page, $NameLang, $ArrayOSec, $Minimize, $SName, $SearchFile) { global $USER, $LNG, $db; $parse = $LNG; if (!$Page) { $INI = 0; $Page = 1; } else { $INI = ($Page - 1) * $Limit; } $ArrayEx = explode(",", $SpecifyItems); if (!$Order || !in_array($Order, $ArrayOSec)) { $Order = $ArrayEx[0]; } $CountArray = count($ArrayEx); $QuerySearch = "SELECT " . $SpecifyItems . " FROM " . DB_PREFIX . $Table . " "; $QuerySearch .= $WhereItem . " "; $QuerySearch .= $SpecifyWhere . " " . $SpecialSpecify . " "; $QuerySearch .= "ORDER BY " . $Order . " " . $OrderBY . " "; $QuerySearch .= "LIMIT " . $INI . "," . $Limit; $FinalQuery = $db->query($QuerySearch); $QueryCSearch = "SELECT COUNT(" . $ArrayEx[0] . ") AS `total` FROM " . DB_PREFIX . $Table . " "; $QueryCSearch .= $WhereItem . " "; $QueryCSearch .= $SpecifyWhere . " " . $SpecialSpecify . " "; $CountQuery = $db->uniquequery($QueryCSearch); if ($CountQuery['total'] > 0) { $NumberOfPages = ceil($CountQuery['total'] / $Limit); $UrlForPage = "?page=search\r\n\t\t\t\t\t\t&search=" . $SearchFile . "\r\n\t\t\t\t\t\t&search_in=" . $_GET['search_in'] . "\r\n\t\t\t\t\t\t&fuki=" . $_GET['fuki'] . "\r\n\t\t\t\t\t\t&key_user="******"\r\n\t\t\t\t\t\t&key_order=" . $_GET['key_order'] . "\r\n\t\t\t\t\t\t&key_acc=" . $_GET['key_acc'] . "\r\n\t\t\t\t\t\t&limit=" . $Limit; if ($NumberOfPages > 1) { $BeforePage = $Page - 1; $NextPage = $Page + 1; for ($i = 1; $i <= $NumberOfPages; $i++) { if ($Page == $i) { $PAGEE .= " " . $Page . " "; } else { $PAGEE .= " <a href='" . $UrlForPage . "&side=" . $i . $Minimize . "'>" . $i . "</a> "; } } if ($Page - 1 > 0) { $BEFORE = "<a href='" . $UrlForPage . "&side=" . $BeforePage . $Minimize . "'><img src=\"./styles/images/Adm/arrowleft.png\" title=" . $LNG['se__before'] . " height=10 width=14></a> "; } if ($Page + 1 <= $NumberOfPages) { $NEXT = "<a href='" . $UrlForPage . "&side=" . $NextPage . $Minimize . "'><img src=\"./styles/images/Adm/arrowright.png\" title=" . $LNG['se__next'] . " height=10 width=14></a>"; } $Search['PAGES'] = '<tr><td colspan="3" style="color:#00CC33;border: 1px lime solid;text-align:center;">' . $BEFORE . ' ' . $PAGEE . ' ' . $NEXT . '</td></tr>'; } $Search['LIST'] = "<table width=\"90%\">"; $Search['LIST'] .= "<tr>"; for ($i = 0; $i < $CountArray; $i++) { $Search['LIST'] .= "<td class=c>" . $NameLang[$i] . "</td>"; } if ($Table == "users") { if ($USER['rights']['ShowAccountDataPage'] == 1) { $Search['LIST'] .= "<td class=c>" . $LNG['se_search_info'] . "</td>"; } if ($USER['authlevel'] == AUTH_ADM) { $Search['LIST'] .= "<td class=c>" . $LNG['button_delete'] . "</td>"; } } if ($Table == "planets") { if ($USER['rights']['ShowQuickEditorPage'] == 1) { $Search['LIST'] .= "<td class=c>" . $LNG['se_search_edit'] . "</td>"; } if ($USER['authlevel'] == AUTH_ADM) { $Search['LIST'] .= "<td class=c>" . $LNG['button_delete'] . "</td>"; } } $Search['LIST'] .= "</tr>"; while ($WhileResult = $db->fetch_num($FinalQuery)) { $Search['LIST'] .= "<tr>"; if ($Table == "users") { if ($_GET['search'] == "online") { $WhileResult[3] = pretty_time(TIMESTAMP - $WhileResult[3]); } else { $WhileResult[3] = date("d-m-Y H:i:s", $WhileResult[3]); } $WhileResult[4] = date("d-m-Y H:i:s", $WhileResult[4]); $WhileResult[6] = $LNG['rank'][$WhileResult[6]]; $WhileResult[7] == '1' ? $WhileResult[7] = "<font color=lime>" . $LNG['one_is_yes'][1] . "</font>" : ($WhileResult[7] = $LNG['one_is_yes'][0]); $WhileResult[8] == '1' ? $WhileResult[8] = "<font color=lime>" . $LNG['one_is_yes'][1] . "</font>" : ($WhileResult[8] = $LNG['one_is_yes'][0]); } if ($Table == "banned") { $WhileResult[2] = date("d-m-Y H:i:s", $WhileResult[2]); $WhileResult[3] = date("d-m-Y H:i:s", $WhileResult[3]); } if ($Table == "alliance") { $WhileResult[4] = date("d-m-Y H:i:s", $WhileResult[4]); } if ($Table == "planets") { $WhileResult[3] = pretty_time(TIMESTAMP - $WhileResult[3]); $WhileResult[7] = $WhileResult[7] > 0 ? "<font color=lime>" . $LNG['one_is_yes'][1] . "</font>" : $LNG['one_is_yes'][0]; } for ($i = 0; $i < $CountArray; $i++) { $Search['LIST'] .= "<th>" . $WhileResult[$i] . "</th>"; } if ($Table == "users") { if ($USER['rights']['ShowAccountDataPage'] == 1) { $Search['LIST'] .= "<th><a href=\"?page=accountdata&id_u=" . $WhileResult[0] . "\"><img title=\"" . $WhileResult[1] . "\" src=\"./styles/images/Adm/GO.png\"></a></th>"; } if ($USER['authlevel'] == '3') { if ($WhileResult[0] != $USER['id'] || $WhileResult[0] != 1) { $DELETEBUTTON = "<a href=\"?page=search&delete=user&user="******"\" border=\"0\" onclick=\"return confirm('" . $LNG['ul_sure_you_want_dlte'] . " " . $WhileResult[1] . "?');\"><img src=\"./styles/images/r1.png\" title=" . $WhileResult[1] . "></a>"; } else { $DELETEBUTTON = "-"; } $Search['LIST'] .= "<th>" . $DELETEBUTTON . "</th>"; } } if ($Table == "planets") { if ($USER['rights']['ShowQuickEditorPage'] == 1) { $Search['LIST'] .= "<th><a href=\"javascript:openEdit('" . $WhileResult[0] . "', 'planet');\" border=\"0\"><img src=\"./styles/images/Adm/GO.png\" title=" . $LNG['se_search_edit'] . "></a></th>"; } if ($USER['authlevel'] == '3') { $Search['LIST'] .= "<th><a href=\"?page=search&delete=planet&planet=" . $WhileResult[0] . "\" border=\"0\" onclick=\"return confirm('" . $LNG['se_confirm_planet'] . " " . $WhileResult[1] . "');\"><img src=\"./styles/images/r1.png\" title=" . $LNG['button_delete'] . "></a></th>"; } } $Search['LIST'] .= "</tr>"; } $Search['LIST'] .= "<tr><th colspan=20>" . $LNG['se_input_hay'] . "<font color=lime>" . $CountQuery['total'] . "</font>" . $SName . "</th></tr>"; $Search['LIST'] .= "</table>"; $db->free_result($FinalQuery); return $Search; } else { $Result['LIST'] = "<br><table border='0px' style='background:url(images/Adm/blank.gif);' width='90%'>"; $Result['LIST'] .= "<tr><th style='color:#00CC33;border: 2px red solid;' height='25px'><font color=red>" . $LNG['se_no_data'] . "</font></th></tr>"; $Result['LIST'] .= "</table>"; return $Result; } }
function ShowBuildingInfoPage($CurrentUser, $CurrentPlanet, $BuildID) { global $dpath, $lang, $resource, $pricelist, $CombatCaps; includeLang('infos'); $GateTPL = ''; $DestroyTPL = ''; $TableHeadTPL = ''; $parse = $lang; // Données de base $parse['dpath'] = $dpath; $parse['name'] = $lang['info'][$BuildID]['name']; $parse['image'] = $BuildID; $parse['description'] = $lang['info'][$BuildID]['description']; if ($BuildID >= 1 && $BuildID <= 3) { // Cas des mines $PageTPL = gettemplate('info_buildings_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_p_hour}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_energy}</td><td class=\"c\">{nfo_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>"; } elseif ($BuildID == 4) { // Centrale Solaire $PageTPL = gettemplate('info_buildings_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th></tr>"; } elseif ($BuildID == 12) { // Centrale Fusion $PageTPL = gettemplate('info_buildings_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_deuter}</td><td class=\"c\">{nfo_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>"; } elseif ($BuildID >= 14 && $BuildID <= 32) { // Batiments Generaux $PageTPL = gettemplate('info_buildings_general'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 33) { // Batiments Terraformer $PageTPL = gettemplate('info_buildings_general'); } elseif ($BuildID == 34) { // Dépot d'alliance $PageTPL = gettemplate('info_buildings_general'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 44) { // Silo de missiles $PageTPL = gettemplate('info_buildings_general'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 41) { // Batiments lunaires $PageTPL = gettemplate('info_buildings_general'); } elseif ($BuildID == 42) { // Phalange $PageTPL = gettemplate('info_buildings_table'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_range}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_range}</th></tr>"; $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 43) { // Porte de Saut $PageTPL = gettemplate('info_buildings_general'); $GateTPL = gettemplate('gate_fleet_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID >= 106 && $BuildID <= 199) { // Laboratoire $PageTPL = gettemplate('info_buildings_general'); } elseif ($BuildID >= 202 && $BuildID <= 215) { // Flotte $PageTPL = gettemplate('info_buildings_fleet'); $parse['element_typ'] = $lang['tech'][200]; $parse['rf_info_to'] = ShowRapidFireTo($BuildID); // Rapid Fire vers $parse['rf_info_fr'] = ShowRapidFireFrom($BuildID); // Rapid Fire de $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']); // Points de Structure $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); // Points de Bouclier $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); // Points d'Attaque $parse['capacity_pt'] = pretty_number($pricelist[$BuildID]['capacity']); // Capacitée de fret $parse['base_speed'] = pretty_number($pricelist[$BuildID]['speed']); // Vitesse de base $parse['base_conso'] = pretty_number($pricelist[$BuildID]['consumption']); // Consommation de base if ($BuildID == 202) { $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['speed2']) . ")</font>"; // Vitesse rééquipée $parse['upd_conso'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['consumption2']) . ")</font>"; // Consommation apres rééquipement } elseif ($BuildID == 211) { $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['speed2']) . ")</font>"; // Vitesse rééquipée } } elseif ($BuildID >= 401 && $BuildID <= 408) { // Defenses $PageTPL = gettemplate('info_buildings_defense'); $parse['element_typ'] = $lang['tech'][400]; $parse['rf_info_to'] = ShowRapidFireTo($BuildID); // Rapid Fire vers $parse['rf_info_fr'] = ShowRapidFireFrom($BuildID); // Rapid Fire de $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']); // Points de Structure $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); // Points de Bouclier $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); // Points d'Attaque } elseif ($BuildID >= 502 && $BuildID <= 503) { // Misilles $PageTPL = gettemplate('info_buildings_defense'); $parse['element_typ'] = $lang['tech'][400]; $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']); // Points de Structure $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); // Points de Bouclier $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); // Points d'Attaque } elseif ($BuildID >= 601 && $BuildID <= 615) { // Officiers $PageTPL = gettemplate('info_officiers_general'); } // ---- Tableau d'evolution if ($TableHeadTPL != '') { $parse['table_head'] = parsetemplate($TableHeadTPL, $lang); $parse['table_data'] = ShowProductionTable($CurrentUser, $CurrentPlanet, $BuildID, $TableTPL); } // La page principale $page = parsetemplate($PageTPL, $parse); if ($GateTPL != '') { if ($CurrentPlanet[$resource[$BuildID]] > 0) { $RestString = GetNextJumpWaitTime($CurrentPlanet); $parse['gate_start_link'] = BuildPlanetAdressLink($CurrentPlanet); if ($RestString['value'] != 0) { $parse['gate_time_script'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], true); $parse['gate_wait_time'] = "<div id=\"bxx" . "Gate" . "1" . "\"></div>"; $parse['gate_script_go'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], false); } else { $parse['gate_time_script'] = ""; $parse['gate_wait_time'] = ""; $parse['gate_script_go'] = ""; } $parse['gate_dest_moons'] = BuildJumpableMoonCombo($CurrentUser, $CurrentPlanet); $parse['gate_fleet_rows'] = BuildFleetListRows($CurrentPlanet); $page .= parsetemplate($GateTPL, $parse); } } if ($DestroyTPL != '') { if ($CurrentPlanet[$resource[$BuildID]] > 0) { // ---- Destruction $NeededRessources = GetBuildingPrice($CurrentUser, $CurrentPlanet, $BuildID, true, true); $DestroyTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $BuildID) / 2; $parse['destroyurl'] = "buildings.php?cmd=destroy&building=" . $BuildID; // Non balisé les balises sont dans le tpl $parse['levelvalue'] = $CurrentPlanet[$resource[$BuildID]]; // Niveau du batiment a detruire $parse['nfo_metal'] = $lang['Metal']; $parse['nfo_crysta'] = $lang['Crystal']; $parse['nfo_deuter'] = $lang['Deuterium']; $parse['metal'] = pretty_number($NeededRessources['metal']); // Cout en metal de la destruction $parse['crystal'] = pretty_number($NeededRessources['crystal']); // Cout en cristal de la destruction $parse['deuterium'] = pretty_number($NeededRessources['deuterium']); // Cout en deuterium de la destruction $parse['destroytime'] = pretty_time($DestroyTime); // Durée de la destruction // L'insert de destruction $page .= parsetemplate($DestroyTPL, $parse); } } return $page; }
foreach ($fleet as $a => $b) { if ($b != '') { $e++; $a = explode(",", $b); $page .= "{$tech[$a[0]]}: {$a[1]}\n"; if ($e > 1) { $page .= "\t"; } } } $page .= "\">{$f[fleet_amount]}</a></th>"; $page .= "<th>[{$f[fleet_start_galaxy]}:{$f[fleet_start_system]}:{$f[fleet_start_planet]}]</th>"; $page .= "<th>" . gmdate("D M d H:i:s", $f['fleet_start_time'] - 3 * 60 * 60) . "</th>"; $page .= "<th>[{$f[fleet_end_galaxy]}:{$f[fleet_end_system]}:{$f[fleet_end_planet]}]</th>"; $page .= "<th>" . gmdate("D M d H:i:s", $f['fleet_end_time'] - 3 * 60 * 60) . "</th>"; $page .= " <th>\r\n\t\t\t <form action=\"fleet\" method=\"post\">\r\n\t\t\r\n\t\t<input name=\"order_return\" value=23680670 type=hidden>\r\n\t\t\t<input value=\"Enviar de regreso\" type=\"submit\">\r\n\t\t </form>\r\n\t\t\t\t<font color=\"lime\"><div id=\"time_0\"><font>" . pretty_time(floor($f['fleet_end_time'] + 1 - time())) . "</font></div></font></th>\r\n\t\t\t\t</tr>"; } if ($i == 0) { $page .= "<th>-</th><th>-</th><th>-</th><th>-</th><th>-</th><th>-</th><th>-</th><th>-</th>"; } /* <tr height="20"> <th>2</th> <th> <a title="">Recolectar</a> <a title="Volver al planeta">(V)</a> </th> <th> <a title="Reciclador: 1">1</a></th> <th>[5:328:12]</th> <th>Thu Jun 29 1:52:13</th> <th>[5:328:13]</th> <th>Thu Jun 29 4:44:59</th> <th> </th> </tr> */ $page .= '
/** * BuildingPage.php * * @version 1.0 * @copyright 2009 by MadnessRed for XNova Redesigned */ function BuildingPage($a = 0, $b = 0) { global $lang, $resource, $reslist, $pricelist, $dpath, $game_config, $_GET, $user, $planetrow; CheckPlanetUsedFields($planetrow); if (!$_GET['page']) { return false; die; } // Tables des batiments possibles par type de planete if ($_GET['page'] == 'station') { $Allowed[1] = array(14, 15, 21, 31, 33, 34, 44); $Allowed[3] = array(14, 21, 34, 41, 42, 43); } elseif ($_GET['page'] == 'resources') { $Allowed[1] = array(1, 2, 3, 4, 12, 212, 22, 23, 24); $Allowed[3] = array(212, 22, 23, 24); } else { die("Hacking attempt"); } //Right, lets see what he has an generate him an image. $imgnum = ''; if ($planetrow[$resource[1]] > 0) { $imgnum .= "_1"; } if ($planetrow[$resource[2]] > 0) { $imgnum .= "_2"; } if ($planetrow[$resource[3]] > 0) { $imgnum .= "_3"; } if ($planetrow[$resource[4]] > 0) { $imgnum .= "_4"; } // Boucle d'interpretation des eventuelles commandes if (isset($_GET['cmd'])) { // On passe une commande $bThisIsCheated = false; $bDoItNow = false; $TheCommand = $_GET['cmd']; $Element = $_GET['building']; $ListID = $_GET['listid']; if (isset($Element)) { if (!strchr($Element, " ")) { if (!strchr($Element, ",")) { if (in_array(trim($Element), $Allowed[$planetrow['planet_type']])) { $bDoItNow = true; } else { //$bThisIsCheated = true; $bDoItNow = true; } } else { $bThisIsCheated = true; } } else { $bThisIsCheated = true; } } elseif (isset($ListID)) { $bDoItNow = true; } if ($bDoItNow == true) { switch ($TheCommand) { case 'cancel': //Remove last queue item RemoveFromQueue(); break; case 'remove': //Remove a specific queue item RemoveFromQueue($ListID); break; case 'insert': //Insert into the queue a build $fields_rem = $planetrow['field_max'] - $planetrow['field_current'] + $planetrow[$resource[33]] * 5; if ($fields_rem >= 0) { AddToQueue($Element, 1); } else { echo $fields_rem . " < 0"; die("Hacking Attempt!"); } break; case 'destroy': //Add a deconstrction to the queue AddToQueue($Element, -1); break; } // switch } elseif ($bThisIsCheated == true) { //ResetThisFuckingCheater ( $user['id'] ); } //If they want axah_section if ($_GET['axah_box']) { $q = ShowQueue(false); makeAXAH($q['buildlist']); die; } } $Queue = ShowQueue(true); // On enregistre ce que l'on a modifi� dans planet ! BuildingSavePlanetRecord($planetrow); // On enregistre ce que l'on a eventuellement modifi� dans users BuildingSaveUserRecord($user); $max_qs = MAX_BUILDING_QUEUE_SIZE; if ($max_qs > 0) { //fine :) } else { $max_qs = 10; } if ($Queue['length'] < $max_qs) { $CanBuildElement = true; } else { $CanBuildElement = false; } if ($_GET['page'] == 'station') { if ($planetrow['planet_type'] == 3) { $SubTemplate = gettemplate('buildings/station-moon_buttonz'); } else { $SubTemplate = gettemplate('buildings/station_buttonz'); } } elseif ($_GET['page'] == 'resources') { $SubTemplate = gettemplate('buildings/resources_buttonz'); } else { die("Hacking attempt"); } $parse = array(); $infopg = array(); foreach ($lang['names'] as $Element => $ElementName) { if (!$planetrow['planet_type']) { die("no planet type"); } if (in_array($Element, $Allowed[$planetrow['planet_type']]) || $_GET['page'] == 'station') { if (@in_array($Element, $Allowed[$planetrow['planet_type']])) { if (!IsTechnologieAccessible($user, $planetrow, $Element)) { $parse['state_' . $Element] = "off"; $parse['mes_' . $Element] = "Requirements are not met"; $parse['canbuild_' . $Element] = ""; } elseif (!IsElementBuyable($user, $planetrow, $Element, true, false) && $Queue['length'] == 0) { $parse['state_' . $Element] = "disabled"; $parse['mes_' . $Element] = "Not enough resources!"; $parse['canbuild_' . $Element] = ""; } elseif (!$CanBuildElement) { $parse['state_' . $Element] = "disabled"; $parse['mes_' . $Element] = "Queue is full!"; $parse['canbuild_' . $Element] = ""; } else { $parse['state_' . $Element] = "on"; $parse['mes_' . $Element] = ""; $parse['canbuild_' . $Element] = "\n\t\t\t\t\t\t<a class=\"fastBuild tips\" href=\"#\" onclick=\"loadpage('./?page=" . $_GET['page'] . "&cmd=insert&building={$Element}&id={$Element}',document.title,document.body.id);\">\n\t\t\t\t\t\t\t<img src=\"" . GAME_SKIN . "/img/layout/sofort_bauen.gif\" height=\"14\" width=\"22\">\n\t\t\t\t\t\t</a>"; } } else { $parse['state_' . $Element] = "off"; $parse['mes_' . $Element] = "Not availble"; $parse['canbuild_' . $Element] = ""; } $parse['name_' . $Element] = $ElementName; $parse['count_' . $Element] = $planetrow[$resource[$Element]]; } } //Countdowns if ($planetrow['b_building'] > 0) { $BuildQueue = explode(";", $planetrow['b_building_id']); $CurrBuild = explode(",", $BuildQueue[0]); $parse['countdown_' . $CurrBuild[0]] = "\n\t\t\t\t\t\t\t\t\t<div class=\"construction\">\n\n\t\t\t\t\t\t\t\t\t\t<div class=\"pusher\" style=\"height: 80px; margin-bottom: -80px;\">\n\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"time\" id=\"resource\">" . parsecountdown($planetrow['b_building']) . "</span>\n\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t</div>\n"; } $BuildingPage = parsetemplate($SubTemplate, $parse); $parse = $lang; $Element = idstring($_GET['id']); $ElementName = $lang['names'][$Element]; // Faut il afficher la liste de construction ?? if ($Queue['length'] > 0) { $parse['BuildList'] = $Queue['buildlist']; } else { $parse['BuildList'] = ""; } $de_planettype = PlanetType($planetrow['image']); $parse['type'] = $de_planettype['type']; if ($_GET['page'] == 'station') { $parse['bg'] = HEADER_CACHE . "station/" . $parse['type'] . ".png"; } elseif ($_GET['page'] == 'resources') { if (url_exists(HEADER_CACHE . "resources/" . $parse['type'] . $imgnum . ".png")) { $parse['bg'] = HEADER_CACHE . "resources/" . $parse['type'] . $imgnum . ".png"; } else { $parse['bg'] = HEADER_CACHE . "resources/default.png"; } } else { die("Hacking attempt"); } $parse['hideres'] = "display:none;"; $parse['hidenorm'] = ""; $parse['planetname'] = $planetrow['name']; if (!$Element) { if ($_GET['mode'] == "resources") { $parse['hideres'] = ""; $parse['hidenorm'] = "display:none;"; } } else { if (!is_array($Allowed[$planetrow['planet_type']])) { $message = $user['username'] . " (" . intval($user['id']) . ") does not have a propper planet_type, so \$Allowed[\$planetrow['planet_type']] was not an array, causing the error which is most likely directly below this."; trigger_error($message, E_USER_NOTICE); } if (in_array($Element, $Allowed[$planetrow['planet_type']])) { //Something else $HaveRessources = IsElementBuyable($user, $planetrow, $Element, true, false); $parse['i'] = $Element; $parse['dpath'] = $dpath; $BuildingLevel = $planetrow[$resource[$Element]]; $parse['nivel'] = $BuildingLevel == 0 ? "" : " (" . $lang['level'] . " " . $BuildingLevel . ")"; $parse['n'] = $ElementName; $parse['descriptions'] = $lang['res']['descriptions'][$Element]; $ElementBuildTime = BuildingTime($Element, $BuildingLevel + 1, $planetrow); $parse['time'] = ShowBuildTime($ElementBuildTime); $parse['price'] = GetElementPrice($user, $planetrow, $Element); $parse['rest_price'] = GetRestPrice($user, $planetrow, $Element); $parse['click'] = ''; $NextBuildLevel = $planetrow[$resource[$Element]] + 1; $CurrentMaxFields = CalculateMaxPlanetFields($planetrow); if ($planetrow["field_current"] < $CurrentMaxFields - $Queue['lenght']) { $RoomIsOk = true; } else { $RoomIsOk = false; } if ($Element == 31) { // Sp�cial Laboratoire if ($user["b_tech_planet"] != 0 && $game_config['BuildLabWhileRun'] != 1) { // Variable qui contient le parametre // On verifie si on a le droit d'evoluer pendant les recherches (Setting dans config) $parse['click'] = "<font color=#FF0000>" . $lang['in_working'] . "</font>"; } } if (IsTechnologieAccessible($user, $planetrow, $Element)) { if ($parse['click'] != '') { // Bin on ne fait rien, vu que l'on l'a deja fait au dessus !! } elseif ($RoomIsOk && $CanBuildElement) { if ($Queue['lenght'] == 0) { if ($NextBuildLevel == 1) { if ($HaveRessources == true) { $parse['click'] = "<a href=\"./?page=" . $_GET['page'] . "&cmd=insert&building=" . $Element . "&id=" . $Element . "\"><font color=#00FF00>" . $lang['BuildFirstLevel'] . "</font></a>"; $infopg['build_link'] = "./?page=" . $_GET['page'] . "&cmd=insert&building=" . $Element . "&id=" . $Element; $infopg['build_text'] = $lang['BuildFirstLevel']; } else { $parse['click'] = "<font color=#FF0000>4" . $lang['BuildFirstLevel'] . "</font>"; $infopg['build_text'] = $lang['BuildFirstLevel']; } } else { if ($HaveRessources == true) { $parse['click'] = "<a href=\"./?page=" . $_GET['page'] . "&cmd=insert&building=" . $Element . "&id=" . $Element . "\"><font color=#00FF00>" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font></a>"; $infopg['build_link'] = "./?page=" . $_GET['page'] . "&cmd=insert&building=" . $Element . "&id=" . $Element; $infopg['build_text'] = $lang['BuildNextLevel'] . " " . $NextBuildLevel; } else { $parse['click'] = "<font color=#FF0000>" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font>"; $infopg['build_text'] = $lang['BuildNextLevel'] . " " . $NextBuildLevel; } } } else { $parse['click'] = "<a href=\"./?page=" . $_GET['page'] . "&cmd=insert&building=" . $Element . "&id=" . $Element . "\"><font color=#00FF00>" . $lang['InBuildQueue'] . "</font></a>"; $infopg['build_link'] = "./?page=" . $_GET['page'] . "&cmd=insert&building=" . $Element . "&id=" . $Element; $infopg['build_text'] = $lang['InBuildQueue']; } } elseif ($RoomIsOk && !$CanBuildElement) { if ($NextBuildLevel == 1) { $parse['click'] = "<font color=#FF0000>2" . $lang['BuildFirstLevel'] . "</font>"; $infopg['build_text'] = $lang['BuildFirstLevel']; } else { $parse['click'] = "<font color=#FF0000>1" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font>"; $infopg['build_text'] = $lang['BuildNextLevel'] . " " . $NextBuildLevel; } } else { $parse['click'] = "<font color=#FF0000>" . $lang['NoMoreSpace'] . "</font>"; $infopg['build_text'] = $lang['NoMoreSpace']; } } else { $parse['click'] = "<font color=#FF0000>" . $lang['NotAccessible'] . "</font>"; $infopg['build_text'] = $lang['NotAccessible']; } //Building Info if ($infopg['build_link']) { $infopg['buildit_class'] = "build-it"; $infopg['build_text'] = "Improve"; } else { $infopg['buildit_class'] = "build-it_disabled"; $infopg['build_text'] = "In queue"; } $infopg['id'] = $Element; $infopg['name'] = $ElementName; $infopg['level'] = $planetrow[$resource[$Element]]; if ($planetrow[$resource[$Element]] < 1) { $infopg['display_destroy'] = "style=\"display:none;\""; } $infopg['td_url'] = "./?page=" . $_GET['page'] . "&cmd=destroy&id=" . $Element . "&building=" . $Element; $infopg['title'] = "Tear down"; $infopg['level1'] = $infopg['level'] + 1; $infopg['duration'] = pretty_time($ElementBuildTime); $infopg['shortdesc'] = $lang['sdesc'][$Element]; $infopg['skin'] = $user['skin']; $infopg['cost_m'] = 1 * floor($pricelist[$Element]['metal'] * pow($pricelist[$Element]['factor'], $planetrow[$resource[$Element]])); $infopg['cost_c'] = 1 * floor($pricelist[$Element]['crystal'] * pow($pricelist[$Element]['factor'], $planetrow[$resource[$Element]])); $infopg['cost_d'] = 1 * floor($pricelist[$Element]['deuterium'] * pow($pricelist[$Element]['factor'], $planetrow[$resource[$Element]])); if ($infopg['cost_m'] > $planetrow['metal'] && $infopg['cost_m'] > 0) { $infopg['missing_resource_m'] = "missing_resource"; } if ($infopg['cost_c'] > $planetrow['crystal'] && $infopg['cost_c'] > 0) { $infopg['missing_resource_c'] = "missing_resource"; } if ($infopg['cost_d'] > $planetrow['deuterium'] && $infopg['cost_d'] > 0) { $infopg['missing_resource_d'] = "missing_resource"; } $infopg['sh_cost_m'] = KMnumber($infopg['cost_m'], 0, 'up'); $infopg['sh_cost_c'] = KMnumber($infopg['cost_c'], 0, 'up'); $infopg['sh_cost_d'] = KMnumber($infopg['cost_d'], 0, 'up'); $infopg['cost_m'] = pretty_number($infopg['cost_m']); $infopg['cost_c'] = pretty_number($infopg['cost_c']); $infopg['cost_d'] = pretty_number($infopg['cost_d']); $infopg['page'] = $_GET['page']; $parse['info'] = parsetemplate(gettemplate('buildings/info'), $infopg); $parse['extra'] = "style=\"display:none\""; if ($_GET['axah_section'] == '1') { makeAXAH($parse['info']); die; } } } $parse['planet_field_current'] = $planetrow["field_current"]; $parse['planet_field_max'] = $planetrow['field_max'] + $planetrow[$resource[33]] * 5; $parse['field_libre'] = $parse['planet_field_max'] - $planetrow['field_current']; $parse['buttonz'] = $BuildingPage; $parse['BuildingsList'] = $BuildingPage; if ($_GET['page'] == 'station') { $page = parsetemplate(gettemplate('buildings/station'), $parse); $title = $lang['Facilities']; } elseif ($_GET['page'] == 'resources') { //Resources screen $parse['resources_section'] = BuildRessourcePage($user, $planetrow, $parse['hideres']); $page = parsetemplate(gettemplate('buildings/resources'), $parse); $title = $lang['Resources']; } else { die("Hacking attempt"); } if ($_GET['axah']) { makeAXAH($page); } else { displaypage($page, $title); } }
function show() { global $LNG, $PLANET, $USER; $AdminsOnline = array(); $chatOnline = array(); $AllPlanets = array(); $Moon = array(); $RefLinks = array(); $db = Database::get(); foreach ($USER['PLANETS'] as $ID => $CPLANET) { if ($ID == $PLANET['id'] || $CPLANET['planet_type'] == 3) { continue; } if (!empty($CPLANET['b_building']) && $CPLANET['b_building'] > TIMESTAMP) { $Queue = unserialize($CPLANET['b_building_id']); $BuildPlanet = $LNG['tech'][$Queue[0][0]] . " (" . $Queue[0][1] . ")<br><span style=\"color:#7F7F7F;\">(" . pretty_time($Queue[0][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) { $sql = "SELECT id, name FROM %%PLANETS%% WHERE id = :lunaID;"; $Moon = $db->selectSingle($sql, array(':lunaID' => $PLANET['id_luna'])); } if ($PLANET['b_building'] - TIMESTAMP > 0) { $Queue = unserialize($PLANET['b_building_id']); $buildInfo['buildings'] = array('id' => $Queue[0][0], 'level' => $Queue[0][1], 'timeleft' => $PLANET['b_building'] - TIMESTAMP, 'time' => $PLANET['b_building'], 'starttime' => pretty_time($PLANET['b_building'] - TIMESTAMP)); } else { $buildInfo['buildings'] = false; } /* As FR#206 (http://tracker.2moons.cc/view.php?id=206), i added the shipyard and research status here, but i add not them the template. */ if (!empty($PLANET['b_hangar_id'])) { $Queue = unserialize($PLANET['b_hangar_id']); $time = BuildFunctions::getBuildingTime($USER, $PLANET, $Queue[0][0]) * $Queue[0][1]; $buildInfo['fleet'] = array('id' => $Queue[0][0], 'level' => $Queue[0][1], 'timeleft' => $time - $PLANET['b_hangar'], 'time' => $time, 'starttime' => pretty_time($time - $PLANET['b_hangar'])); } else { $buildInfo['fleet'] = false; } if ($USER['b_tech'] - TIMESTAMP > 0) { $Queue = unserialize($USER['b_tech_queue']); $buildInfo['tech'] = array('id' => $Queue[0][0], 'level' => $Queue[0][1], 'timeleft' => $USER['b_tech'] - TIMESTAMP, 'time' => $USER['b_tech'], 'starttime' => pretty_time($USER['b_tech'] - TIMESTAMP)); } else { $buildInfo['tech'] = false; } $sql = "SELECT id,username FROM %%USERS%% WHERE universe = :universe AND onlinetime >= :onlinetime AND authlevel > :authlevel;"; $onlineAdmins = $db->select($sql, array(':universe' => Universe::current(), ':onlinetime' => TIMESTAMP - 10 * 60, ':authlevel' => AUTH_USR)); foreach ($onlineAdmins as $AdminRow) { $AdminsOnline[$AdminRow['id']] = $AdminRow['username']; } $sql = "SELECT userName FROM %%CHAT_ON%% WHERE dateTime > DATE_SUB(NOW(), interval 2 MINUTE) AND channel = 0"; $chatUsers = $db->select($sql); foreach ($chatUsers as $chatRow) { $chatOnline[] = $chatRow['userName']; } $Messages = $USER['messages']; // Fehler: Wenn Spieler gelöscht werden, werden sie nicht mehr in der Tabelle angezeigt. $sql = "SELECT u.id, u.username, s.total_points FROM %%USERS%% as u\n\t\tLEFT JOIN %%STATPOINTS%% as s ON s.id_owner = u.id AND s.stat_type = '1' WHERE ref_id = :userID;"; $RefLinksRAW = $db->select($sql, array(':userID' => $USER['id'])); $config = Config::get(); if ($config->ref_active) { foreach ($RefLinksRAW as $RefRow) { $RefLinks[$RefRow['id']] = array('username' => $RefRow['username'], 'points' => min($RefRow['total_points'], $config->ref_minpoints)); } } $sql = 'SELECT total_points, total_rank FROM %%STATPOINTS%% WHERE id_owner = :userId AND stat_type = :statType'; $statData = Database::get()->selectSingle($sql, array(':userId' => $USER['id'], ':statType' => 1)); if ($statData['total_rank'] == 0) { $rankInfo = "-"; } else { $rankInfo = sprintf($LNG['ov_userrank_info'], pretty_number($statData['total_points']), $LNG['ov_place'], $statData['total_rank'], $statData['total_rank'], $LNG['ov_of'], $config->users_amount); } $this->assign(array('rankInfo' => $rankInfo, 'is_news' => $config->OverviewNewsFrame, 'news' => makebr($config->OverviewNewsText), 'planetname' => $PLANET['name'], 'planetimage' => $PLANET['image'], 'galaxy' => $PLANET['galaxy'], 'system' => $PLANET['system'], 'planet' => $PLANET['planet'], 'planet_type' => $PLANET['planet_type'], 'username' => $USER['username'], 'userid' => $USER['id'], 'buildInfo' => $buildInfo, 'Moon' => $Moon, 'fleets' => $this->GetFleets(), 'AllPlanets' => $AllPlanets, 'AdminsOnline' => $AdminsOnline, 'teamspeakData' => $this->GetTeamspeakData(), 'messages' => $Messages > 0 ? $Messages == 1 ? $LNG['ov_have_new_message'] : sprintf($LNG['ov_have_new_messages'], pretty_number($Messages)) : 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'], 'ref_active' => $config->ref_active, 'ref_minpoints' => $config->ref_minpoints, 'RefLinks' => $RefLinks, 'chatOnline' => $chatOnline, 'servertime' => _date("M D d H:i:s", TIMESTAMP, $USER['timezone']), 'path' => HTTP_PATH)); $this->display('page.overview.default.tpl'); }
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"); }
$parse['dpath'] = $dpath; $Last15Mins = doquery("SELECT * FROM {{users}} WHERE `onlinetime` >= '" . (time() - 15 * 60) . "' ORDER BY `" . $TypeSort . "` ASC;"); $Count = 0; $Color = "lime"; while ($TheUser = mysql_fetch_assoc($Last15Mins)) { if ($PrevIP != "") { if ($PrevIP == $TheUser['user_lastip']) { $Color = "red"; } else { $Color = "lime"; } } $UserPoints = doquery("SELECT * FROM {{statpoints}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $TheUser['id'] . "';", '', true); $Bloc['dpath'] = $dpath; $Bloc['adm_ov_altpm'] = $lang['adm_ov_altpm']; $Bloc['adm_ov_wrtpm'] = $lang['adm_ov_wrtpm']; $Bloc['adm_ov_data_id'] = $TheUser['id']; $Bloc['adm_ov_data_name'] = $TheUser['username']; $Bloc['adm_ov_data_agen'] = htmlentities($TheUser['user_agent']); $Bloc['adm_ov_data_clip'] = $Color; // $Bloc['adm_ov_data_adip'] = $TheUser['user_lastip']; $Bloc['adm_ov_data_ally'] = $TheUser['ally_name']; $Bloc['adm_ov_data_point'] = pretty_number($UserPoints['total_points']); $Bloc['adm_ov_data_activ'] = pretty_time(time() - $TheUser['onlinetime']); $PrevIP = $TheUser['user_lastip']; $parse['adm_ov_data_table'] .= parsetemplate($RowsTPL, $Bloc); $Count++; } $parse['adm_ov_data_count'] = $Count; $Page = parsetemplate($PageTPL, $parse); display($Page, $lang['sys_overview'], false, '', true);
} } } $page .= "\">" . pretty_number($f[fleet_amount]) . "</a></th>"; // (04) Fleet From (Planete d'origine) $page .= "<th>[" . $f[fleet_start_galaxy] . ":" . $f[fleet_start_system] . ":" . $f[fleet_start_planet] . "]</th>"; // (05) Fleet Start Time $page .= "<th>" . gmdate("d. M Y H:i:s", $f['fleet_start_time']) . "</th>"; // (06) Fleet Target (Planete de destination) $page .= "<th>[" . $f[fleet_end_galaxy] . ":" . $f[fleet_end_system] . ":" . $f[fleet_end_planet] . "]</th>"; // (07) Fleet Target Time $page .= "<th>" . gmdate("d. M Y H:i:s", $f['fleet_end_time']) . "</th>"; // (08) Fleet Back Time // $page .= "<th><font color=\"lime\"><div id=\"time_0\"><font>". pretty_time(floor($f['fleet_end_time'] + 1 - time())) ."</font></th>"; // (09) Fleet Back In $page .= "<th><font color=\"lime\"><div id=\"time_0\"><font>" . pretty_time(floor($f['fleet_end_time'] + 1 - time())) . "</font></th>"; // (10) Orders $page .= "<th>"; if ($f['fleet_mess'] == 0) { $page .= "<form action=\"fleetback.php\" method=\"post\">"; $page .= "<input name=\"fleetid\" value=\"" . $f['fleet_id'] . "\" type=\"hidden\">"; $page .= "<input value=\" " . $lang['fl_back_to_ttl'] . " \" type=\"submit\" name=\"send\">"; $page .= "</form>"; if ($f[fleet_mission] == 1) { $page .= "<form action=\"verband.php\" method=\"post\">"; $page .= "<input name=\"fleetid\" value=\"" . $f['fleet_id'] . "\" type=\"hidden\">"; $page .= "<input value=\" " . $lang['fl_associate'] . " \" type=\"submit\">"; $page .= "</form>"; } } else { $page .= " - ";
break; case 'diametro': $short = 'diameter'; break; default: $short = 'id'; break; } } else { $short = 'id'; } $parse = $lang; $query = doquery("SELECT `id`, `id_owner`, `name`, `last_update`, `field_current`, `field_max`, `diameter`, `galaxy`, `system`, `planet` FROM {{table}} WHERE planet_type=3 ORDER BY `" . $short . "` ASC", "planets"); $i = 0; while ($u = mysql_fetch_array($query)) { $parse['planetes'] .= "<tr>" . "<td class=b><center><a href='moonlist.php?action=edit&id=" . $u['id'] . "'>" . $u['id'] . "</a></center></td>" . "<td class=b><center><a href='moonlist.php?action=edit&id=" . $u['id'] . "'>" . $u['id_owner'] . "</a></center></td>" . "<td class=b><center><a href='moonlist.php?action=edit&id=" . $u['id'] . "'>" . $u['name'] . "</a></center></td>" . "<td class=b><center><a href='moonlist.php?action=edit&id=" . $u['id'] . "'>" . $u['field_current'] . "/" . $u['field_max'] . "</a></center></td>" . "<td class=b><center><a href='moonlist.php?action=edit&id=" . $u['id'] . "'>" . pretty_number($u['diameter']) . " Km</a></center></td>" . "<td class=b><center><a href='moonlist.php?action=edit&id=" . $u['id'] . "'>" . $u['galaxy'] . ":" . $u['system'] . ":" . $u['planet'] . "</a></center></td>" . "<td class=b><center><a href='moonlist.php?action=edit&id=" . $u['id'] . "'>" . pretty_time(time() - $u['last_update']) . "</a></center></td>" . "</tr>"; $i++; } if ($i == "1") { $parse['planetes'] .= "<tr><th class=b colspan=7>Hay 1 luna creada</th></tr>"; } else { $parse['planetes'] .= "<tr><th class=b colspan=7>Hay {$i} lunas creadas</th></tr>"; } if (isset($_GET['action']) && isset($_GET['id'])) { $id = intval($_GET['id']); $query = doquery("SELECT * FROM {{table}} WHERE planet_type=3 AND id='" . $id . "' LIMIT 1", "planets"); $planet = mysql_fetch_array($query); $parse['show_edit_form'] = parsetemplate(gettemplate('admin/moon_edit_form'), $planet); } if (isset($_POST['submit'])) { $edit_id = intval($_POST['currid']);