diff --git a/.htaccess b/.htaccess index 9b5fc3a..11469a0 100644 --- a/.htaccess +++ b/.htaccess @@ -3,12 +3,7 @@ Order Allow,Deny Deny from All - + Order Allow,Deny Deny from All - - - -Order Allow,Deny -Deny from All - + \ No newline at end of file diff --git a/CombatReport.php b/CombatReport.php index 67c76eb..d52ab68 100644 --- a/CombatReport.php +++ b/CombatReport.php @@ -1,35 +1,21 @@ "; -$raportrow = doquery("SELECT * FROM {{table}} WHERE `rid` = '".(mysql_escape_string($_GET["raport"]))."';", 'rw', true); +$raportrow = doquery("SELECT * FROM {{table}} WHERE `rid` = '".(mysql_escape_string($_GET["raport"]))."';", 'rw', TRUE); $owners = explode(",", $raportrow["owners"]); @@ -56,5 +42,5 @@ $Page .= $report; } -display($Page, false, '', false, false); +display($Page, FALSE, '', FALSE, FALSE); ?> \ No newline at end of file diff --git a/FleetAjax.php b/FleetAjax.php index 918bd2b..0b6a779 100644 --- a/FleetAjax.php +++ b/FleetAjax.php @@ -1,30 +1,16 @@ $ShipID) @@ -47,7 +33,7 @@ $fleet['fleetlist'] .= $ShipID .",". $planetrow[$resource[$ShipID]] .";"; $fleet['amount'] += $planetrow[$resource[$ShipID]]; $PartialCount += $planetrow[$resource[$ShipID]]; - $PartialFleet = true; + $PartialFleet = TRUE; } else { @@ -59,7 +45,7 @@ } } -if ($PartialFleet == true) +if ($PartialFleet == TRUE) { if ( $PartialCount < 1 ) { @@ -68,9 +54,9 @@ } } -$PrNoob = $game_config['noobprotection']; -$PrNoobTime = $game_config['noobprotectiontime']; -$PrNoobMulti = $game_config['noobprotectionmulti']; +$PrNoob = read_config ( 'noobprotection' ); +$PrNoobTime = read_config ( 'noobprotectiontime' ); +$PrNoobMulti = read_config ( 'noobprotectionmulti' ); $galaxy = intval($_POST['galaxy']); if ($galaxy > MAX_GALAXY_IN_WORLD || $galaxy < 1) @@ -97,32 +83,46 @@ $FleetArray = $fleet['fleetarray']; -$CurrentFlyingFleets = doquery("SELECT COUNT(fleet_id) AS `Nbre` FROM {{table}} WHERE `fleet_owner` = '".$user['id']."';", 'fleets', true); +$CurrentFlyingFleets = doquery("SELECT COUNT(fleet_id) AS `Nbre` FROM {{table}} WHERE `fleet_owner` = '".$user['id']."';", 'fleets', TRUE); $CurrentFlyingFleets = $CurrentFlyingFleets["Nbre"]; $QrySelectEnemy = "SELECT * FROM {{table}} "; $QrySelectEnemy .= "WHERE "; -$QrySelectEnemy .= "`galaxy` = '". $_POST['galaxy'] ."' AND "; -$QrySelectEnemy .= "`system` = '". $_POST['system'] ."' AND "; -$QrySelectEnemy .= "`planet` = '". $_POST['planet'] ."' AND "; -$QrySelectEnemy .= "`planet_type` = '". $_POST['planettype'] ."';"; -$TargetRow = doquery( $QrySelectEnemy, 'planets', true); +$QrySelectEnemy .= "`galaxy` = '". intval($_POST['galaxy']) ."' AND "; +$QrySelectEnemy .= "`system` = '". intval($_POST['system']) ."' AND "; +$QrySelectEnemy .= "`planet` = '". intval($_POST['planet']) ."' AND "; +$QrySelectEnemy .= "`planet_type` = '". intval($_POST['planettype']) ."';"; +$TargetRow = doquery( $QrySelectEnemy, 'planets', TRUE); if ($TargetRow['id_owner'] == '') +{ $TargetUser = $user; +} elseif ($TargetRow['id_owner'] != '') - $TargetUser = doquery("SELECT * FROM {{table}} WHERE `id` = '". $TargetRow['id_owner'] ."';", 'users', true); +{ + $TargetUser = doquery("SELECT * FROM {{table}} WHERE `id` = '". $TargetRow['id_owner'] ."';", 'users', TRUE); +} +// invisible debris by jstar +if ($_POST['mission']== 8) +{ + $TargetGPlanet = doquery("SELECT invisible_start_time, metal, crystal FROM {{table}} WHERE galaxy = '". intval($_POST['galaxy']) ."' AND system = '". intval($_POST['system']) ."' AND planet = '". intval($_POST['planet']) ."'", "galaxy",TRUE); + + if($TargetGPlanet['metal'] == 0 && $TargetGPlanet['crystal'] == 0 && time() > ($TargetGPlanet['invisible_start_time']+DEBRIS_LIFE_TIME)) + { + die(); + } +} -$UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $user['id'] ."';", 'statpoints', true); -$User2Points = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $TargetUser['id'] ."';", 'statpoints', true); +$UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $user['id'] ."';", 'statpoints', TRUE); +$User2Points = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $TargetUser['id'] ."';", 'statpoints', TRUE); $CurrentPoints = $UserPoints['total_points']; $TargetPoints = $User2Points['total_points']; $TargetVacat = $TargetUser['urlaubs_modus']; -if ((($user[$resource[108]] + 1) + ($user['rpg_commandant'] * COMMANDANT)) <= $CurrentFlyingFleets) +if ((get_max_fleets ( $CurrentUser[$resource[108]] , $CurrentUser['rpg_amiral'] )) <= $CurrentFlyingFleets) { $ResultMessage = "612; ".$lang['fa_no_more_slots']." |".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles; die ($ResultMessage); @@ -234,14 +234,14 @@ if ($TargetRow['id_level'] > $user['authlevel']) { - $Allowed = true; + $Allowed = TRUE; switch ($_POST['mission']) { case 1: case 2: case 6: case 9: - $Allowed = false; + $Allowed = FALSE; break; case 3: case 4: @@ -252,7 +252,7 @@ break; default: } - if ($Allowed == false) + if ($Allowed == FALSE) { $ResultMessage = "619; ".$lang['fa_action_not_allowed']." |".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles; die ( $ResultMessage ); @@ -292,7 +292,7 @@ $CurrentFlyingFleets++; -$planetrow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['current_planet'] ."';", 'planets', true); +$planetrow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['current_planet'] ."';", 'planets', TRUE); $ResultMessage = "600; ".$lang['fa_sending']." ". $FleetShipCount ." ". $lang['tech'][$Ship] ." a ". $_POST['galaxy'] .":". $_POST['system'] .":". $_POST['planet'] ."...|"; $ResultMessage .= $CurrentFlyingFleets ." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles; diff --git a/MissilesAjax.php b/MissilesAjax.php index b7a0839..a6726cc 100644 --- a/MissilesAjax.php +++ b/MissilesAjax.php @@ -1,102 +1,120 @@ = $tempvar2 || $g != $currentplanet['galaxy']) - $error = $lang['ma_not_send_other_galaxy']; -elseif (!$tempvar3) - $error = $lang['ma_planet_doesnt_exists']; -elseif ($anz > $iraks) - $error = $lang['ma_cant_send'] . $anz . $lang['ma_missile'] . $iraks; -elseif ((!is_numeric($pziel) && $pziel != "all") OR ($pziel < 0 && $pziel > 7 && $pziel != "all")) - $error = $lang['ma_wrong_target']; -elseif ($iraks==0) - $error = $lang['ma_no_missiles']; -elseif ($anz==0) - $error = $lang['ma_add_missile_number']; -elseif (($MyGameLevel > ($HeGameLevel * $protectionmulti)) && $protection == 1 && ($HeGameLevel < ($protectiontime * 1000))) - $error = $lang['fl_week_player']; -elseif ((($MyGameLevel * $protectionmulti) < $HeGameLevel) && $protection == 1 && ($MyGameLevel < ($protectiontime * 1000))) - $error = $lang['fl_strong_player']; -elseif ($tempvar4['urlaubs_modus']==1) - $error = $lang['fl_in_vacation_player']; - -if ($error != "") - exit ( message ( $error, "game.php?page=galaxy&mode=2&galaxy=".$g."&system=".$s."&planet=".$i."¤t=".$user['current_planet']."", 2 ) ); +{ + $error .= $lang['ma_silo_level'].'
'; + $errors++; +} +if ($user['impulse_motor_tech'] == 0) +{ + $error .= $lang['ma_impulse_drive_required'].'
'; + $errors++; +} +if ($tempvar1 >= $tempvar2 || $g != $currentplanet['galaxy']) +{ + $error .= $lang['ma_not_send_other_galaxy'].'
'; + $errors++; +} +if (!$tempvar3) +{ + $error .= $lang['ma_planet_doesnt_exists'].'
'; + $errors++; +} +if ($anz > $iraks) +{ + $error .= $lang['ma_cant_send'] . $anz . $lang['ma_missile'] . $iraks.'
'; + $errors++; +} +if (((!is_numeric($pziel) && $pziel != "all") or ($pziel < 0 or $pziel > 8))) +{ + $error .= $lang['ma_wrong_target'].'
'; + $errors++; +} +if ($iraks==0) +{ + $error .= $lang['ma_no_missiles'].'
'; + $errors++; +} +if ($anz==0) +{ + $error .= $lang['ma_add_missile_number'].'
'; + $errors++; +} +if ($tempvar4['onlinetime'] >= (time()-60 * 60 * 24 * 7)){ + if (($MyGameLevel > ($HeGameLevel * $protectionmulti)) && $protection == 1 && ($HeGameLevel < $protectiontime)) + { + $error .= $lang['fl_week_player'].'
'; + $errors++; + }elseif ((($MyGameLevel * $protectionmulti) < $HeGameLevel) && $protection == 1 && ($MyGameLevel < $protectiontime)){ + $error .= $lang['fl_strong_player'].'
'; + $errors++; + } +} +if ($tempvar4['urlaubs_modus']==1){ + $error .= $lang['fl_in_vacation_player'].'
'; + $errors++; +} + +if ($errors != 0) +{ + message ($error, "game.php?page=galaxy&mode=0&galaxy=".$g."&system=".$s, 3); +} $ziel_id = $tempvar3["id_owner"]; -$flugzeit = round(((30 + (60 * $tempvar1)) * 2500) / $game_config['fleet_speed']); +$flugzeit = round(((30 + (60 * $tempvar1)) * 2500) / read_config ( 'fleet_speed' ) ); $DefenseLabel = array( -'0' => $lang['ma_misil_launcher'], -'1' => $lang['ma_small_laser'], -'2' => $lang['ma_big_laser'], -'3' => $lang['ma_gauss_canyon'], -'4' => $lang['ma_ionic_canyon'], -'5' => $lang['ma_buster_canyon'], -'6' => $lang['ma_small_protection_shield'], -'7' => $lang['ma_big_protection_shield'], +0 => $lang['tech'][401], +1 => $lang['tech'][402], +2 => $lang['tech'][403], +3 => $lang['tech'][404], +4 => $lang['tech'][405], +5 => $lang['tech'][406], +6 => $lang['tech'][407], +7 => $lang['tech'][408], 'all' => $lang['ma_all']); @@ -125,7 +143,7 @@ fleet_mess = 0, start_time = ".time().";", 'fleets'); -doquery("UPDATE {{table}} SET interplanetary_misil = (interplanetary_misil - ".$anz.") WHERE id = '".$user['current_planet']."'", 'planets'); +doquery("UPDATE {{table}} SET interplanetary_misil = (interplanetary_misil - ".$anz.") WHERE id = '".$user['current_planet']."'", 'planets'); message("".$anz."". $lang['ma_missiles_sended'] .$DefenseLabel[$pziel], "game.php?page=overview", 3); ?> \ No newline at end of file diff --git a/SendFleetBack.php b/SendFleetBack.php index b89a28b..3337f7e 100644 --- a/SendFleetBack.php +++ b/SendFleetBack.php @@ -1,44 +1,31 @@ 0) { - $Aks = doquery("SELECT teilnehmer FROM {{table}} WHERE id = '". $FleetRow['fleet_group'] ."';", 'aks', true); + $Aks = doquery("SELECT teilnehmer FROM {{table}} WHERE id = '". $FleetRow['fleet_group'] ."';", 'aks', TRUE); if ($Aks['teilnehmer'] == $FleetRow['fleet_owner'] AND $FleetRow['fleet_mission'] == 1) { doquery ("DELETE FROM {{table}} WHERE id ='". $FleetRow['fleet_group'] ."';", 'aks'); @@ -51,26 +38,19 @@ } $CurrentFlyingTime = time() - $FleetRow['start_time']; - /* - if ($FleetRow['fleet_end_stay'] != 0) - { - if ($FleetRow['fleet_start_time'] < time()) - { - $CurrentFlyingTime = time() - $FleetRow['start_time']; - } - else - { - $CurrentFlyingTime = time() - $FleetRow['start_time']; - } - } - else - { - $CurrentFlyingTime = time() - $FleetRow['start_time']; // LO QUE ESTA COMO COMENTARIO ES EL BETA DEL FIX PARA - } // LOS TIEMPOS DE REGRESO DE LAS FLOTAS - // FUNCIONABA BIEN PERO FALLABA PARA LA MISION MATENER POSICION - */ - $ReturnFlyingTime = $CurrentFlyingTime + time(); + /*** start fix by jstar ***/ + //the fleet time duration between 2 planet, it is equal for go and return when maintaining time=0 + $fleetLeght = $FleetRow['fleet_start_time'] - $FleetRow['start_time']; + //the return time when you press "call back ships" + $ReturnFlyingTime = + //if the ships mission is maintaining position and they are already in target pianet + ( $FleetRow['fleet_end_stay'] != 0 && $CurrentFlyingTime > $fleetLeght ) + //then the return time is the $fleetLeght + the current time in maintaining position + ? $fleetLeght + time() + // else normal mission + : $CurrentFlyingTime + time(); + /***end fix by jstar***/ $QryUpdateFleet = "UPDATE {{table}} SET "; $QryUpdateFleet .= "`fleet_start_time` = '". (time() - 1) ."', "; diff --git a/adm/AccountDataPage.php b/adm/AccountDataPage.php index 9f4b0cb..5b925b3 100644 --- a/adm/AccountDataPage.php +++ b/adm/AccountDataPage.php @@ -1,483 +1,464 @@ ".$UserList['username']."   (".$lang['rank'][$UserList['authlevel']].")"; + die(message ($lang['404_page'])); } +$parse = $lang; -if($_GET['id_u'] != NULL) - $id_u = $_GET['id_u']; -else - $id_u = $_GET['id_u2']; +if ( $user['authlevel'] != 3 ) +{ + $NOSUPERMI = "WHERE `authlevel` < '" . $user['authlevel'] . "'"; +} + +$UserWhileLogin = doquery ( "SELECT `id`, `username`, `authlevel` FROM {{table}} " . $NOSUPERMI . " ORDER BY `username` ASC" , "users" ); + +while ( $UserList = mysql_fetch_array ( $UserWhileLogin ) ) +{ + $parse['lista'] .= ""; +} -$OnlyQueryLogin = doquery("SELECT `id`, `authlevel` FROM {{table}} WHERE `id` = '".$id_u."'", "users", true); +if ( $_GET['id_u'] != NULL ) +{ + $id_u = $_GET['id_u']; +} +else +{ + $id_u = $_GET['id_u2']; +} +$OnlyQueryLogin = doquery ( "SELECT `id`, `authlevel` FROM {{table}} WHERE `id` = '" . $id_u . "'" , "users" , TRUE ); - if ($_GET) +if ($_GET) +{ + if ( $id_u == NULL ) { - if ($id_u == NULL) - { - $parse['error'] = "".$lang['ac_user_id_required'].""; - } - elseif($_GET['id_u'] != NULL && $_GET['id_u2'] != NULL) - { - $parse['error'] = "".$lang['ac_select_one_id'].""; - } - elseif(!is_numeric($id_u)) + $parse['error'] = "" . $lang['ac_user_id_required'] . ""; + } + elseif ( $_GET['id_u'] != NULL && $_GET['id_u2'] != NULL ) + { + $parse['error'] = "" . $lang['ac_select_one_id'] . ""; + } + elseif ( !is_numeric ( $id_u ) ) + { + $parse['error'] = "" . $lang['ac_no_character'] . ""; + } + elseif ( $OnlyQueryLogin == NULL or $OnlyQueryLogin == 0 ) + { + $parse['error'] = "" . $lang['ac_username_doesnt'] . ""; + } + elseif ( $user['authlevel'] != 3 && $OnlyQueryLogin['authlevel'] > $user['authlevel'] ) + { + $parse['error'] = "" . $lang['ac_no_rank_level'] . ""; + } + else + { + // COMIENZA SAQUEO DE DATOS DE LA TABLA DE USUARIOS + $SpecifyItemsU = + "id,username,email,email_2,authlevel,id_planet,galaxy,system,planet,user_lastip,ip_at_reg,user_agent,register_time,onlinetime,noipcheck,urlaubs_modus, + urlaubs_until,spy_tech,computer_tech,military_tech,defence_tech,shield_tech,energy_tech,hyperspace_tech,combustion_tech,impulse_motor_tech, + hyperspace_motor_tech,laser_tech,ionic_tech,buster_tech,intergalactic_tech,expedition_tech,graviton_tech,ally_id,ally_name,ally_request, + ally_request_text,ally_register_time,ally_rank_id,rpg_geologue,rpg_amiral,rpg_ingenieur,rpg_technocrate,darkmatter,bana,banaday"; + + $UserQuery = doquery ( "SELECT " . $SpecifyItemsU . " FROM {{table}} WHERE `id` = '" . $id_u . "'" , "users" , TRUE ); + + + $parse['reg_time'] = date("d-m-Y H:i:s", $UserQuery['register_time']); + $parse['onlinetime'] = date("d-m-Y H:i:s", $UserQuery['onlinetime']); + $parse['id'] = $UserQuery['id']; + $parse['nombre'] = $UserQuery['username']; + $parse['email_1'] = $UserQuery['email']; + $parse['email_2'] = $UserQuery['email_2']; + $parse['ip'] = $UserQuery['ip_at_reg']; + $parse['ip2'] = $UserQuery['user_lastip']; + $parse['id_p'] = $UserQuery['id_planet']; + $parse['g'] = $UserQuery['galaxy']; + $parse['s'] = $UserQuery['system']; + $parse['p'] = $UserQuery['planet']; + $parse['info'] = $UserQuery['user_agent']; + $alianza = $UserQuery['ally_name']; + $parse['nivel'] = $lang['rank'][$UserQuery['authlevel']]; + $parse['ipcheck'] = $lang['ac_checkip'][$UserQuery['noipcheck']]; + + if ( $UserQuery['urlaubs_modus'] == 1 ) { - $parse['error'] = "".$lang['ac_no_character'].""; + $parse['vacas'] = $lang['one_is_yes'][1]; } - elseif($OnlyQueryLogin == NULL or $OnlyQueryLogin == 0) + else { - $parse['error'] = "".$lang['ac_username_doesnt'].""; + $parse['vacas'] = $lang['one_is_yes'][0]; } - elseif($user['authlevel'] != 3 && $OnlyQueryLogin['authlevel'] > $user['authlevel']) + + if ( $UserQuery['bana'] == 1 ) { - $parse['error'] = "".$lang['ac_no_rank_level'].""; + $parse['suspen'] = $lang['one_is_yes'][1]; } else { - // COMIENZA SAQUEO DE DATOS DE LA TABLA DE USUARIOS - $SpecifyItemsU = - "id,username,email,email_2,authlevel,id_planet,galaxy,system,planet,user_lastip,ip_at_reg,user_agent,register_time,onlinetime,noipcheck,urlaubs_modus, - urlaubs_until,spy_tech,computer_tech,military_tech,defence_tech,shield_tech,energy_tech,hyperspace_tech,combustion_tech,impulse_motor_tech, - hyperspace_motor_tech,laser_tech,ionic_tech,buster_tech,intergalactic_tech,expedition_tech,graviton_tech,ally_id,ally_name,ally_request, - ally_request_text,ally_register_time,ally_rank_id,rpg_geologue,rpg_amiral,rpg_ingenieur,rpg_technocrate,rpg_espion,rpg_constructeur,rpg_scientifique, - rpg_commandant,rpg_stockeur,darkmatter,rpg_defenseur,rpg_destructeur,rpg_general,rpg_bunker,rpg_raideur,rpg_empereur,bana,banaday"; - - $UserQuery = doquery("SELECT ".$SpecifyItemsU." FROM {{table}} WHERE `id` = '".$id_u."'", "users", true); - - - $parse['reg_time'] = date("d-m-Y H:i:s", $UserQuery['register_time']); - $parse['onlinetime'] = date("d-m-Y H:i:s", $UserQuery['onlinetime']); - $parse['id'] = $UserQuery['id']; - $parse['nombre'] = $UserQuery['username']; - $parse['email_1'] = $UserQuery['email']; - $parse['email_2'] = $UserQuery['email_2']; - $parse['ip'] = $UserQuery['ip_at_reg']; - $parse['ip2'] = $UserQuery['user_lastip']; - $parse['id_p'] = $UserQuery['id_planet']; - $parse['g'] = $UserQuery['galaxy']; - $parse['s'] = $UserQuery['system']; - $parse['p'] = $UserQuery['planet']; - $parse['info'] = $UserQuery['user_agent']; - $alianza = $UserQuery['ally_name']; - $parse['nivel'] = $lang['rank'][$UserQuery['authlevel']]; - $parse['ipcheck'] = $lang['ac_checkip'][$UserQuery['noipcheck']]; - if($UserQuery['urlaubs_modus'] == 1) $parse['vacas'] = $lang['one_is_yes'][1]; else $parse['vacas'] = $lang['one_is_yes'][0]; - if($UserQuery['bana'] == 1) $parse['suspen'] = $lang['one_is_yes'][1]; else $parse['suspen'] = $lang['one_is_yes'][0]; - - - $parse['mo'] = "".shortly_number($UserQuery['darkmatter']).""; - - $Log .= "\n".$lang['log_info_detail_title']."\n"; - $Log .= $lang['log_the_user'].$user['username'].$lang['log_searchto_1'].$UserQuery['username']."\n"; - LogFunction($Log, "GeneralLog", $LogCanWork); - - $parse['tec_espia'] = $UserQuery['spy_tech']; - $parse['tec_compu'] = $UserQuery['computer_tech']; - $parse['tec_militar'] = $UserQuery['military_tech']; - $parse['tec_defensa'] = $UserQuery['defence_tech']; - $parse['tec_blindaje'] = $UserQuery['shield_tech']; - $parse['tec_energia'] = $UserQuery['energy_tech']; - $parse['tec_hiperespacio'] = $UserQuery['hyperspace_tech']; - $parse['tec_combustion'] = $UserQuery['combustion_tech']; - $parse['tec_impulso'] = $UserQuery['impulse_motor_tech']; - $parse['tec_hiperespacio_p'] = $UserQuery['hyperspace_motor_tech']; - $parse['tec_laser'] = $UserQuery['laser_tech']; - $parse['tec_ionico'] = $UserQuery['ionic_tech']; - $parse['tec_plasma'] = $UserQuery['buster_tech']; - $parse['tec_intergalactico'] = $UserQuery['intergalactic_tech']; - $parse['tec_expedicion'] = $UserQuery['expedition_tech']; - $parse['tec_graviton'] = $UserQuery['graviton_tech']; - - - $parse['ofi_geologo'] = $UserQuery['rpg_geologue']; - $parse['ofi_almirante'] = $UserQuery['rpg_amiral']; - $parse['ofi_ingeniero'] = $UserQuery['rpg_ingenieur']; - $parse['ofi_tecnocrata'] = $UserQuery['rpg_technocrate']; - $parse['ofi_espia'] = $UserQuery['rpg_espion']; - $parse['ofi_constructor'] = $UserQuery['rpg_constructeur']; - $parse['ofi_cientifico'] = $UserQuery['rpg_scientifique']; - $parse['ofi_comandante'] = $UserQuery['rpg_commandant']; - $parse['ofi_almacenista'] = $UserQuery['rpg_stockeur']; - $parse['ofi_defensa'] = $UserQuery['rpg_defenseur']; - $parse['ofi_destructor'] = $UserQuery['rpg_destructeur']; - $parse['ofi_general'] = $UserQuery['rpg_general']; - $parse['ofi_bunker'] = $UserQuery['rpg_bunker']; - $parse['ofi_conquis'] = $UserQuery['rpg_raideur']; - $parse['ofi_emperador'] = $UserQuery['rpg_empereur']; - - - if ($UserQuery['bana'] != 0) - { - $parse['mas'] = "".$lang['ac_more'].""; + $parse['suspen'] = $lang['one_is_yes'][0]; + } - $BannedQuery = doquery("SELECT theme,time,longer,author FROM {{table}} WHERE `who` = '".$UserQuery['username']."'", "banned", true); + $parse['mo'] = "" . shortly_number ( $UserQuery['darkmatter'] ) . ""; + + $Log .= "\n" . $lang['log_info_detail_title'] . "\n"; + $Log .= $lang['log_the_user'] . $user['username'] . $lang['log_searchto_1'] . $UserQuery['username'] . "\n"; + + LogFunction ( $Log , "GeneralLog" , $LogCanWork ); + + // TECNOLOGIAS + $parse['tec_espia'] = $UserQuery['spy_tech']; + $parse['tec_compu'] = $UserQuery['computer_tech']; + $parse['tec_militar'] = $UserQuery['military_tech']; + $parse['tec_defensa'] = $UserQuery['defence_tech']; + $parse['tec_blindaje'] = $UserQuery['shield_tech']; + $parse['tec_energia'] = $UserQuery['energy_tech']; + $parse['tec_hiperespacio'] = $UserQuery['hyperspace_tech']; + $parse['tec_combustion'] = $UserQuery['combustion_tech']; + $parse['tec_impulso'] = $UserQuery['impulse_motor_tech']; + $parse['tec_hiperespacio_p'] = $UserQuery['hyperspace_motor_tech']; + $parse['tec_laser'] = $UserQuery['laser_tech']; + $parse['tec_ionico'] = $UserQuery['ionic_tech']; + $parse['tec_plasma'] = $UserQuery['buster_tech']; + $parse['tec_intergalactico'] = $UserQuery['intergalactic_tech']; + $parse['tec_expedicion'] = $UserQuery['expedition_tech']; + $parse['tec_graviton'] = $UserQuery['graviton_tech']; + + //OFICIALES + $parse['ofi_geologo'] = $UserQuery['rpg_geologue']; + $parse['ofi_almirante'] = $UserQuery['rpg_amiral']; + $parse['ofi_ingeniero'] = $UserQuery['rpg_ingenieur']; + $parse['ofi_tecnocrata'] = $UserQuery['rpg_technocrate']; + + if ($UserQuery['bana'] != 0) + { + $parse['mas'] = "" . $lang['ac_more'] . ""; + $BannedQuery = doquery ( "SELECT theme,time,longer,author FROM {{table}} WHERE `who` = '" . $UserQuery['username'] . "'" , "banned" , TRUE ); - $parse['sus_longer'] = date("d-m-Y H-i-s", $BannedQuery['longer']); - $parse['sus_time'] = date("d-m-Y H-i-s", $BannedQuery['time']); - $parse['sus_reason'] = $BannedQuery['theme']; - $parse['sus_author'] = $BannedQuery['author']; + $parse['sus_longer'] = date ( "d-m-Y H-i-s" , $BannedQuery['longer'] ); + $parse['sus_time'] = date ( "d-m-Y H-i-s" , $BannedQuery['time'] ); + $parse['sus_reason'] = $BannedQuery['theme']; + $parse['sus_author'] = $BannedQuery['author']; + } - } + // COMIENZA EL SAQUEO DE DATOS DE LA TABLA DE PUNTAJE + $SpecifyItemsS = "tech_count,defs_count,fleet_count,build_count,build_points,tech_points,defs_points,fleet_points,tech_rank,build_rank,defs_rank,fleet_rank,total_points,stat_type"; + $StatQuery = doquery ( "SELECT " . $SpecifyItemsS . " FROM {{table}} WHERE `id_owner` = '" .$id_u . "' AND `stat_type` = '1'" , "statpoints" , TRUE ); - // COMIENZA EL SAQUEO DE DATOS DE LA TABLA DE PUNTAJE - $SpecifyItemsS = - "tech_count,defs_count,fleet_count,build_count,build_points,tech_points,defs_points,fleet_points,tech_rank,build_rank,defs_rank,fleet_rank,total_points, - stat_type"; + $parse['count_tecno'] = pretty_number ( $StatQuery['tech_count'] ); + $parse['count_def'] = pretty_number ( $StatQuery['defs_count'] ); + $parse['count_fleet'] = pretty_number ( $StatQuery['fleet_count'] ); + $parse['count_builds'] = pretty_number ( $StatQuery['build_count'] ); - $StatQuery = doquery("SELECT ".$SpecifyItemsS." FROM {{table}} WHERE `id_owner` = '".$id_u."' AND `stat_type` = '1'", "statpoints", true); + $parse['point_builds'] = pretty_number ( $StatQuery['build_points'] ); + $parse['point_tecno'] = pretty_number ( $StatQuery['tech_points'] ); + $parse['point_def'] = pretty_number ( $StatQuery['defs_points'] ); + $parse['point_fleet'] = pretty_number ( $StatQuery['fleet_points'] ); - $parse['count_tecno'] = pretty_number($StatQuery['tech_count']); - $parse['count_def'] = pretty_number($StatQuery['defs_count']); - $parse['count_fleet'] = pretty_number($StatQuery['fleet_count']); - $parse['count_builds'] = pretty_number($StatQuery['build_count']); + $parse['ranking_tecno'] = $StatQuery['tech_rank']; + $parse['ranking_builds'] = $StatQuery['build_rank']; + $parse['ranking_def'] = $StatQuery['defs_rank']; + $parse['ranking_fleet'] = $StatQuery['fleet_rank']; - $parse['point_builds'] = pretty_number($StatQuery['build_points']); - $parse['point_tecno'] = pretty_number($StatQuery['tech_points']); - $parse['point_def'] = pretty_number($StatQuery['defs_points']); - $parse['point_fleet'] = pretty_number($StatQuery['fleet_points']); + $parse['total_points'] = pretty_number ( $StatQuery['total_points'] ); + // COMIENZA EL SAQUEO DE DATOS DE LA ALIANZA + $AliID = $UserQuery['ally_id']; - $parse['ranking_tecno'] = $StatQuery['tech_rank']; - $parse['ranking_builds'] = $StatQuery['build_rank']; - $parse['ranking_def'] = $StatQuery['defs_rank']; - $parse['ranking_fleet'] = $StatQuery['fleet_rank']; - $parse['total_points'] = pretty_number($StatQuery['total_points']); + if ( $alianza == 0 && $AliID == 0 ) + { + $parse['alianza'] = $lang['ac_no_ally']; + $parse['AllianceHave'] = "" . $lang['ac_alliance'] . " " . $lang['ac_no_alliance'] . ""; + } + elseif ( $alianza != NULL && $AliID != 0 ) + { + include_once("AdminFunctions/BBCode-Panel-Adm.php"); + $bbcode = new bbcode; + $parse['AllianceHave'] = " " . $lang['ac_alliance'] . ""; + $SpecifyItemsA = "ally_owner,id,ally_tag,ally_name,ally_web,ally_description,ally_text,ally_request,ally_image,ally_members,ally_register_time"; - // COMIENZA EL SAQUEO DE DATOS DE LA ALIANZA - $AliID = $UserQuery['ally_id']; + $AllianceQuery = doquery ( "SELECT " . $SpecifyItemsA . " FROM {{table}} WHERE `ally_name` = '" . $alianza . "'" , "alliance" , TRUE ); + $parse['alianza'] = $alianza; + $parse['id_ali'] = " (".$lang['ac_ali_idid']." ".$AliID.")"; + $parse['id_aliz'] = $AllianceQuery['id']; + $parse['tag'] = $AllianceQuery['ally_tag']; + $parse['ali_nom'] = $AllianceQuery['ally_name']; + $parse['ali_cant'] = $AllianceQuery['ally_members']; + $parse['ally_register_time'] = date("d-m-Y H:i:s", $AllianceQuery['ally_register_time']); + $ali_lider = $AllianceQuery['ally_owner']; - if ($alianza == 0 && $AliID == 0) + if ( $AllianceQuery['ally_web'] != NULL ) { - $parse['alianza'] = $lang['ac_no_ally']; - $parse['AllianceHave'] = " - ".$lang['ac_alliance']." ".$lang['ac_no_alliance'].""; + $parse['ali_web'] = "" . $AllianceQuery['ally_web'] . ""; } - elseif ($alianza != NULL && $AliID != 0) + else { - include_once("AdminFunctions/BBCode-Panel-Adm.php"); - $bbcode = new bbcode; - - $parse['AllianceHave'] = " - ".$lang['ac_alliance'].""; - - - - $SpecifyItemsA = - "ally_owner,id,ally_tag,ally_name,ally_web,ally_description,ally_text,ally_request,ally_image,ally_members,ally_register_time"; - - $AllianceQuery = doquery("SELECT ".$SpecifyItemsA." FROM {{table}} WHERE `ally_name` = '".$alianza."'", "alliance", true); - - - - $parse['alianza'] = $alianza; - $parse['id_ali'] = " (".$lang['ac_ali_idid']." ".$AliID.")"; - $parse['id_aliz'] = $AllianceQuery['id']; - $parse['tag'] = $AllianceQuery['ally_tag']; - $parse['ali_nom'] = $AllianceQuery['ally_name']; - $parse['ali_cant'] = $AllianceQuery['ally_members']; - $parse['ally_register_time'] = date("d-m-Y H:i:s", $AllianceQuery['ally_register_time']); - $ali_lider = $AllianceQuery['ally_owner']; - - - if($AllianceQuery['ally_web'] != NULL) - $parse['ali_web'] = "".$AllianceQuery['ally_web'].""; - else - $parse['ali_web'] = $lang['ac_no_web']; + $parse['ali_web'] = $lang['ac_no_web']; + } + if ( $AllianceQuery['ally_description'] != NULL ) + { + $parse['ali_ext2'] = $bbcode->reemplazo ( $AllianceQuery['ally_description'] ); + $parse['ali_ext'] = "" . $lang['ac_view_text_ext'] . ""; + } + else + { + $parse['ali_ext'] = $lang['ac_no_text_ext']; + } - if($AllianceQuery['ally_description'] != NULL) - { - $parse['ali_ext2'] = $bbcode->reemplazo($AllianceQuery['ally_description']); - $parse['ali_ext'] = "".$lang['ac_view_text_ext'].""; - } - else - { - $parse['ali_ext'] = $lang['ac_no_text_ext']; - } - if($AllianceQuery['ally_text'] != NULL) - { - $parse['ali_int2'] = $bbcode->reemplazo($AllianceQuery['ally_text']); - $parse['ali_int'] = "".$lang['ac_view_text_int'].""; - } - else - { - $parse['ali_int'] = $lang['ac_no_text_int']; - } + if ( $AllianceQuery['ally_text'] != NULL ) + { + $parse['ali_int2'] = $bbcode->reemplazo($AllianceQuery['ally_text']); + $parse['ali_int'] = "".$lang['ac_view_text_int'].""; + } + else + { + $parse['ali_int'] = $lang['ac_no_text_int']; + } - if($AllianceQuery['ally_request'] != NULL) - { - $parse['ali_sol2'] = $bbcode->reemplazo($AllianceQuery['ally_request']); - $parse['ali_sol'] = "".$lang['ac_view_text_sol'].""; - } - else - { - $parse['ali_sol'] = $lang['ac_no_text_sol']; - } + if ( $AllianceQuery['ally_request'] != NULL ) + { + $parse['ali_sol2'] = $bbcode->reemplazo($AllianceQuery['ally_request']); + $parse['ali_sol'] = "".$lang['ac_view_text_sol'].""; + } + else + { + $parse['ali_sol'] = $lang['ac_no_text_sol']; + } - if($AllianceQuery['ally_image'] != NULL) - { - $parse['ali_logo2'] = $AllianceQuery['ally_image']; - $parse['ali_logo'] = "".$lang['ac_view_image2'].""; - } - else - { - $parse['ali_logo'] = $lang['ac_no_img']; - } + if ( $AllianceQuery['ally_image'] != NULL ) + { + $parse['ali_logo2'] = $AllianceQuery['ally_image']; + $parse['ali_logo'] = "".$lang['ac_view_image2'].""; + } + else + { + $parse['ali_logo'] = $lang['ac_no_img']; + } + $SearchLeader = doquery("SELECT `username` FROM {{table}} WHERE `id` = '".$ali_lider."'", "users", TRUE); + $parse['ali_lider'] = $SearchLeader['username']; - $SearchLeader = doquery("SELECT `username` FROM {{table}} WHERE `id` = '".$ali_lider."'", "users", true); - $parse['ali_lider'] = $SearchLeader['username']; + $StatQueryAlly = doquery("SELECT " . $SpecifyItemsS . " FROM {{table}} WHERE `id_owner` = '".$ali_lider."' AND `stat_type` = '2'" , "statpoints" , TRUE ); + $parse['count_tecno_ali'] = pretty_number ( $StatQueryAlly['tech_count'] ); + $parse['count_def_ali'] = pretty_number ( $StatQueryAlly['defs_count'] ); + $parse['count_fleet_ali'] = pretty_number ( $StatQueryAlly['fleet_count'] ); + $parse['count_builds_ali'] = pretty_number ( $StatQueryAlly['build_count'] ); + $parse['point_builds_ali'] = pretty_number ( $StatQueryAlly['build_points'] ); + $parse['point_tecno_ali'] = pretty_number ( $StatQueryAlly['tech_points'] ); + $parse['point_def_ali'] = pretty_number ( $StatQueryAlly['defs_points'] ); + $parse['point_fleet_ali'] = pretty_number ( $StatQueryAlly['fleet_points'] ); - $StatQueryAlly = doquery("SELECT ".$SpecifyItemsS." FROM {{table}} WHERE `id_owner` = '".$ali_lider."' AND - `stat_type` = '2'", "statpoints", true); + $parse['ranking_tecno_ali'] = pretty_number ( $StatQueryAlly['tech_rank'] ); + $parse['ranking_builds_ali'] = pretty_number ( $StatQueryAlly['build_rank'] ); + $parse['ranking_def_ali'] = pretty_number ( $StatQueryAlly['defs_rank'] ); + $parse['ranking_fleet_ali'] = pretty_number ( $StatQueryAlly['fleet_rank'] ); - $parse['count_tecno_ali'] = pretty_number($StatQueryAlly['tech_count']); - $parse['count_def_ali'] = pretty_number($StatQueryAlly['defs_count']); - $parse['count_fleet_ali'] = pretty_number($StatQueryAlly['fleet_count']); - $parse['count_builds_ali'] = pretty_number($StatQueryAlly['build_count']); + $parse['total_points_ali'] = pretty_number ( $StatQueryAlly['total_points'] ); + } - $parse['point_builds_ali'] = pretty_number($StatQueryAlly['build_points']); - $parse['point_tecno_ali'] = pretty_number($StatQueryAlly['tech_points']); - $parse['point_def_ali'] = pretty_number($StatQueryAlly['defs_points']); - $parse['point_fleet_ali'] = pretty_number($StatQueryAlly['fleet_points']); + // COMIENZA EL SAQUEO DE DATOS DE LOS PLANETAS + $SpecifyItemsP = + "planet_type,id,name,galaxy,system,planet,destruyed,diameter,field_current,field_max,temp_min,temp_max,metal,crystal,deuterium,energy_max, + metal_mine,crystal_mine,deuterium_sintetizer,solar_plant,fusion_plant,robot_factory,nano_factory,hangar,metal_store,crystal_store,deuterium_store, + laboratory,terraformer,ally_deposit,silo,small_ship_cargo,big_ship_cargo,light_hunter,heavy_hunter,crusher,battle_ship,colonizer,recycler, + spy_sonde,bomber_ship,solar_satelit,destructor,dearth_star,battleship,misil_launcher,small_laser,big_laser,gauss_canyon,ionic_canyon, + buster_canyon,small_protection_shield,big_protection_shield,interceptor_misil,interplanetary_misil,mondbasis,phalanx,sprungtor, + energy_used"; + $PlanetsQuery = doquery ( "SELECT " . $SpecifyItemsP . " FROM {{table}} WHERE `id_owner` = '" . $id_u . "'" , "planets" ); - $parse['ranking_tecno_ali'] = pretty_number($StatQueryAlly['tech_rank']); - $parse['ranking_builds_ali'] = pretty_number($StatQueryAlly['build_rank']); - $parse['ranking_def_ali'] = pretty_number($StatQueryAlly['defs_rank']); - $parse['ranking_fleet_ali'] = pretty_number($StatQueryAlly['fleet_rank']); + while ( $PlanetsWhile = mysql_fetch_array ( $PlanetsQuery ) ) + { + if ( $PlanetsWhile['planet_type'] == 3 ) + { + $Planettt = $PlanetsWhile['name'] . " (" . $lang['ac_moon'] . ")
[" . $PlanetsWhile['galaxy'] . ":" . $PlanetsWhile['system'] . ":" . $PlanetsWhile['planet'] . "]"; - $parse['total_points_ali'] = pretty_number($StatQueryAlly['total_points']); + $MoonZ = 0; + $Moons = $PlanetsWhile['name'] . " (" . $lang['ac_moon'] . ")
[" . $PlanetsWhile['galaxy'] . ":" . $PlanetsWhile['system'] . ":" . $PlanetsWhile['planet'] . "]"; + $MoonZ++; + } + else + { + $Planettt = $PlanetsWhile['name'] . "
[" . $PlanetsWhile['galaxy'] . ":" . $PlanetsWhile['system'] . ":" . $PlanetsWhile['planet'] . "]"; } - - - - // COMIENZA EL SAQUEO DE DATOS DE LOS PLANETAS - $SpecifyItemsP = - "planet_type,id,name,galaxy,system,planet,destruyed,diameter,field_current,field_max,temp_min,temp_max,metal,crystal,deuterium,energy_max, - metal_mine,crystal_mine,deuterium_sintetizer,solar_plant,fusion_plant,robot_factory,nano_factory,hangar,metal_store,crystal_store,deuterium_store, - laboratory,terraformer,ally_deposit,silo,small_ship_cargo,big_ship_cargo,light_hunter,heavy_hunter,crusher,battle_ship,colonizer,recycler, - spy_sonde,bomber_ship,solar_satelit,destructor,dearth_star,battleship,supernova,misil_launcher,small_laser,big_laser,gauss_canyon,ionic_canyon, - buster_canyon,small_protection_shield,planet_protector,big_protection_shield,interceptor_misil,interplanetary_misil,mondbasis,phalanx,sprungtor, - energy_used"; - - $PlanetsQuery = doquery("SELECT ".$SpecifyItemsP." FROM {{table}} WHERE `id_owner` = '".$id_u."'", "planets"); - - while ($PlanetsWhile = mysql_fetch_array($PlanetsQuery)) + if ($PlanetsWhile["destruyed"] == 0) { - if ($PlanetsWhile['planet_type'] == 3) + $parse['planets_moons'] .= " + + " .$Planettt . " + " . $PlanetsWhile['id'] . " + " . pretty_number ( $PlanetsWhile['diameter'] ) . " + " . pretty_number ( $PlanetsWhile['field_current'] ) . "/" . pretty_number ( $PlanetsWhile['field_max'] ) ." + " . pretty_number ( $PlanetsWhile['temp_min'] ) . "/" . pretty_number ( $PlanetsWhile['temp_max'] ) ." + "; + + $SumOfEnergy = ( $PlanetsWhile['energy_max'] + $PlanetsWhile['energy_used'] ); + + if ( $SumOfEnergy < 0 ) { - $Planettt = $PlanetsWhile['name']." (".$lang['ac_moon'].")
[" - .$PlanetsWhile['galaxy'].":".$PlanetsWhile['system'].":".$PlanetsWhile['planet']."]"; + $Color = "" . shortly_number ( $SumOfEnergy ) . ""; + } - $MoonZ = 0; - $Moons = $PlanetsWhile['name']." (".$lang['ac_moon'].")
[" - .$PlanetsWhile['galaxy'].":".$PlanetsWhile['system'].":".$PlanetsWhile['planet']."]"; - $MoonZ++; + elseif ($SumOfEnergy > 0) + { + $Color = "" . shortly_number ( $SumOfEnergy ) . ""; } + else { - $Planettt = $PlanetsWhile['name']."
[".$PlanetsWhile['galaxy'].":".$PlanetsWhile['system'].":" - .$PlanetsWhile['planet']."]"; + $Color = shortly_number ( $SumOfEnergy ); } - - - if ($PlanetsWhile["destruyed"] == 0) + $parse['resources'] .= " + + ".$Planettt." + ".shortly_number($PlanetsWhile['metal'])." + + ".shortly_number($PlanetsWhile['crystal'])." + ".shortly_number($PlanetsWhile['deuterium'])." + ".$Color."/".shortly_number($PlanetsWhile['energy_max'])." + "; + + $parse['ships'] .= " + + ".$Planettt." + ".shortly_number($PlanetsWhile['small_ship_cargo'])." + ".shortly_number($PlanetsWhile['big_ship_cargo'])." + ".shortly_number($PlanetsWhile['light_hunter'])." + ".shortly_number($PlanetsWhile['heavy_hunter'])." + ".shortly_number($PlanetsWhile['crusher'])." + ".shortly_number($PlanetsWhile['battle_ship'])." + ".shortly_number($PlanetsWhile['colonizer'])." + ".shortly_number($PlanetsWhile['recycler'])." + ".shortly_number($PlanetsWhile['spy_sonde'])." + ".shortly_number($PlanetsWhile['bomber_ship'])." + ".shortly_number($PlanetsWhile['solar_satelit'])." + ".shortly_number($PlanetsWhile['destructor'])." + ".shortly_number($PlanetsWhile['dearth_star'])." + ".shortly_number($PlanetsWhile['battleship'])." + "; + + $parse['defenses'] .= " + + ".$Planettt." + ".shortly_number($PlanetsWhile['misil_launcher'])." + ".shortly_number($PlanetsWhile['small_laser'])." + ".shortly_number($PlanetsWhile['big_laser'])." + ".shortly_number($PlanetsWhile['gauss_canyon'])." + ".shortly_number($PlanetsWhile['ionic_canyon'])." + ".shortly_number($PlanetsWhile['buster_canyon'])." + ".shortly_number($PlanetsWhile['small_protection_shield'])." + ".shortly_number($PlanetsWhile['big_protection_shield'])." + ".shortly_number($PlanetsWhile['interceptor_misil'])." + ".shortly_number($PlanetsWhile['interplanetary_misil'])." + "; + + $parse['buildings'] .= " + + ".$Planettt." + ".shortly_number($PlanetsWhile['metal_mine'])." + ".shortly_number($PlanetsWhile['crystal_mine'])." + ".shortly_number($PlanetsWhile['deuterium_sintetizer'])." + ".shortly_number($PlanetsWhile['solar_plant'])." + ".shortly_number($PlanetsWhile['fusion_plant'])." + ".shortly_number($PlanetsWhile['robot_factory'])." + ".shortly_number($PlanetsWhile['nano_factory'])." + ".shortly_number($PlanetsWhile['hangar'])." + ".shortly_number($PlanetsWhile['metal_store'])." + ".shortly_number($PlanetsWhile['crystal_store'])." + ".shortly_number($PlanetsWhile['deuterium_store'])." + ".shortly_number($PlanetsWhile['laboratory'])." + ".shortly_number($PlanetsWhile['terraformer'])." + ".shortly_number($PlanetsWhile['ally_deposit'])." + ".shortly_number($PlanetsWhile['silo'])." + "; + + if ( $PlanetsWhile['planet_type'] == 3 ) { - $parse['planets_moons'] .= " + $parse['moon_buildings'] .= " - ".$Planettt." - ".$PlanetsWhile['id']." - ".pretty_number($PlanetsWhile['diameter'])." - ".pretty_number($PlanetsWhile['field_current'])."/".pretty_number($PlanetsWhile['field_max'])." - ".pretty_number($PlanetsWhile['temp_min'])."/".pretty_number($PlanetsWhile['temp_max'])." + ".$Moons." + ".shortly_number($PlanetsWhile['mondbasis'])." + ".shortly_number($PlanetsWhile['phalanx'])." + ".shortly_number($PlanetsWhile['sprungtor'])." "; - - - $SumOfEnergy = ($PlanetsWhile['energy_max'] + $PlanetsWhile['energy_used']); - - if ($SumOfEnergy < 0) - $Color = "".shortly_number($SumOfEnergy).""; - elseif ($SumOfEnergy > 0) - $Color = "".shortly_number($SumOfEnergy).""; - else - $Color = shortly_number($SumOfEnergy); - - - $parse['resources'] .= " - - ".$Planettt." - ".shortly_number($PlanetsWhile['metal'])." - ".shortly_number($PlanetsWhile['crystal'])." - ".shortly_number($PlanetsWhile['deuterium'])." - ".$Color."/".shortly_number($PlanetsWhile['energy_max'])." - "; - - - $parse['ships'] .= " - - ".$Planettt." - ".shortly_number($PlanetsWhile['small_ship_cargo'])." - ".shortly_number($PlanetsWhile['big_ship_cargo'])." - ".shortly_number($PlanetsWhile['light_hunter'])." - ".shortly_number($PlanetsWhile['heavy_hunter'])." - ".shortly_number($PlanetsWhile['crusher'])." - ".shortly_number($PlanetsWhile['battle_ship'])." - ".shortly_number($PlanetsWhile['colonizer'])." - ".shortly_number($PlanetsWhile['recycler'])." - ".shortly_number($PlanetsWhile['spy_sonde'])." - ".shortly_number($PlanetsWhile['bomber_ship'])." - ".shortly_number($PlanetsWhile['solar_satelit'])." - ".shortly_number($PlanetsWhile['destructor'])." - ".shortly_number($PlanetsWhile['dearth_star'])." - ".shortly_number($PlanetsWhile['battleship'])." - ".shortly_number($PlanetsWhile['supernova'])." - "; - - - $parse['defenses'] .= " - - ".$Planettt." - ".shortly_number($PlanetsWhile['misil_launcher'])." - ".shortly_number($PlanetsWhile['small_laser'])." - ".shortly_number($PlanetsWhile['big_laser'])." - ".shortly_number($PlanetsWhile['gauss_canyon'])." - ".shortly_number($PlanetsWhile['ionic_canyon'])." - ".shortly_number($PlanetsWhile['buster_canyon'])." - ".shortly_number($PlanetsWhile['small_protection_shield'])." - ".shortly_number($PlanetsWhile['big_protection_shield'])." - ".shortly_number($PlanetsWhile['planet_protector'])." - ".shortly_number($PlanetsWhile['interceptor_misil'])." - ".shortly_number($PlanetsWhile['interplanetary_misil'])." - "; - - - $parse['buildings'] .= " - - ".$Planettt." - ".shortly_number($PlanetsWhile['metal_mine'])." - ".shortly_number($PlanetsWhile['crystal_mine'])." - ".shortly_number($PlanetsWhile['deuterium_sintetizer'])." - ".shortly_number($PlanetsWhile['solar_plant'])." - ".shortly_number($PlanetsWhile['fusion_plant'])." - ".shortly_number($PlanetsWhile['robot_factory'])." - ".shortly_number($PlanetsWhile['nano_factory'])." - ".shortly_number($PlanetsWhile['hangar'])." - ".shortly_number($PlanetsWhile['metal_store'])." - ".shortly_number($PlanetsWhile['crystal_store'])." - ".shortly_number($PlanetsWhile['deuterium_store'])." - ".shortly_number($PlanetsWhile['laboratory'])." - ".shortly_number($PlanetsWhile['terraformer'])." - ".shortly_number($PlanetsWhile['ally_deposit'])." - ".shortly_number($PlanetsWhile['silo'])." - "; - - - - if ($PlanetsWhile['planet_type'] == 3) - { - $parse['moon_buildings'] .= " - - ".$Moons." - ".shortly_number($PlanetsWhile['mondbasis'])." - ".shortly_number($PlanetsWhile['phalanx'])." - ".shortly_number($PlanetsWhile['sprungtor'])." - "; - } + } - if ($MoonZ != 0) - $parse['MoonHave'] = " - ".$lang['moon_build'].""; - else - $parse['MoonHave'] = " - ".$lang['moon_build']." ".$lang['ac_moons_no'].""; + if ( $MoonZ != 0 ) + { + $parse['MoonHave'] = " + ".$lang['moon_build'].""; } - - $DestruyeD = 0; - if ($PlanetsWhile["destruyed"] > 0) + else { - $parse['destroyed'] .= " - - ".$PlanetsWhile['name']." - ".$PlanetsWhile['id']." - [".$PlanetsWhile['galaxy'].":".$PlanetsWhile['system'].":".$PlanetsWhile['planet']."] - ".date("d-m-Y H:i:s", $PlanetsWhile['destruyed'])." - "; - $DestruyeD++; + $parse['MoonHave'] = " + ".$lang['moon_build']." ".$lang['ac_moons_no'].""; } + } + $DestruyeD = 0; - if ($DestruyeD != 0) - $parse['DestructionHave'] = " - ".$lang['ac_recent_destroyed_planets'].""; - else - $parse['DestructionHave'] = " - ".$lang['ac_recent_destroyed_planets']." ".$lang['ac_isnodestruyed'].""; + if ( $PlanetsWhile["destruyed"] > 0 ) + { + $parse['destroyed'] .= " + + ".$PlanetsWhile['name']." + ".$PlanetsWhile['id']." + [".$PlanetsWhile['galaxy'].":".$PlanetsWhile['system'].":".$PlanetsWhile['planet']."] + ".date("d-m-Y H:i:s", $PlanetsWhile['destruyed'])." + "; + + $DestruyeD++; } - display (parsetemplate(gettemplate("adm/AccountDataBody"), $parse), false, '', true, false); + if ($DestruyeD != 0) + { + $parse['DestructionHave'] = " + ".$lang['ac_recent_destroyed_planets'].""; + } + else + { + $parse['DestructionHave'] = " + ".$lang['ac_recent_destroyed_planets']." ".$lang['ac_isnodestruyed'].""; + } } + + + display (parsetemplate(gettemplate("adm/AccountDataBody"), $parse), FALSE, '', TRUE, FALSE); } +} -display (parsetemplate(gettemplate("adm/AccountDataIntro"), $parse), false, '', true, false); +display (parsetemplate(gettemplate("adm/AccountDataIntro"), $parse), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/AccountEditorPage.php b/adm/AccountEditorPage.php index 8861358..8a8516e 100644 --- a/adm/AccountEditorPage.php +++ b/adm/AccountEditorPage.php @@ -1,32 +1,17 @@ 0) { $Sum = $mondbasis * FIELDS_BY_MOONBASIS_LEVEL; - doquery("UPDATE {{table}} SET `field_max` = field_max + '".$Sum."', `field_current` = field_current + '".$mondbasis."'", "planets"); + //doquery("UPDATE {{table}} SET `field_max` = field_max + '".$Sum."', `field_current` = field_current + '".$mondbasis."'", "planets"); + // FIX START BY alivan + //doquery("UPDATE {{table}} SET `field_max` = field_max '".$Sum."', `field_current` = field_current '".$mondbasis."' WHERE `id` = '". $id ."'", "planets"); + // FIX END BY alivan + //fix by jstar lol + doquery("UPDATE {{table}} SET `field_max` = field_max + '".$Sum."', `field_current` = field_current + '".$mondbasis."' WHERE `id` = '". $id ."'", "planets"); } } else @@ -425,6 +404,8 @@ if ($QueryFind['planet_type'] == '3') { $QryUpdatePlanet = "UPDATE {{table}} SET "; + + $QryUpdatePlanet .= "`mondbasis` = `mondbasis` - '". $mondbasis ."', "; $QryUpdatePlanet .= "`phalanx` = `phalanx` - '". $phalanx ."', "; $QryUpdatePlanet .= "`sprungtor` = `sprungtor` - '". $sprungtor ."' "; @@ -435,7 +416,12 @@ if ($mondbasis > 0) { $Sum = $mondbasis * FIELDS_BY_MOONBASIS_LEVEL; - doquery("UPDATE {{table}} SET `field_max` = field_max - '".$Sum."', `field_current` = field_current - '".$mondbasis."'", "planets"); + //doquery("UPDATE {{table}} SET `field_max` = field_max - '".$Sum."', `field_current` = field_current - '".$mondbasis."'", "planets"); + // FIX START BY alivan + //doquery("UPDATE {{table}} SET `field_max` = field_max - '".$Sum."', `field_current` = field_current - '".$mondbasis."' WHERE `id` = '". $id ."'", "planets"); + // FIX END BY alivan + //fix by jstar + doquery("UPDATE {{table}} SET `field_max` = field_max - '".$Sum."', `field_current` = field_current - '".$mondbasis."' WHERE `id` = '". $id ."'", "planets"); } } else @@ -481,7 +467,7 @@ } } - display (parsetemplate(gettemplate("adm/EditorTPL/BuildingsBody"), $parse), false, '', true, false); + display (parsetemplate(gettemplate("adm/EditorTPL/BuildingsBody"), $parse), FALSE, '', TRUE, FALSE); break; case'researchs': @@ -503,14 +489,12 @@ $buster_tech = $_POST['buster_tech']; $intergalactic_tech = $_POST['intergalactic_tech']; $expedition_tech = $_POST['expedition_tech']; - $atom_tech = $_POST['atom_tech']; - $colonisation_tech = $_POST['colonisation_tech']; $graviton_tech = $_POST['graviton_tech']; if(is_numeric($id) && is_numeric($spy_tech) && is_numeric($computer_tech) && is_numeric($military_tech) && is_numeric($defence_tech) && is_numeric($shield_tech) && is_numeric($energy_tech) && is_numeric($hyperspace_tech) && is_numeric($combustion_tech) && is_numeric($impulse_motor_tech) && is_numeric($hyperspace_motor_tech) && is_numeric($laser_tech) && is_numeric($ionic_tech) && - is_numeric($buster_tech)&& is_numeric($intergalactic_tech) && is_numeric($expedition_tech) && is_numeric($atom_tech) && is_numeric($colonisation_tech) && is_numeric($graviton_tech)) + is_numeric($buster_tech)&& is_numeric($intergalactic_tech) && is_numeric($expedition_tech) && is_numeric($graviton_tech)) { if ($_POST['add']) @@ -531,8 +515,6 @@ $QryUpdatePlanet .= "`buster_tech` = `buster_tech` + '". $buster_tech ."', "; $QryUpdatePlanet .= "`intergalactic_tech` = `intergalactic_tech` + '". $intergalactic_tech ."', "; $QryUpdatePlanet .= "`expedition_tech` = `expedition_tech` + '". $expedition_tech ."', "; - $QryUpdatePlanet .= "`atom_tech` = `atom_tech` + '". $atom_tech ."', "; - $QryUpdatePlanet .= "`colonisation_tech` = `colonisation_tech` + '". $colonisation_tech ."', "; $QryUpdatePlanet .= "`graviton_tech` = `graviton_tech` + '". $graviton_tech ."' "; $QryUpdatePlanet .= "WHERE "; $QryUpdatePlanet .= "`id` = '". $id ."' "; @@ -559,8 +541,6 @@ $QryUpdatePlanet .= "`buster_tech` = `buster_tech` - '". $buster_tech ."', "; $QryUpdatePlanet .= "`intergalactic_tech` = `intergalactic_tech` - '". $intergalactic_tech ."', "; $QryUpdatePlanet .= "`expedition_tech` = `expedition_tech` - '". $expedition_tech ."', "; - $QryUpdatePlanet .= "`atom_tech` = `atom_tech` - '". $atom_tech ."', "; - $QryUpdatePlanet .= "`colonisation_tech` = `colonisation_tech` - '". $colonisation_tech ."', "; $QryUpdatePlanet .= "`graviton_tech` = `graviton_tech` - '". $graviton_tech ."' "; $QryUpdatePlanet .= "WHERE "; $QryUpdatePlanet .= "`id` = '". $id ."' "; @@ -588,7 +568,6 @@ $Log .= $lang['buster_tech'].": ".$buster_tech."\n"; $Log .= $lang['intergalactic_tech'].": ".$intergalactic_tech."\n"; $Log .= $lang['expedition_tech'].": ".$expedition_tech."\n"; - $Log .= $lang['atom_tech'].": ".$atom_tech."\n"; $Log .= $lang['graviton_tech'].": ".$graviton_tech."\n"; $Log .= $lang['log_to_user'].$id."\n"; @@ -601,7 +580,7 @@ } } - display (parsetemplate(gettemplate("adm/EditorTPL/ResearchBody"), $parse), false, '', true, false); + display (parsetemplate(gettemplate("adm/EditorTPL/ResearchBody"), $parse), FALSE, '', TRUE, FALSE); break; case 'personal': @@ -622,6 +601,9 @@ $Log .= "\n".$lang['log_the_user'].$user['username']." ".$lang['log_modify_personal'].":\n"; $PersonalQuery = "UPDATE {{table}} SET "; + + + if($_POST['username'] != NULL){ $PersonalQuery .= "`username` = '".$_POST['username']."', "; $Log .= $lang['ad_personal_name'].": ".$_POST['username']."\n";} @@ -671,7 +653,7 @@ $parse['display'] = ''.$lang['ad_personal_succes'].''; } } - display (parsetemplate(gettemplate("adm/EditorTPL/PersonalBody"), $parse), false, '', true, false); + display (parsetemplate(gettemplate("adm/EditorTPL/PersonalBody"), $parse), FALSE, '', TRUE, FALSE); break; case'officiers': @@ -682,22 +664,8 @@ $rpg_amiral = $_POST['rpg_amiral']; $rpg_ingenieur = $_POST['rpg_ingenieur']; $rpg_technocrate = $_POST['rpg_technocrate']; - $rpg_espion = $_POST['rpg_espion']; - $rpg_constructeur = $_POST['rpg_constructeur']; - $rpg_scientifique = $_POST['rpg_scientifique']; - $rpg_commandant = $_POST['rpg_commandant']; - $rpg_stockeur = $_POST['rpg_stockeur']; - $rpg_defenseur = $_POST['rpg_defenseur']; - $rpg_destructeur = $_POST['rpg_destructeur']; - $rpg_general = $_POST['rpg_general']; - $rpg_bunker = $_POST['rpg_bunker']; - $rpg_raideur = $_POST['rpg_raideur']; - $rpg_empereur = $_POST['rpg_empereur']; - - if(is_numeric($id) && is_numeric($rpg_geologue) && is_numeric($rpg_amiral) && is_numeric($rpg_ingenieur) && is_numeric($rpg_technocrate) && - is_numeric($rpg_espion) && is_numeric($rpg_constructeur) && is_numeric($rpg_scientifique) && is_numeric($rpg_commandant) && - is_numeric($rpg_stockeur) && is_numeric($rpg_defenseur) && is_numeric($rpg_destructeur) && is_numeric($rpg_general) && - is_numeric($rpg_bunker)&& is_numeric($rpg_raideur) && is_numeric($rpg_empereur)) + + if(is_numeric($id) && is_numeric($rpg_geologue) && is_numeric($rpg_amiral) && is_numeric($rpg_ingenieur) && is_numeric($rpg_technocrate)) { if ($_POST['add']) @@ -706,18 +674,7 @@ $QryUpdatePlanet .= "`rpg_geologue` = `rpg_geologue` + '". $rpg_geologue ."', "; $QryUpdatePlanet .= "`rpg_amiral` = `rpg_amiral` + '". $rpg_amiral ."', "; $QryUpdatePlanet .= "`rpg_ingenieur` = `rpg_ingenieur` + '". $rpg_ingenieur ."', "; - $QryUpdatePlanet .= "`rpg_technocrate` = `rpg_technocrate` + '". $rpg_technocrate ."', "; - $QryUpdatePlanet .= "`rpg_espion` = `rpg_espion` + '". $rpg_espion ."', "; - $QryUpdatePlanet .= "`rpg_constructeur` = `rpg_constructeur` + '". $rpg_constructeur ."', "; - $QryUpdatePlanet .= "`rpg_scientifique` = `rpg_scientifique` + '". $rpg_scientifique ."', "; - $QryUpdatePlanet .= "`rpg_commandant` = `rpg_commandant` + '". $rpg_commandant ."', "; - $QryUpdatePlanet .= "`rpg_stockeur` = `rpg_stockeur` + '". $rpg_stockeur ."', "; - $QryUpdatePlanet .= "`rpg_defenseur` = `rpg_defenseur` + '". $rpg_defenseur ."', "; - $QryUpdatePlanet .= "`rpg_destructeur` = `rpg_destructeur` + '". $rpg_destructeur ."', "; - $QryUpdatePlanet .= "`rpg_general` = `rpg_general` + '". $rpg_general ."', "; - $QryUpdatePlanet .= "`rpg_bunker` = `rpg_bunker` + '". $rpg_bunker ."', "; - $QryUpdatePlanet .= "`rpg_raideur` = `rpg_raideur` + '". $rpg_raideur ."', "; - $QryUpdatePlanet .= "`rpg_empereur` = `rpg_empereur` + '". $rpg_empereur ."' "; + $QryUpdatePlanet .= "`rpg_technocrate` = `rpg_technocrate` + '". $rpg_technocrate ."' "; $QryUpdatePlanet .= "WHERE "; $QryUpdatePlanet .= "`id` = '". $id ."' "; doquery( $QryUpdatePlanet, "users"); @@ -731,18 +688,7 @@ $QryUpdatePlanet .= "`rpg_geologue` = `rpg_geologue` - '". $rpg_geologue ."', "; $QryUpdatePlanet .= "`rpg_amiral` = `rpg_amiral` - '". $rpg_amiral ."', "; $QryUpdatePlanet .= "`rpg_ingenieur` = `rpg_ingenieur` - '". $rpg_ingenieur ."', "; - $QryUpdatePlanet .= "`rpg_technocrate` = `rpg_technocrate` - '". $rpg_technocrate ."', "; - $QryUpdatePlanet .= "`rpg_espion` = `rpg_espion` - '". $rpg_espion ."', "; - $QryUpdatePlanet .= "`rpg_constructeur` = `rpg_constructeur` - '". $rpg_constructeur ."', "; - $QryUpdatePlanet .= "`rpg_scientifique` = `rpg_scientifique` - '". $rpg_scientifique ."', "; - $QryUpdatePlanet .= "`rpg_commandant` = `rpg_commandant` - '". $rpg_commandant ."', "; - $QryUpdatePlanet .= "`rpg_stockeur` = `rpg_stockeur` - '". $rpg_stockeur ."', "; - $QryUpdatePlanet .= "`rpg_defenseur` = `rpg_defenseur` - '". $rpg_defenseur ."', "; - $QryUpdatePlanet .= "`rpg_destructeur` = `rpg_destructeur` - '". $rpg_destructeur ."', "; - $QryUpdatePlanet .= "`rpg_general` = `rpg_general` - '". $rpg_general ."', "; - $QryUpdatePlanet .= "`rpg_bunker` = `rpg_bunker` - '". $rpg_bunker ."', "; - $QryUpdatePlanet .= "`rpg_raideur` = `rpg_raideur` - '". $rpg_raideur ."', "; - $QryUpdatePlanet .= "`rpg_empereur` = `rpg_empereur` - '". $rpg_empereur ."' "; + $QryUpdatePlanet .= "`rpg_technocrate` = `rpg_technocrate` - '". $rpg_technocrate ."' "; $QryUpdatePlanet .= "WHERE "; $QryUpdatePlanet .= "`id` = '". $id ."' "; doquery( $QryUpdatePlanet, "users"); @@ -758,17 +704,6 @@ $Log .= $lang['admiral'].": ".$rpg_amiral."\n"; $Log .= $lang['engineer'].": ".$rpg_ingenieur."\n"; $Log .= $lang['technocrat'].": ".$rpg_technocrate."\n"; - $Log .= $lang['spy'].": ".$rpg_espion."\n"; - $Log .= $lang['constructor'].": ".$rpg_constructeur."\n"; - $Log .= $lang['scientific'].": ".$rpg_scientifique."\n"; - $Log .= $lang['commander'].": ".$rpg_commandant."\n"; - $Log .= $lang['storer'].": ".$rpg_stockeur."\n"; - $Log .= $lang['defender'].": ".$rpg_defenseur."\n"; - $Log .= $lang['destroyer'].": ".$rpg_destructeur."\n"; - $Log .= $lang['general'].": ".$rpg_general."\n"; - $Log .= $lang['protector'].": ".$rpg_bunker."\n"; - $Log .= $lang['conqueror'].": ".$rpg_raideur."\n"; - $Log .= $lang['emperor'].": ".$rpg_empereur."\n"; $Log .= $lang['log_to_user'].$id."\n"; LogFunction($Log, "OfficierLog", $LogCanWork); @@ -780,7 +715,7 @@ } } - display (parsetemplate(gettemplate("adm/EditorTPL/OfficiersBody"), $parse), false, '', true, false); + display (parsetemplate(gettemplate("adm/EditorTPL/OfficiersBody"), $parse), FALSE, '', TRUE, FALSE); break; case 'planets': @@ -789,6 +724,7 @@ $id = $_POST['id']; $name = $_POST['name']; $change_id = $_POST['change_id']; + $diameter = $_POST['diameter']; $fields = $_POST['fields']; $buildings = $_POST['0_buildings']; @@ -828,13 +764,13 @@ `heavy_hunter` = '0', `crusher` = '0', `battle_ship` = '0', `colonizer` = '0', `recycler` = '0', `spy_sonde` = '0', `bomber_ship` = '0', `solar_satelit` = '0', `destructor` = '0', - `dearth_star` = '0', `battleship` = '0', `supernova` = '0' WHERE `id` = '".$id."'", "planets"); + `dearth_star` = '0', `battleship` = '0' WHERE `id` = '".$id."'", "planets"); $Log .= $lang['log_delete_all_ships']."\n";} if ($defenses == 'on'){ doquery("UPDATE {{table}} SET `misil_launcher` = '0', `small_laser` = '0', `big_laser` = '0', `gauss_canyon` = '0', `ionic_canyon` = '0', `buster_canyon` = '0', - `small_protection_shield` = '0', `planet_protector` = '0', `big_protection_shield` = '0', + `small_protection_shield` = '0', `big_protection_shield` = '0', `interceptor_misil` = '0', `interplanetary_misil` = '0' WHERE `id` = '".$id."'", "planets"); $Log .= $lang['log_delete_all_def']."\n";} @@ -848,7 +784,7 @@ $Log .= $lang['log_delete_all_c_edi']."\n";} - $P = doquery("SELECT * FROM {{table}} WHERE `id` = '".$id."'", "planets", true); + $P = doquery("SELECT * FROM {{table}} WHERE `id` = '".$id."'", "planets", TRUE); if ($diameter != NULL && is_numeric($diameter) && $diameter > 0){ doquery("UPDATE {{table}} SET `diameter` = '".$diameter."' WHERE `id` = '".$id."'", "planets"); @@ -864,7 +800,7 @@ $galaxy <= MAX_GALAXY_IN_WORLD && $system <= MAX_SYSTEM_IN_GALAXY && $planet <= MAX_PLANET_IN_SYSTEM) { $Queryyy = doquery("SELECT * FROM {{table}} WHERE `galaxy` = '".$galaxy."' AND `system` = '".$system."' AND - `planet` = '".$planet."'", "galaxy", true); + `planet` = '".$planet."'", "galaxy", TRUE); if ($P['planet_type'] == '1') { @@ -902,7 +838,7 @@ `id_luna` = '".$id."' WHERE `id_planet` = '".$Queryyy['id_planet']."'", "galaxy"); $QMOON2 = doquery("SELECT * FROM {{table}} WHERE `galaxy` = '".$galaxy."' AND `system` = '".$system."' AND - `planet` = '".$planet."'", "planets", true); + `planet` = '".$planet."'", "planets", TRUE); doquery ("UPDATE {{table}} SET `galaxy` = '".$galaxy."', `system` = '".$system."', `planet` = '".$planet."', `id_owner` = '".$QMOON2['id_owner']."', `id_level` = '".$QMOON2['id_level']."' WHERE `id` = '".$id."' AND `planet_type` = '3'", "planets"); @@ -919,6 +855,7 @@ } } + $Log .= $lang['log_change_pla_pos'].$Name.": [".$galaxy.":".$system.":".$planet."]\n"; } else @@ -932,7 +869,7 @@ } else { - $QueryPlanetsS = doquery("SELECT planet_type FROM {{table}} WHERE id = '".$id."'", "planets", true); + $QueryPlanetsS = doquery("SELECT planet_type FROM {{table}} WHERE id = '".$id."'", "planets", TRUE); if ($QueryPlanetsS['planet_type'] == '1') { doquery("DELETE FROM {{table}} WHERE id = '".$id."'", "planets"); @@ -962,7 +899,7 @@ } } - display (parsetemplate(gettemplate("adm/EditorTPL/PlanetsMoonsBody"), $parse), false, '', true, false); + display (parsetemplate(gettemplate("adm/EditorTPL/PlanetsMoonsBody"), $parse), FALSE, '', TRUE, FALSE); break; case 'alliances': @@ -980,7 +917,7 @@ if ($id != NULL) { - $QueryF = doquery("SELECT * FROM {{table}} WHERE `id` = '".$id."'", "alliance", true); + $QueryF = doquery("SELECT * FROM {{table}} WHERE `id` = '".$id."'", "alliance", TRUE); if ($QueryF) { @@ -997,7 +934,7 @@ $i = 0; - $QueryF2 = doquery("SELECT * FROM {{table}} WHERE `id` = '".$changeleader."'", "users", true); + $QueryF2 = doquery("SELECT * FROM {{table}} WHERE `id` = '".$changeleader."'", "users", TRUE); if ($QueryF2 && $changeleader != NULL && $QueryF2['ally_id'] == $id){ doquery("UPDATE {{table}} SET `ally_owner` = '".$changeleader."' WHERE `id` = '".$id."'", "alliance"); doquery("UPDATE {{table}} SET `ally_rank_id` = '0' WHERE `id` = '".$changeleader."'", "users"); @@ -1026,7 +963,7 @@ - $QueryF3 = doquery("SELECT * FROM {{table}} WHERE `id` = '".$delete_u."'", "users", true); + $QueryF3 = doquery("SELECT * FROM {{table}} WHERE `id` = '".$delete_u."'", "users", TRUE); if ($QueryF3 && $delete_u != NULL){ doquery("UPDATE {{table}} SET `ally_members` = ally_members - 1 WHERE `id` = '".$id."'", "alliance"); doquery("UPDATE {{table}} SET `ally_id` = '0', `ally_name` = '', `ally_request` = '0', `ally_rank_id` = '0', `ally_register_time` = '0', @@ -1057,7 +994,7 @@ } } - display (parsetemplate(gettemplate("adm/EditorTPL/AllianceBody"), $parse), false, '', true, false); + display (parsetemplate(gettemplate("adm/EditorTPL/AllianceBody"), $parse), FALSE, '', TRUE, FALSE); break; default: @@ -1068,6 +1005,6 @@ '; - display(parsetemplate(gettemplate('adm/EditorTPL/EditorBody'), $parse), false, '', true, false); + display(parsetemplate(gettemplate('adm/EditorTPL/EditorBody'), $parse), FALSE, '', TRUE, FALSE); } ?> \ No newline at end of file diff --git a/adm/ActivePlanets.php b/adm/ActivePlanets.php index 377ff54..6a487b5 100644 --- a/adm/ActivePlanets.php +++ b/adm/ActivePlanets.php @@ -1,32 +1,18 @@ " . $lang['ap_there_are'] . $Count . $lang['ap_with_activity'] . ""; $parse['online_list'] .= ""; -display( parsetemplate( gettemplate('adm/ActivePlanetsBody') , $parse ), false, '', true, false); +display( parsetemplate( gettemplate('adm/ActivePlanetsBody') , $parse ), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/AdminFunctions/Autorization.php b/adm/AdminFunctions/Autorization.php index f136516..8dbad66 100644 --- a/adm/AdminFunctions/Autorization.php +++ b/adm/AdminFunctions/Autorization.php @@ -1,40 +1,29 @@ \ No newline at end of file diff --git a/adm/AdminFunctions/BBCode-Panel-Adm.php b/adm/AdminFunctions/BBCode-Panel-Adm.php index 3630205..06fb7fe 100644 --- a/adm/AdminFunctions/BBCode-Panel-Adm.php +++ b/adm/AdminFunctions/BBCode-Panel-Adm.php @@ -1,9 +1,19 @@ sizefix(\'\\1\',\'\\2\')' ); - return preg_replace($pattern, $replace, nl2br(htmlspecialchars(stripslashes($string)))); + return preg_replace ( $pattern , $replace , nl2br ( htmlspecialchars ( stripslashes ( $string ) ) ) ); } - function sCode($string) + function sCode ( $string ) { - $pattern = '/\\\\"(.*?)\\\"/s'; - $string = preg_replace($pattern, '\3', $string); - return '
' . trim($string) . '
'; + $pattern = '/\\\\"(.*?)\\\"/s'; + $string = preg_replace ( $pattern , '\3' , $string ); + + return '
' . trim ( $string ) . '
'; } - function sQuote($string) + function sQuote ( $string ) { - $pattern = '/\\\\"(.*?)\\\"/s'; - $string = preg_replace($pattern, '\3', $string); + $pattern = '/\\\\"(.*?)\\\"/s'; + $string = preg_replace ( $pattern , '\3' , $string ); + return '

' . trim($string) . '

'; } - function sList($string) + function sList ( $string ) { - $tmp = explode('[*]', stripslashes($string)); - $out = null; - foreach($tmp as $list) { - if(strlen(str_replace('', '', $list)) > 0) { - $out .= '
  • ' . trim($list) . '
  • '; + $tmp = explode ( '[*]' , stripslashes ( $string ) ); + $out = NULL; + + foreach ( $tmp as $list ) + { + if ( strlen ( str_replace ( '' , '' , $list ) ) > 0 ) + { + $out .= '
  • ' . trim ( $list ) . '
  • '; } } + return ''; } @@ -85,45 +101,51 @@ function imagefix($img) return '' . $img . ''; } - function urlfix($url, $title) + function urlfix ( $url , $title ) { - $title = stripslashes($title); + $title = stripslashes ( $title ); + return '' . $title . ''; } - function fontfix($font, $title) + function fontfix ( $font , $title ) { - $title = stripslashes($title); + $title = stripslashes ( $title ); + return '' . $title . ''; } - function bgfix($bg, $title) + function bgfix ( $bg , $title ) { - $title = stripslashes($title); + $title = stripslashes ( $title ); return '' . $title . ''; } - function sizefix($size, $text) + function sizefix ( $size , $text ) { - $title = stripslashes($text); + $title = stripslashes ( $text ); return '' . $title . ''; } - function MessageForm($Title, $Message, $Goto = '', $Button = ' ok ', $TwoLines = false) + function MessageForm ( $Title , $Message , $Goto = '' , $Button = ' ok ' , $TwoLines = FALSE ) { - $Form .= "
    "; + $Form .= "
    "; $Form .= ""; $Form .= ""; - $Form .= ""; + $Form .= ""; $Form .= ""; - if ($TwoLines == true) + + if ( $TwoLines == TRUE ) { - $Form .= ""; + $Form .= ""; $Form .= ""; - $Form .= ""; + $Form .= ""; } else - $Form .= ""; + { + $Form .= ""; + } + $Form .= ""; $Form .= "
    ". $Title ."" . $Title . "
    ". $Message ."" . $Message . "
    ". $Message ."" . $Message . "
    "; $Form .= ""; diff --git a/adm/AdminFunctions/LogFunction.php b/adm/AdminFunctions/LogFunction.php index fea6eb4..3725321 100644 --- a/adm/AdminFunctions/LogFunction.php +++ b/adm/AdminFunctions/LogFunction.php @@ -1,50 +1,42 @@ diff --git a/styles/images/smileys/index.html b/adm/AdminFunctions/index.html similarity index 100% rename from styles/images/smileys/index.html rename to adm/AdminFunctions/index.html diff --git a/adm/BanPage.php b/adm/BanPage.php index 289a763..0a88267 100644 --- a/adm/BanPage.php +++ b/adm/BanPage.php @@ -1,31 +1,18 @@ '.$a['username'].'  (ID: '.$a['id'].')'.$SuspendedNow.''; $Users++; } @@ -67,7 +54,7 @@ $ORDER2 = "id"; else $ORDER2 = "username"; - + $Banneds = 0; $UserListBan = doquery("SELECT `username`, `id` FROM {{table}} WHERE `bana` = '1' ORDER BY ".$ORDER2." ASC", "users"); while ($b = mysql_fetch_array($UserListBan)) @@ -85,9 +72,9 @@ if($_GET['panel']) { - $QueryUserBan = doquery("SELECT * FROM {{table}} WHERE `who` = '".$_GET['ban_name']."'", "banned", true); - $QueryUserBanVacation = doquery("SELECT urlaubs_modus FROM {{table}} WHERE `username` = '".$_GET['ban_name']."'", "users", true); - + $QueryUserBan = doquery("SELECT * FROM {{table}} WHERE `who` = '".$_GET['ban_name']."'", "banned", TRUE); + $QueryUserBanVacation = doquery("SELECT urlaubs_modus FROM {{table}} WHERE `username` = '".$_GET['ban_name']."'", "users", TRUE); + if (!$QueryUserBan) { $parse['title'] = $lang['bo_bbb_title_1']; @@ -97,23 +84,23 @@ { $parse['title'] = $lang['bo_bbb_title_3']; $parse['changedate'] = $lang['bo_bbb_title_6']; - $parse['changedate_advert'] = ""; - + $parse['reas'] = $QueryUserBan['theme']; - $parse['timesus'] = + $parse['timesus'] = " ".$lang['bo_bbb_title_5']." ".date("d-m-Y H:i:s", $QueryUserBan['longer'])." "; } - - + + if ($QueryUserBanVacation['urlaubs_modus'] == 1) $parse['vacation'] = 'checked = "checked"'; else $parse['vacation'] = ''; - + $parse['name'] = $_GET['ban_name']; @@ -121,8 +108,8 @@ if ($_POST['bannow']) { if(!is_numeric($_POST['days']) || !is_numeric($_POST['hour']) || !is_numeric($_POST['mins']) || !is_numeric($_POST['secs'])) - return display( parsetemplate(gettemplate("adm/BanOptionsResultBody"), $parse), false, '', true, false); - + return display( parsetemplate(gettemplate("adm/BanOptionsResultBody"), $parse), FALSE, '', TRUE, FALSE); + $name = $_POST['ban_name']; $reas = $_POST['why']; $days = $_POST['days']; @@ -138,13 +125,13 @@ $BanTime += $secs; if ($QueryUserBan['longer'] > time()) $BanTime += ($QueryUserBan['longer'] - time()); - + if (($BanTime + $Now) < time()) $BannedUntil = $Now; else $BannedUntil = $Now + $BanTime; - - + + if ($QueryUserBan) { $QryInsertBan = "UPDATE {{table}} SET "; @@ -197,44 +184,43 @@ $PunishThePlanets .= "WHERE "; $PunishThePlanets .= "`id_owner` = '". $GetUserData['id'] ."';"; doquery( $PunishThePlanets, 'planets'); - - - + + + $Log .= "\n".$lang['log_suspended_title']."\n"; $Log .= $lang['log_the_user'].$user['username']." ".$lang['log_suspended_1'].$name.$lang['log_suspended_2']."\n"; $Log .= $lang['log_reason'].$reas."\n"; $Log .= $lang['log_time'].date("d-m-Y H:i:s", time())."\n"; $Log .= $lang['log_longer'].date("d-m-Y H:i:s", $BannedUntil)."\n"; $Log .= $lang['log_vacations'].$lang['log_viewmod'][$ASD]."\n"; - - LogFunction($Log, "GeneralLog", $LogCanWork); + LogFunction($Log, "GeneralLog", $LogCanWork); - header ("Location: BanPage.php?panel=ban_name&ban_name=".$_GET['ban_name']."&succes=yes"); + header ( 'location:BanPage.php?panel=ban_name&ban_name='.$_GET['ban_name'].'&succes=yes' ); } if ($_GET['succes'] == 'yes') $parse['display'] = "". $lang['bo_the_player'] . $name . $lang['bo_banned'] .""; - display( parsetemplate(gettemplate("adm/BanOptionsResultBody"), $parse), false, '', true, false); + display( parsetemplate(gettemplate("adm/BanOptionsResultBody"), $parse), FALSE, '', TRUE, FALSE); } elseif($_POST && $_POST['unban_name']) { $name = $_POST['unban_name']; doquery("DELETE FROM {{table}} WHERE who = '".$name."'", 'banned'); doquery("UPDATE {{table}} SET bana = '0', banaday = '0' WHERE username = '".$name."'", "users"); - - - + + + $Log .= "\n".$lang['log_suspended_title']."\n"; $Log .= $lang['log_the_user'].$user['username']." ".$lang['log_suspended_3'].$name."\n"; - + LogFunction($Log, "GeneralLog", $LogCanWork); - - header ("Location: BanPage.php?succes2=yes"); + + header ( 'location:BanPage.php?succes2=yes' ); } if ($_GET['succes2'] == 'yes') $parse['display2'] = "". $lang['bo_the_player2'] . $name . $lang['bo_unbanned'] .""; -display( parsetemplate(gettemplate("adm/BanOptions"), $parse), false, '', true, false); +display( parsetemplate(gettemplate("adm/BanOptions"), $parse), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/ChangePassPage.php b/adm/ChangePassPage.php index 98c808f..02cf23f 100644 --- a/adm/ChangePassPage.php +++ b/adm/ChangePassPage.php @@ -1,40 +1,28 @@ \ No newline at end of file diff --git a/adm/CombatReport.php b/adm/CombatReport.php index 613aa69..6a62a19 100644 --- a/adm/CombatReport.php +++ b/adm/CombatReport.php @@ -1,34 +1,20 @@ ".$lang['cr_lost_contact']."
    "; @@ -51,5 +37,5 @@ $Page .= $report; } -display($Page, false, '', false, false); +display($Page, FALSE, '', FALSE, FALSE); ?> \ No newline at end of file diff --git a/adm/ConfigStatsPage.php b/adm/ConfigStatsPage.php index 9b6f210..6d83ab1 100644 --- a/adm/ConfigStatsPage.php +++ b/adm/ConfigStatsPage.php @@ -1,96 +1,91 @@ = 10) + if (isset($_POST['stat_amount']) && is_numeric($_POST['stat_amount']) && $_POST['stat_amount'] != $game_stat_amount && $_POST['stat_amount'] >= 10) { update_config('stat_amount', $_POST['stat_amount']); - $game_config['stat_amount'] = $_POST['stat_amount']; + $game_stat_amount = $_POST['stat_amount']; $Log .= $lang['log_stats_value_3'].": ".$_POST['stat_amount']."\n"; } - if (isset($_POST['stat_update_time']) && is_numeric($_POST['stat_update_time']) && $_POST['stat_update_time'] != $game_config['stat_update_time']) + if (isset($_POST['stat_update_time']) && is_numeric($_POST['stat_update_time']) && $_POST['stat_update_time'] != $game_stat_update_time) { update_config('stat_update_time', $_POST['stat_update_time']); - $game_config['stat_update_time'] = $_POST['stat_update_time']; + $game_stat_update_time = $_POST['stat_update_time']; $Log .= $lang['log_stats_value_2'].": ".$_POST['stat_update_time']."\n"; } LogFunction($Log, "ConfigLog", $LogCanWork); - header("location:ConfigStatsPage.php"); + header ( 'location:ConfigStatsPage.php' ); + } else { $selected = "selected=\"selected\""; - $stat = (($game_config['stat'] == 1)? 'sel_sta0':'sel_sta1'); + $stat = (($game_stat == 1)? 'sel_sta0':'sel_sta1'); $lang[$stat] = $selected; - $stat_fly = (($game_config['stat_flying'] == 1)? 'sel_sf1':'sel_sf0'); + $stat_fly = (($game_stat_flying == 1)? 'sel_sf1':'sel_sf0'); $lang[$stat_fly] = $selected; - $lang['stat_level'] = $game_config['stat_level']; - $lang['stat_settings'] = $game_config['stat_settings']; - $lang['stat_amount'] = $game_config['stat_amount']; - $lang['stat_update_time'] = $game_config['stat_update_time']; - $lang['timeact'] = gmdate("d/M/y H:i:s", $game_config['stat_last_update']); + $lang['stat_level'] = $game_stat_level; + $lang['stat_settings'] = $game_stat_settings; + $lang['stat_amount'] = $game_stat_amount; + $lang['stat_update_time'] = $game_stat_update_time; + $lang['timeact'] = gmdate("d/M/y H:i:s", $game_stat_last_update); $lang['yes'] = $lang['one_is_yes'][1]; $lang['no'] = $lang['one_is_yes'][0]; $admin_settings = parsetemplate(gettemplate('adm/ConfigStatsBody'), $lang); - display($admin_settings, false, '', true, false); + display($admin_settings, FALSE, '', TRUE, FALSE); } ?> \ No newline at end of file diff --git a/adm/CreateNewUserPage.php b/adm/CreateNewUserPage.php index e479ed5..62ed3ca 100644 --- a/adm/CreateNewUserPage.php +++ b/adm/CreateNewUserPage.php @@ -1,32 +1,18 @@ \ No newline at end of file diff --git a/adm/DataBaseViewPage.php b/adm/DataBaseViewPage.php index 8053ca2..4b814b8 100644 --- a/adm/DataBaseViewPage.php +++ b/adm/DataBaseViewPage.php @@ -1,31 +1,17 @@ $tabla) @@ -56,17 +42,17 @@ doquery("OPTIMIZE TABLE {$tabla}", "$tabla"); $Message = $lang['od_opt']; $Log = "\n".$lang['log_database_title']."\n".$lang['log_the_user'].$user['username'].$lang['log_database_view'].":\n".$lang['log_data_optimize']."\n";} - + if ($_POST['Repair']){ doquery("REPAIR TABLE {$tabla}", "$tabla"); $Message = $lang['od_rep']; $Log = "\n".$lang['log_database_title']."\n".$lang['log_the_user'].$user['username'].$lang['log_database_view'].":\n".$lang['log_data_repair']."\n";} - + if ($_POST['Check']){ doquery("CHECK TABLE {$tabla}", "$tabla"); $Message = $lang['od_check_ok']; $Log = "\n".$lang['log_database_title']."\n".$lang['log_the_user'].$user['username'].$lang['log_database_view'].":\n".$lang['log_data_check']."\n";} - + if (mysql_errno()) { $parse['tabla'] .= ""; @@ -83,9 +69,9 @@ } } } - + LogFunction($Log, "GeneralLog", $LogCanWork); } -display(parsetemplate(gettemplate('adm/DataBaseViewBody'), $parse), false, '', true, false); +display(parsetemplate(gettemplate('adm/DataBaseViewBody'), $parse), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/ErrorPage.php b/adm/ErrorPage.php index 2d4031d..292fa91 100644 --- a/adm/ErrorPage.php +++ b/adm/ErrorPage.php @@ -1,38 +1,24 @@ ". $i . $lang['er_errors'] .""; - - - if (isset($delete)){ + + + if (isset($delete)) + { doquery("DELETE FROM {{table}} WHERE `error_id`=$delete", 'errors'); $Log .= "\n".$lang['log_errores_title']."\n"; $Log .= $lang['log_the_user'].$user['username']." ".$lang['log_delete_errors']."\n"; LogFunction($Log, "GeneralLog", $LogCanWork); - header ("Location: ErrorPage.php");} - elseif ($deleteall == 'yes'){ + header ( 'location:ErrorPage.php' ); + } + elseif ($deleteall == 'yes') + { doquery("TRUNCATE TABLE {{table}}", 'errors'); $Log .= "\n".$lang['log_errores_title']."\n"; $Log .= $lang['log_the_user'].$user['username']." ".$lang['log_delete_all_errors']."\n"; LogFunction($Log, "GeneralLog", $LogCanWork); - header ("Location: ErrorPage.php");} + header ( 'location:ErrorPage.php' ); + } - display(parsetemplate(gettemplate('adm/ErrorMessagesBody'), $parse), false, '', true, false); + display(parsetemplate(gettemplate('adm/ErrorMessagesBody'), $parse), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/GlobalMessagePage.php b/adm/GlobalMessagePage.php index 7dd80ed..e585bd2 100644 --- a/adm/GlobalMessagePage.php +++ b/adm/GlobalMessagePage.php @@ -1,90 +1,72 @@ 0){ - $still=intval($_POST['still']); - $ress_all = doquery("UPDATE {{table}} SET `darkmatter`=`darkmatter`+'".$still."';", 'users'); - } - if ((isset($_POST["tresc"]) && $_POST["tresc"] != '') && (isset($_POST["temat"]) && $_POST["temat"] != '')) - { - $sq = doquery("SELECT `id`,`username` FROM {{table}}", "users"); - $Time = time(); - $From = "". $ranga ." ".$user['username'].""; - $Subject = "".$_POST['temat'].""; - $Message = "".$_POST['tresc'].""; - $summery = 0; + elseif ($user['authlevel'] == 1) + { + $kolor = 'yellow'; + $ranga = $lang['user_level'][1]; + } + if ((isset($_POST["tresc"]) && $_POST["tresc"] != '') && (isset($_POST["temat"]) && $_POST["temat"] != '')) + { + $sq = doquery("SELECT `id`,`username` FROM {{table}}", "users"); + $Time = time(); + $From = "". $ranga ." ".$user['username'].""; + $Subject = "".$_POST['temat'].""; + $Message = "".$_POST['tresc'].""; + $summery = 0; - while ($u = mysql_fetch_array($sq)) - { - SendSimpleMessage ( $u['id'], $user['id'], $Time, 1, $From, $Subject, $Message); - $_POST['tresc'] = str_replace(":name:",$u['username'],$_POST['tresc']); - } - - - $Log .= "\n".$lang['log_circular_message']."\n"; - $Log .= $lang['log_the_user'].$user['username'].$lang['log_message_specify'].":\n"; - $Log .= $lang['log_mes_subject'].": ".$_POST["temat"]."\n"; - $Log .= $lang['log_mes_text'].": ".$_POST["tresc"]."\n"; - - LogFunction($Log, "GeneralLog", $LogCanWork); - - $parse['display'] = "".$lang['ma_message_sended'].""; - } - else - { - $parse['display'] = "".$lang['ma_subject_needed'].""; - } - } - - -display(parsetemplate(gettemplate('adm/GlobalMessageBody'), $parse), false,'', true, false); + while ($u = mysql_fetch_array($sq)) + { + SendSimpleMessage ( $u['id'], $user['id'], $Time, 1, $From, $Subject, $Message); + $_POST['tresc'] = str_replace(":name:",$u['username'],$_POST['tresc']); + } + + + $Log .= "\n".$lang['log_circular_message']."\n"; + $Log .= $lang['log_the_user'].$user['username'].$lang['log_message_specify'].":\n"; + $Log .= $lang['log_mes_subject'].": ".$_POST["temat"]."\n"; + $Log .= $lang['log_mes_text'].": ".$_POST["tresc"]."\n"; + + LogFunction($Log, "GeneralLog", $LogCanWork); + + $parse['display'] = "".$lang['ma_message_sended'].""; + } + else + { + $parse['display'] = "".$lang['ma_subject_needed'].""; + } + } + + +display(parsetemplate(gettemplate('adm/GlobalMessageBody'), $parse), FALSE,'', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/Log/BuildingsLog.php b/adm/Log/BuildingsLog.php index 87fc606..cc96e94 100644 --- a/adm/Log/BuildingsLog.php +++ b/adm/Log/BuildingsLog.php @@ -1,24 +1,24 @@ -Èãðîê admin óäàëèòü: -Ðóäíèê ïî äîáû÷å ìåòàëëà: 0 -Ðóäíèê ïî äîáû÷å êðèñòàëëà: 0 -Ñèíòåçàòîð äåéòåðèÿ: 0 -Ñîëíå÷íàÿ ýëåêòðîñòàíöèÿ: 0 -Òåðìîÿäåðíûé ðåàêòîð: 0 -Ôàáðèêà ðîáîòîâ: 20 -Ôàáðèêà íàíèòîâ: 0 -Âåðôü: 0 -Õðàíèëèùå ìåòàëîâ: 0 -Õðàíèëèùå êðåñòàëîâ: 0 -Åìêîñòü äëÿ äåéòåðèÿ: 0 -Èññëåäîâàòåëüñêàÿ ëàáîðàòîðèÿ: 0 -Òåðàôîðìåðû: 0 -Ñêëàä Àëüÿíñà: 0 -Ðàêåòíàÿ øàõòà: 0 -Ëóíàÿ áàçà: 0 -Ñåíñîðíàÿ ôàëàíãà: 0 -Ïðûøêîâûå âðàòà: 0 -ê ïëàíåòå ñ ID: 1 -Operation on: 25-08-2010 21:59:39 -43 -23:10 +El usuario lucky agrego: +Mina de metal: 0 +Mina de cristal: 0 +Sintetizador de deuterio: 0 +Planta de energía solar: 0 +Planta de fusión: 0 +Fábrica de Robots: 0 +Fábrica de Nanobots: 0 +Hangar: 0 +Almacén de Metal: 0 +Almacén de Cristal: 0 +Contenedor de deuterio: 0 +Laboratorio de investigación: 0 +Terraformer: 0 +Depósito de la Alianza: 0 +Silo: 0 +Base lunar: 1 +Phalanx: 1 +Salto cuántico: 1 +al planeta con el ID: 4 +Operación realizada el: 04-01-2012 18:14:07 + +:39:55 diff --git a/adm/Log/ConfigLog.php b/adm/Log/ConfigLog.php index 8aff876..e8ab058 100644 --- a/adm/Log/ConfigLog.php +++ b/adm/Log/ConfigLog.php @@ -1,10 +1,11 @@ -Èãðîê admin has changed the parameters of statistics: -The administration may be in the ranking?: -Operation on: 23-08-2010 00:11:16 -zada el: 15-08-2010 20:08:38 -peración realizada el: 15-08-2010 19:55:09 -d de flota : x1 +El usuario cambio la siguiente configuración: +¿Servidor cerrado? : +¿Modo DEBUG activado? : +Nombre del juego : XG Proyect +URL del foro : http://www.xgproyect.net/ +Velocidad del juego : x1 +Velocidad de flota : x1 Velocidad de producción : x1 Campos iniciales : 163 Básico de metal por hora : 20 @@ -18,6 +19,4 @@ ¿Protección contra novatos activado? : Tiempo de protección contra novato : 5000 Limite de puntos para la protección de novato : 5 -Operación realizada el: 04-08-2010 08:50:06 -:50 -:55 +Operación realizada el: 20-12-2011 22:17:36 diff --git a/adm/Log/DefensesLog.php b/adm/Log/DefensesLog.php deleted file mode 100644 index 3e96ad5..0000000 --- a/adm/Log/DefensesLog.php +++ /dev/null @@ -1,15 +0,0 @@ - -Èãðîê admin äàáàâèòü: -Ðàêåòíàÿ óñòàíîâêà: 0 -Ëåãêèé ëàçåð: 0 -Òÿæ¸ëûé ëàçåð: 0 -Ïóøêà Ãàóññà: 0 -Èîííîå îðóäèå: 0 -Ïëàçìåííîå îðóäèå: 0 -Ìàëûé ùèòîâîé êóïîë: 0 -Áîëüøîé ùèòîâîé êóïîë: 0 -Íåéòðîííûé êóïîë: 0 -Ðàêåòà-ïåðåõâàò÷èê: 0 -Ìåæïëàíåòíàÿ ðàêåòà: 0 -ê ïëàíåòå ñ ID: 1 -Operation on: 25-08-2010 22:54:39 diff --git a/adm/Log/GeneralLog.php b/adm/Log/GeneralLog.php index f9174c5..cb55979 100644 --- a/adm/Log/GeneralLog.php +++ b/adm/Log/GeneralLog.php @@ -1,10 +1,10 @@ -||| LIST OF ERRORS ||| -Èãðîê admin has removed an error -Operation on: 25-08-2010 23:02:54 -guientes especificaciones: -Razón: Estoy haciendo una prueba. -el: 15-08-2010 19:43:52 -hasta el: 15-08-2010 19:44:52 +||| LISTA DE ERRORES ||| +El usuario lucky ha borrado todos los mensajes de error +Operación realizada el: 05-01-2012 04:16:21 +: 23-11-2011 01:45:07 +5 +21:15:04 +hasta el: 04-10-2011 21:15:04 ¿En modo vacaciones? -Operación realizada el: 15-08-2010 19:43:52 +Operación realizada el: 03-10-2011 21:15:04 diff --git a/adm/Log/OfficierLog.php b/adm/Log/OfficierLog.php index e69de29..ab8dc53 100644 --- a/adm/Log/OfficierLog.php +++ b/adm/Log/OfficierLog.php @@ -0,0 +1,8 @@ + +El usuario lucky borro: +Geólogo: 1 +Almirante: 1 +Ingeniero: 1 +Tecnócrata: 1 +al usuario con el ID: 1 +Operación realizada el: 23-11-2011 01:48:57 diff --git a/adm/Log/PersonalLog.php b/adm/Log/PersonalLog.php deleted file mode 100644 index e61f8bf..0000000 --- a/adm/Log/PersonalLog.php +++ /dev/null @@ -1,4 +0,0 @@ - -El usuario lucky modifico los siguientes datos: -al usuario con el ID: 1 -Operación realizada el: 25-02-2010 19:49:01 diff --git a/adm/Log/ResearchLog.php b/adm/Log/ResearchLog.php index a5083b4..6c06a07 100644 --- a/adm/Log/ResearchLog.php +++ b/adm/Log/ResearchLog.php @@ -1,21 +1,22 @@ -Èãðîê admin äàáàâèòü: -Øïèîíñêàÿ Òåõíîëîãèÿ: 0 -Êîìïüþòåðíàÿ òåõíîëîãèÿ: 0 -Îðóæåéíàÿ òåõíîëîãèÿ: 0 -Ùèòîâàÿ òåõíîëîãèÿ: 0 -Òåõíîëîãèÿ çàùèòû êîñìè÷åñêèõ àïïàðàòîâ: 0 -Ýíåðãåòè÷åñêàÿ òåõíîëîãèÿ: 0 -Ãèïåðïðîñòðàíñòâåííàÿ òåõíîëîãèÿ: 0 -Ðàêåòíûé äâèãàòåëü: 0 -Èìïóëüñíûé äâèãàòåëü: 0 -Ãèïåðïðîñòðàíñòâåííûé äâèãàòåëü: 0 -Ëàçåðíàÿ òåõíîëîãèÿ: 0 -Èîííàÿ òåõíîëîãèÿ: 0 -Ïëàçìåííàÿ òåõíîëîãèÿ: 0 -Ìåæãàëàêòè÷åñêàÿ íàó÷íî-èññëåäîâàòåëüñêàÿ ñåòü: 0 -Ýêñïåäèöèîííàÿ òåõíîëîãèÿ: 0 -Àòîìíàÿ òåõíîëîãèÿ: 3 -Ãðàâèòàöèîííàÿ òåõíîëîãèÿ: 0 -ê èãðîêó ñ ID: 1 -Operation on: 25-08-2010 23:10:11 +El usuario lucky agrego: +Tecnología de espionaje: 0 +Tecnología de computación: 0 +Tecnología militar: 0 +Tecnología de defensa: 0 +Tecnología de blindaje: 0 +Tecnología de energía: 0 +Tecnología de hiperespacio: 0 +Motor de combustión: 0 +Motor de impulso: 0 +Propulsor hiperespacial: 0 +Tecnología láser: 0 +Tecnología iónica: 0 +Tecnología de plasma: 0 +Red de investigación intergaláctica: 0 +Tecnología de expedicion: 0 +Tecnología de gravitón: 1 +al usuario con el ID: 1 +Operación realizada el: 20-12-2011 19:51:16 +6 +:12 diff --git a/adm/Log/ResourcesLog.php b/adm/Log/ResourcesLog.php index be740a7..9ff7618 100644 --- a/adm/Log/ResourcesLog.php +++ b/adm/Log/ResourcesLog.php @@ -1,11 +1,9 @@ -Èãðîê admin äàáàâèòü: -Ìåòàë: 1000000 -Êðèñòàëû: 1000000 -Äåéòåðèé: 1000000 -ê ïëàíåòå ñ ID: 1 -and Òåìíàÿ ìàòåðèÿ: 0 -ê èãðîêó ñ ID: 0 -Operation on: 24-08-2010 23:38:40 -10 19:56:58 -42 +El usuario lucky agrego: +Metal: 1000000 +Cristal: 1000000 +Deuterio: 1000000 +al planeta con el ID: 1 +y Materia oscura: 0 +al usuario con el ID: 0 +Operación realizada el: 21-12-2011 12:05:03 diff --git a/adm/Log/ShipsLog.php b/adm/Log/ShipsLog.php index ff44edd..55214f9 100644 --- a/adm/Log/ShipsLog.php +++ b/adm/Log/ShipsLog.php @@ -1,12 +1,12 @@ El usuario lucky agrego: -Nave pequeña de carga: 1000 -Nave grande de carga: 1000 -Cazador ligero: 1000 -Cazador pesado: 1000 -Crucero: 1000 -Nave de batalla: 1000 -Colonizador: 1000 +Nave pequeña de carga: 10 +Nave grande de carga: 10 +Cazador ligero: 10 +Cazador pesado: 10 +Crucero: 0 +Nave de batalla: 0 +Colonizador: 0 Reciclador: 0 Sonda de espionaje: 0 Bombardero: 0 @@ -14,7 +14,5 @@ Destructor: 0 Estrella de la muerte: 0 Acorazado: 0 -Supernova: 0 al planeta con el ID: 1 -Operación realizada el: 15-08-2010 19:59:41 - el: 27-02-2010 15:25:06 +Operación realizada el: 06-12-2011 20:52:44 diff --git a/styles/skins/New-Year!/gebaeude/index.html b/adm/Log/index.html similarity index 100% rename from styles/skins/New-Year!/gebaeude/index.html rename to adm/Log/index.html diff --git a/adm/LogToolPage.php b/adm/LogToolPage.php index 4b3f9e9..13fda36 100644 --- a/adm/LogToolPage.php +++ b/adm/LogToolPage.php @@ -1,36 +1,22 @@ \ No newline at end of file diff --git a/adm/MakerPage.php b/adm/MakerPage.php index a9de795..e8e6c2c 100644 --- a/adm/MakerPage.php +++ b/adm/MakerPage.php @@ -1,31 +1,17 @@ ".$lang['only_numbers'].""; } - $QueryFind = doquery("SELECT `id_level` FROM {{table}} WHERE `id` = '".$PlanetID."'", "planets", true); + $QueryFind = doquery("SELECT `id_level` FROM {{table}} WHERE `id` = '".$PlanetID."'", "planets", TRUE); $QryInsertMoonInPlanet = "INSERT INTO {{table}} SET "; $QryInsertMoonInPlanet .= "`name` = '".$MoonName."', "; @@ -233,7 +219,7 @@ $QryGetMoonIdFromLunas .= "`system` = '". $System ."' AND "; $QryGetMoonIdFromLunas .= "`planet` = '". $Planet ."' AND "; $QryGetMoonIdFromLunas .= "`planet_type` = '3';"; - $PlanetRow = doquery( $QryGetMoonIdFromLunas , 'planets', true); + $PlanetRow = doquery( $QryGetMoonIdFromLunas , 'planets', TRUE); $QryUpdateMoonInGalaxy = "UPDATE {{table}} SET "; $QryUpdateMoonInGalaxy .= "`id_luna` = '". $PlanetRow['id'] ."', "; @@ -260,7 +246,7 @@ { $MoonID = $_POST['del_moon']; - $MoonSelected = doquery("SELECT * FROM {{table}} WHERE `id` = '". $MoonID ."'", 'planets', true); + $MoonSelected = doquery("SELECT * FROM {{table}} WHERE `id` = '". $MoonID ."'", 'planets', TRUE); if ($MoonSelected && is_numeric($MoonID)) { if ($MoonSelected['planet_type'] == 3) @@ -293,7 +279,7 @@ } } - display (parsetemplate(gettemplate("adm/MoonOptionsBody"), $parse), false, '', true, false); + display (parsetemplate(gettemplate("adm/MoonOptionsBody"), $parse), FALSE, '', TRUE, FALSE); break; case 'new_planet': @@ -306,11 +292,14 @@ $system = $_POST['system']; $planet = $_POST['planet']; $name = $_POST['name']; + + + $field_max = $_POST['field_max']; $i = 0; - $QueryS = doquery("SELECT * FROM {{table}} WHERE `galaxy` = '".$galaxy."' AND `system` = '".$system."' AND `planet` = '".$planet."'", "galaxy", true); - $QueryS2 = doquery("SELECT * FROM {{table}} WHERE `id` = '".$id."'", "users", true); + $QueryS = doquery("SELECT * FROM {{table}} WHERE `galaxy` = '".$galaxy."' AND `system` = '".$system."' AND `planet` = '".$planet."'", "galaxy", TRUE); + $QueryS2 = doquery("SELECT * FROM {{table}} WHERE `id` = '".$id."'", "users", TRUE); if (is_numeric($_POST['id']) && isset($_POST['id']) && !$QueryS && $QueryS2) { if ($galaxy < 1 or $system < 1 or $planet < 1 or !is_numeric($galaxy) or !is_numeric($system) or !is_numeric($planet)){ @@ -323,8 +312,8 @@ if ($i == 0) { - CreateOnePlanetRecord ($galaxy, $system, $planet, $id, '', '', false) ; - $QueryS3 = doquery("SELECT * FROM {{table}} WHERE `id_owner` = '".$id."' LIMIT 1", "planets", true); + CreateOnePlanetRecord ($galaxy, $system, $planet, $id, '', '', FALSE) ; + $QueryS3 = doquery("SELECT * FROM {{table}} WHERE `id_owner` = '".$id."' LIMIT 1", "planets", TRUE); $QryUpdatePlanet = "UPDATE {{table}} SET "; if ($field_max > 0 && is_numeric($field_max)) @@ -356,13 +345,13 @@ $id = $_POST['id']; if (is_numeric($id) && isset($id)) { - $QueryS = doquery("SELECT * FROM {{table}} WHERE `id` = '".$id."'", "planets", true); + $QueryS = doquery("SELECT * FROM {{table}} WHERE `id` = '".$id."'", "planets", TRUE); if ($QueryS) { if ($QueryS['planet_type'] == '1') { - $QueryS2 = doquery("SELECT * FROM {{table}} WHERE `id_planet` = '".$id."'", "galaxy", true); + $QueryS2 = doquery("SELECT * FROM {{table}} WHERE `id_planet` = '".$id."'", "galaxy", TRUE); if ($QueryS2['id_luna'] > 0) { doquery("DELETE FROM {{table}} WHERE `galaxy` = '".$QueryS['galaxy']."' AND `system` = '".$QueryS['system']."' AND @@ -389,12 +378,12 @@ $parse['display2'] = $Error; } - display (parsetemplate(gettemplate('adm/PlanetOptionsBody'), $parse), false, '', true, false); + display (parsetemplate(gettemplate('adm/PlanetOptionsBody'), $parse), FALSE, '', TRUE, FALSE); break; default: - display( parsetemplate(gettemplate('adm/CreatorBody'), $parse), false, '', true, false); + display( parsetemplate(gettemplate('adm/CreatorBody'), $parse), FALSE, '', TRUE, FALSE); break; } ?> \ No newline at end of file diff --git a/adm/MessageListPage.php b/adm/MessageListPage.php index 4426112..5fe16ae 100644 --- a/adm/MessageListPage.php +++ b/adm/MessageListPage.php @@ -1,39 +1,25 @@ = 1) $ViewPage = $CurrPage; else $ViewPage = 1; + } - elseif ($Next == true && $_POST['page']) + elseif ($Next == TRUE && $_POST['page']) { if ($Selected < 100) - $Mess = doquery("SELECT COUNT(*) AS `max` FROM {{table}} WHERE `message_type` = '". $Selected ."';", 'messages', true); + $Mess = doquery("SELECT COUNT(*) AS `max` FROM {{table}} WHERE `message_type` = '". $Selected ."';", 'messages', TRUE); elseif ($Selected == 100) - $Mess = doquery("SELECT COUNT(*) AS `max` FROM {{table}}", 'messages', true); - + $Mess = doquery("SELECT COUNT(*) AS `max` FROM {{table}}", 'messages', TRUE); + $MaxPage = ceil ( ($Mess['max'] / 25) ); $CurrPage += 1; if ($CurrPage <= $MaxPage) @@ -72,10 +59,10 @@ else $ViewPage = $MaxPage; } - + if ($_POST['delsel'] && $_POST['sele'] >= 1 && $_POST['page']) { - if ($DelSel == true) + if ($DelSel == TRUE) { foreach($_POST['sele'] as $MessId => $Value) { @@ -84,17 +71,17 @@ } } } - + if ($_POST['deldat'] && $_POST['sele'] >= 1 && is_numeric($_POST['selday']) && is_numeric($_POST['selmonth']) && is_numeric($_POST['selyear']) && $_POST['page']) { - if ($DelDat == true) + if ($DelDat == TRUE) { $SelDay = $_POST['selday']; $SelMonth = $_POST['selmonth']; $SelYear = $_POST['selyear']; $LimitDate = mktime (0,0,0, $SelMonth, $SelDay, $SelYear ); - if ($LimitDate != false) + if ($LimitDate != FALSE) { doquery ( "DELETE FROM {{table}} WHERE `message_time` <= '". $LimitDate ."';", 'messages'); doquery ( "DELETE FROM {{table}} WHERE `time` <= '". $LimitDate ."';", 'rw'); @@ -103,10 +90,10 @@ } if ($Selected < 100) - $Mess = doquery("SELECT COUNT(*) AS `max` FROM {{table}} WHERE `message_type` = '". $Selected ."';", 'messages', true); + $Mess = doquery("SELECT COUNT(*) AS `max` FROM {{table}} WHERE `message_type` = '". $Selected ."';", 'messages', TRUE); elseif ($Selected == 100) - $Mess = doquery("SELECT COUNT(*) AS `max` FROM {{table}}", 'messages', true); - + $Mess = doquery("SELECT COUNT(*) AS `max` FROM {{table}}", 'messages', TRUE); + $MaxPage = ceil ( ($Mess['max'] / 25) ); $parse['mlst_data_page'] = $ViewPage; @@ -128,7 +115,8 @@ $parse['mlst_data_pages'] .= ""; } - $StartRec = 1 + (($ViewPage - 1) * 25); + $StartRec = ($ViewPage - 1) * 25; + if ($Selected < 100) $Messages = doquery("SELECT * FROM {{table}} WHERE `message_type` = '". $Selected ."' ORDER BY `message_time` DESC LIMIT ". $StartRec .",25;", 'messages'); elseif ($Selected == 100) @@ -136,15 +124,15 @@ while ($row = mysql_fetch_assoc($Messages)) { - $OwnerData = doquery ("SELECT `username` FROM {{table}} WHERE `id` = '". $row['message_owner'] ."';", 'users',true); + $OwnerData = doquery ("SELECT `username` FROM {{table}} WHERE `id` = '". $row['message_owner'] ."';", 'users',TRUE); $bloc['mlst_id'] = $row['message_id']; $bloc['mlst_from'] = $row['message_from']; $bloc['mlst_to'] = $OwnerData['username'] ." ".$lang['input_id'].":". $row['message_owner']; $bloc['mlst_subject'] = $row['message_subject']; $bloc['mlst_text'] = $row['message_text']; - $bloc['mlst_time'] = gmdate ("d/M/y H:i:s", $row['message_time'] ); + $bloc['mlst_time'] = date ("d/M/y H:i:s", $row['message_time'] ); $parse['mlst_data_rows'] .= parsetemplate(gettemplate('adm/MessageListRows'), $bloc); } - display (parsetemplate(gettemplate('adm/MessageListBody'), $parse), false, '', true, false); + display (parsetemplate(gettemplate('adm/MessageListBody'), $parse), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/Moderation.php b/adm/Moderation.php index aaa1e65..33b77c7 100644 --- a/adm/Moderation.php +++ b/adm/Moderation.php @@ -1,32 +1,18 @@ '.$lang['ad_authlevel_succes'].''; - display (parsetemplate(gettemplate("adm/AuthlevelBody"), $parse), false, '', true, false); + display (parsetemplate(gettemplate("adm/AuthlevelBody"), $parse), FALSE, '', TRUE, FALSE); } else { diff --git a/adm/MoonListPage.php b/adm/MoonListPage.php index 1fe1e08..5142f00 100644 --- a/adm/MoonListPage.php +++ b/adm/MoonListPage.php @@ -1,32 +1,18 @@ ". $lang['mt_there_are'] . $i . $lang['mt_moons'] .""; - display(parsetemplate(gettemplate('adm/MoonListBody'), $parse), false, '', true, false); + display(parsetemplate(gettemplate('adm/MoonListBody'), $parse), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/MoonOptionsPage.php b/adm/MoonOptionsPage.php index 6ec9b94..993afea 100644 --- a/adm/MoonOptionsPage.php +++ b/adm/MoonOptionsPage.php @@ -1,32 +1,18 @@ \ No newline at end of file diff --git a/adm/OnlineUsersPage.php b/adm/OnlineUsersPage.php index 1daddb4..2a902aa 100644 --- a/adm/OnlineUsersPage.php +++ b/adm/OnlineUsersPage.php @@ -1,32 +1,18 @@ \ No newline at end of file diff --git a/adm/OverviewPage.php b/adm/OverviewPage.php index f0c2a51..831dc69 100644 --- a/adm/OverviewPage.php +++ b/adm/OverviewPage.php @@ -1,56 +1,40 @@ $game_config['VERSION']) + if ( str_replace ( '.' , '' , $current ) > str_replace ( '.' , '' , read_config ( 'version' ) ) ) { - return true; + return TRUE; } else { - return false; + return FALSE; } } } $parse = $lang; -if(file_exists($xgp_root . 'install/') && defined('IN_ADMIN')) +if(file_exists(XGP_ROOT . 'install/') && defined('IN_ADMIN')) { $Message .= "".$lang['ow_install_file_detected']."

    "; $error++; @@ -64,7 +48,7 @@ function check_updates() $error++; } - $Errors = doquery("SELECT COUNT(*) AS `errors` FROM {{table}} WHERE 1;", 'errors', true); + $Errors = doquery("SELECT COUNT(*) AS `errors` FROM {{table}} WHERE 1;", 'errors', TRUE); if($Errors['errors'] != 0) { @@ -90,5 +74,5 @@ function check_updates() } -display( parsetemplate(gettemplate('adm/OverviewBody'), $parse), false, '', true, false); +display( parsetemplate(gettemplate('adm/OverviewBody'), $parse), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/PassEncripterPage.php b/adm/PassEncripterPage.php index fe8dbeb..7471b8f 100644 --- a/adm/PassEncripterPage.php +++ b/adm/PassEncripterPage.php @@ -1,31 +1,18 @@ \ No newline at end of file diff --git a/adm/PlanetListPage.php b/adm/PlanetListPage.php index bc94611..4527fad 100644 --- a/adm/PlanetListPage.php +++ b/adm/PlanetListPage.php @@ -1,32 +1,18 @@ ". $lang['pl_there_are'] . $i . $lang['pl_planets'] .""; - display(parsetemplate(gettemplate('adm/PlanetListBody'), $parse), false, '', true, false); + display(parsetemplate(gettemplate('adm/PlanetListBody'), $parse), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/PlanetsOptionsPage.php b/adm/PlanetsOptionsPage.php index 941dc72..f09eb9f 100644 --- a/adm/PlanetsOptionsPage.php +++ b/adm/PlanetsOptionsPage.php @@ -1,32 +1,18 @@ '.$lang['po_complete_all'].''; $i++;} + if ($galaxy > MAX_GALAXY_IN_WORLD or $system > MAX_SYSTEM_IN_GALAXY or $planet > MAX_PLANET_IN_SYSTEM){ $Error .= ''.$lang['po_complete_all2'].''; $i++;} if ($i == 0) { - CreateOnePlanetRecord ($galaxy, $system, $planet, $id, '', '', false) ; - $QueryS3 = doquery("SELECT * FROM {{table}} WHERE `id_owner` = '".$id."'", "planets", true); + CreateOnePlanetRecord ($galaxy, $system, $planet, $id, '', '', FALSE) ; + $QueryS3 = doquery("SELECT * FROM {{table}} WHERE `id_owner` = '".$id."'", "planets", TRUE); doquery("UPDATE {{table}} SET `id_level` = '".$QueryS3['id_level']."' WHERE `galaxy` = '".$galaxy."' AND `system` = '".$system."' AND `planet` = '".$planet."' AND `planet_type` = '1'", "planets"); $parse['display'] = ''.$lang['po_complete_succes'].''; @@ -78,13 +65,13 @@ $id = $_POST['id']; if (is_numeric($id) && isset($id)) { - $QueryS = doquery("SELECT * FROM {{table}} WHERE `id` = '".$id."'", "planets", true); + $QueryS = doquery("SELECT * FROM {{table}} WHERE `id` = '".$id."'", "planets", TRUE); if ($QueryS) { if ($QueryS['planet_type'] == '1') { - $QueryS2 = doquery("SELECT * FROM {{table}} WHERE `id_planet` = '".$id."'", "galaxy", true); + $QueryS2 = doquery("SELECT * FROM {{table}} WHERE `id_planet` = '".$id."'", "galaxy", TRUE); if ($QueryS2['id_luna'] > 0) { doquery("DELETE FROM {{table}} WHERE `galaxy` = '".$QueryS['galaxy']."' AND `system` = '".$QueryS['system']."' AND @@ -113,5 +100,5 @@ } -display (parsetemplate(gettemplate('adm/PlanetOptionsBody'), $parse), false, '', true, false); +display (parsetemplate(gettemplate('adm/PlanetOptionsBody'), $parse), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/QueriesPage.php b/adm/QueriesPage.php index 51cc62b..a15246f 100644 --- a/adm/QueriesPage.php +++ b/adm/QueriesPage.php @@ -1,31 +1,17 @@ \ No newline at end of file diff --git a/adm/ResetPage.php b/adm/ResetPage.php index 00a2ce8..9a7ab04 100644 --- a/adm/ResetPage.php +++ b/adm/ResetPage.php @@ -1,31 +1,17 @@ $LimitTime ) { - $UserPlanet = doquery ("SELECT `name` FROM {{table}} WHERE `id` = '". $TheUser['id_planet']."';", 'planets_s', true); + $UserPlanet = doquery ("SELECT `name` FROM {{table}} WHERE `id` = '". $TheUser['id_planet']."';", 'planets_s', TRUE); if ($UserPlanet['name'] != "") { $Time = time(); @@ -82,12 +66,13 @@ function ResetUniverse ( $CurrentUser ) doquery( $QryInsertUser, 'users'); doquery("UPDATE {{table}} SET `bana` = '0' WHERE `id` > '1'", "users"); - $NewUser = doquery("SELECT `id` FROM {{table}} WHERE `username` = '". $TheUser['username'] ."' LIMIT 1;", 'users', true); + $NewUser = doquery("SELECT `id` FROM {{table}} WHERE `username` = '". $TheUser['username'] ."' LIMIT 1;", 'users', TRUE); + + CreateOnePlanetRecord ($TheUser['galaxy'], $TheUser['system'], $TheUser['planet'], $NewUser['id'], $UserPlanet['name'], TRUE); - CreateOnePlanetRecord ($TheUser['galaxy'], $TheUser['system'], $TheUser['planet'], $NewUser['id'], $UserPlanet['name'], true); doquery("UPDATE {{table}} SET `id_level` = '".$TheUser['authlevel']."' WHERE `id_owner` = '".$NewUser['id']."'", "planets"); - $PlanetID = doquery("SELECT `id` FROM {{table}} WHERE `id_owner` = '". $NewUser['id'] ."' LIMIT 1;", 'planets', true); + $PlanetID = doquery("SELECT `id` FROM {{table}} WHERE `id_owner` = '". $NewUser['id'] ."' LIMIT 1;", 'planets', TRUE); $QryUpdateUser = "UPDATE {{table}} SET "; $QryUpdateUser .= "`id_planet` = '". $PlanetID['id'] ."', "; @@ -99,7 +84,8 @@ function ResetUniverse ( $CurrentUser ) } } } - doquery("UPDATE {{table}} SET `config_value` = '". $TransUser ."' WHERE `config_name` = 'users_amount' LIMIT 1;", 'config'); + + update_config ( 'users_amount' , $TransUser ); doquery("DROP TABLE {{table}}", 'planets_s'); doquery("DROP TABLE {{table}}", 'users_s'); } @@ -114,7 +100,7 @@ function ResetUniverse ( $CurrentUser ) if ($_POST['defenses'] == 'on'){ doquery("UPDATE {{table}} SET `misil_launcher` = '0', `small_laser` = '0', `big_laser` = '0', `gauss_canyon` = '0', `ionic_canyon` = '0', `buster_canyon` = '0', - `small_protection_shield` = '0', `planet_protector` = '0', `big_protection_shield` = '0', + `small_protection_shield` = '0', `big_protection_shield` = '0', `interceptor_misil` = '0', `interplanetary_misil` = '0'", "planets"); $Log .= $lang['log_defenses']."\n";} @@ -123,7 +109,7 @@ function ResetUniverse ( $CurrentUser ) `heavy_hunter` = '0', `crusher` = '0', `battle_ship` = '0', `colonizer` = '0', `recycler` = '0', `spy_sonde` = '0', `bomber_ship` = '0', `solar_satelit` = '0', `destructor` = '0', - `dearth_star` = '0', `battleship` = '0', `supernova` = '0'", "planets"); + `dearth_star` = '0', `battleship` = '0'", "planets"); $Log .= $lang['log_ships']."\n";} if ($_POST['h_d'] == 'on'){ @@ -166,8 +152,7 @@ function ResetUniverse ( $CurrentUser ) if ($_POST['ofis'] == 'on'){ doquery("UPDATE {{table}} SET `rpg_geologue` = '0', `rpg_amiral` = '0', `rpg_ingenieur` = '0', - `rpg_technocrate` = '0', `rpg_espion` = '0', `rpg_constructeur` = '0', - `rpg_scientifique` = '0', `rpg_commandant` = '0', `rpg_stockeur` = '0'", "users"); + `rpg_technocrate` = '0'", "users"); $Log .= $lang['log_officiers']."\n";} if ($_POST['inves_c'] == 'on'){ @@ -246,5 +231,5 @@ function ResetUniverse ( $CurrentUser ) } -display(parsetemplate(gettemplate('adm/ResetBody'), $parse), false, '', true, false); +display(parsetemplate(gettemplate('adm/ResetBody'), $parse), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/SearchInDBPage.php b/adm/SearchInDBPage.php index 22961cc..14a39a4 100644 --- a/adm/SearchInDBPage.php +++ b/adm/SearchInDBPage.php @@ -1,32 +1,18 @@ '; - $QueryFind = doquery("SELECT * FROM {{table}}", "users", true); + $QueryFind = doquery("SELECT * FROM {{table}}", "users", TRUE); $ORDERBY = $_POST['key_order']; $ORDERBY2 = $_POST['key_acc']; if (!$ORDERBY || !$QueryFind[$ORDERBY]) @@ -150,7 +136,7 @@ { $parse['error'] = $lang['se_no_data']; } - display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), false, '', true, false); + display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), FALSE, '', TRUE, FALSE); break; @@ -202,7 +188,7 @@ '; - $QueryFind = doquery("SELECT * FROM {{table}}", "planets", true); + $QueryFind = doquery("SELECT * FROM {{table}}", "planets", TRUE); $ORDERBY = $_POST['key_order']; $ORDERBY2 = $_POST['key_acc']; if (!$ORDERBY || !$QueryFind[$ORDERBY]) @@ -235,7 +221,7 @@ $s = $planet['system']; $p = $planet['planet']; - $QueryFiind = doquery("SELECT `id_luna` FROM {{table}} WHERE `galaxy` = '".$g."' AND `system` = '".$s."' AND `planet` = '".$p."'", "galaxy", true); + $QueryFiind = doquery("SELECT `id_luna` FROM {{table}} WHERE `galaxy` = '".$g."' AND `system` = '".$s."' AND `planet` = '".$p."'", "galaxy", TRUE); if ($QueryFiind['id_luna'] != '0') $moons = "".$lang['se_yes'].""; @@ -254,7 +240,7 @@ $parse['table3'] = "".$lang['se_input_hay'].$cnt.$lang['se_input_planett'].""; } } - display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), false, '', true, false); + display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), FALSE, '', TRUE, FALSE); break; @@ -306,7 +292,7 @@ '; - $QueryFind = doquery("SELECT * FROM {{table}}", "planets", true); + $QueryFind = doquery("SELECT * FROM {{table}}", "planets", TRUE); $ORDERBY = $_POST['key_order']; $ORDERBY2 = $_POST['key_acc']; if (!$ORDERBY || !$QueryFind[$ORDERBY]) @@ -351,7 +337,7 @@ $parse['table3'] = "".$lang['se_input_hay'].$cnt.$lang['se_input_moonn'].""; } } - display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), false, '', true, false); + display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), FALSE, '', TRUE, FALSE); break; // ALIANZAS #################################################################### @@ -402,7 +388,7 @@ '; - $QueryFind = doquery("SELECT * FROM {{table}}", "alliance", true); + $QueryFind = doquery("SELECT * FROM {{table}}", "alliance", TRUE); $ORDERBY = $_POST['key_order']; $ORDERBY2 = $_POST['key_acc']; if (!$ORDERBY || !$QueryFind[$ORDERBY]) @@ -448,7 +434,7 @@ $parse['table3'] = "".$lang['se_input_hay'].$cnt.$lang['se_input_allyy'].""; } } - display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), false, '', true, false); + display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), FALSE, '', TRUE, FALSE); break; @@ -492,7 +478,7 @@ '; - $QueryFind = doquery("SELECT * FROM {{table}}", "users", true); + $QueryFind = doquery("SELECT * FROM {{table}}", "users", TRUE); $ORDERBY = $_POST['key_order']; $ORDERBY2 = $_POST['key_acc']; if (!$ORDERBY || !$QueryFind[$ORDERBY]) @@ -544,7 +530,7 @@ $parse['table3'] = "".$lang['se_input_hay'].$cnt.$lang['se_input_vacatii'].""; } } - display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), false, '', true, false); + display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), FALSE, '', TRUE, FALSE); break; @@ -588,7 +574,7 @@ '; - $QueryFind = doquery("SELECT * FROM {{table}}", "banned", true); + $QueryFind = doquery("SELECT * FROM {{table}}", "banned", TRUE); $ORDERBY = $_POST['key_order']; $ORDERBY2 = $_POST['key_acc']; if (!$ORDERBY || !$QueryFind[$ORDERBY]) @@ -636,7 +622,7 @@ $parse['table3'] = "".$lang['se_input_hay'].$cnt.$lang['se_input_susss'].""; } } - display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), false, '', true, false); + display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), FALSE, '', TRUE, FALSE); break; @@ -680,7 +666,7 @@ '; - $QueryFind = doquery("SELECT * FROM {{table}}", "users", true); + $QueryFind = doquery("SELECT * FROM {{table}}", "users", TRUE); $ORDERBY = $_POST['key_order']; $ORDERBY2 = $_POST['key_acc']; if (!$ORDERBY || !$QueryFind[$ORDERBY]) @@ -704,6 +690,7 @@ } else { + while ($admin = mysql_fetch_array($search)) { $id = $admin['id']; @@ -732,7 +719,7 @@ $parse['table3'] = "".$lang['se_input_hay'].$cnt.$lang['se_input_admm'].""; } } - display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), false, '', true, false); + display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), FALSE, '', TRUE, FALSE); break; @@ -774,7 +761,7 @@ '; - $QueryFind = doquery("SELECT * FROM {{table}}", "users", true); + $QueryFind = doquery("SELECT * FROM {{table}}", "users", TRUE); $ORDERBY = $_POST['key_order']; $ORDERBY2 = $_POST['key_acc']; if (!$ORDERBY || !$QueryFind[$ORDERBY]) @@ -830,10 +817,10 @@ } } - display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), false, '', true, false); + display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), FALSE, '', TRUE, FALSE); break; default: - display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), false, '', true, false); + display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), FALSE, '', TRUE, FALSE); } ?> \ No newline at end of file diff --git a/adm/SearchingPage.php b/adm/SearchingPage.php index 685ef5f..84e7936 100644 --- a/adm/SearchingPage.php +++ b/adm/SearchingPage.php @@ -1,31 +1,17 @@ 0) { @@ -192,7 +178,7 @@ function MyCrazyLittleSearch($SpecifyItems, $WhereItem, $SpecifyWhere, $SpecialS if($_GET['search'] == 'planet') { - $QueryForMoons = doquery("SELECT id_luna FROM {{table}} WHERE id_planet = '".$WhileResult[0]."'", "galaxy", true); + $QueryForMoons = doquery("SELECT id_luna FROM {{table}} WHERE id_planet = '".$WhileResult[0]."'", "galaxy", TRUE); (($QueryForMoons['id_luna'] > '0') ? $QueryForMoons2 = "".$lang['one_is_yes'][1]."" : $QueryForMoons2 = $lang['one_is_yes'][0]); $Search['LIST'] .= "".$QueryForMoons2."";} @@ -227,7 +213,7 @@ function MyCrazyLittleSearch($SpecifyItems, $WhereItem, $SpecifyWhere, $SpecialS } // BORRADO -include_once($xgp_root . 'includes/functions/DeleteSelectedUser.' . $phpEx); +include_once(XGP_ROOT . 'includes/functions/DeleteSelectedUser.php'); if ($_GET['delete'] == 'user'){ DeleteSelectedUser ($_GET['user']); $Log .= "\n".$lang['log_searchindb_del1'].$_GET['user'].$lang['log_searchindb_del2'].$user['username']."\n"; @@ -436,5 +422,5 @@ function MyCrazyLittleSearch($SpecifyItems, $WhereItem, $SpecifyWhere, $SpecialS $parse['TimeToCreatePage'] = $lang['se_time_of_page'].$Time_Two." ".$lang['time_seconds']; -display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), false, '', true, false); +display(parsetemplate(gettemplate('adm/SearchInDBBody'), $parse), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/SettingsPage.php b/adm/SettingsPage.php index cce8010..87d251a 100644 --- a/adm/SettingsPage.php +++ b/adm/SettingsPage.php @@ -1,44 +1,31 @@ BuildFlyingFleetTable(); -display(parsetemplate(gettemplate('adm/fleet_body'), $parse), false, '', true, false); +display(parsetemplate(gettemplate('adm/fleet_body'), $parse), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/UserListPage.php b/adm/UserListPage.php index 503dac1..344a6f8 100644 --- a/adm/UserListPage.php +++ b/adm/UserListPage.php @@ -1,33 +1,19 @@ \ No newline at end of file diff --git a/adm/chat.php b/adm/chat.php deleted file mode 100644 index 598d79d..0000000 --- a/adm/chat.php +++ /dev/null @@ -1,44 +0,0 @@ -= 3) { - // Systeme de suppression - $parse = $lang; - extract($_GET); - if (isset($delete)) { - doquery("DELETE FROM {{table}} WHERE `messageid`=".$delete, 'chat'); - } elseif ($deleteall == 'yes') { - doquery("DELETE FROM {{table}}", 'chat'); - } - - // Affichage des messages - $query = doquery("SELECT * FROM {{table}} ORDER BY messageid DESC LIMIT 25", 'chat'); - $i = 0; - while ($e = mysql_fetch_array($query)) { - $i++; - $parse['msg_list'] .= stripslashes("{$e['messageid']}" . - "
    " . - "
    {$e['user']}
    " . - "
    " . date('d/m/Y - h:i:s', $e['timestamp']) . "
    " . - "" . nl2br($e['message']) . ""); - } - $parse['msg_list'] .= "Ñîîáùåíèé {$i} ".$lang['ch_nbs'].""; - - display(parsetemplate(gettemplate('adm/chat_body'), $parse),false, '', true, false); - } else { - message ($lang['not_enough_permissions']); - } -?> \ No newline at end of file diff --git a/styles/skins/New-Year!/gfx/index.html b/adm/index.html similarity index 100% rename from styles/skins/New-Year!/gfx/index.html rename to adm/index.html diff --git a/adm/index.php b/adm/index.php index b52d504..41a7d90 100644 --- a/adm/index.php +++ b/adm/index.php @@ -1,38 +1,24 @@ \n"; $page .= "\n"; - $page .= "\n"; - $page .= "". $game_config['game_name'] ." - Admin CP\n"; + $page .= "\n"; + $page .= "". read_config ( 'game_name' ) ." - Admin CP\n"; $page .= "\n"; $page .= "\n"; $page .= "\n"; diff --git a/adm/menu.php b/adm/menu.php index 8cd7928..2fdca63 100644 --- a/adm/menu.php +++ b/adm/menu.php @@ -1,31 +1,17 @@ -".$lang['mu_stats_options']." "; - - -$EditTable = + + +$EditTable = " @@ -73,7 +59,9 @@
    ".$lang['mu_users_settings']."".$lang['mu_ban_options']."
    "; - + + + $ViewTable = " @@ -107,18 +95,13 @@
    ".$lang['mu_search_page']."
    "; - - + + $ToolsTable = " - - - - - @@ -144,7 +127,7 @@ // OPERADORES if($user['authlevel'] == 2) { - if($Observation == 1) $parse['ViewTable'] = $ViewTable; + if($Observation == 1) $parse['ViewTable'] = $ViewTable; if($EditUsers == 1) $parse['EditTable'] = $EditTable; if($ConfigGame == 1) $parse['ConfigTable'] = $ConfigTable; if($ToolsCanUse == 1) $parse['ToolsTable'] = $ToolsTable; @@ -161,5 +144,5 @@ -display( parsetemplate(gettemplate('adm/menu'), $parse), false, '', true, false); +display( parsetemplate(gettemplate('adm/menu'), $parse), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/adm/statbuilder.php b/adm/statbuilder.php index e3b2714..a99239c 100644 --- a/adm/statbuilder.php +++ b/adm/statbuilder.php @@ -1,32 +1,18 @@ 0) OR (`onlinetime` < '".$del_inactive."' AND `authlevel` <> 3)", 'users'); if($ChooseToDelete) { - include_once($xgp_root . 'includes/functions/DeleteSelectedUser.' . $phpEx); + include_once(XGP_ROOT . 'includes/functions/DeleteSelectedUser.php'); while($delete = mysql_fetch_array($ChooseToDelete)) { @@ -164,23 +151,23 @@ function MakeStats() { if ($resource[ $Defense ] != 'small_protection_shield' && $resource[ $Defense ] != 'big_protection_shield') { - $select_defenses .= " SUM(p.".$resource[ $Defense ].") AS ".$resource[ $Defense ].","; + $select_defenses .= " SUM(p.`".$resource[ $Defense ]."`) AS `".$resource[ $Defense ]."`,"; } } $select_buildings = ''; foreach($reslist['build'] as $n => $Building) { - $select_buildings .= " p.".$resource[ $Building ].","; + $select_buildings .= " p.`".$resource[ $Building ]."`,"; } $selected_tech = ''; foreach($reslist['tech'] as $n => $Techno) { - $selected_tech .= " u.".$resource[ $Techno ].","; + $selected_tech .= " u.`".$resource[ $Techno ]."`,"; } $select_fleets = ''; foreach($reslist['fleet'] as $n => $Fleet) { - $select_fleets .= " SUM(p.".$resource[ $Fleet ].") AS ".$resource[ $Fleet ].","; + $select_fleets .= " SUM(p.`".$resource[ $Fleet ]."`) AS `".$resource[ $Fleet ]."`,"; } //If you have some data type enmu is better if you put it here, because that data give a error in the SUM function. $selected_enum = "p.small_protection_shield, p.big_protection_shield";//For now... @@ -190,11 +177,19 @@ function MakeStats() //For users table $select_user = " u.id, u.ally_id, u.authlevel "; //We check how many users are for not overload the server... - $total_users = doquery("SELECT COUNT(*) AS `count` FROM {{table}} WHERE 1;", 'users', true); - //We will make query every $game_config['stat_amount'] users + $total_users = doquery("SELECT COUNT(*) AS `count` FROM {{table}} WHERE 1;", 'users', TRUE); + //We will make query every 'stat_amount' users //Min amount = 10, if it is less than 10, it is not a good system - $game_config['stat_amount'] = (($game_config['stat_amount']>=10)?$game_config['stat_amount']:10); - $amount_per_block = (($game_config['stat_amount']<$game_config['users_amount'])?$game_config['users_amount']:$game_config['stat_amount']); + + $game_stat_amount = read_config ( 'stat_amount' ); + $game_users_amount = read_config ( 'users_amount' ); + $game_stat_flying = read_config ( 'stat_flying' ); + $game_stat_settings = read_config ( 'stat_settings' ); + $game_stat_level = read_config ( 'stat_level' ); + $game_stat = read_config ( 'stat' ); + + $game_stat_amount = (($game_stat_amount>=10)?$game_stat_amount:10); + $amount_per_block = (($game_stat_amount<$game_users_amount)?$game_users_amount:$game_stat_amount); if ($total_users['count'] > $amount_per_block) { $LastQuery = roundUp($total_users['count'] / $amount_per_block); @@ -217,7 +212,7 @@ function MakeStats() $minmax_sql = 'SELECT Max(id) AS `max`, Min(id) AS `min` FROM (SELECT id FROM {{table}}users ORDER BY id ASC LIMIT '. $start.','. ($amount_per_block) .') AS A'; - $minmax = doquery($minmax_sql, '',true); + $minmax = doquery($minmax_sql, '',TRUE); $sql_parcial = 'SELECT '.$select_buildings .$select_planet . $selected_enum.', p.id FROM {{table}}planets as p WHERE p.id_owner <='. $minmax['max'].' AND p.id_owner >= ' .$minmax['min'].';'; //We delete now the old stats of the users $sql_old_stats = 'SELECT '.$select_old_ranks.' FROM {{table}} WHERE stat_type = 1 AND stat_code = 1 AND id_owner <= '.$minmax['max'].' AND id_owner >= '.$minmax['min'].';'; @@ -239,7 +234,7 @@ function MakeStats() unset($CurStats, $old_stats); //We take the data of flying fleets if stat_flying is =1 in game config //If you have trouble with the RAM and CPU usage, please set stat_flying = 0 and a low value of stat_amount (25, 15...) - if($game_config['stat_flying'] == 1) + if($game_stat_flying == 1) { $sql_flying_fleets = 'SELECT fleet_array, fleet_owner, fleet_id FROM {{table}} WHERE fleet_owner <= '. $minmax['max'].' AND fleet_owner >= '. $minmax['min'].';'; $flying_fleets = doquery($sql_flying_fleets, 'fleets'); @@ -275,22 +270,22 @@ function MakeStats() $u_OldFleetRank = (($old_stats_array[$CurUser['id']]['old_fleet_rank'])? $old_stats_array[$CurUser['id']]['old_fleet_rank']:0); //We dont need this anymore... unset($old_stats_array[$CurUser['id']]); - //1 point= $game_config['stat_settings'] ressources + //1 point= 'stat_settings' ressources //Make the tech points XD $u_points = GetTechnoPoints ( $CurUser ); $u_TTechCount = $u_points['TechCount']; - $u_TTechPoints = ($u_points['TechPoint'] / $game_config['stat_settings']); + $u_TTechPoints = ($u_points['TechPoint'] / $game_stat_settings); //Make the defense points $u_points = GetDefensePoints ( $CurUser ); $u_TDefsCount = $u_points['DefenseCount']; - $u_TDefsPoints = ($u_points['DefensePoint'] / $game_config['stat_settings']); + $u_TDefsPoints = ($u_points['DefensePoint'] / $game_stat_settings); //Make the fleets points (without the flying fleets... $u_points = GetFleetPoints ( $CurUser ); $u_TFleetCount = $u_points['FleetCount']; - $u_TFleetPoints = ($u_points['FleetPoint'] / $game_config['stat_settings']); + $u_TFleetPoints = ($u_points['FleetPoint'] / $game_stat_settings); //Now we add the flying fleets points - //This is used if($game_config['stat_flying'] == 1) - if($game_config['stat_flying'] == 1) + //This is used if($game_stat_flying == 1) + if($game_stat_flying == 1) { if($flying_fleets_array[$CurUser['id']]) { @@ -298,7 +293,7 @@ function MakeStats() { $u_points = GetFlyingFleetPoints ( $fleet_array ); $u_TFleetCount += $u_points['FleetCount']; - $u_TFleetPoints += ($u_points['FleetPoint'] / $game_config['stat_settings']); + $u_TFleetPoints += ($u_points['FleetPoint'] / $game_stat_settings); } } //We dont need this anymore... @@ -311,7 +306,7 @@ function MakeStats() { $u_points = GetFlyingFleetPoints ( $FleetRow['fleet_array'] ); $u_TFleetCount += $u_points['FleetCount']; - $u_TFleetPoints += ($u_points['FleetPoint'] / $game_config['stat_settings']); + $u_TFleetPoints += ($u_points['FleetPoint'] / $game_stat_settings); } //We dont need this anymore... unset($OwnFleets, $FleetRow); @@ -324,11 +319,11 @@ function MakeStats() { $u_points = GetBuildPoints ( $building ); $u_TBuildCount += $u_points['BuildCount']; - $u_TBuildPoints += ($u_points['BuildPoint'] / $game_config['stat_settings']); + $u_TBuildPoints += ($u_points['BuildPoint'] / $game_stat_settings); //We add the shields points (this way is a temporary way...) $u_points = GetDefensePoints ( $building ); $u_TDefsCount += $u_points['DefenseCount']; - $u_TDefsPoints += ($u_points['DefensePoint'] / $game_config['stat_settings']); + $u_TDefsPoints += ($u_points['DefensePoint'] / $game_stat_settings); } //We dont need this anymore... unset($Buildings_array[$CurUser['id']],$planet_id,$building); @@ -339,7 +334,7 @@ function MakeStats() } $u_GCount = $u_TDefsCount + $u_TTechCount + $u_TFleetCount + $u_TBuildCount; $u_GPoints = $u_TTechPoints + $u_TDefsPoints + $u_TFleetPoints + $u_TBuildPoints; - if (($CurUser['authlevel'] >= $game_config['stat_level']&& $game_config['stat']==1 ) || $CurUser['bana']==1) + if (($CurUser['authlevel'] >= $game_stat_level&& $game_stat==1 ) || $CurUser['bana']==1) { $insert_user_query .= '('.$CurUser['id'].','.$CurUser['ally_id'].',1,1,'.$u_OldTechRank.', 0,0,'.$u_OldBuildRank.',0,0,'.$u_OldDefsRank.',0,0,'.$u_OldFleetRank.', @@ -355,12 +350,12 @@ function MakeStats() } unset_vars( 'u_' ); - $CheckUserQuery = true; + $CheckUserQuery = TRUE; } //TODO, make a end string check in case that insert_user_query end in VALUE... //Here we change the end of the query for ; - if($CheckUserQuery == true) + if($CheckUserQuery == TRUE) { $insert_user_query = substr_replace($insert_user_query, ';', -1); doquery ( $insert_user_query , 'statpoints'); @@ -386,8 +381,8 @@ function MakeStats() if ($total_ally > 0)//We only update allys if at least 1 ally exist... { //Min amount = 10, if it is less than 10, it is not a good system - $game_config['stat_amount']= (($game_config['stat_amount']>=10)?$game_config['stat_amount']:10); - $amount_per_block = (($game_config['stat_amount']<$game_config['users_amount'])?$game_config['users_amount']:$game_config['stat_amount']); + $game_stat_amount= (($game_stat_amount>=10)?$game_stat_amount:10); + $amount_per_block = (($game_stat_amount<$game_users_amount)?$game_users_amount:$game_stat_amount); if ($total_ally > $amount_per_block) { $LastQuery = roundUp($total_ally / $amount_per_block); @@ -410,7 +405,7 @@ function MakeStats() $minmax_sql = 'SELECT Max(id) AS `max`, Min(id) AS `min` FROM (SELECT id FROM {{table}}alliance ORDER BY id ASC LIMIT '. $start.','. $amount_per_block.') AS A'; - $minmax = doquery($minmax_sql, '',true); + $minmax = doquery($minmax_sql, '',TRUE); $select_old_a_ranks = "s.id_owner , s.stat_type, s.tech_rank AS old_tech_rank, s.build_rank AS old_build_rank, s.defs_rank AS old_defs_rank, s.fleet_rank AS old_fleet_rank, s.total_rank AS old_total_rank"; @@ -480,11 +475,11 @@ function MakeStats() doquery ( "UPDATE {{table}} SET `ally_id`=0, `ally_name` = '', `ally_register_time`= 0, `ally_rank_id`= 0 WHERE `ally_id`='{$CurAlly['id_ally']}'", "users"); } - $CheckAllyQuery = true; + $CheckAllyQuery = TRUE; } //Here we change the end of the query for ; - if($CheckAllyQuery == true) + if($CheckAllyQuery == TRUE) { $insert_ally_query = substr_replace($insert_ally_query, ';', -1); doquery ( $insert_ally_query , 'statpoints'); diff --git a/adm/topnav.php b/adm/topnav.php index 1ade8c2..f31d7ad 100644 --- a/adm/topnav.php +++ b/adm/topnav.php @@ -1,31 +1,17 @@  '.$lang['re_reset_universe'].' '; $parse['queries'] = ' '.$lang['qe_title_menu'].' '; } - - -display( parsetemplate(gettemplate('adm/Topnav'), $parse), false, '', true, false); + + +display( parsetemplate(gettemplate('adm/Topnav'), $parse), FALSE, '', TRUE, FALSE); ?> \ No newline at end of file diff --git a/chat.php b/chat.php deleted file mode 100644 index e09cb9d..0000000 --- a/chat.php +++ /dev/null @@ -1,56 +0,0 @@ -='".(time()-15*60)."'",'users', 'true'); - $parse['NumberMembersOnline'] = $OnlineUsers[0]; - ////caha - $searchtext="chat"; - $OnlineAdmins = doquery("SELECT * FROM {{table}} WHERE authlevel<=1 AND current_page LIKE '%{$searchtext}%' ",'users'); - //// - if($OnlineAdmins){ - $parse['OnlineAdmins'] = ""; - while ($oas = mysql_fetch_array($OnlineAdmins)) { - $parse['OnlineAdmins'] .= " ". $oas['username'] ." , 
    "; - } - }else{ - $parse['OnlineAdmins'] = "--"; - } - - $page = parsetemplate($BodyTPL, $parse); - display($page, $lang['chat']); - -// Shoutbox by e-Zobar - Copyright XNova Team 2008 -?> \ No newline at end of file diff --git a/chat_add.php b/chat_add.php deleted file mode 100644 index 91f25d3..0000000 --- a/chat_add.php +++ /dev/null @@ -1,43 +0,0 @@ -""){ - $query = doquery("INSERT INTO {{table}}(user, ally_id, message, timestamp) VALUES ('".$nick."','".$ally_id."','".$msg."', '".time()."')", "chat"); - }else{ - $query = doquery("INSERT INTO {{table}}(user, ally_id, message, timestamp) VALUES ('".$nick."','0', '".$msg."', '".time()."')", "chat"); - } - } -?> \ No newline at end of file diff --git a/chat_msg.php b/chat_msg.php deleted file mode 100644 index 693f47f..0000000 --- a/chat_msg.php +++ /dev/null @@ -1,110 +0,0 @@ -''){ - $page = $_GET['page']; -}else{ - $page = 0; -} -$start_row = $page * $page_limit; - -if ($_GET) { - if($_GET['chat_type']=='ally' && $_GET['ally_id']>''){ - if ($_GET['show']=='history') { - showPageButtons($page,'ally'); - $query = doquery("SELECT * FROM {{table}} WHERE ally_id = '".$_GET['ally_id']."' ORDER BY messageid DESC LIMIT ".$start_row.",".$page_limit." ", "chat"); - }else{ - $query = doquery("SELECT * FROM {{table}} WHERE ally_id = '".$_GET['ally_id']."' ORDER BY messageid DESC LIMIT ".$page_limit." ", "chat"); - } - }else{ - if ($_GET['show']=='history') { - showPageButtons($page,'all'); - $query = doquery("SELECT * FROM {{table}} WHERE ally_id < 1 ORDER BY messageid DESC LIMIT ".$start_row.",".$page_limit." ", "chat"); - }else{ - $query = doquery("SELECT * FROM {{table}} WHERE ally_id < 1 ORDER BY messageid DESC LIMIT ".$page_limit." ", "chat"); - } - } -}else{ - if($_POST['chat_type']=='ally' && $_POST['ally_id']>''){ - $query = doquery("SELECT * FROM {{table}} WHERE ally_id = '".$_POST['ally_id']."' ORDER BY messageid DESC LIMIT ".$page_limit." ", "chat"); - }else{ - $query = doquery("SELECT * FROM {{table}} WHERE ally_id < 1 ORDER BY messageid DESC LIMIT ".$page_limit." ", "chat"); - } -} - -$buff = ""; -while($v=mysql_fetch_object($query)){ - $msg = ""; - if($_GET['show']!='history'){ -$nick="user, ENT_QUOTES, cp1251)." ]')\">".htmlentities($v->user, ENT_QUOTES, cp1251).""; }else{ - $nick=htmlentities($v->user, ENT_QUOTES, cp1251); - } - $msg=htmlentities($v->message, ENT_QUOTES, cp1251); - $msgtimestamp=htmlentities($v->timestamp, ENT_QUOTES, cp1251); - $msgtimestamp=date("m/d H:i:s", $msgtimestamp); - // Les différentes polices (gras, italique, couleurs, etc...) - include("includes/msg_replace.php"); - - // Affichage du message - $msg="
    [".$msgtimestamp."] ".$nick." : ".$msg."
    "; - $buff = $msg . $buff; -} -print $buff; - -function showPageButtons($curPage,$type){ - global $page_limit,$lang; - echo "
    "; - echo "".$lang['AllyChat']." / ".$lang['chat_history']." "; - echo "         "; - echo "".$lang['chat_page'].": "; - echo " "; - echo "
    "; -} - -// Shoutbox by e-Zobar - Copyright XNova Team 2008 -?> diff --git a/clock.php b/clock.php deleted file mode 100644 index bbfa662..0000000 --- a/clock.php +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/common.php b/common.php deleted file mode 100644 index 43b85db..0000000 --- a/common.php +++ /dev/null @@ -1,150 +0,0 @@ -CheckUser($IsUserChecked); - $IsUserChecked = $Result['state']; - $user = $Result['record']; - - if($game_config['game_disable'] == 0 && $user['authlevel'] == 0) - { - message(stripslashes($game_config['close_reason']), '', '', false, false); - } - } - - if ( ( time() >= ( $game_config['stat_last_update'] + ( 60 * $game_config['stat_update_time'] ) ) ) ) - { - include($xgp_root . 'adm/statfunctions.' . $phpEx); - $result = MakeStats(); - update_config('stat_last_update', $result['stats_time']); - } - - if (isset($user)) - { - include($xgp_root . 'includes/classes/class.FlyingFleetHandler.'.$phpEx); - $_fleets = doquery("SELECT fleet_start_galaxy,fleet_start_system,fleet_start_planet,fleet_start_type FROM {{table}} WHERE `fleet_start_time` <= '".time()."' and `fleet_mess` ='0' order by fleet_id asc;", 'fleets'); // OR fleet_end_time <= ".time() - - while ($row = mysql_fetch_array($_fleets)) - { - $array = array(); - $array['galaxy'] = $row['fleet_start_galaxy']; - $array['system'] = $row['fleet_start_system']; - $array['planet'] = $row['fleet_start_planet']; - $array['planet_type'] = $row['fleet_start_type']; - - $temp = new FlyingFleetHandler ($array); - } - mysql_free_result($_fleets); - $_fleets = doquery("SELECT fleet_end_galaxy,fleet_end_system,fleet_end_planet ,fleet_end_type FROM {{table}} WHERE `fleet_end_time` <= '".time()." order by fleet_id asc';", 'fleets'); // OR fleet_end_time <= ".time() - - while ($row = mysql_fetch_array($_fleets)) - { - $array = array(); - $array['galaxy'] = $row['fleet_end_galaxy']; - $array['system'] = $row['fleet_end_system']; - $array['planet'] = $row['fleet_end_planet']; - $array['planet_type'] = $row['fleet_end_type']; - - $temp = new FlyingFleetHandler ($array); - } - - mysql_free_result($_fleets); - unset($_fleets); - - if ( defined('IN_ADMIN') ) - { - includeLang('ADMIN'); - include('../adm/AdminFunctions/Autorization.' . $phpEx); - $dpath = "../". DEFAULT_SKINPATH ; - } - else - { - $dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"]; - } - //We include the plugin system 0.3 - include($xgp_root . 'includes/plugins.'.$phpEx); - - include($xgp_root . 'includes/functions/SetSelectedPlanet.' . $phpEx); - SetSelectedPlanet ($user); - - $planetrow = doquery("SELECT * FROM `{{table}}` WHERE `id` = '".$user['current_planet']."';", "planets", true); - - include($xgp_root . 'includes/functions/CheckPlanetUsedFields.' . $phpEx); - CheckPlanetUsedFields($planetrow); - } -} -else -{ - $dpath = "../" . DEFAULT_SKINPATH; -} - -include('includes/classes/class.SecurePage.' . $phpEx ); // include the class -$SecureSqlInjection = new SecureSqlInjection(); // load the class -$SecureSqlInjection->secureGlobals(); // run the main class function - -?> \ No newline at end of file diff --git a/config.php b/config.php index e69de29..05c888b 100644 --- a/config.php +++ b/config.php @@ -0,0 +1,10 @@ + "localhost", // MySQL server name. +"user" => "root", // MySQL username. +"pass" => "root", // MySQL password. +"name" => "ogame", // MySQL database name. +"prefix" => "xgp_", // Tables prefix. +"secretword" => "XGProyect875208701"); // Cookies. +?> \ No newline at end of file diff --git a/extension.inc.php b/extension.inc.php deleted file mode 100644 index 1f90126..0000000 --- a/extension.inc.php +++ /dev/null @@ -1,30 +0,0 @@ - \ No newline at end of file diff --git a/game.php b/game.php index 8aa65e7..6c2af62 100644 --- a/game.php +++ b/game.php @@ -1,185 +1,171 @@ FleetBuildingPage ($planetrow, $user); break; case 'defense': - include_once($xgp_root . 'includes/pages/class.ShowShipyardPage.' . $phpEx); + include_once(XGP_ROOT . 'includes/pages/class.ShowShipyardPage.php'); $DefensesBuildingPage = new ShowShipyardPage(); $DefensesBuildingPage->DefensesBuildingPage ($planetrow, $user); break; default: - include_once($xgp_root . 'includes/pages/class.ShowBuildingsPage.' . $phpEx); + include_once(XGP_ROOT . 'includes/pages/class.ShowBuildingsPage.php'); new ShowBuildingsPage($planetrow, $user); break; } break; // ----------------------------------------------------------------------------------------------------------------------------------------------// case'resources': - include_once($xgp_root . 'includes/pages/ShowResourcesPage.' . $phpEx); - ShowResourcesPage($user, $planetrow); + include_once(XGP_ROOT . 'includes/pages/class.ShowResourcesPage.php'); + new ShowResourcesPage($user, $planetrow); break; // ----------------------------------------------------------------------------------------------------------------------------------------------// case'officier': - include_once($xgp_root . 'includes/pages/class.ShowOfficierPage.' . $phpEx); + include_once(XGP_ROOT . 'includes/pages/class.ShowOfficierPage.php'); new ShowOfficierPage($user); break; // ----------------------------------------------------------------------------------------------------------------------------------------------// case'trader': - include_once($xgp_root . 'includes/pages/ShowTraderPage.' . $phpEx); - ShowTraderPage($user, $planetrow); + include_once(XGP_ROOT . 'includes/pages/class.ShowTraderPage.php'); + new ShowTraderPage ( $user , $planetrow ); break; // ----------------------------------------------------------------------------------------------------------------------------------------------// case'techtree': - include_once($xgp_root . 'includes/pages/ShowTechTreePage.' . $phpEx); - ShowTechTreePage($user, $planetrow); + include_once(XGP_ROOT . 'includes/pages/class.ShowTechTreePage.php'); + new ShowTechTreePage($user, $planetrow); break; // ----------------------------------------------------------------------------------------------------------------------------------------------// case'infos': - include_once($xgp_root . 'includes/pages/class.ShowInfosPage.' . $phpEx); + include_once(XGP_ROOT . 'includes/pages/class.ShowInfosPage.php'); new ShowInfosPage($user, $planetrow, $_GET['gid']); break; // ----------------------------------------------------------------------------------------------------------------------------------------------// case'messages': - include_once($xgp_root . 'includes/pages/ShowMessagesPage.' . $phpEx); - ShowMessagesPage($user); + include_once(XGP_ROOT . 'includes/pages/class.ShowMessagesPage.php'); + new ShowMessagesPage($user); break; // ----------------------------------------------------------------------------------------------------------------------------------------------// case'alliance': - include_once($xgp_root . 'includes/pages/class.ShowAlliancePage.' . $phpEx); + include_once(XGP_ROOT . 'includes/pages/class.ShowAlliancePage.php'); new ShowAlliancePage($user); break; // ----------------------------------------------------------------------------------------------------------------------------------------------// case'buddy': - include_once($xgp_root . 'includes/pages/ShowBuddyPage.' . $phpEx); - ShowBuddyPage($user); + include_once(XGP_ROOT . 'includes/pages/class.ShowBuddyPage.php'); + new ShowBuddyPage($user); break; // ----------------------------------------------------------------------------------------------------------------------------------------------// case'notes': - include_once($xgp_root . 'includes/pages/ShowNotesPage.' . $phpEx); - ShowNotesPage($user); + include_once(XGP_ROOT . 'includes/pages/class.ShowNotesPage.php'); + new ShowNotesPage($user); break; // ----------------------------------------------------------------------------------------------------------------------------------------------// case'statistics': - include_once($xgp_root . 'includes/pages/ShowStatisticsPage.' . $phpEx); - ShowStatisticsPage($user); + include_once(XGP_ROOT . 'includes/pages/class.ShowStatisticsPage.php'); + new ShowStatisticsPage($user); break; // ----------------------------------------------------------------------------------------------------------------------------------------------// case'search': - include_once($xgp_root . 'includes/pages/ShowSearchPage.' . $phpEx); - ShowSearchPage(); + include_once(XGP_ROOT . 'includes/pages/class.ShowSearchPage.php'); + new ShowSearchPage(); break; // ----------------------------------------------------------------------------------------------------------------------------------------------// case'options': - include_once($xgp_root . 'includes/pages/class.ShowOptionsPage.' . $phpEx); + include_once(XGP_ROOT . 'includes/pages/class.ShowOptionsPage.php'); new ShowOptionsPage($user); break; // ----------------------------------------------------------------------------------------------------------------------------------------------// case'banned': - include_once($xgp_root . 'includes/pages/ShowBannedPage.' . $phpEx); - ShowBannedPage(); + include_once(XGP_ROOT . 'includes/pages/class.ShowBannedPage.php'); + new ShowBannedPage(); break; // ----------------------------------------------------------------------------------------------------------------------------------------------// case'logout': - setcookie($game_config['COOKIE_NAME'], "", time()-100000, "/", "", 0); - message($lang['see_you_soon'], $xgp_root, 1, false, false); + setcookie(read_config ( 'cookie_name' ), "", time()-100000, "/", "", 0); + message($lang['see_you_soon'], XGP_ROOT, 1, FALSE, FALSE); break; // ----------------------------------------------------------------------------------------------------------------------------------------------// default: diff --git a/global.php b/global.php new file mode 100644 index 0000000..9898c3a --- /dev/null +++ b/global.php @@ -0,0 +1,140 @@ +CheckUser ( $IsUserChecked ); + $IsUserChecked = $Result['state']; + $user = $Result['record']; + + if ( read_config ( 'game_disable' ) == 0 && $user['authlevel'] == 0 ) + { + message ( stripslashes ( read_config ( 'close_reason' ) ) , '' , '' , FALSE , FALSE ); + } + } + + if ( ( time() >= ( read_config ( 'stat_last_update' ) + ( 60 * read_config ( 'stat_update_time' ) ) ) ) ) + { + include ( XGP_ROOT . 'adm/statfunctions.php' ); + $result = MakeStats(); + update_config ( 'stat_last_update' , $result['stats_time'] ); + } + + if ( isset ( $user ) ) + { + include ( XGP_ROOT . 'includes/classes/class.FlyingFleetHandler.php' ); + $_fleets = doquery ( "SELECT fleet_start_galaxy,fleet_start_system,fleet_start_planet,fleet_start_type FROM {{table}} WHERE `fleet_start_time` <= '" . time() . "' and `fleet_mess` ='0' order by fleet_id asc;" , 'fleets' ); // OR fleet_end_time <= ".time() + + while ( $row = mysql_fetch_array ( $_fleets ) ) + { + $array = array(); + $array['galaxy'] = $row['fleet_start_galaxy']; + $array['system'] = $row['fleet_start_system']; + $array['planet'] = $row['fleet_start_planet']; + $array['planet_type'] = $row['fleet_start_type']; + + $temp = new FlyingFleetHandler ( $array ); + } + + mysql_free_result ( $_fleets ); + + $_fleets = doquery ( "SELECT fleet_end_galaxy,fleet_end_system,fleet_end_planet ,fleet_end_type FROM {{table}} WHERE `fleet_end_time` <= '" . time() . " order by fleet_id asc';" , 'fleets' ); // OR fleet_end_time <= ".time() + + while ( $row = mysql_fetch_array ($_fleets ) ) + { + $array = array(); + $array['galaxy'] = $row['fleet_end_galaxy']; + $array['system'] = $row['fleet_end_system']; + $array['planet'] = $row['fleet_end_planet']; + $array['planet_type'] = $row['fleet_end_type']; + + $temp = new FlyingFleetHandler ( $array ); + } + + mysql_free_result ( $_fleets); + unset ( $_fleets ); + + if ( defined ( 'IN_ADMIN' ) ) + { + includeLang ( 'ADMIN' ); + include ( '../adm/AdminFunctions/Autorization.php' ); + + define('DPATH' , "../". DEFAULT_SKINPATH ); + } + else + { + define('DPATH' , ( ( !$user["dpath"] ) ? DEFAULT_SKINPATH : SKIN_PATH . $user["dpath"] . '/' ) ); + } + + include ( XGP_ROOT . 'includes/functions/SetSelectedPlanet.php' ); + SetSelectedPlanet ( $user ); + + $planetrow = doquery ( "SELECT * FROM `{{table}}` WHERE `id` = '" . $user['current_planet'] . "';" , "planets" , TRUE ); + + // Include the plugin system 0.3 + include ( XGP_ROOT . 'includes/plugins.php' ); + } +} +else +{ + define('DPATH' , "../". DEFAULT_SKINPATH ); +} + +include ( 'includes/classes/class.SecurePage.php' ); // include the class +$SecureSqlInjection = new SecureSqlInjection(); // load the class +$SecureSqlInjection->secureGlobals(); // run the main class function + +?> \ No newline at end of file diff --git a/includes/GeneralFunctions.php b/includes/GeneralFunctions.php index e0d56df..526e204 100644 --- a/includes/GeneralFunctions.php +++ b/includes/GeneralFunctions.php @@ -1,64 +1,48 @@ get_configs (); + } + else + { + return $configs->get_config ( $config_name ); + } + +} + +function update_config ( $config_name, $config_value ) +{ + $configs = new xml ( 'config.xml' ); + + $configs->write_config ( $config_name , $config_value ); } function is_email($email) @@ -66,26 +50,26 @@ function is_email($email) return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i", $email)); } -function message ($mes, $dest = "", $time = "3", $topnav = false, $menu = true) +function message ($mes, $dest = "", $time = "3", $topnav = FALSE, $menu = TRUE) { $parse['mes'] = $mes; - $page .= parsetemplate(gettemplate('message_body'), $parse); + $page .= parsetemplate(gettemplate('general/message_body'), $parse); if (!defined('IN_ADMIN')) { - display ($page, $topnav, (($dest != "") ? "" : ""), false, $menu); + display ($page, $topnav, (($dest != "") ? "" : ""), FALSE, $menu); } else { - display ($page, $topnav, (($dest != "") ? "" : ""), true, false); + display ($page, $topnav, (($dest != "") ? "" : ""), TRUE, FALSE); } } -function display ($page, $topnav = true, $metatags = '', $AdminPage = false, $menu = true) +function display ($page, $topnav = TRUE, $metatags = '', $AdminPage = FALSE, $menu = TRUE) { - global $link, $game_config, $debug, $user, $planetrow, $xgp_root, $phpEx; + global $link, $debug, $user, $planetrow; if (!$AdminPage) $DisplayPage = StdUserHeader($metatags); @@ -94,27 +78,27 @@ function display ($page, $topnav = true, $metatags = '', $AdminPage = false, $me if ($topnav) { - include_once($xgp_root . 'includes/functions/ShowTopNavigationBar.' . $phpEx); + include_once(XGP_ROOT . 'includes/functions/ShowTopNavigationBar.php'); $DisplayPage .= ShowTopNavigationBar( $user, $planetrow ); } if ($menu && !$AdminPage) { - include_once($xgp_root . 'includes/functions/ShowLeftMenu.' . $phpEx); - $DisplayPage .= ShowLeftMenu ($user['authlevel']); + include_once(XGP_ROOT . 'includes/functions/ShowLeftMenu.php'); + $DisplayPage .= ShowLeftMenu ($user); } $DisplayPage .= "\n
    \n". $page ."\n
    \n"; if(!defined('LOGIN') && $_GET['page'] != 'galaxy') - $DisplayPage .= parsetemplate(gettemplate('footer'), $parse); + $DisplayPage .= parsetemplate(gettemplate('general/footer'), $parse); if ($link) { mysql_close($link); } - if ( $user['authlevel'] == 3 && $game_config['debug'] == 1 && !$AdminPage ) + if ( $user['authlevel'] == 3 && read_config ( 'debug' ) == 1 && !$AdminPage ) { // Convertir a objeto dom $DisplayPage = str_get_html($DisplayPage); @@ -128,7 +112,7 @@ function display ($page, $topnav = true, $metatags = '', $AdminPage = false, $me echo $DisplayPage; - if ( $user['authlevel'] == 3 && $game_config['debug'] == 1 && $AdminPage) + if ( $user['authlevel'] == 3 && read_config ( 'debug' ) == 1 && $AdminPage) { echo "
    "; @@ -141,17 +125,17 @@ function display ($page, $topnav = true, $metatags = '', $AdminPage = false, $me function StdUserHeader ($metatags = '') { - global $dpath, $game_config; - - $parse['-title-'] .= $game_config['game_name']; + $parse['-title-'] .= read_config ( 'game_name' ); $parse['-favi-'] .= "\n"; - $parse['-meta-'] .= "\n"; + $parse['-meta-'] .= "\n"; + $parse['-meta-'] .= "\n"; if(!defined('LOGIN')) { $parse['-style-'] .= "\n"; $parse['-style-'] .= "\n"; - $parse['-style-'] .= "\n"; + $parse['-style-'] .= "\n"; + $parse['-meta-'] .= "\n"; } else { @@ -159,24 +143,27 @@ function StdUserHeader ($metatags = '') } $parse['-meta-'] .= ($metatags) ? $metatags : ""; - $parse['-meta-'] .= "\n"; - return parsetemplate(gettemplate('simple_header'), $parse); + return parsetemplate(gettemplate('general/simple_header'), $parse); } function AdminUserHeader ($metatags = '') { - global $game_config; - if (!defined('IN_ADMIN')) + { $parse['-title-'] .= "XG Proyect - Install"; + } else - $parse['-title-'] .= $game_config['game_name'] . " - Admin CP"; + { + $parse['-title-'] .= read_config ( 'game_name' ) . " - Admin CP"; + } + $parse['-favi-'] .= "\n"; $parse['-style-'] .= "\n"; - $parse['-meta-'] .= "\n"; + $parse['-meta-'] .= "\n"; $parse['-meta-'] .= ($metatags) ? $metatags : ""; + return parsetemplate(gettemplate('adm/simple_header'), $parse); } @@ -211,8 +198,7 @@ function GetMissionDuration ($GameSpeed, $MaxFleetSpeed, $Distance, $SpeedFactor function GetGameSpeedFactor () { - global $game_config; - return $game_config['fleet_speed'] / 2500; + return read_config ( 'fleet_speed' ) / 2500; } function GetFleetMaxSpeed ($FleetArray, $Fleet, $Player) @@ -245,7 +231,7 @@ function GetFleetMaxSpeed ($FleetArray, $Fleet, $Player) $speedalls[$Ship] = $pricelist[$Ship]['speed'] + (($pricelist[$Ship]['speed'] * $Player['impulse_motor_tech']) * 0.2); } - if ($Ship == 207 or $Ship == 213 or $Ship == 214 or $Ship == 215 or $Ship == 216) + if ($Ship == 207 or $Ship == 213 or $Ship == 214 or $Ship == 215) $speedalls[$Ship] = $pricelist[$Ship]['speed'] + (($pricelist[$Ship]['speed'] * $Player['hyperspace_motor_tech']) * 0.3); } @@ -304,10 +290,10 @@ function pretty_time ($seconds) if ($sr < 10) { $ss = "0" . $sr; } else { $ss = $sr; } $time = ''; - if ($day != 0) { $time .= $day . 'äåíü '; } - if ($hs != 0) { $time .= $hh . '÷àñ. '; } else { $time .= '00÷àñ. '; } - if ($ms != 0) { $time .= $mm . 'ìèí. '; } else { $time .= '00ìèí. '; } - $time .= $ss . 'ñåê.'; + if ($day != 0) { $time .= $day . 'd '; } + if ($hs != 0) { $time .= $hh . 'h '; } else { $time .= '00h '; } + if ($ms != 0) { $time .= $mm . 'm '; } else { $time .= '00m '; } + $time .= $ss . 's'; return $time; } @@ -326,22 +312,26 @@ function ShowBuildTime($time) return "
    ". $lang['fgf_time'] . pretty_time($time); } -function parsetemplate ($template, $array) +function get_max_fleets ( $computer_tech , $amiral_level ) +{ + return ( 1 + $computer_tech + ( $amiral_level * AMIRAL ) ); +} + +function parsetemplate ( $template , $array ) { - return preg_replace('#\{([a-zà-ÿ0-9\-_]*?)\}#Ssie', '( ( isset($array[\'\1\']) ) ? $array[\'\1\'] : \'\' );', $template); + return preg_replace ( '#\{([a-z0-9\-_]*?)\}#Ssie' , '( ( isset($array[\'\1\']) ) ? $array[\'\1\'] : \'\' );' , $template ); } -function gettemplate ($templatename) +function gettemplate ( $templatename ) { - global $xgp_root; - return @file_get_contents($xgp_root . TEMPLATE_DIR . '/' . $templatename . ".tpl"); + return @file_get_contents ( XGP_ROOT . TEMPLATE_DIR . '/' . $templatename . '.php' ); } -function includeLang ($filename, $ext = '.mo') +function includeLang ( $filename ) { - global $xgp_root, $lang; + global $lang; - include ($xgp_root . "language/". DEFAULT_LANG ."/". $filename.$ext); + include ( XGP_ROOT . "language/" . DEFAULT_LANG ."/". $filename . '.php' ); } function GetStartAdressLink ( $FleetRow, $FleetType ) @@ -365,33 +355,44 @@ function BuildPlanetAdressLink ( $CurrentPlanet ) return $Link; } -function doquery($query, $table, $fetch = false) +function doquery($query, $table, $fetch = FALSE) { - global $link, $debug, $xgp_root; + global $link, $debug; - require($xgp_root.'config.php'); + require ( XGP_ROOT . 'config.php' ); if(!$link) { - $link = mysql_connect($dbsettings["server"], $dbsettings["user"], $dbsettings["pass"]) or $debug->error(mysql_error()."
    $query","SQL Error"); - mysql_select_db($dbsettings["name"]) or $debug->error(mysql_error()."
    $query","SQL Error"); + $link = mysql_connect ( + $dbsettings["server"], + $dbsettings["user"], + $dbsettings["pass"] + ) or $debug->error ( mysql_error() . "
    $query" , "SQL Error" ); + + mysql_select_db ( $dbsettings["name"] ) or $debug->error ( mysql_error() . "
    $query" , "SQL Error" ); + echo mysql_error(); } - $sql = str_replace("{{table}}", $dbsettings["prefix"].$table, $query); - $sqlquery = mysql_query($sql) or $debug->error(mysql_error()."
    $sql
    ","SQL Error"); + $sql = str_replace ( "{{table}}" , $dbsettings["prefix"] . $table , $query ); + $sqlquery = mysql_query ( $sql ) or $debug->error ( mysql_error() . "
    $sql
    " , "SQL Error" ); - unset($dbsettings); + unset ( $dbsettings ); global $numqueries,$debug; $numqueries++; - $debug->add("
    "); + $debug->add ( ""); - if($fetch) - return mysql_fetch_array($sqlquery); + if ( $fetch ) + { + return mysql_fetch_array ( $sqlquery ); + } else + { return $sqlquery; + } + } function colorNumber($n, $s = '') @@ -425,7 +426,7 @@ function colorGreen($n) return '' . $n . ''; } -function pretty_number($n, $floor = true) +function pretty_number($n, $floor = TRUE) { if ($floor) $n = floor($n); @@ -460,9 +461,24 @@ function shortly_number($number) return pretty_number($number); } -function floattostring($Numeric, $Pro = 0, $Output = false) +function floattostring($Numeric, $Pro = 0, $Output = FALSE) { return ($Output) ? str_replace(",",".", sprintf("%.".$Pro."f", $Numeric)) : sprintf("%.".$Pro."f", $Numeric); } +function roundUp($value, $precision = 0) +{ + if ( $precision == 0 ) + { + $precisionFactor = 1; + } + + else + { + $precisionFactor = pow( 10, $precision ); + } + + return ceil( $value * $precisionFactor )/$precisionFactor; +} + ?> \ No newline at end of file diff --git a/includes/classes/class.BBCode.php b/includes/classes/class.BBCode.php new file mode 100644 index 0000000..081c7d9 --- /dev/null +++ b/includes/classes/class.BBCode.php @@ -0,0 +1,120 @@ +', + '', + '$this->sList(\'\\1\')', + '\1', + '\1', + '\1', + '\1', + '\1', + '\1', + '$this->urlfix(\'\\1\',\'\\2\')', + '\2', + '$this->imagefix(\'\\1\')', + '\2', + '$this->sQuote(\'\1\')', + '$this->sCode(\'\1\')', + '$this->fontfix(\'\\1\',\'\\2\')', + '$this->bgfix(\'\\1\',\'\\2\')', + '$this->sizefix(\'\\1\',\'\\2\')' + ); + + return preg_replace($pattern, $replace, nl2br(htmlspecialchars(stripslashes($string)))); + } + + private function sCode($string) + { + $pattern = '/\\\\"(.*?)\\\"/s'; + $string = preg_replace($pattern, '\3', $string); + return '
    ' . trim($string) . '
    '; + } + + private function sQuote($string) + { + $pattern = '/\\\\"(.*?)\\\"/s'; + $string = preg_replace($pattern, '\3', $string); + return '

    ' . trim($string) . '

    '; + } + + private function sList($string) + { + $tmp = explode('[*]', stripslashes($string)); + $out = NULL; + foreach($tmp as $list) { + if(strlen(str_replace('', '', $list)) > 0) { + $out .= '
  • ' . trim($list) . '
  • '; + } + } + return '
      ' . $out . '
    '; + } + + private function imagefix($img) + { + if(substr($img, 0, 7) != 'http://') + { + $img = './images/' . $img; + } + return '' . $img . ''; + } + + private function urlfix($url, $title) + { + $title = stripslashes($title); + $url = trim($url); + return (substr ($url, 0, 5) == 'data:' || substr ($url, 0, 5) == 'file:' || substr ($url, 0, 11) == 'javascript:' || substr ($url, 0, 4) == 'jar:' || substr ($url, 0, 1) == '#') ? '' : ''.htmlspecialchars($title, ENT_QUOTES).''; + } + + private function fontfix($font, $title) + { + $title = stripslashes($title); + return '' . $title . ''; + } + + private function bgfix($bg, $title) + { + $title = stripslashes($title); + return '' . $title . ''; + } + + private function sizefix($size, $text) + { + $title = stripslashes($text); + return '' . $title . ''; + } +} +?> \ No newline at end of file diff --git a/includes/classes/class.CheckSession.php b/includes/classes/class.CheckSession.php index ea4379a..75b8dc2 100644 --- a/includes/classes/class.CheckSession.php +++ b/includes/classes/class.CheckSession.php @@ -1,130 +1,129 @@ CheckCookies($IsUserChecked); - $IsUserChecked = $Result['state']; - - if ($Result['record'] != false) - { - $user = $Result['record']; - - if ($user['bana'] == 1) - { - die("

    ".$lang['css_account_banned_message']."


    ".$lang['css_account_banned_expire'].date("d-m-y H:i", $user['banaday'])."
    "); - } - - $RetValue['record'] = $user; - $RetValue['state'] = $IsUserChecked; - } - else - { - $RetValue['record'] = array(); - $RetValue['state'] = false; - header("location:".$xgp_root); - } - - return $RetValue; - } -} -?> \ No newline at end of file + private function CheckCookies ($IsUserChecked) + { + global $lang; + + $UserRow = array(); + + include(XGP_ROOT . 'config.php'); + + $game_cookie = read_config ( 'cookie_name' ); + + if (isset($_COOKIE[$game_cookie])) + { + $TheCookie = explode("/%/", $_COOKIE[$game_cookie]); + + // START FIX BY JSTAR + $TheCookie = array_map ( 'mysql_escape_string' , $TheCookie ); + // END FIX BY JSTAR + + // BETTER QUERY BY LUCKY! REDUCE GENERAL QUERY FROM 11 TO 10. + $UserResult = doquery("SELECT {{table}}users.*, {{table}}statpoints.total_rank, {{table}}statpoints.total_points, {{table}}users.id + FROM {{table}}statpoints + RIGHT JOIN {{table}}users ON {{table}}statpoints.id_owner = {{table}}users.id + WHERE ({{table}}users.username = '{$TheCookie[1]}') LIMIT 1;", ''); + + + if (mysql_num_rows($UserResult) != 1) + { + message($lang['ccs_multiple_users'], XGP_ROOT, 5, FALSE, FALSE); + } + + $UserRow = mysql_fetch_array($UserResult); + + if ($UserRow["id"] != $TheCookie[0]) + { + message($lang['ccs_other_user'], XGP_ROOT, 5, FALSE, FALSE); + } + + if (md5($UserRow["password"] . "--" . $dbsettings["secretword"]) !== $TheCookie[2]) + { + message($lang['css_different_password'], XGP_ROOT, 5, FALSE, FALSE); + } + + $NextCookie = implode("/%/", $TheCookie); + + if ($TheCookie[3] == 1) + { + $ExpireTime = time() + 31536000; + } + else + { + $ExpireTime = 0; + } + + if ($IsUserChecked == FALSE) + { + setcookie ($game_cookie, $NextCookie, $ExpireTime, "/", "", 0); + $QryUpdateUser = "UPDATE {{table}} SET "; + $QryUpdateUser .= "`onlinetime` = '". time() ."', "; + $QryUpdateUser .= "`current_page` = '". mysql_real_escape_string(htmlspecialchars($_SERVER['REQUEST_URI'])) ."', "; + $QryUpdateUser .= "`user_lastip` = '". mysql_real_escape_string(htmlspecialchars($_SERVER['REMOTE_ADDR'])) ."', "; + $QryUpdateUser .= "`user_agent` = '". mysql_real_escape_string(htmlspecialchars($_SERVER['HTTP_USER_AGENT'])) ."' "; + $QryUpdateUser .= "WHERE "; + $QryUpdateUser .= "`id` = '". intval($TheCookie[0]) ."' LIMIT 1;"; + doquery( $QryUpdateUser, 'users'); + $IsUserChecked = TRUE; + } + else + { + $QryUpdateUser = "UPDATE {{table}} SET "; + $QryUpdateUser .= "`onlinetime` = '". time() ."', "; + $QryUpdateUser .= "`current_page` = '". mysql_real_escape_string(htmlspecialchars($_SERVER['REQUEST_URI'])) ."', "; + $QryUpdateUser .= "`user_lastip` = '". mysql_real_escape_string(htmlspecialchars($_SERVER['REMOTE_ADDR'])) ."', "; + $QryUpdateUser .= "`user_agent` = '". mysql_real_escape_string(htmlspecialchars($_SERVER['HTTP_USER_AGENT'])) ."' "; + $QryUpdateUser .= "WHERE "; + $QryUpdateUser .= "`id` = '". intval($TheCookie[0]) ."' LIMIT 1;"; + doquery( $QryUpdateUser, 'users'); + $IsUserChecked = TRUE; + } + } + + unset($dbsettings); + + $Return['state'] = $IsUserChecked; + $Return['record'] = $UserRow; + + return $Return; + } + + public function CheckUser($IsUserChecked) + { + global $user, $lang; + + $Result = $this->CheckCookies($IsUserChecked); + $IsUserChecked = $Result['state']; + + if ($Result['record'] != FALSE) + { + $user = $Result['record']; + + if ($user['bana'] == 1) + { + die("

    ".$lang['css_account_banned_message']."


    ".$lang['css_account_banned_expire'].date("d-m-y H:i", $user['banaday'])."
    "); + } + + $RetValue['record'] = $user; + $RetValue['state'] = $IsUserChecked; + } + else + { + $RetValue['record'] = array(); + $RetValue['state'] = FALSE; + header ( 'location:' . XGP_ROOT ); + } + + return $RetValue; + } +} \ No newline at end of file diff --git a/includes/classes/class.FlyingFleetHandler.php b/includes/classes/class.FlyingFleetHandler.php index de5fbd0..b3f0354 100644 --- a/includes/classes/class.FlyingFleetHandler.php +++ b/includes/classes/class.FlyingFleetHandler.php @@ -1,86 +1,73 @@ $Attacker) { foreach($Attacker['detail'] as $Element => $amount) { - $SortFleets[$FleetID] += $pricelist[$Element]['capacity'] * $amount; + if ($Element != 210) //fix probos capacity in attack by jstar + $SortFleets[$FleetID] += $pricelist[$Element]['capacity'] * $amount; } $SortFleets[$FleetID] -= $Attacker['fleet']['fleet_resource_metal'] - $Attacker['fleet']['fleet_resource_crystal'] - $Attacker['fleet']['fleet_resource_deuterium']; } $Sumcapacity = array_sum($SortFleets); + //FIX JTSAMPER + $booty['deuterium'] = min($Sumcapacity / 3, ($defenderPlanet['deuterium'] / 2)); + $Sumcapacity -= $booty['deuterium']; - // Step 1 - $booty['metal'] = min(($Sumcapacity / 3), ($defenderPlanet['metal'] / 2)); - $Sumcapacity -= $booty['metal']; - - // Step 2 $booty['crystal'] = min(($Sumcapacity / 2), ($defenderPlanet['crystal'] / 2)); $Sumcapacity -= $booty['crystal']; - // Step 3 - $booty['deuterium'] = min($Sumcapacity, ($defenderPlanet['deuterium'] / 2)); - $Sumcapacity -= $booty['deuterium']; + $booty['metal'] = min(($Sumcapacity ), ($defenderPlanet['metal'] / 2)); + $Sumcapacity -= $booty['metal']; + + + $oldMetalBooty = $booty['crystal'] ; + $booty['crystal'] += min(($Sumcapacity /2 ), max((($defenderPlanet['crystal']) / 2) - $booty['crystal'], 0)); - // Step 4 - $oldMetalBooty = $booty['metal']; - $booty['metal'] += min(($Sumcapacity / 2), max((($defenderPlanet['metal']) / 2) - $booty['metal'], 0)); - $Sumcapacity += $oldMetalBooty - $booty['metal']; + $Sumcapacity += $oldMetalBooty - $booty['crystal'] ; - // Step 5 - $booty['crystal'] += min(($Sumcapacity), max((($defenderPlanet['crystal']) / 2) - $booty['crystal'], 0)); + $booty['metal'] += min(($Sumcapacity ), max(($defenderPlanet['metal'] / 2) - $booty['metal'], 0)); - $booty['metal'] = max($booty['metal'] ,0); - $booty['crystal'] = max($booty['crystal'] ,0); - $booty['deuterium'] = max($booty['deuterium'] ,0); - $steal = array_map('floor', $booty); + $booty['metal'] = max($booty['metal'] ,0); + $booty['crystal'] = max($booty['crystal'] ,0); + $booty['deuterium'] = max($booty['deuterium'] ,0); + //END FIX + $steal = array_map('floor', $booty); if($ForSim) return $steal; - $AllCapacity = array_sum($SortFleets); - $QryUpdateFleet = ""; + $AllCapacity = array_sum($SortFleets); + $QryUpdateFleet = ""; foreach($SortFleets as $FleetID => $Capacity) { - $QryUpdateFleet = "UPDATE {{table}} SET "; - $QryUpdateFleet .= "`fleet_resource_metal` = `fleet_resource_metal` + '".floattostring($steal['metal'] * ($Capacity / $AllCapacity))."', "; - $QryUpdateFleet .= "`fleet_resource_crystal` = `fleet_resource_crystal` +'".floattostring($steal['crystal'] * ($Capacity / $AllCapacity))."', "; - $QryUpdateFleet .= "`fleet_resource_deuterium` = `fleet_resource_deuterium` +'".floattostring($steal['deuterium'] * ($Capacity / $AllCapacity))."' "; - $QryUpdateFleet .= "WHERE fleet_id = '".$FleetID."' "; - $QryUpdateFleet .= "LIMIT 1;"; + $QryUpdateFleet = 'UPDATE {{table}} SET '; + $QryUpdateFleet .= '`fleet_resource_metal` = `fleet_resource_metal` + '.floattostring($steal['metal'] * ($Capacity / $AllCapacity)).', '; + $QryUpdateFleet .= '`fleet_resource_crystal` = `fleet_resource_crystal` +'.floattostring($steal['crystal'] * ($Capacity / $AllCapacity)).', '; + $QryUpdateFleet .= '`fleet_resource_deuterium` = `fleet_resource_deuterium` +'.floattostring($steal['deuterium'] * ($Capacity / $AllCapacity)).' '; + $QryUpdateFleet .= 'WHERE fleet_id = '.$FleetID.' '; + $QryUpdateFleet .= 'LIMIT 1;'; doquery($QryUpdateFleet, 'fleets'); } @@ -92,14 +79,14 @@ private function SpyTarget ($TargetPlanet, $Mode, $TitleString) { global $lang, $resource; - $LookAtLoop = true; + $LookAtLoop = TRUE; if ($Mode == 0) { $String = "
    ".$lang['mu_tools']."
    ".$lang['chat_title']."
    ".$lang['mu_global_message']."
    Query $numqueries: $query$table$fetch
    Query $numqueries: $query$table$fetch
    "; + $String .= $lang['sys_the'] . date("d-m-Y H:i:s", time()) .""; $String .= ""; $String .= ""; $String .= ""; @@ -107,7 +94,7 @@ private function SpyTarget ($TargetPlanet, $Mode, $TitleString) $String .= ""; $String .= ""; $String .= ""; - $LookAtLoop = false; + $LookAtLoop = FALSE; } elseif ($Mode == 1) { @@ -136,7 +123,7 @@ private function SpyTarget ($TargetPlanet, $Mode, $TitleString) $Loops = 1; } - if ($LookAtLoop == true) + if ($LookAtLoop == TRUE) { $String = "
    "; $String .= $TitleString ." ". $TargetPlanet['name']; $String .= " "; $String .= "[". $TargetPlanet["galaxy"] .":". $TargetPlanet["system"] .":". $TargetPlanet["planet"] ."]"; - $String .= $lang['sys_the'] . gmdate("d-m-Y H:i:s", time() + 2 * 60 * 60) ."
    ". $lang['Metal'] ."". pretty_number($TargetPlanet['metal']) ." ". $lang['Crystal'] ."". pretty_number($TargetPlanet['crystal']) ."". $lang['Deuterium'] ."". pretty_number($TargetPlanet['deuterium']) ." ". $lang['Energy'] ."". pretty_number($TargetPlanet['energy_max']) ."
    "; $Count = 0; @@ -188,7 +175,7 @@ private function SpyTarget ($TargetPlanet, $Mode, $TitleString) private function walka ($CurrentSet, $TargetSet, $CurrentTechno, $TargetTechno) { - global $pricelist, $CombatCaps, $game_config, $user; + global $pricelist, $CombatCaps, $user; $runda = array(); $atakujacy_n = array(); @@ -241,11 +228,11 @@ private function walka ($CurrentSet, $TargetSet, $CurrentTechno, $TargetTechno) { foreach($CurrentSet as $a => $b) { - $CurrentSet[$a]["obrona"] = $CurrentSet[$a]['count'] * ($pricelist[$a]['metal'] + $pricelist[$a]['crystal']) / 10 * (1 + (0.1 * ($CurrentTechno["defence_tech"]) + (AMIRAL * $user['rpg_amiral']))); + $CurrentSet[$a]["obrona"] = $CurrentSet[$a]['count'] * ($pricelist[$a]['metal'] + $pricelist[$a]['crystal']) / 10 * (1 + (0.1 * ($CurrentTechno["defence_tech"]))); $rand = rand(80, 120) / 100; - $CurrentSet[$a]["tarcza"] = $CurrentSet[$a]['count'] * $CombatCaps[$a]['shield'] * (1 + (0.1 * $CurrentTechno["shield_tech"]) + (AMIRAL * $user['rpg_amiral'])) * $rand; + $CurrentSet[$a]["tarcza"] = $CurrentSet[$a]['count'] * $CombatCaps[$a]['shield'] * (1 + (0.1 * $CurrentTechno["shield_tech"])) * $rand; $atak_statku = $CombatCaps[$a]['attack']; - $technologie = (1 + (0.1 * $CurrentTechno["military_tech"]+(AMIRAL * $user['rpg_amiral']))); + $technologie = (1 + (0.1 * $CurrentTechno["military_tech"])); $rand = rand(80, 120) / 100; $ilosc = $CurrentSet[$a]['count']; $CurrentSet[$a]["atak"] = $ilosc * $atak_statku * $technologie * $rand; @@ -264,11 +251,11 @@ private function walka ($CurrentSet, $TargetSet, $CurrentTechno, $TargetTechno) { foreach($TargetSet as $a => $b) { - $TargetSet[$a]["obrona"] = $TargetSet[$a]['count'] * ($pricelist[$a]['metal'] + $pricelist[$a]['crystal']) / 10 * (1 + (0.1 * ($TargetTechno["defence_tech"]) + (AMIRAL* $user['rpg_amiral']))); + $TargetSet[$a]["obrona"] = $TargetSet[$a]['count'] * ($pricelist[$a]['metal'] + $pricelist[$a]['crystal']) / 10 * (1 + (0.1 * ($TargetTechno["defence_tech"]))); $rand = rand(80, 120) / 100; - $TargetSet[$a]["tarcza"] = $TargetSet[$a]['count'] * $CombatCaps[$a]['shield'] * (1 + (0.1 * $TargetTechno["shield_tech"])+ (AMIRAL * $user['rpg_amiral'])) * $rand; + $TargetSet[$a]["tarcza"] = $TargetSet[$a]['count'] * $CombatCaps[$a]['shield'] * (1 + (0.1 * $TargetTechno["shield_tech"])) * $rand; $atak_statku = $CombatCaps[$a]['attack']; - $technologie = (1 + (0.1 * $TargetTechno["military_tech"]) + (AMIRAL * $user['rpg_amiral'])); + $technologie = (1 + (0.1 * $TargetTechno["military_tech"])); $rand = rand(80, 120) / 100; $ilosc = $TargetSet[$a]['count']; $TargetSet[$a]["atak"] = $ilosc * $atak_statku * $technologie * $rand; @@ -467,11 +454,14 @@ private function walka ($CurrentSet, $TargetSet, $CurrentTechno, $TargetTechno) if (($ilosc_wrog > 0) && ($atakujacy_ilosc == 0)) $wygrana = "w"; - $zlom['metal'] = ((($atakujacy_zlom_poczatek['metal'] - $atakujacy_zlom_koniec['metal']) + ($wrog_zlom_poczatek['metal'] - $wrog_zlom_koniec['metal'])) * ($game_config['Fleet_Cdr'] / 100)); - $zlom['crystal'] = ((($atakujacy_zlom_poczatek['crystal'] - $atakujacy_zlom_koniec['crystal']) + ($wrog_zlom_poczatek['crystal'] - $wrog_zlom_koniec['crystal'])) * ($game_config['Fleet_Cdr'] / 100)); + $game_fleet_cdr = read_config ( 'fleet_cdr' ); + $game_def_cdr = read_config ( 'defs_cdr' ); - $zlom['metal'] += ((($atakujacy_zlom_poczatek['metal'] - $atakujacy_zlom_koniec['metal']) + ($wrog_zlom_poczatek['metal'] - $wrog_zlom_koniec['metal'])) * ($game_config['Defs_Cdr'] / 100)); - $zlom['crystal'] += ((($atakujacy_zlom_poczatek['crystal'] - $atakujacy_zlom_koniec['crystal']) + ($wrog_zlom_poczatek['crystal'] - $wrog_zlom_koniec['crystal'])) * ($game_config['Defs_Cdr'] / 100)); + $zlom['metal'] = ((($atakujacy_zlom_poczatek['metal'] - $atakujacy_zlom_koniec['metal']) + ($wrog_zlom_poczatek['metal'] - $wrog_zlom_koniec['metal'])) * ($game_fleet_cdr / 100)); + $zlom['crystal'] = ((($atakujacy_zlom_poczatek['crystal'] - $atakujacy_zlom_koniec['crystal']) + ($wrog_zlom_poczatek['crystal'] - $wrog_zlom_koniec['crystal'])) * ($game_fleet_cdr / 100)); + + $zlom['metal'] += ((($atakujacy_zlom_poczatek['metal'] - $atakujacy_zlom_koniec['metal']) + ($wrog_zlom_poczatek['metal'] - $wrog_zlom_koniec['metal'])) * ($game_def_cdr / 100)); + $zlom['crystal'] += ((($atakujacy_zlom_poczatek['crystal'] - $atakujacy_zlom_koniec['crystal']) + ($wrog_zlom_poczatek['crystal'] - $wrog_zlom_koniec['crystal'])) * ($game_def_cdr / 100)); $zlom["atakujacy"] = (($atakujacy_zlom_poczatek['metal'] - $atakujacy_zlom_koniec['metal']) + ($atakujacy_zlom_poczatek['crystal'] - $atakujacy_zlom_koniec['crystal'])); $zlom["wrog"] = (($wrog_zlom_poczatek['metal'] - $wrog_zlom_koniec['metal']) + ($wrog_zlom_poczatek['crystal'] - $wrog_zlom_koniec['crystal']) + $straty_obrona_wrog); @@ -479,10 +469,16 @@ private function walka ($CurrentSet, $TargetSet, $CurrentTechno, $TargetTechno) return array("atakujacy" => $CurrentSet, "wrog" => $TargetSet, "wygrana" => $wygrana, "dane_do_rw" => $runda, "zlom" => $zlom); } - private function RestoreFleetToPlanet ($FleetRow, $Start = true) + private function RestoreFleetToPlanet ($FleetRow, $Start = TRUE) { global $resource; + //fix resource by jstar + $targetPlanet = doquery("SELECT * FROM {{table}} WHERE `galaxy` = ". intval($FleetRow['fleet_start_galaxy']) ." AND `system` = ". intval($FleetRow['fleet_start_system']) ." AND `planet_type` = ". intval($FleetRow['fleet_start_type']) ." AND `planet` = ". intval($FleetRow['fleet_start_planet']) .";",'planets', TRUE); + $targetUser = doquery('SELECT * FROM {{table}} WHERE id='.intval($targetPlanet['id_owner']),'users', TRUE); + PlanetResourceUpdate ( $targetUser, $targetPlanet, time() ); + // + $FleetRecord = explode(";", $FleetRow['fleet_array']); $QryUpdFleet = ""; foreach ($FleetRecord as $Item => $Group) @@ -503,7 +499,7 @@ private function RestoreFleetToPlanet ($FleetRow, $Start = true) $QryUpdatePlanet .= "`deuterium` = `deuterium` + '". $FleetRow['fleet_resource_deuterium'] ."' "; $QryUpdatePlanet .= "WHERE "; - if ($Start == true) + if ($Start == TRUE) { $QryUpdatePlanet .= "`galaxy` = '". $FleetRow['fleet_start_galaxy'] ."' AND "; $QryUpdatePlanet .= "`system` = '". $FleetRow['fleet_start_system'] ."' AND "; @@ -521,15 +517,22 @@ private function RestoreFleetToPlanet ($FleetRow, $Start = true) doquery( $QryUpdatePlanet, 'planets'); } - private function StoreGoodsToPlanet ($FleetRow, $Start = false) + private function StoreGoodsToPlanet ($FleetRow, $Start = FALSE) { + + //fix resource by jstar + $targetPlanet = doquery("SELECT * FROM {{table}} WHERE `galaxy` = ". intval($FleetRow['fleet_start_galaxy']) ." AND `system` = ". intval($FleetRow['fleet_start_system']) ." AND `planet_type` = ". intval($FleetRow['fleet_start_type']) ." AND `planet` = ". intval($FleetRow['fleet_start_planet']) .";",'planets', TRUE); + $targetUser = doquery('SELECT * FROM {{table}} WHERE id='.intval($targetPlanet['id_owner']),'users', TRUE); + PlanetResourceUpdate ( $targetUser, $targetPlanet, time() ); + // + $QryUpdatePlanet = "UPDATE {{table}} SET "; $QryUpdatePlanet .= "`metal` = `metal` + '". $FleetRow['fleet_resource_metal'] ."', "; $QryUpdatePlanet .= "`crystal` = `crystal` + '". $FleetRow['fleet_resource_crystal'] ."', "; $QryUpdatePlanet .= "`deuterium` = `deuterium` + '". $FleetRow['fleet_resource_deuterium'] ."' "; $QryUpdatePlanet .= "WHERE "; - if ($Start == true) + if ($Start == TRUE) { $QryUpdatePlanet .= "`galaxy` = '". $FleetRow['fleet_start_galaxy'] ."' AND "; $QryUpdatePlanet .= "`system` = '". $FleetRow['fleet_start_system'] ."' AND "; @@ -548,135 +551,13 @@ private function StoreGoodsToPlanet ($FleetRow, $Start = false) doquery( $QryUpdatePlanet, 'planets'); } - private function raketenangriff($verteidiger_panzerung, $angreifer_waffen, $iraks, $def, $primaerziel = '0') - { - $temp = ''; - $temp2 = ''; - - $def[10] = $iraks; - - $metall = Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - $kristall = Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - $deut = Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - $verblieben = Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - - for($temp = 0; $temp < 11; $temp++) - $verblieben[$temp] = $def[$temp]; - - $kaputt = Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - $hull = Array(); - $hull[0] = 200 * (1 + $verteidiger_panzerung / 10); - $hull[1] = $hull[0]; - $hull[2] = 800 * (1 + ($verteidiger_panzerung / 10)); - $hull[3] = 3500 * (1 + ($verteidiger_panzerung / 10)); - $hull[4] = $hull[2]; - $hull[5] = 10000 * (1 + ($verteidiger_panzerung / 10)); - $hull[6] = 2000 * (1 + ($verteidiger_panzerung / 10)); - $hull[7] = $hull[5]; - $hull[8] = 1500 * (1 + ($verteidiger_panzerung / 10)); - - $metall_cost_tab = Array( 2, 1.5, 6, 20, 2, 50, 10, 50, 12.5, 8); - $kristall_cost_tab = Array( 0, 0.5, 2, 15, 6, 50, 10, 50, 2.5, 0); - $deut_cost_tab = Array( 0, 0, 0, 2, 0, 30, 0, 0, 10.0, 2); - - $schaden = floor(($def[10] - $def[9]) * (12000 * (1 + ($angreifer_waffen / 10)))); - if ($schaden < 0) - $schaden = 0; - - switch ($primaerziel) - { - case 0: - $beschussreihenfolge = Array(0, 1, 2, 3, 4, 5, 6, 7, 8); - break; - case 1: - $beschussreihenfolge = Array(1, 0, 2, 3, 4, 5, 6, 7, 8); - break; - case 2: - $beschussreihenfolge = Array(2, 0, 1, 3, 4, 5, 6, 7, 8); - break; - case 3: - $beschussreihenfolge = Array(3, 0, 1, 2, 4, 5, 6, 7, 8); - break; - case 4: - $beschussreihenfolge = Array(4, 0, 1, 2, 3, 5, 6, 7, 8); - break; - case 5: - $beschussreihenfolge = Array(5, 0, 1, 2, 3, 4, 6, 7, 8); - break; - case 6: - $beschussreihenfolge = Array(6, 0, 1, 2, 3, 4, 5, 7, 8); - break; - case 7: - $beschussreihenfolge = Array(7, 0, 1, 2, 3, 4, 5, 6, 8); - break; - case 8: - $beschussreihenfolge = Array(0, 1, 2, 3, 4, 5, 6, 7, 8); - break; - } - - $verblieben[10] = 0; - $kaputt[10] += $def[10]; - $metall[10] += $kaputt[10] * $metall_cost_tab[8]; - $kristall[10] += $kaputt[10] * $kristall_cost_tab[8]; - $deut[10] += $kaputt[10] * $deut_cost_tab[8]; - $verblieben[9] = ($def[9] - $def[10]); - - if ($verblieben[9] < 0) - $verblieben[9] = 0; - - $kaputt[11] = $def[9] - $verblieben[9]; - $kaputt[9] += ($def[9] - $verblieben[9]); - $metall[9] += $kaputt[9] * $metall_cost_tab[9]; - $kristall[9] += $kaputt[9] * $kristall_cost_tab[9]; - $deut[9] += $kaputt[9] * $deut_cost_tab[9]; - $metall[11] += $metall[9]; - $kristall[11] += $kristall[9]; - $deut[11] += $deut[9]; - - for($temp = 0; $temp < 9; $temp++) - { - if ($schaden >= ($hull[$beschussreihenfolge[$temp]] * $def[$beschussreihenfolge[$temp]])) - { - $kaputt[$beschussreihenfolge[$temp]] += $def[$beschussreihenfolge[$temp]]; - $verblieben[$beschussreihenfolge[$temp]] = 0; - $schaden -= ($hull[$beschussreihenfolge[$temp]] * $kaputt[$beschussreihenfolge[$temp]]); - } - else - { - $kaputt[$beschussreihenfolge[$temp]] += floor($schaden / $hull[$beschussreihenfolge[$temp]]); - $schaden -= $kaputt[$beschussreihenfolge[$temp]] * $hull[$beschussreihenfolge[$temp]]; - $verblieben[$beschussreihenfolge[$temp]] = ($def[$beschussreihenfolge[$temp]] - $kaputt[$beschussreihenfolge[$temp]]); - } - - $metall[$beschussreihenfolge[$temp]] += $kaputt[$beschussreihenfolge[$temp]] * $metall_cost_tab[$beschussreihenfolge[$temp]]; - $kristall[$beschussreihenfolge[$temp]] += $kaputt[$beschussreihenfolge[$temp]] * $kristall_cost_tab[$beschussreihenfolge[$temp]]; - $deut[$beschussreihenfolge[$temp]] += $kaputt[$beschussreihenfolge[$temp]] * $deut_cost_tab[$beschussreihenfolge[$temp]]; - - $verblieben[11] += $verblieben[$beschussreihenfolge[$temp]]; - $kaputt[11] += $kaputt[$beschussreihenfolge[$temp]]; - $metall[11] += $metall[$beschussreihenfolge[$temp]]; - $kristall[11] += $kristall[$beschussreihenfolge[$temp]]; - $deut[11] += $deut[$beschussreihenfolge[$temp]]; - } - - $return = array(); - - $return['verbleibt'] = $verblieben; - $return['zerstoert'] = $kaputt; - $return['verluste_metall'] = $metall; - $return['verluste_kristall'] = $kristall; - $return['verluste_deuterium'] = $deut; - - return $return; - } - private function MissionCaseAttack ($FleetRow) { - global $pricelist, $lang, $resource, $CombatCaps, $game_config, $user; + global $pricelist, $lang, $resource, $CombatCaps, $user; if ($FleetRow['fleet_mess'] == 0 && $FleetRow['fleet_start_time'] <= time()) { - $targetPlanet = doquery("SELECT * FROM {{table}} WHERE `galaxy` = ". intval($FleetRow['fleet_end_galaxy']) ." AND `system` = ". intval($FleetRow['fleet_end_system']) ." AND `planet_type` = ". intval($FleetRow['fleet_end_type']) ." AND `planet` = ". intval($FleetRow['fleet_end_planet']) .";",'planets', true); + $targetPlanet = doquery("SELECT * FROM {{table}} WHERE `galaxy` = ". intval($FleetRow['fleet_end_galaxy']) ." AND `system` = ". intval($FleetRow['fleet_end_system']) ." AND `planet_type` = ". intval($FleetRow['fleet_end_type']) ." AND `planet` = ". intval($FleetRow['fleet_end_planet']) .";",'planets', TRUE); if ($FleetRow['fleet_group'] > 0) { @@ -688,13 +569,13 @@ private function MissionCaseAttack ($FleetRow) doquery("UPDATE {{table}} SET fleet_mess=1 WHERE fleet_id=".intval($FleetRow['fleet_id']),'fleets'); } - $targetGalaxy = doquery('SELECT * FROM {{table}} WHERE `galaxy` = '. intval($FleetRow['fleet_end_galaxy']) .' AND `system` = '. intval($FleetRow['fleet_end_system']) .' AND `planet` = '. intval($FleetRow['fleet_end_planet']) .';','galaxy', true); - $targetUser = doquery('SELECT * FROM {{table}} WHERE id='.intval($targetPlanet['id_owner']),'users', true); + $targetGalaxy = doquery('SELECT * FROM {{table}} WHERE `galaxy` = '. intval($FleetRow['fleet_end_galaxy']) .' AND `system` = '. intval($FleetRow['fleet_end_system']) .' AND `planet` = '. intval($FleetRow['fleet_end_planet']) .';','galaxy', TRUE); + $targetUser = doquery('SELECT * FROM {{table}} WHERE id='.intval($targetPlanet['id_owner']),'users', TRUE); PlanetResourceUpdate ( $targetUser, $targetPlanet, time() ); - $targetGalaxy = doquery('SELECT * FROM {{table}} WHERE `galaxy` = '. intval($FleetRow['fleet_end_galaxy']) .' AND `system` = '. intval($FleetRow['fleet_end_system']) .' AND `planet` = '. intval($FleetRow['fleet_end_planet']) .';','galaxy', true); - $targetUser = doquery('SELECT * FROM {{table}} WHERE id='.intval($targetPlanet['id_owner']),'users', true); + $targetGalaxy = doquery('SELECT * FROM {{table}} WHERE `galaxy` = '. intval($FleetRow['fleet_end_galaxy']) .' AND `system` = '. intval($FleetRow['fleet_end_system']) .' AND `planet` = '. intval($FleetRow['fleet_end_planet']) .';','galaxy', TRUE); + $targetUser = doquery('SELECT * FROM {{table}} WHERE id='.intval($targetPlanet['id_owner']),'users', TRUE); $TargetUserID = $targetUser['id']; $attackFleets = array(); @@ -705,7 +586,7 @@ private function MissionCaseAttack ($FleetRow) while ($fleet = mysql_fetch_assoc($fleets)) { $attackFleets[$fleet['fleet_id']]['fleet'] = $fleet; - $attackFleets[$fleet['fleet_id']]['user'] = doquery('SELECT * FROM {{table}} WHERE id ='.intval($fleet['fleet_owner']),'users', true); + $attackFleets[$fleet['fleet_id']]['user'] = doquery('SELECT * FROM {{table}} WHERE id ='.intval($fleet['fleet_owner']),'users', TRUE); $attackFleets[$fleet['fleet_id']]['detail'] = array(); $temp = explode(';', $fleet['fleet_array']); foreach ($temp as $temp2) @@ -725,7 +606,7 @@ private function MissionCaseAttack ($FleetRow) else { $attackFleets[$FleetRow['fleet_id']]['fleet'] = $FleetRow; - $attackFleets[$FleetRow['fleet_id']]['user'] = doquery('SELECT * FROM {{table}} WHERE id='.intval($FleetRow['fleet_owner']),'users', true); + $attackFleets[$FleetRow['fleet_id']]['user'] = doquery('SELECT * FROM {{table}} WHERE id='.intval($FleetRow['fleet_owner']),'users', TRUE); $attackFleets[$FleetRow['fleet_id']]['detail'] = array(); $temp = explode(';', $FleetRow['fleet_array']); foreach ($temp as $temp2) @@ -756,7 +637,7 @@ private function MissionCaseAttack ($FleetRow) $defense[$defRow['fleet_id']][$Element[0]] = 0; $defense[$defRow['fleet_id']]['def'][$Element[0]] += $Element[1]; - $defense[$defRow['fleet_id']]['user'] = doquery('SELECT * FROM {{table}} WHERE id='.intval($defRow['fleet_owner']),'users', true); + $defense[$defRow['fleet_id']]['user'] = doquery('SELECT * FROM {{table}} WHERE id='.intval($defRow['fleet_owner']),'users', TRUE); } } @@ -769,11 +650,12 @@ private function MissionCaseAttack ($FleetRow) $defense[0]['def'][$i] = $targetPlanet[$resource[$i]]; } } - $start = microtime(true); + $start = microtime(TRUE); $result = calculateAttack($attackFleets, $defense); - $totaltime = microtime(true) - $start; + $totaltime = microtime(TRUE) - $start; $QryUpdateGalaxy = "UPDATE {{table}} SET "; + $QryUpdateGalaxy .= "`invisible_start_time` = '".time()."', "; $QryUpdateGalaxy .= "`metal` = `metal` +'".($result['debree']['att'][0]+$result['debree']['def'][0]) . "', "; $QryUpdateGalaxy .= "`crystal` = `crystal` + '" .($result['debree']['att'][1]+$result['debree']['def'][1]). "' "; $QryUpdateGalaxy .= "WHERE "; @@ -834,7 +716,7 @@ private function MissionCaseAttack ($FleetRow) } else { - doquery('UPDATE {{table}} SET fleet_array="'.$fleetArray.'", fleet_amount='.$totalCount.', fleet_mess=1 WHERE fleet_id='.$fleetID,'fleets'); + doquery("UPDATE {{table}} SET fleet_array='$fleetArray', fleet_amount='$totalCount' WHERE fleet_id='$fleetID'",'fleets'); } } @@ -935,7 +817,7 @@ private function MissionCaseAttack ($FleetRow) $style = "red"; } - $raport = "" . $lang['sys_mess_attack_report'] ." [". $FleetRow['fleet_end_galaxy'] .":". $FleetRow['fleet_end_system'] .":". $FleetRow['fleet_end_planet'] ."]"; + $raport = "" . $lang['sys_mess_attack_report'] ." [". $FleetRow['fleet_end_galaxy'] .":". $FleetRow['fleet_end_system'] .":". $FleetRow['fleet_end_planet'] ."]"; SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 3, $lang['sys_mess_tower'], $raport, '' ); @@ -952,7 +834,7 @@ private function MissionCaseAttack ($FleetRow) $style = "green"; } - $raport2 = "" . $lang['sys_mess_attack_report'] ." [". $FleetRow['fleet_end_galaxy'] .":". $FleetRow['fleet_end_system'] .":". $FleetRow['fleet_end_planet'] ."]"; + $raport2 = "" . $lang['sys_mess_attack_report'] ." [". $FleetRow['fleet_end_galaxy'] .":". $FleetRow['fleet_end_system'] .":". $FleetRow['fleet_end_planet'] ."]"; foreach ($users2 as $id) { @@ -977,7 +859,7 @@ private function MissionCaseAttack ($FleetRow) private function MissionCaseACS($FleetRow) { - global $pricelist, $lang, $resource, $CombatCaps, $game_config; + global $pricelist, $lang, $resource, $CombatCaps; if ($FleetRow['fleet_mess'] == 0 && $FleetRow['fleet_start_time'] > time()) { @@ -1001,7 +883,7 @@ private function MissionCaseTransport ( $FleetRow ) $QryStartPlanet .= "`system` = '". $FleetRow['fleet_start_system'] ."' AND "; $QryStartPlanet .= "`planet` = '". $FleetRow['fleet_start_planet'] ."' AND "; $QryStartPlanet .= "`planet_type` = '". $FleetRow['fleet_start_type'] ."';"; - $StartPlanet = doquery( $QryStartPlanet, 'planets', true); + $StartPlanet = doquery( $QryStartPlanet, 'planets', TRUE); $StartName = $StartPlanet['name']; $StartOwner = $StartPlanet['id_owner']; @@ -1011,7 +893,7 @@ private function MissionCaseTransport ( $FleetRow ) $QryTargetPlanet .= "`system` = '". $FleetRow['fleet_end_system'] ."' AND "; $QryTargetPlanet .= "`planet` = '". $FleetRow['fleet_end_planet'] ."' AND "; $QryTargetPlanet .= "`planet_type` = '". $FleetRow['fleet_end_type'] ."';"; - $TargetPlanet = doquery( $QryTargetPlanet, 'planets', true); + $TargetPlanet = doquery( $QryTargetPlanet, 'planets', TRUE); $TargetName = $TargetPlanet['name']; $TargetOwner = $TargetPlanet['id_owner']; @@ -1019,7 +901,7 @@ private function MissionCaseTransport ( $FleetRow ) { if ($FleetRow['fleet_start_time'] < time()) { - $this->StoreGoodsToPlanet ($FleetRow, false); + $this->StoreGoodsToPlanet ($FleetRow, FALSE); $Message = sprintf( $lang['sys_tran_mess_owner'], $TargetName, GetTargetAdressLink($FleetRow, ''), $FleetRow['fleet_resource_metal'], $lang['Metal'], @@ -1054,7 +936,7 @@ private function MissionCaseTransport ( $FleetRow ) { $Message = sprintf ($lang['sys_tran_mess_back'], $StartName, GetStartAdressLink($FleetRow, '')); SendSimpleMessage ( $StartOwner, '', $FleetRow['fleet_end_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_fleetback'], $Message); - $this->RestoreFleetToPlanet ( $FleetRow, true ); + $this->RestoreFleetToPlanet ( $FleetRow, TRUE ); doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets'); } } @@ -1074,7 +956,7 @@ private function MissionCaseStay($FleetRow) $QryGetTargetPlanet .= "`system` = '". $FleetRow['fleet_end_system'] ."' AND "; $QryGetTargetPlanet .= "`planet` = '". $FleetRow['fleet_end_planet'] ."' AND "; $QryGetTargetPlanet .= "`planet_type` = '". $FleetRow['fleet_end_type'] ."';"; - $TargetPlanet = doquery( $QryGetTargetPlanet, 'planets', true); + $TargetPlanet = doquery( $QryGetTargetPlanet, 'planets', TRUE); $TargetUserID = $TargetPlanet['id_owner']; $TargetAdress = sprintf ($lang['sys_adress_planet'], $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']); @@ -1087,7 +969,7 @@ private function MissionCaseStay($FleetRow) $TargetMessage .= $TargetAdress. "". $lang['sys_stay_mess_end'] ."
    ". $TargetAddedGoods; SendSimpleMessage ( $TargetUserID, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_qg'], $lang['sys_stay_mess_stay'], $TargetMessage); - $this->RestoreFleetToPlanet ( $FleetRow, false ); + $this->RestoreFleetToPlanet ( $FleetRow, FALSE ); doquery("DELETE FROM {{table}} WHERE `fleet_id` = '". $FleetRow["fleet_id"] ."';", 'fleets'); } } @@ -1105,7 +987,7 @@ private function MissionCaseStay($FleetRow) $TargetMessage .= $TargetAdress. "". $lang['sys_stay_mess_bend'] ."
    ". $TargetAddedGoods; SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_end_time'], 5, $lang['sys_mess_qg'], $lang['sys_mess_fleetback'], $TargetMessage); - $this->RestoreFleetToPlanet ( $FleetRow, true ); + $this->RestoreFleetToPlanet ( $FleetRow, TRUE ); doquery("DELETE FROM {{table}} WHERE `fleet_id` = '". $FleetRow["fleet_id"] ."';", 'fleets'); } } @@ -1120,7 +1002,7 @@ private function MissionCaseStayAlly($FleetRow) $QryStartPlanet .= "`galaxy` = '". $FleetRow['fleet_start_galaxy'] ."' AND "; $QryStartPlanet .= "`system` = '". $FleetRow['fleet_start_system'] ."' AND "; $QryStartPlanet .= "`planet` = '". $FleetRow['fleet_start_planet'] ."';"; - $StartPlanet = doquery( $QryStartPlanet, 'planets', true); + $StartPlanet = doquery( $QryStartPlanet, 'planets', TRUE); $StartName = $StartPlanet['name']; $StartOwner = $StartPlanet['id_owner']; @@ -1129,7 +1011,7 @@ private function MissionCaseStayAlly($FleetRow) $QryTargetPlanet .= "`galaxy` = '". $FleetRow['fleet_end_galaxy'] ."' AND "; $QryTargetPlanet .= "`system` = '". $FleetRow['fleet_end_system'] ."' AND "; $QryTargetPlanet .= "`planet` = '". $FleetRow['fleet_end_planet'] ."';"; - $TargetPlanet = doquery( $QryTargetPlanet, 'planets', true); + $TargetPlanet = doquery( $QryTargetPlanet, 'planets', TRUE); $TargetName = $TargetPlanet['name']; $TargetOwner = $TargetPlanet['id_owner']; @@ -1174,7 +1056,7 @@ private function MissionCaseStayAlly($FleetRow) { $Message = sprintf ($lang['sys_tran_mess_back'], $StartName, GetStartAdressLink($FleetRow, '')); SendSimpleMessage ( $StartOwner, '', $FleetRow['fleet_end_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_fleetback'], $Message); - $this->RestoreFleetToPlanet ( $FleetRow, true ); + $this->RestoreFleetToPlanet ( $FleetRow, TRUE ); doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets'); } } @@ -1186,7 +1068,7 @@ private function MissionCaseSpy($FleetRow) if ($FleetRow['fleet_start_time'] <= time()) { - $CurrentUser = doquery("SELECT * FROM {{table}} WHERE `id` = '".$FleetRow['fleet_owner']."';", 'users', true); + $CurrentUser = doquery("SELECT * FROM {{table}} WHERE `id` = '".$FleetRow['fleet_owner']."';", 'users', TRUE); $CurrentUserID = $FleetRow['fleet_owner']; $QryGetTargetPlanet = "SELECT * FROM {{table}} "; $QryGetTargetPlanet .= "WHERE "; @@ -1194,12 +1076,12 @@ private function MissionCaseSpy($FleetRow) $QryGetTargetPlanet .= "`system` = '". $FleetRow['fleet_end_system'] ."' AND "; $QryGetTargetPlanet .= "`planet` = '". $FleetRow['fleet_end_planet'] ."' AND "; $QryGetTargetPlanet .= "`planet_type` = '". $FleetRow['fleet_end_type'] ."';"; - $TargetPlanet = doquery( $QryGetTargetPlanet, 'planets', true); + $TargetPlanet = doquery( $QryGetTargetPlanet, 'planets', TRUE); $TargetUserID = $TargetPlanet['id_owner']; - $CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `galaxy` = '".$FleetRow['fleet_start_galaxy']."' AND `system` = '".$FleetRow['fleet_start_system']."' AND `planet` = '".$FleetRow['fleet_start_planet']."';", 'planets', true); - $CurrentSpyLvl = $CurrentUser['spy_tech'] + ($CurrentUser['rpg_espion'] * ESPION); - $TargetUser = doquery("SELECT * FROM {{table}} WHERE `id` = '".$TargetUserID."';", 'users', true); - $TargetSpyLvl = $TargetUser['spy_tech'] + ($TargetUser['rpg_espion'] * ESPION); + $CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `galaxy` = '".$FleetRow['fleet_start_galaxy']."' AND `system` = '".$FleetRow['fleet_start_system']."' AND `planet` = '".$FleetRow['fleet_start_planet']."';", 'planets', TRUE); + $CurrentSpyLvl = $CurrentUser['spy_tech'] + ($CurrentUser['rpg_technocrate'] * TECHNOCRATE_SPY); + $TargetUser = doquery("SELECT * FROM {{table}} WHERE `id` = '".$TargetUserID."';", 'users', TRUE); + $TargetSpyLvl = $TargetUser['spy_tech'] + ($TargetUser['rpg_technocrate'] * TECHNOCRATE_SPY); $fleet = explode(";", $FleetRow['fleet_array']); $fquery = ""; @@ -1211,95 +1093,94 @@ private function MissionCaseSpy($FleetRow) { $a = explode(",", $b); $fquery .= "{$resource[$a[0]]}={$resource[$a[0]]} + {$a[1]}, \n"; - if ($FleetRow["fleet_mess"] != "1") + if ($FleetRow["fleet_mess"] != "1" && $a[0] == "210") { - if ($a[0] == "210") - { - $LS = $a[1]; - $QryTargetGalaxy = "SELECT * FROM {{table}} WHERE "; - $QryTargetGalaxy .= "`galaxy` = '". $FleetRow['fleet_end_galaxy'] ."' AND "; - $QryTargetGalaxy .= "`system` = '". $FleetRow['fleet_end_system'] ."' AND "; - $QryTargetGalaxy .= "`planet` = '". $FleetRow['fleet_end_planet'] ."';"; - $TargetGalaxy = doquery( $QryTargetGalaxy, 'galaxy', true); - $CristalDebris = $TargetGalaxy['crystal']; - $SpyToolDebris = $LS * 300; - - $MaterialsInfo = $this->SpyTarget ( $TargetPlanet, 0, $lang['sys_spy_maretials'] ); - $Materials = $MaterialsInfo['String']; - - $PlanetFleetInfo = $this->SpyTarget ( $TargetPlanet, 1, $lang['sys_spy_fleet'] ); - $PlanetFleet = $Materials; - $PlanetFleet .= $PlanetFleetInfo['String']; - - $PlanetDefenInfo = $this->SpyTarget ( $TargetPlanet, 2, $lang['sys_spy_defenses'] ); - $PlanetDefense = $PlanetFleet; - $PlanetDefense .= $PlanetDefenInfo['String']; - - $PlanetBuildInfo = $this->SpyTarget ( $TargetPlanet, 3, $lang['tech'][0] ); - $PlanetBuildings = $PlanetDefense; - $PlanetBuildings .= $PlanetBuildInfo['String']; - - $TargetTechnInfo = $this->SpyTarget ( $TargetUser, 4, $lang['tech'][100] ); - $TargetTechnos = $PlanetBuildings; - $TargetTechnos .= $TargetTechnInfo['String']; - - $TargetForce = ($PlanetFleetInfo['Count'] * $LS) / 4; - - if ($TargetForce > 100) - $TargetForce = 100; - - $TargetChances = rand(0, $TargetForce); - $SpyerChances = rand(0, 100); - - if ($TargetChances >= $SpyerChances) - $DestProba = "".$lang['sys_mess_spy_destroyed'].""; - elseif ($TargetChances < $SpyerChances) - $DestProba = sprintf( $lang['sys_mess_spy_lostproba'], $TargetChances); - - $AttackLink = "
    "; - $AttackLink .= "". $lang['type_mission'][1] .""; - $AttackLink .= "
    "; - $MessageEnd = "
    ".$DestProba."
    "; - - $pT = ($TargetSpyLvl - $CurrentSpyLvl); - $pW = ($CurrentSpyLvl - $TargetSpyLvl); - if ($TargetSpyLvl > $CurrentSpyLvl) - $ST = ($LS - pow($pT, 2)); - if ($CurrentSpyLvl > $TargetSpyLvl) - $ST = ($LS + pow($pW, 2)); - if ($TargetSpyLvl == $CurrentSpyLvl) - $ST = $CurrentSpyLvl; - if ($ST <= "1") - $SpyMessage = $Materials."
    ".$AttackLink.$MessageEnd; - if ($ST == "2") - $SpyMessage = $PlanetFleet."
    ".$AttackLink.$MessageEnd; - if ($ST == "4" or $ST == "3") - $SpyMessage = $PlanetDefense."
    ".$AttackLink.$MessageEnd; - if ($ST == "5" or $ST == "6") - $SpyMessage = $PlanetBuildings."
    ".$AttackLink.$MessageEnd; - if ($ST >= "7") - $SpyMessage = $TargetTechnos."
    ".$AttackLink.$MessageEnd; - - SendSimpleMessage ( $CurrentUserID, '', $FleetRow['fleet_start_time'], 0, $lang['sys_mess_qg'], $lang['sys_mess_spy_report'], $SpyMessage); - - $TargetMessage = $lang['sys_mess_spy_ennemyfleet'] ." ". $CurrentPlanet['name']; - - if($FleetRow['fleet_start_type'] == 3) - $TargetMessage .= $lang['sys_mess_spy_report_moon'] . " "; - - $TargetMessage .= ""; - $TargetMessage .= "[". $CurrentPlanet["galaxy"] .":". $CurrentPlanet["system"] .":". $CurrentPlanet["planet"] ."] "; - $TargetMessage .= $lang['sys_mess_spy_seen_at'] ." ". $TargetPlanet['name']; - $TargetMessage .= " [". $TargetPlanet["galaxy"] .":". $TargetPlanet["system"] .":". $TargetPlanet["planet"] ."]."; - - SendSimpleMessage ( $TargetUserID, '', $FleetRow['fleet_start_time'], 0, $lang['sys_mess_spy_control'], $lang['sys_mess_spy_activity'], $TargetMessage); - } + $LS = $a[1]; + $QryTargetGalaxy = "SELECT * FROM {{table}} WHERE "; + $QryTargetGalaxy .= "`galaxy` = '". $FleetRow['fleet_end_galaxy'] ."' AND "; + $QryTargetGalaxy .= "`system` = '". $FleetRow['fleet_end_system'] ."' AND "; + $QryTargetGalaxy .= "`planet` = '". $FleetRow['fleet_end_planet'] ."';"; + $TargetGalaxy = doquery( $QryTargetGalaxy, 'galaxy', TRUE); + $CristalDebris = $TargetGalaxy['crystal']; + $SpyToolDebris = $LS * 300; + + $MaterialsInfo = $this->SpyTarget ( $TargetPlanet, 0, $lang['sys_spy_maretials'] ); + $Materials = $MaterialsInfo['String']; + + $PlanetFleetInfo = $this->SpyTarget ( $TargetPlanet, 1, $lang['sys_spy_fleet'] ); + $PlanetFleet = $Materials; + $PlanetFleet .= $PlanetFleetInfo['String']; + + $PlanetDefenInfo = $this->SpyTarget ( $TargetPlanet, 2, $lang['sys_spy_defenses'] ); + $PlanetDefense = $PlanetFleet; + $PlanetDefense .= $PlanetDefenInfo['String']; + + $PlanetBuildInfo = $this->SpyTarget ( $TargetPlanet, 3, $lang['tech'][0] ); + $PlanetBuildings = $PlanetDefense; + $PlanetBuildings .= $PlanetBuildInfo['String']; + + $TargetTechnInfo = $this->SpyTarget ( $TargetUser, 4, $lang['tech'][100] ); + $TargetTechnos = $PlanetBuildings; + $TargetTechnos .= $TargetTechnInfo['String']; + + $TargetForce = ($PlanetFleetInfo['Count'] * $LS) / 4; + + if ($TargetForce > 100) + $TargetForce = 100; + + $TargetChances = rand(0, $TargetForce); + $SpyerChances = rand(0, 100); + + if ($TargetChances >= $SpyerChances) + $DestProba = "".$lang['sys_mess_spy_destroyed'].""; + elseif ($TargetChances < $SpyerChances) + $DestProba = sprintf( $lang['sys_mess_spy_lostproba'], $TargetChances); + + $AttackLink = "
    "; + $AttackLink .= "". $lang['type_mission'][1] .""; + $AttackLink .= "
    "; + $MessageEnd = "
    ".$DestProba."
    "; + + $pT = ($TargetSpyLvl - $CurrentSpyLvl); + $pW = ($CurrentSpyLvl - $TargetSpyLvl); + if ($TargetSpyLvl > $CurrentSpyLvl) + $ST = ($LS - pow($pT, 2)); + if ($CurrentSpyLvl > $TargetSpyLvl) + $ST = ($LS + pow($pW, 2)); + if ($TargetSpyLvl == $CurrentSpyLvl) + $ST = $CurrentSpyLvl; + if ($ST <= "1") + $SpyMessage = $Materials."
    ".$AttackLink.$MessageEnd; + if ($ST == "2") + $SpyMessage = $PlanetFleet."
    ".$AttackLink.$MessageEnd; + if ($ST == "4" or $ST == "3") + $SpyMessage = $PlanetDefense."
    ".$AttackLink.$MessageEnd; + if ($ST == "5" or $ST == "6") + $SpyMessage = $PlanetBuildings."
    ".$AttackLink.$MessageEnd; + if ($ST >= "7") + $SpyMessage = $TargetTechnos."
    ".$AttackLink.$MessageEnd; + + SendSimpleMessage ( $CurrentUserID, '', $FleetRow['fleet_start_time'], 0, $lang['sys_mess_qg'], $lang['sys_mess_spy_report'], $SpyMessage); + + $TargetMessage = $lang['sys_mess_spy_ennemyfleet'] ." ". $CurrentPlanet['name']; + + if($FleetRow['fleet_start_type'] == 3) + $TargetMessage .= $lang['sys_mess_spy_report_moon'] . " "; + + $TargetMessage .= ""; + $TargetMessage .= "[". $CurrentPlanet["galaxy"] .":". $CurrentPlanet["system"] .":". $CurrentPlanet["planet"] ."] "; + $TargetMessage .= $lang['sys_mess_spy_seen_at'] ." ". $TargetPlanet['name']; + $TargetMessage .= " [". $TargetPlanet["galaxy"] .":". $TargetPlanet["system"] .":". $TargetPlanet["planet"] ."]."; + + SendSimpleMessage ( $TargetUserID, '', $FleetRow['fleet_start_time'], 0, $lang['sys_mess_spy_control'], $lang['sys_mess_spy_activity'], $TargetMessage); + if ($TargetChances >= $SpyerChances) { $QryUpdateGalaxy = "UPDATE {{table}} SET "; + $QryUpdateGalaxy .= "`invisible_start_time` = '".time()."', "; $QryUpdateGalaxy .= "`crystal` = `crystal` + '". (0 + $SpyToolDebris) ."' "; $QryUpdateGalaxy .= "WHERE `id_planet` = '". $TargetPlanet['id'] ."';"; doquery( $QryUpdateGalaxy, 'galaxy'); @@ -1313,7 +1194,7 @@ private function MissionCaseSpy($FleetRow) { if ($FleetRow['fleet_end_time'] <= time()) { - $this->RestoreFleetToPlanet ( $FleetRow, true ); + $this->RestoreFleetToPlanet ( $FleetRow, TRUE ); doquery("DELETE FROM {{table}} WHERE `fleet_id` = ". $FleetRow["fleet_id"], 'fleets'); } } @@ -1335,7 +1216,7 @@ private function MissionCaseRecycling ($FleetRow) $QrySelectGalaxy .= "`system` = '".$FleetRow['fleet_end_system']."' AND "; $QrySelectGalaxy .= "`planet` = '".$FleetRow['fleet_end_planet']."' "; $QrySelectGalaxy .= "LIMIT 1;"; - $TargetGalaxy = doquery( $QrySelectGalaxy, 'galaxy', true); + $TargetGalaxy = doquery( $QrySelectGalaxy, 'galaxy', TRUE); $FleetRecord = explode(";", $FleetRow['fleet_array']); $RecyclerCapacity = 0; @@ -1422,112 +1303,111 @@ private function MissionCaseRecycling ($FleetRow) pretty_number($FleetRow['fleet_resource_crystal']), $lang['Crystal'], pretty_number($FleetRow['fleet_resource_deuterium']), $lang['Deuterium'] ); SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_end_time'], 4, $lang['sys_mess_spy_control'], $lang['sys_mess_fleetback'], $Message); - $this->RestoreFleetToPlanet ( $FleetRow, true ); + $this->RestoreFleetToPlanet ( $FleetRow, TRUE ); doquery("DELETE FROM {{table}} WHERE `fleet_id` = '". $FleetRow["fleet_id"] ."';", 'fleets'); } } } -private function MissionCaseColonisation($FleetRow) -{ -global $lang, $resource; -$iMaxColo = mysql_result(doquery("SELECT `colonisation_tech` + 1 FROM `{{table}}` WHERE `id`='". $FleetRow['fleet_owner']."'",'users'), 0); -$iPlanetCount = mysql_result(doquery ("SELECT count(*) FROM {{table}} WHERE `id_owner` = '". $FleetRow['fleet_owner'] ."' AND `planet_type` = '1' AND `destruyed` = '0'", 'planets'), 0); + private function MissionCaseColonisation($FleetRow) + { + global $lang, $resource; -if ($FleetRow['fleet_mess'] == 0) -{ -$iGalaxyPlace = mysql_result(doquery ("SELECT count(*) FROM {{table}} WHERE `galaxy` = '". $FleetRow['fleet_end_galaxy']."' AND `system` = '". $FleetRow['fleet_end_system']."' AND `planet` = '". $FleetRow['fleet_end_planet']."' AND `planet_type` = '". $FleetRow['fleet_end_type']."';", 'planets'), 0); -$TargetAdress = sprintf ($lang['sys_adress_planet'], $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']); -if ($iGalaxyPlace == 0) -{ -if ($iPlanetCount >= $iMaxColo || $iPlanetCount >= MAX_PLAYER_PLANETS) { -$TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_maxcolo']; -SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 6, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage); -doquery("UPDATE `{{table}}` SET `fleet_mess` = '1' WHERE `fleet_id` = ". $FleetRow["fleet_id"], 'fleets'); -} -else -{ -$NewOwnerPlanet = CreateOnePlanetRecord($FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet'], $FleetRow['fleet_owner'], $lang['sys_colo_defaultname'], false); -if ( $NewOwnerPlanet == true ) -{ -$TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_allisok']; -$TheMessage = sprintf( $lang['sys_colo_arrival'] . $TargetAdress .$lang['sys_colo_tran']. $lang['sys_colo_allisok'], -$lang['Metal'], $FleetRow['fleet_resource_metal'], -$lang['Crystal'], $FleetRow['fleet_resource_crystal'], -$lang['Deuterium'], $FleetRow['fleet_resource_deuterium'] ); -SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 6, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage); -if ($FleetRow['fleet_amount'] == 1) { -$this->StoreGoodsToPlanet ($FleetRow, false); -doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets'); -} else { -$this->StoreGoodsToPlanet ($FleetRow, false); -$CurrentFleet = explode(";", $FleetRow['fleet_array']); -$NewFleet = ""; -foreach ($CurrentFleet as $Item => $Group) -{ -if ($Group != '') -{ -$Class = explode (",", $Group); -if ($Class[0] == 208) -{ -if ($Class[1] > 1) -{ -$NewFleet .= $Class[0].",".($Class[1] - 1).";"; -} -} -else -{ -if ($Class[1] <> 0) -{ -$NewFleet .= $Class[0].",".$Class[1].";"; -} -} -} -} -$QryUpdateFleet = "UPDATE {{table}} SET "; -$QryUpdateFleet .= "`fleet_array` = '". $NewFleet ."', "; -$QryUpdateFleet .= "`fleet_amount` = `fleet_amount` - 1, "; -$QryUpdateFleet .= "`fleet_resource_metal` = 0, "; -$QryUpdateFleet .= "`fleet_resource_crystal` = 0, "; -$QryUpdateFleet .= "`fleet_resource_deuterium` = 0, "; -$QryUpdateFleet .= "`fleet_mess` = '1' "; -$QryUpdateFleet .= "WHERE `fleet_id` = '". $FleetRow["fleet_id"] ."';"; -doquery( $QryUpdateFleet, 'fleets'); -} -} -else -{ -$TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_badpos']; -SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 6, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage); -doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = ". $FleetRow["fleet_id"], 'fleets'); -} -} -} -else -{ -$TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_notfree']; -SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_end_time'], 6, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage); -doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = ". $FleetRow["fleet_id"], 'fleets'); -} -} -elseif ($FleetRow['fleet_end_time'] < time()) -{ + $iPlanetCount = mysql_result(doquery ("SELECT count(*) FROM {{table}} WHERE `id_owner` = '". $FleetRow['fleet_owner'] ."' AND `planet_type` = '1' AND `destruyed` = '0'", 'planets'), 0); -$this->RestoreFleetToPlanet ( $FleetRow, true ); -doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets'); -} -} + if ($FleetRow['fleet_mess'] == 0) + { + $iGalaxyPlace = mysql_result(doquery ("SELECT count(*) FROM {{table}} WHERE `galaxy` = '". $FleetRow['fleet_end_galaxy']."' AND `system` = '". $FleetRow['fleet_end_system']."' AND `planet` = '". $FleetRow['fleet_end_planet']."';", 'galaxy'), 0); + $TargetAdress = sprintf ($lang['sys_adress_planet'], $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']); + if ($iGalaxyPlace == 0) + { + if ($iPlanetCount >= MAX_PLAYER_PLANETS) + { + $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_maxcolo'] . MAX_PLAYER_PLANETS . $lang['sys_colo_planet']; + SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage); + doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = ". $FleetRow["fleet_id"], 'fleets'); + } + else + { + $NewOwnerPlanet = CreateOnePlanetRecord($FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet'], $FleetRow['fleet_owner'], $lang['sys_colo_defaultname'], FALSE); + if ( $NewOwnerPlanet == TRUE ) + { + $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_allisok']; + SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage); + if ($FleetRow['fleet_amount'] == 1) + { + $this->StoreGoodsToPlanet ($FleetRow); + doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets'); + } + else + { + $this->StoreGoodsToPlanet ($FleetRow); + $CurrentFleet = explode(";", $FleetRow['fleet_array']); + $NewFleet = ""; + foreach ($CurrentFleet as $Item => $Group) + { + if ($Group != '') + { + $Class = explode (",", $Group); + if ($Class[0] == 208) + { + if ($Class[1] > 1) + { + $NewFleet .= $Class[0].",".($Class[1] - 1).";"; + } + } + else + { + if ($Class[1] <> 0) + { + $NewFleet .= $Class[0].",".$Class[1].";"; + } + } + } + } + $QryUpdateFleet = "UPDATE {{table}} SET "; + $QryUpdateFleet .= "`fleet_array` = '". $NewFleet ."', "; + $QryUpdateFleet .= "`fleet_amount` = `fleet_amount` - 1, "; + $QryUpdateFleet .= "`fleet_resource_metal` = '0' , "; + $QryUpdateFleet .= "`fleet_resource_crystal` = '0' , "; + $QryUpdateFleet .= "`fleet_resource_deuterium` = '0' , "; + $QryUpdateFleet .= "`fleet_mess` = '1' "; + $QryUpdateFleet .= "WHERE `fleet_id` = '". $FleetRow["fleet_id"] ."';"; + doquery( $QryUpdateFleet, 'fleets'); + } + } + else + { + $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_badpos']; + SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage); + doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = ". $FleetRow["fleet_id"], 'fleets'); + } + } + } + else + { + $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_notfree']; + SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_end_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage); + doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = ". $FleetRow["fleet_id"], 'fleets'); + } + } + elseif ($FleetRow['fleet_end_time'] < time()) + { + $this->RestoreFleetToPlanet ( $FleetRow, TRUE ); + doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets'); + } + } private function MissionCaseDestruction($FleetRow) { - global $user, $phpEx, $pricelist, $lang, $resource, $CombatCaps; + global $user, $pricelist, $lang, $resource, $CombatCaps; if ($FleetRow['fleet_start_time'] <= time()) { if ($FleetRow['fleet_mess'] == 0) { if (!isset($CombatCaps[202]['sd'])) - header("location:game." . $phpEx . "?page=fleet"); + header("location:game.php?page=fleet"); $QryTargetPlanet = "SELECT * FROM {{table}} "; $QryTargetPlanet .= "WHERE "; @@ -1535,7 +1415,7 @@ private function MissionCaseDestruction($FleetRow) $QryTargetPlanet .= "`system` = '". $FleetRow['fleet_end_system'] ."' AND "; $QryTargetPlanet .= "`planet` = '". $FleetRow['fleet_end_planet'] ."' AND "; $QryTargetPlanet .= "`planet_type` = '". $FleetRow['fleet_end_type'] ."';"; - $TargetPlanet = doquery( $QryTargetPlanet, 'planets', true); + $TargetPlanet = doquery( $QryTargetPlanet, 'planets', TRUE); $TargetUserID = $TargetPlanet['id_owner']; $QryDepPlanet = "SELECT * FROM {{table}} "; @@ -1544,19 +1424,19 @@ private function MissionCaseDestruction($FleetRow) $QryDepPlanet .= "`system` = '". $FleetRow['fleet_start_system'] ."' AND "; $QryDepPlanet .= "`planet` = '". $FleetRow['fleet_start_planet'] ."' AND "; $QryDepPlanet .= "`planet_type` = '". $FleetRow['fleet_start_type'] ."';"; - $DepPlanet = doquery( $QryDepPlanet, 'planets', true); + $DepPlanet = doquery( $QryDepPlanet, 'planets', TRUE); $DepName = $DepPlanet['name']; $QryCurrentUser = "SELECT * FROM {{table}} "; $QryCurrentUser .= "WHERE "; $QryCurrentUser .= "`id` = '". $FleetRow['fleet_owner'] ."';"; - $CurrentUser = doquery($QryCurrentUser , 'users', true); + $CurrentUser = doquery($QryCurrentUser , 'users', TRUE); $CurrentUserID = $CurrentUser['id']; $QryTargetUser = "SELECT * FROM {{table}} "; $QryTargetUser .= "WHERE "; $QryTargetUser .= "`id` = '". $TargetUserID ."';"; - $TargetUser = doquery($QryTargetUser, 'users', true); + $TargetUser = doquery($QryTargetUser, 'users', TRUE); for ($SetItem = 200; $SetItem < 500; $SetItem++) { @@ -1660,7 +1540,7 @@ private function MissionCaseDestruction($FleetRow) $QryPlanet .= "`system` = '". $FleetRow['fleet_end_system'] ."' AND "; $QryPlanet .= "`planet` = '". $FleetRow['fleet_end_planet'] ."' AND "; $QryPlanet .= "`planet_type` = '1';"; - $Planet = doquery( $QryPlanet, 'planets', true); + $Planet = doquery( $QryPlanet, 'planets', TRUE); $IDPlanet = $Planet['id']; $Qryvue = "UPDATE {{table}} SET "; @@ -1711,6 +1591,7 @@ private function MissionCaseDestruction($FleetRow) doquery( $QryUpdateTarget , 'planets'); $QryUpdateGalaxy = "UPDATE {{table}} SET "; + $QryUpdateGalaxy .= "`invisible_start_time` = '".time()."', "; $QryUpdateGalaxy .= "`metal` = `metal` + '". $zlom['metal'] ."', "; $QryUpdateGalaxy .= "`crystal` = `crystal` + '". $zlom['crystal'] ."' "; $QryUpdateGalaxy .= "WHERE "; @@ -1754,7 +1635,7 @@ private function MissionCaseDestruction($FleetRow) $AttackDate = date("r", $FleetRow["fleet_start_time"]); $title = sprintf ($lang['sys_destruc_title'], $AttackDate); $raport = "
    ". $TitleString ."
    ". $title ."
    "; - $zniszczony = false; + $zniszczony = FALSE; $a_zestrzelona = 0; $AttackTechon['A'] = $CurrentUser["military_tech"] * 10; $AttackTechon['B'] = $CurrentUser["defence_tech"] * 10; @@ -1807,7 +1688,7 @@ private function MissionCaseDestruction($FleetRow) if ($a == 2) $a_zestrzelona = 1; - $zniszczony = true; + $zniszczony = TRUE; $raport .= "
    ". $lang['sys_destroyed']; } @@ -1847,7 +1728,7 @@ private function MissionCaseDestruction($FleetRow) } else { - $zniszczony = true; + $zniszczony = TRUE; $raport .= "
    ". $lang['sys_destroyed']; } @@ -1855,7 +1736,7 @@ private function MissionCaseDestruction($FleetRow) - if (($zniszczony == false) and !($a == 8)) + if (($zniszczony == FALSE) and !($a == 8)) { $AttackWaveStat = sprintf ($lang['sys_attack_attack_wave'], floor($b["atakujacy"]["atak"]), floor($b["wrog"]["tarcza"])); $DefendWavaStat = sprintf ($lang['sys_attack_defend_wave'], floor($b["wrog"]["atak"]), floor($b["atakujacy"]["tarcza"])); @@ -1894,16 +1775,16 @@ private function MissionCaseDestruction($FleetRow) $raport .= "
    "; $rid = md5($raport); - $QryInsertRapport = "INSERT INTO {{table}} SET "; - $QryInsertRapport .= "`time` = UNIX_TIMESTAMP(), "; - $QryInsertRapport .= "`id_owner1` = '". $FleetRow['fleet_owner'] ."', "; - $QryInsertRapport .= "`id_owner2` = '". $TargetUserID ."', "; - $QryInsertRapport .= "`rid` = '". $rid ."', "; - $QryInsertRapport .= "`a_zestrzelona` = '". $a_zestrzelona ."', "; - $QryInsertRapport .= "`raport` = '". addslashes ( $raport ) ."';"; + $owners = $FleetRow['fleet_owner'].",".$TargetUserID; + $QryInsertRapport = "INSERT INTO {{table}} SET "; + $QryInsertRapport .= "`time` = UNIX_TIMESTAMP(), "; + $QryInsertRapport .= "`owners` = '". $owners ."', "; + $QryInsertRapport .= "`rid` = '". $rid ."', "; + $QryInsertRapport .= "`a_zestrzelona` = '". $a_zestrzelona ."', "; + $QryInsertRapport .= "`raport` = '". addslashes ( $raport ) ."';"; doquery( $QryInsertRapport , 'rw'); - $raport = ""; + $raport = ""; $raport .= "
    "; if($FleetResult == "a") @@ -1928,7 +1809,7 @@ private function MissionCaseDestruction($FleetRow) SendSimpleMessage ( $CurrentUserID, '', $FleetRow['fleet_start_time'], 3, $lang['sys_mess_tower'], $lang['sys_mess_destruc_report'], $raport ); - $raport2 = ""; + $raport2 = ""; $raport2 .= "
    "; if($FleetResult == "a") @@ -1989,132 +1870,102 @@ private function MissionCaseDestruction($FleetRow) private function MissionCaseMIP ($FleetRow) { - global $user, $phpEx, $pricelist, $lang, $resource, $CombatCaps; + global $user, $pricelist, $lang, $resource, $CombatCaps; if ($FleetRow['fleet_start_time'] <= time()) { if ($FleetRow['fleet_mess'] == 0) { - if (!isset($CombatCaps[202]['sd'])) - header("location:game." . $phpEx . "?page=fleet"); - - $QryTargetPlanet = "SELECT * FROM {{table}} "; - $QryTargetPlanet .= "WHERE "; - $QryTargetPlanet .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND "; - $QryTargetPlanet .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND "; - $QryTargetPlanet .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' AND "; - $QryTargetPlanet .= "`planet_type` = '" . $FleetRow['fleet_end_type'] . "';"; - $planet = doquery($QryTargetPlanet, 'planets', true); - - $QrySelect = "SELECT defence_tech,military_tech FROM {{table}} "; - $QrySelect .= "WHERE "; - $QrySelect .= "`id` = '".$FleetRow['fleet_owner']."';"; - $UserFleet = doquery( $QrySelect, 'users',true); - - $verteidiger = $UserFleet["defence_tech"]; - $angreifer = $UserFleet["military_tech"]; - - $ids = array( - 0 => 401, - 1 => 402, - 2 => 403, - 3 => 404, - 4 => 405, - 5 => 406, - 6 => 407, - 7 => 408, - 8 => 502, - 9 => 503, - 10 => 409); - - $def = array( - 0 => $planet['misil_launcher'], - 1 => $planet['small_laser'], - 2 => $planet['big_laser'], - 3 => $planet['gauss_canyon'], - 4 => $planet['ionic_canyon'], - 5 => $planet['buster_canyon'], - 6 => $planet['small_protection_shield'], - 7 => $planet['big_protection_shield'], - 8 => $planet['interceptor_misil'], - 9 => $planet['interplanetary_misil'], - 10 => $planet['planet_protector']); - - $DefenseLabel = array(0 => $lang['tech'][401], - 1 => $lang['tech'][402], - 2 => $lang['tech'][403], - 3 => $lang['tech'][404], - 4 => $lang['tech'][405], - 5 => $lang['tech'][406], - 6 => $lang['tech'][407], - 7 => $lang['tech'][408], - 8 => $lang['tech'][502], - 9 => $lang['tech'][503], - 10 => $lang['tech'][409]); - - $message = ''; + $planet = doquery('SELECT * FROM {{table}} WHERE `galaxy` = '.$FleetRow['fleet_end_galaxy'].' AND `system` = '.$FleetRow['fleet_end_system'].' AND `planet` = '.$FleetRow['fleet_end_planet'].' AND `planet_type` = '.$FleetRow['fleet_end_type'], 'planets', TRUE); + $Target = doquery('SELECT id, defence_tech FROM {{table}} WHERE `galaxy` = '.$FleetRow['fleet_end_galaxy'].' AND `system` = '.$FleetRow['fleet_end_system'].' AND `planet` = '.$FleetRow['fleet_end_planet'], 'users', TRUE); if ($planet['interceptor_misil'] >= $FleetRow['fleet_amount']) { - $message = 'Tus misiles de intersepción destruyeron los misiles interplanetarios
    '; - $x = $resource[$ids[8]]; - doquery("UPDATE {{table}} SET " . $x . " = " . $x . "-" . $FleetRow['fleet_amount'] . " WHERE id = " . $planet['id'], 'planets'); + $message = $lang["ma_all_destroyed"] . '
    '; + doquery("UPDATE {{table}} SET ".$resource[502]." = ".$resource[502]." - ".$FleetRow['fleet_amount']." WHERE id = ".$planet['id'], 'planets'); } else { + doquery("UPDATE {{table}} SET ".$resource[502]." = '0' WHERE id = ".$planet['id'], 'planets'); + if ($planet['interceptor_misil'] > 0) + $message .= $planet['interceptor_misil'].$lang['ma_some_destroyed']."
    "; + + $attack = floor(($FleetRow['fleet_amount'] - $planet['interceptor_misil']) * ($CombatCaps[503]['attack'] * (1 + ($user["military_tech"] / 10)))); + + switch ($FleetRow['fleet_target_obj']) { - $x = $resource[$ids[8]]; - doquery("UPDATE {{table}} SET " . $x . " = '0' WHERE id = " . $planet['id'], 'planets'); - $message = $planet['interceptor_misil'] . "interplanetario misiles fueron destruidos por misiles interceptores.
    "; - $irak = $this->raketenangriff($verteidiger, $angreifer, $FleetRow['fleet_amount']-$planet['interceptor_misil'], $def, $FleetRow['fleet_target_obj']); + case 0: + $attack_order = Array(401, 402, 403, 404, 405, 406, 407, 408, 503); + break; + case 1: + $attack_order = Array(402, 401, 403, 404, 405, 406, 407, 408, 503); + break; + case 2: + $attack_order = Array(403, 401, 402, 404, 405, 406, 407, 408, 503); + break; + case 3: + $attack_order = Array(404, 401, 402, 403, 405, 406, 407, 408, 503); + break; + case 4: + $attack_order = Array(405, 401, 402, 403, 404, 406, 407, 408, 503); + break; + case 5: + $attack_order = Array(406, 401, 402, 403, 404, 405, 407, 408, 503); + break; + case 6: + $attack_order = Array(407, 401, 402, 403, 404, 405, 406, 408, 503); + break; + case 7: + $attack_order = Array(408, 401, 402, 403, 404, 405, 406, 407, 503); + break; + case 8: + $attack_order = Array(401, 402, 403, 404, 405, 406, 407, 408, 503); + break; } - $irak = $this->raketenangriff($verteidiger, $angreifer, $FleetRow['fleet_amount'], $def, $FleetRow['fleet_target_obj']); - - foreach ($irak['zerstoert'] as $id => $anzahl) + for ($t = 0; $t < 10; $t++) { - if ($id < 10) + $n = $attack_order[$t]; + + if ($planet[$resource[$n]]) { - if ($id != 8) - $message .= $DefenseLabel[$id] . " (- " . $anzahl . ")
    "; + $defense = (($pricelist[$n]['metal'] + $pricelist[$n]['crystal']) / 10) * (1 + ($Target['defence_tech'] / 10)); - $x = $resource[$ids[$id]]; - $x1 = $x ."-". $anzahl; - doquery("UPDATE {{table}} SET " . $x . " = " . $x1 . " WHERE id = " . $planet['id'], 'planets'); + if ($attack >= ($defense * $planet[$resource[$n]])) + { + $destroyed = $planet[$resource[$n]]; + } + else + { + $destroyed = floor($attack / $defense); + } + + $attack -= $destroyed * $defense; + + if ($destroyed != 0) + { + $message .= $lang['tech'][$n] . " (-" . $destroyed . ")
    "; + doquery("UPDATE {{table}} SET ".$resource[$n]." = ".$resource[$n]." - ".$destroyed." WHERE id = ".$planet['id'], 'planets'); + } } } } - $UserPlanet = doquery("SELECT name FROM {{table}} WHERE id = '" . $FleetRow['fleet_owner'] . "'", 'planets',true); - $name = $UserPlanet['name']; - $name_deffer = $QryTargetPlanet['name']; - $message_vorlage = 'Un ataque con misiles (' .$FleetRow['fleet_amount']. ') de ' .$name. ' '; - $message_vorlage .= 'al planeta ' .$name_deffer.'

    '; + + $UserPlanet = doquery('SELECT name FROM {{table}} WHERE `galaxy` = '.$FleetRow['fleet_start_galaxy'].' AND `system` = '.$FleetRow['fleet_start_system'].' AND `planet` = '.$FleetRow['fleet_start_planet'].' AND `planet_type` = '.$FleetRow['fleet_start_type'], 'planets', TRUE); + + $search=array('%1%','%2%','%3%'); + $replace=array($FleetRow['fleet_amount'], $UserPlanet['name'].' ['. $FleetRow['fleet_start_galaxy'] .':'. $FleetRow['fleet_start_system'] .':'. $FleetRow['fleet_start_planet'].'] ', $planet['name']. ' ['. $FleetRow['fleet_end_galaxy'] .':'. $FleetRow['fleet_end_system'] .':'. $FleetRow['fleet_end_planet'].'] '); + $message_vorlage=str_replace($search,$replace,$lang['ma_missile_string']); if (empty($message)) - $message = "Tu planeta no tenia defensa!"; - - doquery("INSERT INTO {{table}} SET - `message_owner`='" . $FleetRow['fleet_target_owner'] . "', - `message_sender`='".$UserPlanet['id']."', - `message_time`=UNIX_TIMESTAMP(), - `message_type`='3', - `message_from`='Torre de Control', - `message_subject`='Ataque con misiles', - `message_text`='" . $message_vorlage . $message . "'" , 'messages'); - doquery("INSERT INTO {{table}} SET - `message_owner`='" . $UserPlanet['id'] . "', - `message_sender`='".$FleetRow['fleet_target_owner']."', - `message_time`=UNIX_TIMESTAMP(), - `message_type`='3', - `message_from`='Torre de Control', - `message_subject`='Ataque con misiles', - `message_text`='" . $message_vorlage . $message . "'" , 'messages'); + $message = $lang['ma_planet_without_defens']; + + SendSimpleMessage($Target['id'], '', $FleetRow['fleet_end_time'], 3, $lang['sys_mess_tower'], $lang['gl_missile_attack'], $message_vorlage . $message); doquery("DELETE FROM {{table}} WHERE fleet_id = '" . intval($FleetRow['fleet_id']) . "'", 'fleets'); } } - $FleetRow['fleet_start_time'] <= time(); } private function MissionCaseExpedition($FleetRow) @@ -2129,41 +1980,39 @@ private function MissionCaseExpedition($FleetRow) { if ($FleetRow['fleet_end_stay'] < time()) { - $PointsFlotte = array( - 202 => 1.0, - 203 => 1.5, - 204 => 0.5, - 205 => 1.5, - 206 => 2.0, - 207 => 2.5, - 208 => 0.5, - 209 => 1.0, - 210 => 0.01, - 211 => 3.0, - 212 => 0.0, - 213 => 3.5, - 214 => 5.0, - 215 => 3.2, - 216 => 3.5, - ); - - $RatioGain = array ( - 202 => 0.1, - 203 => 0.1, - 204 => 0.1, - 205 => 0.5, - 206 => 0.25, - 207 => 0.125, - 208 => 0.5, - 209 => 0.1, - 210 => 0.1, - 211 => 0.0625, - 212 => 0.0, - 213 => 0.0625, - 214 => 0.03125, - 215 => 0.0625, - 216 => 0.03125, - ); + $PointsFlotte = array ( + 202 => 1.0, + 203 => 1.5, + 204 => 0.5, + 205 => 1.5, + 206 => 2.0, + 207 => 2.5, + 208 => 0.5, + 209 => 1.0, + 210 => 0.01, + 211 => 3.0, + 212 => 0.0, + 213 => 3.5, + 214 => 5.0, + 215 => 3.2, + ); + + $RatioGain = array ( + 202 => 0.1, + 203 => 0.1, + 204 => 0.1, + 205 => 0.5, + 206 => 0.25, + 207 => 0.125, + 208 => 0.5, + 209 => 0.1, + 210 => 0.1, + 211 => 0.0625, + 212 => 0.0, + 213 => 0.0625, + 214 => 0.03125, + 215 => 0.0625, + ); $FleetStayDuration = ($FleetRow['fleet_end_stay'] - $FleetRow['fleet_start_time']) / 3600; $farray = explode(";", $FleetRow['fleet_array']); @@ -2176,7 +2025,7 @@ private function MissionCaseExpedition($FleetRow) $TypeVaisseau = $Class[0]; $NbreVaisseau = $Class[1]; $LaFlotte[$TypeVaisseau] = $NbreVaisseau; - $FleetCapacity += $pricelist[$TypeVaisseau]['capacity']; + $FleetCapacity += $pricelist[$TypeVaisseau]['capacity'] * $NbreVaisseau; $FleetPoints += ($NbreVaisseau * $PointsFlotte[$TypeVaisseau]); } } @@ -2192,25 +2041,38 @@ private function MissionCaseExpedition($FleetRow) $Hasard += 1; $LostAmount = (($Hasard * 33) + 1) / 100; - if ($LostAmount == 100) + if ($LostAmount == 1) { SendSimpleMessage ( $FleetOwner, '', $FleetRow['fleet_end_stay'], 15, $MessSender, $MessTitle, $lang['sys_expe_blackholl_2'] ); doquery ("DELETE FROM {{table}} WHERE `fleet_id` = ". $FleetRow["fleet_id"], 'fleets'); } else { + $all_destroyed = TRUE; foreach ($LaFlotte as $Ship => $Count) { - $LostShips[$Ship] = intval($Count * $LostAmount); - $NewFleetArray .= $Ship.",". ($Count - $LostShips[$Ship]) .";"; + if(floor($Count * $LostAmount)!=0) + { + $LostShips[$Ship] = floor($Count * $LostAmount); + $NewFleetArray .= $Ship.",". ($Count - $LostShips[$Ship]) .";"; + $all_destroyed = FALSE; + } + } + if(!$all_destroyed) + { + $QryUpdateFleet = "UPDATE {{table}} SET "; + $QryUpdateFleet .= "`fleet_array` = '". $NewFleetArray ."', "; + $QryUpdateFleet .= "`fleet_mess` = '1' "; + $QryUpdateFleet .= "WHERE "; + $QryUpdateFleet .= "`fleet_id` = '". $FleetRow["fleet_id"] ."';"; + doquery( $QryUpdateFleet, 'fleets'); + SendSimpleMessage ( $FleetOwner, '', $FleetRow['fleet_end_stay'], 15, $MessSender, $MessTitle, $lang['sys_expe_blackholl_1'] ); + } + else + { + SendSimpleMessage ( $FleetOwner, '', $FleetRow['fleet_end_stay'], 15, $MessSender, $MessTitle, $lang['sys_expe_blackholl_2'] ); + doquery ("DELETE FROM {{table}} WHERE `fleet_id` = ". $FleetRow["fleet_id"], 'fleets'); } - $QryUpdateFleet = "UPDATE {{table}} SET "; - $QryUpdateFleet .= "`fleet_array` = '". $NewFleetArray ."', "; - $QryUpdateFleet .= "`fleet_mess` = '1' "; - $QryUpdateFleet .= "WHERE "; - $QryUpdateFleet .= "`fleet_id` = '". $FleetRow["fleet_id"] ."';"; - doquery( $QryUpdateFleet, 'fleets'); - SendSimpleMessage ( $FleetOwner, '', $FleetRow['fleet_end_stay'], 15, $MessSender, $MessTitle, $lang['sys_expe_blackholl_1'] ); } } elseif ($Hasard == 3) @@ -2222,13 +2084,14 @@ private function MissionCaseExpedition($FleetRow) { if ($FleetCapacity > 5000) { - $MinCapacity = $FleetCapacity - 5000; - $MaxCapacity = $FleetCapacity; - $FoundGoods = rand($MinCapacity, $MaxCapacity); - $FoundMetal = intval($FoundGoods / 2); - $FoundCrist = intval($FoundGoods / 4); - $FoundDeute = intval($FoundGoods / 6); - $FoundDark = intval($FoundGoods / 20); + $MinCapacity = $FleetCapacity - 5000; + $MaxCapacity = $FleetCapacity; + $FoundGoods = rand($MinCapacity, $MaxCapacity); + $FoundMetal = intval($FoundGoods / 2); + $FoundCrist = intval($FoundGoods / 4); + $FoundDeute = intval($FoundGoods / 6); + $FoundDark = ( $FleetCapacity > 10000 ) ? intval ( 3 * log ( $FleetCapacity / 10000 ) * 100 ) : 0; + $FoundDark = mt_rand ( $FoundDark / 2 , $FoundDark ); $QryUpdateFleet = "UPDATE {{table}} SET "; $QryUpdateFleet .= "`fleet_resource_metal` = `fleet_resource_metal` + '". $FoundMetal ."', "; @@ -2257,7 +2120,7 @@ private function MissionCaseExpedition($FleetRow) elseif ($Hasard >= 8 && $Hasard < 11) { $FoundChance = $FleetPoints / $FleetCount; - for ($Ship = 202; $Ship < 216; $Ship++) + for ($Ship = 202; $Ship <= 215; $Ship++) { if ($LaFlotte[$Ship] != 0) { @@ -2275,7 +2138,7 @@ private function MissionCaseExpedition($FleetRow) $NewFleetArray .= $Ship.",". $Count .";"; } - if ( $FoundShip != null ) + if ( $FoundShip != NULL ) { foreach ($FoundShip as $Ship => $Count) { @@ -2314,6 +2177,7 @@ private function MissionCaseExpedition($FleetRow) $QryUpdatePlanet .= "`metal` = `metal` + ". $FleetRow['fleet_resource_metal'] .", "; $QryUpdatePlanet .= "`crystal` = `crystal` + ". $FleetRow['fleet_resource_crystal'] .", "; $QryUpdatePlanet .= "`deuterium` = `deuterium` + ". $FleetRow['fleet_resource_deuterium'] ." "; + $QryUpdatePlanet .= "WHERE "; $QryUpdatePlanet .= "`galaxy` = '". $FleetRow['fleet_start_galaxy'] ."' AND "; $QryUpdatePlanet .= "`system` = '". $FleetRow['fleet_start_system'] ."' AND "; @@ -2351,6 +2215,7 @@ public function __construct (&$planet) $QryFleet .= "( `fleet_start_time` < '". time() ."' OR `fleet_end_time` < '". time() ."' );"; $fleetquery = doquery( $QryFleet, 'fleets' ); + while ($CurrentFleet = mysql_fetch_array($fleetquery)) { switch ($CurrentFleet["fleet_mission"]) diff --git a/includes/classes/class.FlyingFleetsTable.php b/includes/classes/class.FlyingFleetsTable.php index 2dc3d9e..56acdeb 100644 --- a/includes/classes/class.FlyingFleetsTable.php +++ b/includes/classes/class.FlyingFleetsTable.php @@ -1,23 +1,10 @@ "; $FleetPopup .= "');\" onmouseout=\"return nd();\" class=\"". $FleetType ."\">". $Texte ."
    "; + + return $FleetPopup; } private function BuildHostileFleetPlayerLink($FleetRow) { - global $lang, $dpath; + global $lang; - $PlayerName = doquery ("SELECT `username` FROM {{table}} WHERE `id` = '". intval($FleetRow['fleet_owner'])."';", 'users', true); + $PlayerName = doquery ("SELECT `username` FROM {{table}} WHERE `id` = '". intval($FleetRow['fleet_owner'])."';", 'users', TRUE); $Link = $PlayerName['username']. " "; $Link .= ""; - $Link .= ""; + $Link .= ""; return $Link; } @@ -131,8 +120,8 @@ public function BuildFlyingFleetTable () while ( $CurrentFleet = mysql_fetch_assoc( $FlyingFleets ) ) { - $FleetOwner = doquery("SELECT `username` FROM {{table}} WHERE `id` = '". intval($CurrentFleet['fleet_owner']) ."';", 'users', true); - $TargetOwner = doquery("SELECT `username` FROM {{table}} WHERE `id` = '". intval($CurrentFleet['fleet_target_owner']) ."';", 'users', true); + $FleetOwner = doquery("SELECT `username` FROM {{table}} WHERE `id` = '". intval($CurrentFleet['fleet_owner']) ."';", 'users', TRUE); + $TargetOwner = doquery("SELECT `username` FROM {{table}} WHERE `id` = '". intval($CurrentFleet['fleet_target_owner']) ."';", 'users', TRUE); $Bloc['Id'] = $CurrentFleet['fleet_id']; $Bloc['Mission'] = $this->CreateFleetPopupedMissionLink ( $CurrentFleet, $lang['type_mission'][ $CurrentFleet['fleet_mission'] ], '' ); @@ -191,18 +180,18 @@ public function BuildFleetEventTable($FleetRow, $Status, $Owner, $Label, $Record $FleetStatus = array ( 0 => 'flight', 1 => 'holding', 2 => 'return' ); - if ( $Owner == true ) + if ( $Owner == TRUE ) $FleetPrefix = 'own'; else $FleetPrefix = ''; $RowsTPL = gettemplate ('overview/overview_fleet_event'); $MissionType = $FleetRow['fleet_mission']; - $FleetContent = $this->CreateFleetPopupedFleetLink ( $FleetRow, "ôëîòîâ", $FleetPrefix . $FleetStyle[ $MissionType ] ); + $FleetContent = $this->CreateFleetPopupedFleetLink ( $FleetRow, "flotas", $FleetPrefix . $FleetStyle[ $MissionType ] ); $FleetCapacity = $this->CreateFleetPopupedMissionLink ( $FleetRow, $lang['type_mission'][ $MissionType ], $FleetPrefix . $FleetStyle[ $MissionType ] ); - $StartPlanet = doquery("SELECT `name` FROM {{table}} WHERE `galaxy` = '".intval($FleetRow['fleet_start_galaxy'])."' AND `system` = '".intval($FleetRow['fleet_start_system'])."' AND `planet` = '".intval($FleetRow['fleet_start_planet'])."' AND `planet_type` = '".intval($FleetRow['fleet_start_type'])."';", 'planets', true); + $StartPlanet = doquery("SELECT `name` FROM {{table}} WHERE `galaxy` = '".intval($FleetRow['fleet_start_galaxy'])."' AND `system` = '".intval($FleetRow['fleet_start_system'])."' AND `planet` = '".intval($FleetRow['fleet_start_planet'])."' AND `planet_type` = '".intval($FleetRow['fleet_start_type'])."';", 'planets', TRUE); $StartType = $FleetRow['fleet_start_type']; - $TargetPlanet = doquery("SELECT `name` FROM {{table}} WHERE `galaxy` = '".intval($FleetRow['fleet_end_galaxy'])."' AND `system` = '".intval($FleetRow['fleet_end_system'])."' AND `planet` = '".intval($FleetRow['fleet_end_planet'])."' AND `planet_type` = '".intval($FleetRow['fleet_end_type'])."';", 'planets', true); + $TargetPlanet = doquery("SELECT `name` FROM {{table}} WHERE `galaxy` = '".intval($FleetRow['fleet_end_galaxy'])."' AND `system` = '".intval($FleetRow['fleet_end_system'])."' AND `planet` = '".intval($FleetRow['fleet_end_planet'])."' AND `planet_type` = '".intval($FleetRow['fleet_end_type'])."';", 'planets', TRUE); $TargetType = $FleetRow['fleet_end_type']; if ($Status != 2) @@ -221,6 +210,7 @@ public function BuildFleetEventTable($FleetRow, $Status, $Owner, $Label, $Record $TargetID = $lang['cff_the_planet']; elseif ($TargetType == 2) $TargetID = $lang['cff_debris_field']; + elseif ($TargetType == 3) $TargetID = $lang['cff_to_the_moon']; } @@ -269,7 +259,7 @@ public function BuildFleetEventTable($FleetRow, $Status, $Owner, $Label, $Record } else { - if ($Owner == true) + if ($Owner == TRUE) { $EventString = $lang['cff_one_of_your']; $EventString .= $FleetContent; @@ -317,10 +307,10 @@ public function BuildFleetEventTable($FleetRow, $Status, $Owner, $Label, $Record $bloc['fleet_status'] = $FleetStatus[ $Status ]; $bloc['fleet_prefix'] = $FleetPrefix; $bloc['fleet_style'] = $FleetStyle[ $MissionType ]; - $bloc['fleet_javai'] = InsertJavaScriptChronoApplet ( $Label, $Record, $Rest, true ); + $bloc['fleet_javai'] = InsertJavaScriptChronoApplet ( $Label, $Record, $Rest, TRUE ); $bloc['fleet_order'] = $Label . $Record; $bloc['fleet_descr'] = $EventString; - $bloc['fleet_javas'] = InsertJavaScriptChronoApplet ( $Label, $Record, $Rest, false ); + $bloc['fleet_javas'] = InsertJavaScriptChronoApplet ( $Label, $Record, $Rest, FALSE ); return parsetemplate($RowsTPL, $bloc); } diff --git a/includes/classes/class.GalaxyRows.php b/includes/classes/class.GalaxyRows.php index fad1152..d9f1e98 100644 --- a/includes/classes/class.GalaxyRows.php +++ b/includes/classes/class.GalaxyRows.php @@ -1,23 +1,10 @@ "; + global $user, $lang; - if ($GalaxyRowPlayer['id'] != $user['id']) + if ($GalaxyInfo['id'] != $user['id']) { if ($CurrentMIP <> 0) { - if ($GalaxyRowUser['id'] != $user['id']) + if ($GalaxyInfo['id'] != $user['id']) { - if ($GalaxyRowPlanet["galaxy"] == $CurrentGalaxy) + if ($GalaxyInfo["galaxy"] == $CurrentGalaxy) { $Range = $this->GetMissileRange(); $SystemLimitMin = $CurrentSystem - $Range; @@ -97,272 +85,213 @@ public function GalaxyRowActions($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowPlayer, { if ($System >= $SystemLimitMin) { - $MissileBtn = true; + $MissileBtn = TRUE; } else { - $MissileBtn = false; + $MissileBtn = FALSE; } } else { - $MissileBtn = false; + $MissileBtn = FALSE; } } else { - $MissileBtn = false; + $MissileBtn = FALSE; } } else { - $MissileBtn = false; + $MissileBtn = FALSE; } } else { - $MissileBtn = false; + $MissileBtn = FALSE; } - if ($GalaxyRowPlayer && $GalaxyRowPlanet["destruyed"] == 0) + if ($GalaxyInfo && $GalaxyInfo["destruyed"] == 0) { - if ($user["settings_esp"] == "1" && $GalaxyRowPlayer['id']) + if ($user["settings_esp"] == "1" && $GalaxyInfo['id']) { - $Result .= ""; - $Result .= ""; - $Result .= " "; + $links .= ""; + $links .= ""; + $links .= " "; } - if ($user["settings_wri"] == "1" && $GalaxyRowPlayer['id']) + if ($user["settings_wri"] == "1" && $GalaxyInfo['id']) { - $Result .= ""; - $Result .= ""; - $Result .= " "; + $links .= ""; + $links .= ""; + $links .= " "; } - if ($user["settings_bud"] == "1" && $GalaxyRowPlayer['id']) + if ($user["settings_bud"] == "1" && $GalaxyInfo['id']) { - $Result .= ""; - $Result .= ""; - $Result .= " "; + $links .= ""; + $links .= ""; + $links .= " "; } - if ($user["settings_mis"] == "1" && $MissileBtn == true && $GalaxyRowPlayer['id']) + if ($user["settings_mis"] == "1" && $MissileBtn == TRUE && $GalaxyInfo['id']) { - $Result .= ""; - $Result .= ""; + $links .= ""; + $links .= ""; } } } - $Result .= ""; - - return $Result; + return $links; } - public function GalaxyRowAlly($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType) + public function GalaxyRowAlly($GalaxyInfo, $Galaxy, $System, $Planet) { global $user, $lang; - $Result = ""; - if ($GalaxyRowUser['ally_id'] && $GalaxyRowUser['ally_id'] != 0) + if ($GalaxyInfo['ally_id'] && $GalaxyInfo['ally_id'] != 0) { - $allyquery = doquery("SELECT * FROM {{table}} WHERE id=" . intval($GalaxyRowUser['ally_id']), "alliance", true); - if ($allyquery) + if ($GalaxyInfo['ally_members'] > 1) + { + $add = $lang['gl_member_add']; + } + else { - $members_count = doquery("SELECT COUNT(DISTINCT(id)) FROM {{table}} WHERE ally_id=" . intval($allyquery['id']) . ";", "users", true); + $add = ""; + } - if ($members_count[0] > 1) - $add = $lang['gl_member_add']; - else - $add = ""; - - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - if ($allyquery["ally_web"] != "") - { - $Result .= ""; - $Result .= ""; - } - $Result .= ""; - $Result .= "
    ".$lang['gl_alliance_page']."
    ".$lang['gl_see_on_stats']."
    ".$lang['gl_alliance_web_page']."
    "; - $Result .= ""; - $Result .= "\""; - $Result .= ", STICKY, MOUSEOFF, DELAY, 750, CENTER, OFFSETX, -40, OFFSETY, -40 );'"; - $Result .= " onmouseout='return nd();'>"; - if ($user['ally_id'] == $GalaxyRowPlayer['ally_id']) - { - $Result .= "". $allyquery['ally_tag'] ."
    "; - } - elseif ($GalaxyRowUser['ally_id'] == $user['ally_id']) - { - $Result .= "".$allyquery['ally_tag'] .""; - } - else - { - $Result .= $allyquery['ally_tag'] .""; - } + $parse = $lang; + $parse['ally_name'] = $GalaxyInfo['ally_name']; + $parse['ally_members'] = $GalaxyInfo['ally_members']; + $parse['add'] = $add; + $parse['ally_id'] = $GalaxyInfo['ally_id']; + + if ($GalaxyInfo["ally_web"] != "") + { + $parse['web'] = ""; + $parse['web'] .= "".$lang['gl_alliance_web_page'].""; + } + + if ($user['ally_id'] == $GalaxyInfo['ally_id']) + { + $parse['tag'] = "". $GalaxyInfo['ally_tag'] .""; + } + elseif ($GalaxyInfo['ally_id'] == $user['ally_id']) + { + $parse['tag'] = "".$GalaxyInfo['ally_tag'] .""; + } + else + { + $parse['tag'] = $GalaxyInfo['ally_tag']; } } - $Result .= ""; - return $Result; + return parsetemplate(gettemplate('galaxy/galaxy_alliance_block'), $parse); } - public function GalaxyRowDebris($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType, $CurrentRC) + public function GalaxyRowDebris($GalaxyInfo, $Galaxy, $System, $Planet, $PlanetType, $CurrentRC) { - global $dpath, $user, $pricelist, $lang; + global $user, $pricelist, $lang; - $Result = ""; - if ($GalaxyRow) + if ($GalaxyInfo) { - if ($GalaxyRow["metal"] != 0 || $GalaxyRow["crystal"] != 0) + if ($GalaxyInfo["metal"]+$GalaxyInfo["crystal"] >= DEBRIS_MIN_VISIBLE_SIZE) { - $RecNeeded = ceil(($GalaxyRow["metal"] + $GalaxyRow["crystal"]) / $pricelist[209]['capacity']); + $RecNeeded = ceil(($GalaxyInfo["metal"] + $GalaxyInfo["crystal"]) / $pricelist[209]['capacity']); if ($RecNeeded < $CurrentRC) + { $RecSended = $RecNeeded; + } elseif ($RecNeeded >= $CurrentRC) + { $RecSended = $CurrentRC; + } else + { $RecSended = $RecyclerCount; + } - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= "
    ".$lang['gl_resources'].":
    ".$lang['Metal'].": ". number_format( $GalaxyRow['metal'], 0, '', '.') ."
    ".$lang['Crystal'].": ". number_format( $GalaxyRow['crystal'], 0, '', '.') ."
    ".$lang['gl_actions'].":
    "; - $Result .= "".$lang['gl_collect'].""; - $Result .= "
    "; - $Result .= ""; - $Result .= ""; - $Result .= "\""; - $Result .= ", STICKY, MOUSEOFF, DELAY, 750, CENTER, OFFSETX, -40, OFFSETY, -40 );'"; - $Result .= " onmouseout='return nd();'>"; - $Result .= "
    "; + $parse = $lang; + $parse['dpath'] = DPATH; + $parse['galaxy'] = $Galaxy; + $parse['system'] = $System; + $parse['planet'] = $Planet; + $parse['planettype'] = $PlanetType; + $parse['recsended'] = $RecSended; + $parse['debris_metal'] = number_format( $GalaxyInfo['metal'], 0, '', '.'); + $parse['debris_crystal'] = number_format( $GalaxyInfo['crystal'], 0, '', '.'); + + return parsetemplate(gettemplate('galaxy/galaxy_debris_block'), $parse); } } - $Result .= ""; - return $Result; + return ''; } - public function GalaxyRowMoon($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType) + public function GalaxyRowMoon($GalaxyInfo, $Galaxy, $System, $Planet, $PlanetType) { - global $user, $dpath, $CanDestroy, $lang; + global $user, $CanDestroy, $lang; - $Result = ""; - if ($GalaxyRowUser['id'] != $user['id']) + if ($GalaxyInfo['id'] != $user['id']) $MissionType6Link = "".$lang['type_mission'][6]."

    "; - elseif ($GalaxyRowUser['id'] == $user['id']) + elseif ($GalaxyInfo['id'] == $user['id']) $MissionType6Link = ""; - if ($GalaxyRowUser['id'] != $user['id']) + if ($GalaxyInfo['id'] != $user['id']) $MissionType1Link = "".$lang['type_mission'][1]."
    "; - elseif ($GalaxyRowUser['id'] == $user['id']) + elseif ($GalaxyInfo['id'] == $user['id']) $MissionType1Link = ""; - if ($GalaxyRowUser['id'] != $user['id']) + if ($GalaxyInfo['id'] != $user['id']) $MissionType5Link = "".$lang['type_mission'][5]."
    "; - elseif ($GalaxyRowUser['id'] == $user['id']) + elseif ($GalaxyInfo['id'] == $user['id']) $MissionType5Link = ""; - if ($GalaxyRowUser['id'] == $user['id']) + if ($GalaxyInfo['id'] == $user['id']) $MissionType4Link = "".$lang['type_mission'][4]."
    "; - elseif ($GalaxyRowUser['id'] != $user['id']) + elseif ($GalaxyInfo['id'] != $user['id']) $MissionType4Link = ""; - if ($GalaxyRowUser['id'] != $user['id']) + if ($GalaxyInfo['id'] != $user['id']) if ($CanDestroy > 0) $MissionType9Link = "".$lang['type_mission'][9].""; else $MissionType9Link = ""; - elseif ($GalaxyRowUser['id'] == $user['id']) + elseif ($GalaxyInfo['id'] == $user['id']) $MissionType9Link = ""; $MissionType3Link = "".$lang['type_mission'][3]."
    "; - if ($GalaxyRow && $GalaxyRowPlanet["destruyed"] == 0 && $GalaxyRow["id_luna"] != 0) + if ($GalaxyInfo && $GalaxyInfo["destruyed_moon"] == 0 && $GalaxyInfo["id_luna"] != 0) { - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= "
    ".$lang['gl_features']."
    ".$lang['gl_diameter']."". number_format($GalaxyRowPlanet['diameter'], 0, '', '.') ."
    ".$lang['gl_temperature']."". number_format($GalaxyRowPlanet['temp_min'], 0, '', '.') ."
    ".$lang['gl_actions']."
    "; - $Result .= $MissionType6Link; - $Result .= $MissionType3Link; - $Result .= $MissionType4Link; - $Result .= $MissionType1Link; - $Result .= $MissionType5Link; - $Result .= $MissionType9Link; - $Result .= "
    "; - $Result .= ""; - $Result .= ""; - $Result .= "\""; - $Result .= ", STICKY, MOUSEOFF, DELAY, 750, CENTER, OFFSETX, -40, OFFSETY, -40 );'"; - $Result .= " onmouseout='return nd();'>"; - $Result .= ""; - $Result .= "
    "; + $parse = $lang; + $parse['dpath'] = DPATH; + $parse['name_moon'] = $GalaxyInfo["name_moon"]; + $parse['galaxy'] = $Galaxy; + $parse['system'] = $System; + $parse['planet'] = $Planet; + $parse['diameter'] = number_format($GalaxyInfo['diameter'], 0, '', '.'); + $parse['temperature'] = number_format($GalaxyInfo['temp_min'], 0, '', '.'); + $parse['links'] = $MissionType6Link; + $parse['links'] .= $MissionType3Link; + $parse['links'] .= $MissionType4Link; + $parse['links'] .= $MissionType1Link; + $parse['links'] .= $MissionType5Link; + $parse['links'] .= $MissionType9Link; + + return parsetemplate(gettemplate('galaxy/galaxy_moon_block'), $parse); + } - $Result .= ""; - return $Result; + return ''; } - public function GalaxyRowPlanet($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType, $HavePhalanx, $CurrentGalaxy, $CurrentSystem) + public function GalaxyRowPlanet($GalaxyInfo, $Galaxy, $System, $Planet, $PlanetType, $HavePhalanx, $CurrentGalaxy, $CurrentSystem) { - global $dpath, $user, $CurrentMIP, $CurrentSystem, $game_config, $lang; + global $user, $CurrentMIP, $CurrentSystem, $lang; - $Result = ""; - if ($GalaxyRow && $GalaxyRowPlanet["destruyed"] == 0 && $GalaxyRow["id_planet"] != 0) + if ($GalaxyInfo && $GalaxyInfo["destruyed"] == 0 && $GalaxyInfo["id_planet"] != 0) { if ($HavePhalanx <> 0) { - if ($GalaxyRowUser['id'] != $user['id']) + if ($GalaxyInfo['id'] != $user['id']) { - if ($GalaxyRowPlanet["galaxy"] == $CurrentGalaxy) + if ($GalaxyInfo["galaxy"] == $CurrentGalaxy) { $PhRange = $this->GetPhalanxRange ( $HavePhalanx ); $SystemLimitMin = $CurrentSystem - $PhRange; @@ -399,9 +328,9 @@ public function GalaxyRowPlanet($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $G if ($CurrentMIP <> 0) { - if ($GalaxyRowUser['id'] != $user['id']) + if ($GalaxyInfo['id'] != $user['id']) { - if ($GalaxyRowPlanet["galaxy"] == $CurrentGalaxy) + if ($GalaxyInfo["galaxy"] == $CurrentGalaxy) { $MiRange = $this->GetMissileRange(); $SystemLimitMin = $CurrentSystem - $MiRange; @@ -413,201 +342,172 @@ public function GalaxyRowPlanet($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $G if ($System <= $SystemLimitMax) { if ($System >= $SystemLimitMin) - $MissileBtn = true; + $MissileBtn = TRUE; else - $MissileBtn = false; + $MissileBtn = FALSE; } else { - $MissileBtn = false; + $MissileBtn = FALSE; } } else { - $MissileBtn = false; + $MissileBtn = FALSE; } } else { - $MissileBtn = false; + $MissileBtn = FALSE; } } else { - $MissileBtn = false; + $MissileBtn = FALSE; } - if ($GalaxyRowUser['id'] != $user['id']) + if ($GalaxyInfo['id'] != $user['id']) $MissionType6Link = "".$lang['type_mission'][6]."

    "; - elseif ($GalaxyRowUser['id'] == $user['id']) + elseif ($GalaxyInfo['id'] == $user['id']) $MissionType6Link = ""; - if ($GalaxyRowUser['id'] != $user['id']) + if ($GalaxyInfo['id'] != $user['id']) $MissionType1Link = "".$lang['type_mission'][1]."
    "; - elseif ($GalaxyRowUser['id'] == $user['id']) + elseif ($GalaxyInfo['id'] == $user['id']) $MissionType1Link = ""; - if ($GalaxyRowUser['id'] == $user['id']) + if ($GalaxyInfo['id'] == $user['id']) $MissionType5Link = "".$lang['type_mission'][5]."
    "; - elseif ($GalaxyRowUser['id'] == $user['id']) + elseif ($GalaxyInfo['id'] == $user['id']) $MissionType5Link = ""; - if ($GalaxyRowUser['id'] == $user['id']) + if ($GalaxyInfo['id'] == $user['id']) $MissionType4Link = "".$lang['type_mission'][4]."
    "; - elseif ($GalaxyRowUser['id'] != $user['id']) + elseif ($GalaxyInfo['id'] != $user['id']) $MissionType4Link = ""; - if ($user["settings_mis"] == "1" AND $MissileBtn == true && $GalaxyRowUser['id']) + if ($user["settings_mis"] == "1" AND $MissileBtn == TRUE && $GalaxyInfo['id']) $MissionType10Link = "".$lang['gl_missile_attack']."
    "; - elseif ($GalaxyRowUser['id'] != $user['id']) + elseif ($GalaxyInfo['id'] != $user['id']) $MissionType10Link = ""; $MissionType3Link = "".$lang['type_mission'][3]."
    "; - $Result .= ""; - $Result .= ""; - $Result .= ""; - $Result .= $MissionType6Link; - $Result .= $PhalanxTypeLink; - $Result .= $MissionType1Link; - $Result .= $MissionType5Link; - $Result .= $MissionType4Link; - $Result .= $MissionType3Link; - $Result .= $MissionType10Link; - $Result .= ""; - $Result .= ""; - $Result .= "\""; - $Result .= ", STICKY, MOUSEOFF, DELAY, 750, CENTER, OFFSETX, -40, OFFSETY, -40 );'"; - $Result .= " onmouseout='return nd();'>"; - $Result .= ""; - $Result .= ""; - } - $Result .= ""; + $parse = $lang; + $parse['dpath'] = DPATH; + $parse['name'] = $GalaxyInfo["name"]; + $parse['galaxy'] = $Galaxy; + $parse['system'] = $System; + $parse['planet'] = $Planet; + $parse['image'] = $GalaxyInfo["image"]; + $parse['links'] = $MissionType6Link; + $parse['links'] .= $PhalanxTypeLink; + $parse['links'] .= $MissionType1Link; + $parse['links'] .= $MissionType5Link; + $parse['links'] .= $MissionType4Link; + $parse['links'] .= $MissionType3Link; + $parse['links'] .= $MissionType10Link; - return $Result; + } + return parsetemplate(gettemplate('galaxy/galaxy_planet_block'), $parse); } - public function GalaxyRowPlanetName($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType, $HavePhalanx, $CurrentGalaxy, $CurrentSystem) + public function GalaxyRowPlanetName($GalaxyInfo, $Galaxy, $System, $Planet, $PlanetType, $HavePhalanx, $CurrentGalaxy, $CurrentSystem) { global $user, $lang; - $Result = ""; - - if ($GalaxyRowPlanet['last_update'] > (time()-59 * 60) && $GalaxyRowUser['id'] != $user['id']) - $Inactivity = pretty_time_hour(time() - $GalaxyRowPlanet['last_update']); + if ($GalaxyInfo['last_update'] > (time()-59 * 60) && $GalaxyInfo['id'] != $user['id']) + { + $Inactivity = pretty_time_hour(time() - $GalaxyInfo['last_update']); + } - if ($GalaxyRow && $GalaxyRowPlanet["destruyed"] == 0) + if ($GalaxyInfo && $GalaxyInfo["destruyed"] == 0) { if ($HavePhalanx <> 0) { - if ($GalaxyRowPlanet["galaxy"] == $CurrentGalaxy) + if ($GalaxyInfo["galaxy"] == $CurrentGalaxy) { $Range = $this->GetPhalanxRange ( $HavePhalanx ); if ($CurrentGalaxy + $Range <= $CurrentSystem && $CurrentSystem >= $CurrentGalaxy - $Range) - $PhalanxTypeLink = "".$GalaxyRowPlanet['name']."
    "; + $PhalanxTypeLink = "".$GalaxyInfo['name']."
    "; else - $PhalanxTypeLink = stripslashes($GalaxyRowPlanet['name']); + $PhalanxTypeLink = stripslashes($GalaxyInfo['name']); } else { - $PhalanxTypeLink = stripslashes($GalaxyRowPlanet['name']); + $PhalanxTypeLink = stripslashes($GalaxyInfo['name']); } } else { - $PhalanxTypeLink = stripslashes($GalaxyRowPlanet['name']); + $PhalanxTypeLink = stripslashes($GalaxyInfo['name']); } - $Result .= $TextColor . $PhalanxTypeLink . $EndColor; + $planetname .= $TextColor . $PhalanxTypeLink . $EndColor; - if ($GalaxyRowPlanet['last_update'] > (time()-59 * 60) && $GalaxyRowUser['id'] != $user['id']) + if ($GalaxyInfo['last_update'] > (time()-59 * 60) && $GalaxyInfo['id'] != $user['id']) { - if ($GalaxyRowPlanet['last_update'] > (time()-10 * 60) && $GalaxyRowUser['id'] != $user['id']) - $Result .= "(*)"; + if ($GalaxyInfo['last_update'] > (time()-10 * 60) && $GalaxyInfo['id'] != $user['id']) + { + $planetname .= "(*)"; + } else - $Result .= " (".$Inactivity.")"; + { + $planetname .= " (".$Inactivity.")"; + } } } - elseif($GalaxyRowPlanet["destruyed"] != 0) + elseif($GalaxyInfo["destruyed"] != 0) { - $Result .= $lang['gl_planet_destroyed']; + $planetname .= $lang['gl_planet_destroyed']; } - $Result .= ""; - - return $Result; - } - - public function GalaxyRowPos($GalaxyRow, $Galaxy, $System, $Planet) - { - $Result = ""; - $Result .= ""; - $Result .= ""; - - return $Result; + return $planetname; } - public function GalaxyRowUser($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType, $UserPoints) + public function GalaxyRowUser($GalaxyInfo, $Galaxy, $System, $Planet) { - global $game_config, $user, $lang; - - $Result = ""; + global $user, $lang; - if ($GalaxyRowUser && $GalaxyRowPlanet["destruyed"] == 0) + if ($GalaxyInfo && $GalaxyInfo["destruyed"] == 0) { - $protection = $game_config['noobprotection']; - $protectiontime = $game_config['noobprotectiontime']; - $protectionmulti = $game_config['noobprotectionmulti']; - $User2Points = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $GalaxyRowUser['id'] ."';", 'statpoints', true); - $CurrentPoints = $UserPoints['total_points']; - $RowUserPoints = $User2Points['total_points']; - $MyGameLevel = $CurrentPoints * $protectionmulti['config_value']; - $HeGameLevel = $RowUserPoints * $protectionmulti['config_value']; - - if ($GalaxyRowUser['bana'] == 1 && $GalaxyRowUser['urlaubs_modus'] == 1) + $protection = read_config ( 'noobprotection' ); + $protectiontime = read_config ( 'noobprotectiontime' ); + $protectionmulti = read_config ( 'noobprotectionmulti' ); + $MyGameLevel = $user['total_points']; + $HeGameLevel = $GalaxyInfo['total_points']; + + if ($GalaxyInfo['bana'] == 1 && $GalaxyInfo['urlaubs_modus'] == 1) { $Systemtatus2 = "v ".$lang['gl_b'].""; $Systemtatus = ""; } - elseif ($GalaxyRowUser['bana'] == 1) + elseif ($GalaxyInfo['bana'] == 1) { $Systemtatus2 = "".$lang['gl_b'].""; $Systemtatus = ""; } - elseif ($GalaxyRowUser['urlaubs_modus'] == 1) + elseif ($GalaxyInfo['urlaubs_modus'] == 1) { $Systemtatus2 = "".$lang['gl_v'].""; $Systemtatus = ""; } - elseif ($GalaxyRowUser['onlinetime'] < (time()-60 * 60 * 24 * 7) && $GalaxyRowUser['onlinetime'] > (time()-60 * 60 * 24 * 28)) + elseif ($GalaxyInfo['onlinetime'] < (time()-60 * 60 * 24 * 7) && $GalaxyInfo['onlinetime'] > (time()-60 * 60 * 24 * 28)) { $Systemtatus2 = "".$lang['gl_i'].""; $Systemtatus = ""; } - elseif ($GalaxyRowUser['onlinetime'] < (time()-60 * 60 * 24 * 28)) + elseif ($GalaxyInfo['onlinetime'] < (time()-60 * 60 * 24 * 28)) { $Systemtatus2 = "".$lang['gl_i']."".$lang['gl_I'].""; $Systemtatus = ""; } - elseif (($MyGameLevel > ($HeGameLevel * $protectionmulti)) && $protection == 1 && ($HeGameLevel < ($protectiontime * 1000))) + elseif (($MyGameLevel > ($HeGameLevel * $protectionmulti)) && $protection == 1 && ($HeGameLevel < $protectiontime)) { $Systemtatus2 = "".$lang['gl_w'].""; $Systemtatus = ""; } - elseif ((($MyGameLevel * $protectionmulti) < $HeGameLevel) && $protection == 1 && ($MyGameLevel < ($protectiontime * 1000))) + elseif ((($MyGameLevel * $protectionmulti) < $HeGameLevel) && $protection == 1 && ($MyGameLevel < $protectiontime)) { $Systemtatus2 = $lang['gl_s']; $Systemtatus = ""; @@ -617,7 +517,7 @@ public function GalaxyRowUser($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Gal $Systemtatus2 = ""; $Systemtatus = ""; } - $Systemtatus4 = $User2Points['total_rank']; + $Systemtatus4 = $GalaxyInfo['total_rank']; if ($Systemtatus2 != '') { @@ -630,42 +530,34 @@ public function GalaxyRowUser($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Gal $Systemtatus7 = ""; } - $Systemtart = $User2Points['total_rank']; + $Systemtart = $GalaxyInfo['total_rank']; if (strlen($Systemtart) < 3) $Systemtart = 1; else - $Systemtart = (floor( $User2Points['total_rank'] / 100 ) * 100) + 1; - - $Result .= ""; - $Result .= ""; - if ($GalaxyRowUser['id'] != $user['id']) + $Systemtart = (floor( $GalaxyInfo['total_rank'] / 100 ) * 100) + 1; + + $parse = $lang; + $parse['username'] = $GalaxyInfo['username']; + $parse['systemtatus4'] = $Systemtatus4; + $parse['systemtart'] = $Systemtart; + + if ($GalaxyInfo['id'] != $user['id']) { - $Result .= "".$lang['write_message'].""; - $Result .= ""; - $Result .= "".$lang['gl_buddy_request'].""; - $Result .= ""; + $parse['actions'] = "".$lang['write_message'].""; + $parse['actions'] .= ""; + $parse['actions'] .= "".$lang['gl_buddy_request'].""; + $parse['actions'] .= ""; } - $Result .= "".$lang['gl_stat'].""; - $Result .= ""; - $Result .= "\""; - $Result .= ", STICKY, MOUSEOFF, DELAY, 750, CENTER, OFFSETX, -40, OFFSETY, -40 );'"; - $Result .= " onmouseout='return nd();'>"; - $Result .= $Systemtatus; - $Result .= $GalaxyRowUser["username"].""; - $Result .= $Systemtatus6; - $Result .= $Systemtatus; - $Result .= $Systemtatus2; - $Result .= $Systemtatus7." ".$admin; - $Result .= ""; - } - $Result .= ""; - return $Result; + $parse['status'] = $Systemtatus; + $parse['status'] .= $GalaxyInfo["username"].""; + $parse['status'] .= $Systemtatus6; + $parse['status'] .= $Systemtatus; + $parse['status'] .= $Systemtatus2; + $parse['status'] .= $Systemtatus7." ".$admin; + } + return parsetemplate(gettemplate('galaxy/galaxy_username_block'), $parse); } } ?> \ No newline at end of file diff --git a/includes/classes/class.SecurePage.php b/includes/classes/class.SecurePage.php index 23b7b61..46a310a 100644 --- a/includes/classes/class.SecurePage.php +++ b/includes/classes/class.SecurePage.php @@ -1,23 +1,10 @@ ".$this->log."
    Debug Log:
    "; + return "
    ".$this->log."
    Debug Log:
    "; die(); } function error($message,$title) { - global $link, $game_config, $lang; + global $link, $lang, $user; - if($game_config['debug']==1) + if ( read_config ( 'debug' ) == 1 ) { echo "

    $title


    $message

    "; echo "".$this->log."
    "; } - global $user,$xgp_root,$phpEx; - include($xgp_root . 'config.'.$phpEx); + include(XGP_ROOT . 'config.php'); if(!$link) die($lang['cdg_mysql_not_available']); @@ -75,7 +60,7 @@ function error($message,$title) if (!function_exists('message')) echo $lang['cdg_error_message']." ".$q['rows'].""; else - message($lang['cdg_error_message']." ".$q['rows']."", '', '', false, false); + message($lang['cdg_error_message']." ".$q['rows']."", '', '', FALSE, FALSE); die(); } diff --git a/includes/vendor/simplehtmldom/simple_html_dom.php b/includes/classes/class.simple_html_dom.php similarity index 93% rename from includes/vendor/simplehtmldom/simple_html_dom.php rename to includes/classes/class.simple_html_dom.php index 19e5f66..5f2c56b 100644 --- a/includes/vendor/simplehtmldom/simple_html_dom.php +++ b/includes/classes/class.simple_html_dom.php @@ -36,19 +36,19 @@ function file_get_html() { $dom = new simple_html_dom; $args = func_get_args(); - $dom->load(call_user_func_array('file_get_contents', $args), true); + $dom->load(call_user_func_array('file_get_contents', $args), TRUE); return $dom; } // get html dom form string -function str_get_html($str, $lowercase=true) { +function str_get_html($str, $lowercase=TRUE) { $dom = new simple_html_dom; $dom->load($str, $lowercase); return $dom; } // dump html dom tree -function dump_html_tree($node, $show_attr=true, $deep=0) { +function dump_html_tree($node, $show_attr=TRUE, $deep=0) { $lead = str_repeat(' ', $deep); echo $lead.$node->tag; if ($show_attr && count($node->attr)>0) { @@ -67,12 +67,12 @@ function dump_html_tree($node, $show_attr=true, $deep=0) { function file_get_dom() { $dom = new simple_html_dom; $args = func_get_args(); - $dom->load(call_user_func_array('file_get_contents', $args), true); + $dom->load(call_user_func_array('file_get_contents', $args), TRUE); return $dom; } // get dom form string (deprecated) -function str_get_dom($str, $lowercase=true) { +function str_get_dom($str, $lowercase=TRUE) { $dom = new simple_html_dom; $dom->load($str, $lowercase); return $dom; @@ -112,7 +112,7 @@ function clear() { } // dump node's tree - function dump($show_attr=true) { + function dump($show_attr=TRUE) { dump_html_tree($this, $show_attr); } @@ -237,12 +237,12 @@ function makeup() { ++$i; // skip removed attribute - if ($val===null || $val===false) + if ($val===null || $val===FALSE) continue; $ret .= $this->_[HDOM_INFO_SPACE][$i][0]; //no value attr: nowrap, checked selected... - if ($val===true) + if ($val===TRUE) $ret .= $key; else { switch($this->_[HDOM_INFO_QUOTE][$i]) { @@ -329,22 +329,22 @@ protected function seek($selector, &$ret) { for($i=$this->_[HDOM_INFO_BEGIN]+1; $i<$end; ++$i) { $node = $this->dom->nodes[$i]; - $pass = true; + $pass = TRUE; if ($tag==='*' && !$key) { - if (in_array($node, $this->children, true)) + if (in_array($node, $this->children, TRUE)) $ret[$i] = 1; continue; } // compare tag - if ($tag && $tag!=$node->tag && $tag!=='*') {$pass=false;} + if ($tag && $tag!=$node->tag && $tag!=='*') {$pass=FALSE;} // compare key if ($pass && $key) { if ($no_key) { - if (isset($node->attr[$key])) $pass=false; + if (isset($node->attr[$key])) $pass=FALSE; } - else if (!isset($node->attr[$key])) $pass=false; + else if (!isset($node->attr[$key])) $pass=FALSE; } // compare value if ($pass && $key && $val && $val!=='*') { @@ -356,7 +356,7 @@ protected function seek($selector, &$ret) { if ($check) break; } } - if (!$check) $pass = false; + if (!$check) $pass = FALSE; } if ($pass) $ret[$i] = 1; unset($node); @@ -378,7 +378,7 @@ protected function match($exp, $pattern, $value) { return preg_match($pattern, $value); return preg_match("/".$pattern."/i", $value); } - return false; + return FALSE; } protected function parse_selector($selector_string) { @@ -395,7 +395,7 @@ protected function parse_selector($selector_string) { // for borwser grnreated xpath if ($m[1]==='tbody') continue; - list($tag, $key, $val, $exp, $no_key) = array($m[1], null, null, '=', false); + list($tag, $key, $val, $exp, $no_key) = array($m[1], null, null, '=', FALSE); if(!empty($m[2])) {$key='id'; $val=$m[2];} if(!empty($m[3])) {$key='class'; $val=$m[3];} if(!empty($m[4])) {$key=$m[4];} @@ -405,7 +405,7 @@ protected function parse_selector($selector_string) { // convert to lowercase if ($this->dom->lowercase) {$tag=strtolower($tag); $key=strtolower($key);} //elements that do NOT have the specified attribute - if (isset($key[0]) && $key[0]==='!') {$key=substr($key, 1); $no_key=true;} + if (isset($key[0]) && $key[0]==='!') {$key=substr($key, 1); $no_key=TRUE;} $result[] = array($tag, $key, $val, $exp, $no_key); if (trim($m[7])===',') { @@ -445,12 +445,12 @@ function __set($name, $value) { function __isset($name) { switch($name) { - case 'outertext': return true; - case 'innertext': return true; - case 'plaintext': return true; + case 'outertext': return TRUE; + case 'innertext': return TRUE; + case 'plaintext': return TRUE; } //no value attr: nowrap, checked selected... - return (array_key_exists($name, $this->attr)) ? true : isset($this->attr[$name]); + return (array_key_exists($name, $this->attr)) ? TRUE : isset($this->attr[$name]); } function __unset($name) { @@ -482,7 +482,7 @@ class simple_html_dom { public $root = null; public $nodes = array(); public $callback = null; - public $lowercase = false; + public $lowercase = FALSE; protected $pos; protected $doc; protected $char; @@ -523,13 +523,13 @@ function __destruct() { } // load html from string - function load($str, $lowercase=true) { + function load($str, $lowercase=TRUE) { // prepare $this->prepare($str, $lowercase); // strip out comments $this->remove_noise("''is"); // strip out cdata - $this->remove_noise("''is", true); + $this->remove_noise("''is", TRUE); // strip out - -

    {ow_title}

    - - - - -
    {error_message}
    - -
    - - - - - - - - - - - - - - - - - - - -
    {ow_overview}
    {ow_welcome_text}
    {ow_support}
    -
    - Bug Report -
    - Xtreme-gameZ {ow_forum} -
    -
    -
    {ow_credits}
    - - - - - - - - - - - - - -

    {ow_proyect_leader}

    lucky

    {ow_principal_contributors}

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    angelus_iraEstadísticas / Optimización general
    CalzonFixs varios
    cyberrichySACs
    NekoPanel Administrativo / Fixs varios
    PowerMasterFixs varios
    zorro2666Fixs varios
    -
    - - - - -

    Ïåðåâîä íà ðóññêèé ÿçûê è äîðîáîòêà îñóùåñòâëåíû Àäìèíèñòðàöèåé ñàéòà
    Portal-Soft.Net.Ru

    -
    - \ No newline at end of file diff --git a/styles/templates/adm/chat_body.tpl b/styles/templates/adm/chat_body.tpl deleted file mode 100644 index 238007f..0000000 --- a/styles/templates/adm/chat_body.tpl +++ /dev/null @@ -1,14 +0,0 @@ -

    -

    {adm_ch_ttle}

    - - - - - - - - - - -{msg_list} -
    {adm_ch_list} [Óäàëèòü âñå ñîîáùåíèÿ]
    {adm_ch_idmsg}{adm_ch_delet}{adm_ch_play}{adm_ch_time}
    \ No newline at end of file diff --git a/styles/templates/buildings/buildings_builds.tpl b/styles/templates/buildings/buildings_builds.tpl deleted file mode 100644 index 857ed8c..0000000 --- a/styles/templates/buildings/buildings_builds.tpl +++ /dev/null @@ -1,13 +0,0 @@ -
    -
    -{BuildListScript} - - {BuildList} - - - - {BuildingsList} -
    - {planet_field_current} / {planet_field_max} îñòàëîñü {field_libre} íåçàíÿòûõ ïîëåé -
    -
    \ No newline at end of file diff --git a/styles/templates/buildings/buildings_defense.tpl b/styles/templates/buildings/buildings_defense.tpl deleted file mode 100644 index b71faa0..0000000 --- a/styles/templates/buildings/buildings_defense.tpl +++ /dev/null @@ -1,21 +0,0 @@ - -
    -
    - - {message} -
    - - - - - - - - {buildlist} - {build_defenses} -
    {fleet_lvl}
    -
    - {buildinglist} -
    \ No newline at end of file diff --git a/styles/templates/buildings/buildings_fleet.tpl b/styles/templates/buildings/buildings_fleet.tpl deleted file mode 100644 index 4c20b27..0000000 --- a/styles/templates/buildings/buildings_fleet.tpl +++ /dev/null @@ -1,19 +0,0 @@ - -
    -
    - {message} -
    - - - - - - - {buildlist} - {build_fleet} -
    {fleet_lvl}
    -
    - {buildinglist} -
    \ No newline at end of file diff --git a/styles/templates/buildings/buildings_research.tpl b/styles/templates/buildings/buildings_research.tpl deleted file mode 100644 index 4e4e51c..0000000 --- a/styles/templates/buildings/buildings_research.tpl +++ /dev/null @@ -1,15 +0,0 @@ - -
    -
    - {noresearch} - - - - - - {technolist} - -
    {research_lvl}
    -
    \ No newline at end of file diff --git a/styles/templates/chat/chat_body.tpl b/styles/templates/chat/chat_body.tpl deleted file mode 100644 index 67abcd3..0000000 --- a/styles/templates/chat/chat_body.tpl +++ /dev/null @@ -1,116 +0,0 @@ - - - -

    - - - - - - - - - - - - - - - - - - - - -
    {chat_disc}
    -{chat_message}: -
    -   - -   - -   -   - -
    -
    -  Îíëàéí:{OnlineAdmins} -
    -
    -:agr: -:angel: -:bad: -o0 -:blush: -:blush: -:clap: -:cool: -:c: -:crz: -:diablo: -:cool2: -:s: -:rose: -:good: -:huh: -:D -:/ -:yu -:unknw: -:( -:) -:o -:rofl -:eye -:p -;) -:yahoo: -:tratata: -
    - - -:fr: -:dr: -:tease: -:mail1: -:beee: -:preved: -:posle: -:nono: - -:bc: -:be: -:bh: -:bi: -:bk: -:bl: -:br: -:bx: -:cc: -:cr: -:cg: -:ci: -:co: - - - -
    -
    {ExternalTchatFrame}    {ClickBanner}
    -
    \ No newline at end of file diff --git a/styles/templates/fleet/fleetACS_table.tpl b/styles/templates/fleet/fleetACS_table.tpl deleted file mode 100644 index c8482e7..0000000 --- a/styles/templates/fleet/fleetACS_table.tpl +++ /dev/null @@ -1,74 +0,0 @@ - - -
    - - - - - - - - - - - - - - - - {page1} - {maxflot} -
    {fl_fleet} ({fl_max}. {ile})
    {fl_number}{fl_mission}{fl_ammount}{fl_beginning}{fl_departure}{fl_destiny}{fl_objective}{fl_arrival}{fl_order}
    - - - - - - - - - - - - - - - -
    {fl_sac_of_fleet} KV50502025
    {fl_modify_sac_name}
    {aks_code_mr}
    - - - - - - - - - - - - - -
    - {add_user_message_mr} - -
    {fl_members_invited}{fl_invite_members}
    - -
    -
    -
    -
    -
    - - - - - - - - - - -{page3} - \ No newline at end of file diff --git a/styles/templates/install/ins_acc_done.tpl b/styles/templates/install/ins_acc_done.tpl deleted file mode 100644 index 7bfd679..0000000 --- a/styles/templates/install/ins_acc_done.tpl +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/styles/templates/install/ins_body.tpl b/styles/templates/install/ins_body.tpl deleted file mode 100644 index 3f69d4a..0000000 --- a/styles/templates/install/ins_body.tpl +++ /dev/null @@ -1,10 +0,0 @@ -

    -
    {fl_new_mission_title}
    {fl_ship_type}{fl_ship_available}--
    -
    Àäìèíèñòðàòîð ñîçäàí.
    -Óäàëèòå ïàïêó install ÷òîòû îáåçîïàñèòü ñåáÿ îò ïîâòîðíîé óñòàíîâêè!

    -È èçìåíèòå ïðàâà íà ôàéë config.php íà "CHMOD 644"

    -
    - - - - -{ins_page} - -
    - Ìåíþ óñòàíîâêè [Ãëàâíàÿ - Óñòàíîâèòü - Ëèöåíöèÿ - Îáíîâèòü]
    \ No newline at end of file diff --git a/styles/templates/install/ins_intro.tpl b/styles/templates/install/ins_intro.tpl deleted file mode 100644 index b7d0534..0000000 --- a/styles/templates/install/ins_intro.tpl +++ /dev/null @@ -1,14 +0,0 @@ - -
    -

    Èíñòðóêöèÿ

    -

    Æåëàííûé XG Proyect!
    -
    - XG Proyect - îäèí èç ëó÷øèõ êëîóíîâ ñóùåñòâóþùèõ OGame äî ñèõ ïîð. XG Proyect 2 íå ïîñëåäíèé è ñàìûé ñòàáèëüíûé êîãäà áû òî íèáûëî. Òàêîé ïðîåêò êîòîðûé êàê äðóãèå âåðñèè, XG Proyect ïîëó÷àåò îïîðó êîìàíäû Xtreme-gameZ, óáåæäàÿñü â òîì, ÷òî äîáèâàÿñü âñåãäà ëó÷øåãî êà÷åñòâà âî âíèìàíèè è ñòàáèëüíîñòè âåðñèè. XG Proyect 2 êàæäûé äåíü èùåò ðîñò, ñòàáèëüíîñòü, ãèáêîñòü, äèíàìèçì, êà÷åñòâî è âåðó ïîëüçîâàòåëÿ, ÷òî ÿâëÿåòñÿ åãî ëó÷øèì âûáîðîì. Ìû âñåãäà íàäååìñÿ, ÷òî XG Proyect2 ëó÷øå.
    -
    - Ñèñòåìà óñòàíîâêè ïîìîæåò Âàì óñòàíîâèòü èëè îáíîâèòü èãðó, îò áîëåå ñòàðûõ âåðñèé äî ñàìîé ïîñëåäíåé âåðñèè.
    - XG Proyect – Äëÿ òîãî ÷òîáû íà÷àòü óñòàíîâêó èëè îáíîâëåíèå êëèêíåòå â âåðõíåì ìåíþ ïî ñîîòâåòñòâóþùåé ññûëêå.

    - -

    Ïåðåâîä íà ðóññêèé ÿçûê è äîðîáîòêà
    îñóùåñòâëåíû Àäìèíèñòðàöèåé ñàéòà
    Portal-Soft.Net.Ru - -

    - \ No newline at end of file diff --git a/styles/templates/install/ins_update.tpl b/styles/templates/install/ins_update.tpl deleted file mode 100644 index a7a8315..0000000 --- a/styles/templates/install/ins_update.tpl +++ /dev/null @@ -1,43 +0,0 @@ - - Ñåðâåð SQL (Íà ïðèìåð: localhost) - - - - Ïîëüçîâàòåëü SQL (Íà ïðèìåð: root) - - - - Ïàðîëü SQL (Íà ïðèìåð: abc12345) - - - - Èìÿ áàçû äàííûõ SQL (Íà ïðèìåð: ogame) - - - - Ïðåâèêñ áàçû äàííûõ(Íà ïðèìåð: game_) - - - - Âûáåðèòå Âàøó âåðñèþ:(Íà ïðèìåð: 2.4) - - - - - - - \ No newline at end of file diff --git a/styles/templates/messages_pm_form.tpl b/styles/templates/messages_pm_form.tpl deleted file mode 100644 index 7e2e068..0000000 --- a/styles/templates/messages_pm_form.tpl +++ /dev/null @@ -1,20 +0,0 @@ - -
    -
    - - - - - - - - - - - - - - - -
    Îòïðàâêà ñîîáùåíèÿ
    Ïîëó÷àòåëü
    Òåìà ñîîáùåíèÿ
    Òåêñò ñîîáùåíèÿ (0 / 5000 )
    -
    diff --git a/styles/templates/officier/officier_table.tpl b/styles/templates/officier/officier_table.tpl deleted file mode 100644 index a5e2fe7..0000000 --- a/styles/templates/officier/officier_table.tpl +++ /dev/null @@ -1,9 +0,0 @@ -
    -
    - - - - - {disp_off_tbl} -
    {of_available_points} {alv_points} {of_points_per_thousand_darkmatter}
    -
    \ No newline at end of file diff --git a/styles/templates/topnav.tpl b/styles/templates/topnav.tpl deleted file mode 100644 index a4e4717..0000000 --- a/styles/templates/topnav.tpl +++ /dev/null @@ -1,128 +0,0 @@ - -
    - - - - - -
    - - - - - -
    - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - -
    {Metal}{Crystal}{Deuterium}{Energy}{Darkmatter}{Messages}
    {energy}{darkmatter}{message}
    -{show_umod_notice} -
    - - \ No newline at end of file diff --git a/includes/.htaccess b/styles/views/.htaccess similarity index 100% rename from includes/.htaccess rename to styles/views/.htaccess diff --git a/styles/templates/adm/AccountDataBody.tpl b/styles/views/adm/AccountDataBody.php similarity index 98% rename from styles/templates/adm/AccountDataBody.tpl rename to styles/views/adm/AccountDataBody.php index b5786b6..f732e0b 100644 --- a/styles/templates/adm/AccountDataBody.tpl +++ b/styles/views/adm/AccountDataBody.php @@ -1,8 +1,8 @@ - + - + - +
    @@ -13,11 +13,11 @@ - + - +

    AB diff --git a/styles/templates/adm/ActivePlanetsBody.tpl b/styles/views/adm/ActivePlanetsBody.php similarity index 100% rename from styles/templates/adm/ActivePlanetsBody.tpl rename to styles/views/adm/ActivePlanetsBody.php diff --git a/styles/templates/adm/AuthlevelBody.tpl b/styles/views/adm/AuthlevelBody.php similarity index 97% rename from styles/templates/adm/AuthlevelBody.tpl rename to styles/views/adm/AuthlevelBody.php index 3ced75f..a7339d3 100644 --- a/styles/templates/adm/AuthlevelBody.tpl +++ b/styles/views/adm/AuthlevelBody.php @@ -1,5 +1,5 @@ - +
    @@ -13,7 +13,7 @@ - + diff --git a/styles/templates/adm/BanOptions.tpl b/styles/views/adm/BanOptions.php similarity index 98% rename from styles/templates/adm/BanOptions.tpl rename to styles/views/adm/BanOptions.php index 8322059..3026f1b 100644 --- a/styles/templates/adm/BanOptions.tpl +++ b/styles/views/adm/BanOptions.php @@ -1,5 +1,5 @@ - + @@ -15,14 +15,14 @@ {List}
    - {bo_order_username}   {bo_order_id}   + {bo_order_username}   {bo_order_id}   {bo_order_banned} - +

    AB @@ -59,6 +59,7 @@ + diff --git a/styles/templates/alliance/alliance_admin_request_row.tpl b/styles/views/alliance/alliance_admin_request_row.php similarity index 100% rename from styles/templates/alliance/alliance_admin_request_row.tpl rename to styles/views/alliance/alliance_admin_request_row.php diff --git a/styles/templates/alliance/alliance_admin_request_table.tpl b/styles/views/alliance/alliance_admin_request_table.php similarity index 100% rename from styles/templates/alliance/alliance_admin_request_table.tpl rename to styles/views/alliance/alliance_admin_request_table.php diff --git a/styles/templates/alliance/alliance_admin_transfer.tpl b/styles/views/alliance/alliance_admin_transfer.php similarity index 100% rename from styles/templates/alliance/alliance_admin_transfer.tpl rename to styles/views/alliance/alliance_admin_transfer.php diff --git a/styles/templates/alliance/alliance_admin_transfer_row.tpl b/styles/views/alliance/alliance_admin_transfer_row.php similarity index 100% rename from styles/templates/alliance/alliance_admin_transfer_row.tpl rename to styles/views/alliance/alliance_admin_transfer_row.php diff --git a/styles/templates/alliance/alliance_ainfo.tpl b/styles/views/alliance/alliance_ainfo.php similarity index 100% rename from styles/templates/alliance/alliance_ainfo.tpl rename to styles/views/alliance/alliance_ainfo.php diff --git a/styles/templates/alliance/alliance_apply_waitform.tpl b/styles/views/alliance/alliance_apply_waitform.php similarity index 100% rename from styles/templates/alliance/alliance_apply_waitform.tpl rename to styles/views/alliance/alliance_apply_waitform.php diff --git a/styles/templates/alliance/alliance_applyform.tpl b/styles/views/alliance/alliance_applyform.php similarity index 91% rename from styles/templates/alliance/alliance_applyform.tpl rename to styles/views/alliance/alliance_applyform.php index 7f8d2af..84b6068 100644 --- a/styles/templates/alliance/alliance_applyform.tpl +++ b/styles/views/alliance/alliance_applyform.php @@ -1,4 +1,4 @@ - +
    diff --git a/styles/templates/alliance/alliance_circular.tpl b/styles/views/alliance/alliance_circular.php similarity index 93% rename from styles/templates/alliance/alliance_circular.tpl rename to styles/views/alliance/alliance_circular.php index 9dddd19..2a84431 100644 --- a/styles/templates/alliance/alliance_circular.tpl +++ b/styles/views/alliance/alliance_circular.php @@ -1,4 +1,4 @@ - +
    diff --git a/styles/views/alliance/alliance_circular_row.php b/styles/views/alliance/alliance_circular_row.php new file mode 100644 index 0000000..7fa3781 --- /dev/null +++ b/styles/views/alliance/alliance_circular_row.php @@ -0,0 +1,10 @@ +
    + + + \ No newline at end of file diff --git a/styles/templates/alliance/alliance_defaultmenu.tpl b/styles/views/alliance/alliance_defaultmenu.php similarity index 100% rename from styles/templates/alliance/alliance_defaultmenu.tpl rename to styles/views/alliance/alliance_defaultmenu.php diff --git a/styles/templates/alliance/alliance_frontpage.tpl b/styles/views/alliance/alliance_frontpage.php similarity index 100% rename from styles/templates/alliance/alliance_frontpage.tpl rename to styles/views/alliance/alliance_frontpage.php diff --git a/styles/views/alliance/alliance_image_row.php b/styles/views/alliance/alliance_image_row.php new file mode 100644 index 0000000..9d57ab5 --- /dev/null +++ b/styles/views/alliance/alliance_image_row.php @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/styles/templates/alliance/alliance_make.tpl b/styles/views/alliance/alliance_make.php similarity index 100% rename from styles/templates/alliance/alliance_make.tpl rename to styles/views/alliance/alliance_make.php diff --git a/styles/templates/alliance/alliance_memberslist_row.tpl b/styles/views/alliance/alliance_memberslist_row.php similarity index 100% rename from styles/templates/alliance/alliance_memberslist_row.tpl rename to styles/views/alliance/alliance_memberslist_row.php diff --git a/styles/templates/alliance/alliance_memberslist_table.tpl b/styles/views/alliance/alliance_memberslist_table.php similarity index 100% rename from styles/templates/alliance/alliance_memberslist_table.tpl rename to styles/views/alliance/alliance_memberslist_table.php diff --git a/styles/views/alliance/alliance_message_box.php b/styles/views/alliance/alliance_message_box.php new file mode 100644 index 0000000..7c2ebbd --- /dev/null +++ b/styles/views/alliance/alliance_message_box.php @@ -0,0 +1,10 @@ +
    + +
      @@ -91,7 +92,7 @@ var UsersBan = new filterlist(document.userban.unban_name); //--> - +

    A B diff --git a/styles/templates/adm/BanOptionsResultBody.tpl b/styles/views/adm/BanOptionsResultBody.php similarity index 92% rename from styles/templates/adm/BanOptionsResultBody.tpl rename to styles/views/adm/BanOptionsResultBody.php index 311cccd..9959f3d 100644 --- a/styles/templates/adm/BanOptionsResultBody.tpl +++ b/styles/views/adm/BanOptionsResultBody.php @@ -1,5 +1,5 @@ - + - {display} - + {display} + - - - - - + diff --git a/styles/templates/adm/LogBody.tpl b/styles/views/adm/LogBody.php similarity index 100% rename from styles/templates/adm/LogBody.tpl rename to styles/views/adm/LogBody.php diff --git a/styles/templates/adm/LogEditBody.tpl b/styles/views/adm/LogEditBody.php similarity index 100% rename from styles/templates/adm/LogEditBody.tpl rename to styles/views/adm/LogEditBody.php diff --git a/styles/templates/adm/MessageListBody.tpl b/styles/views/adm/MessageListBody.php similarity index 100% rename from styles/templates/adm/MessageListBody.tpl rename to styles/views/adm/MessageListBody.php diff --git a/styles/templates/adm/MessageListRows.tpl b/styles/views/adm/MessageListRows.php similarity index 100% rename from styles/templates/adm/MessageListRows.tpl rename to styles/views/adm/MessageListRows.php diff --git a/styles/templates/adm/ModerationBody.tpl b/styles/views/adm/ModerationBody.php similarity index 100% rename from styles/templates/adm/ModerationBody.tpl rename to styles/views/adm/ModerationBody.php diff --git a/styles/templates/adm/MoonListBody.tpl b/styles/views/adm/MoonListBody.php similarity index 100% rename from styles/templates/adm/MoonListBody.tpl rename to styles/views/adm/MoonListBody.php diff --git a/styles/templates/adm/MoonOptionsBody.tpl b/styles/views/adm/MoonOptionsBody.php similarity index 100% rename from styles/templates/adm/MoonOptionsBody.tpl rename to styles/views/adm/MoonOptionsBody.php diff --git a/styles/templates/adm/OnlineUsersBody.tpl b/styles/views/adm/OnlineUsersBody.php similarity index 100% rename from styles/templates/adm/OnlineUsersBody.tpl rename to styles/views/adm/OnlineUsersBody.php diff --git a/styles/templates/adm/OnlineUsersRow.tpl b/styles/views/adm/OnlineUsersRow.php similarity index 100% rename from styles/templates/adm/OnlineUsersRow.tpl rename to styles/views/adm/OnlineUsersRow.php diff --git a/styles/views/adm/OverviewBody.php b/styles/views/adm/OverviewBody.php new file mode 100644 index 0000000..a319fcd --- /dev/null +++ b/styles/views/adm/OverviewBody.php @@ -0,0 +1,86 @@ + + + +

    {ow_title}

    +
    {ma_send_global_message}
    {ma_subject}
    Òåìíàÿ ìàòåðèÿ
    {ma_characters}
    + + + +
    {error_message}
    + +
    + + + + + + + + + + + + + + + + + + + +
    {ow_overview}
    {ow_welcome_text}
    {ow_support}
    +
    + Reporte de bugs (Bug Report) +
    + XG Proyect {ow_forum} +
    +
    +
    {ow_credits}
    + + + + + + + + + + + + + + + + + + + + + + + + + +

    {ow_proyect_leader}

    lucky

    {ow_principal_contributors}

    + + + + +
    + angelus_ira (Estadísticas - optimización general)
    + Calzon (Fixs varios)
    + cyberrichy (SAC's)
    + jstar (Fixs varios - optimización general)
    + Neko (Panel administrativo - Fixs varios)
    + PowerMaster (Fixs varios)
    + Think (Fixs varios)
    + zorro2666 (Fixs varios) +
    +

    Other contributors

    +
    + adri93, Alberto14, Anghelito, Arali, edering, Green, jtsamper, Kloud, medel, MSW, Neurus, Nickolay, Pada, privatethedawn, Tarta, thyphoon, tomtom, Tonique, Trojan, Saint, shoghicp, slaver7, war4head, zorro2666 +
    +

    {ow_special_thanks}

    Raito
    Chlorel
    e-Zobar
    Flousedid

    +
    + \ No newline at end of file diff --git a/styles/templates/adm/PassEncripterBody.tpl b/styles/views/adm/PassEncripterBody.php similarity index 100% rename from styles/templates/adm/PassEncripterBody.tpl rename to styles/views/adm/PassEncripterBody.php diff --git a/styles/templates/adm/PlanetListBody.tpl b/styles/views/adm/PlanetListBody.php similarity index 100% rename from styles/templates/adm/PlanetListBody.tpl rename to styles/views/adm/PlanetListBody.php diff --git a/styles/templates/adm/PlanetOptionsBody.tpl b/styles/views/adm/PlanetOptionsBody.php similarity index 100% rename from styles/templates/adm/PlanetOptionsBody.tpl rename to styles/views/adm/PlanetOptionsBody.php diff --git a/styles/templates/adm/QueriesBody.tpl b/styles/views/adm/QueriesBody.php similarity index 100% rename from styles/templates/adm/QueriesBody.tpl rename to styles/views/adm/QueriesBody.php diff --git a/styles/templates/adm/ResetBody.tpl b/styles/views/adm/ResetBody.php similarity index 100% rename from styles/templates/adm/ResetBody.tpl rename to styles/views/adm/ResetBody.php diff --git a/styles/templates/adm/SearchInDBBody.tpl b/styles/views/adm/SearchInDBBody.php similarity index 96% rename from styles/templates/adm/SearchInDBBody.tpl rename to styles/views/adm/SearchInDBBody.php index 9e43dd3..8d0eebb 100644 --- a/styles/templates/adm/SearchInDBBody.tpl +++ b/styles/views/adm/SearchInDBBody.php @@ -2,7 +2,7 @@ - + +
    @@ -39,7 +39,7 @@ @@ -80,7 +80,7 @@ - +
    - +
    @@ -88,6 +88,6 @@ - +
    \ No newline at end of file diff --git a/styles/templates/alliance/alliance_admin_laws.tpl b/styles/views/alliance/alliance_admin_laws.php similarity index 100% rename from styles/templates/alliance/alliance_admin_laws.tpl rename to styles/views/alliance/alliance_admin_laws.php diff --git a/styles/templates/alliance/alliance_admin_laws_feet.tpl b/styles/views/alliance/alliance_admin_laws_feet.php similarity index 100% rename from styles/templates/alliance/alliance_admin_laws_feet.tpl rename to styles/views/alliance/alliance_admin_laws_feet.php diff --git a/styles/templates/alliance/alliance_admin_laws_head.tpl b/styles/views/alliance/alliance_admin_laws_head.php similarity index 100% rename from styles/templates/alliance/alliance_admin_laws_head.tpl rename to styles/views/alliance/alliance_admin_laws_head.php diff --git a/styles/templates/alliance/alliance_admin_laws_row.tpl b/styles/views/alliance/alliance_admin_laws_row.php similarity index 100% rename from styles/templates/alliance/alliance_admin_laws_row.tpl rename to styles/views/alliance/alliance_admin_laws_row.php diff --git a/styles/templates/alliance/alliance_admin_members_row.tpl b/styles/views/alliance/alliance_admin_members_row.php similarity index 100% rename from styles/templates/alliance/alliance_admin_members_row.tpl rename to styles/views/alliance/alliance_admin_members_row.php diff --git a/styles/templates/alliance/alliance_admin_members_row_edit.tpl b/styles/views/alliance/alliance_admin_members_row_edit.php similarity index 100% rename from styles/templates/alliance/alliance_admin_members_row_edit.tpl rename to styles/views/alliance/alliance_admin_members_row_edit.php diff --git a/styles/templates/alliance/alliance_admin_members_table.tpl b/styles/views/alliance/alliance_admin_members_table.php similarity index 100% rename from styles/templates/alliance/alliance_admin_members_table.tpl rename to styles/views/alliance/alliance_admin_members_table.php diff --git a/styles/templates/alliance/alliance_admin_rename.tpl b/styles/views/alliance/alliance_admin_rename.php similarity index 100% rename from styles/templates/alliance/alliance_admin_rename.tpl rename to styles/views/alliance/alliance_admin_rename.php diff --git a/styles/templates/alliance/alliance_admin_request_form.tpl b/styles/views/alliance/alliance_admin_request_form.php similarity index 90% rename from styles/templates/alliance/alliance_admin_request_form.tpl rename to styles/views/alliance/alliance_admin_request_form.php index e5b5921..b75fed9 100644 --- a/styles/templates/alliance/alliance_admin_request_form.tpl +++ b/styles/views/alliance/alliance_admin_request_form.php @@ -1,4 +1,4 @@ - +
    {Request_from}
    + {al_circular_message} + + + {al_send_circular_message} + +
    + +
    + + + + {message_box_row} +
    {title}
    +
    +
    \ No newline at end of file diff --git a/styles/views/alliance/alliance_message_box_row_one.php b/styles/views/alliance/alliance_message_box_row_one.php new file mode 100644 index 0000000..e6592d4 --- /dev/null +++ b/styles/views/alliance/alliance_message_box_row_one.php @@ -0,0 +1,6 @@ + + + {message} + + + \ No newline at end of file diff --git a/styles/views/alliance/alliance_message_box_row_two.php b/styles/views/alliance/alliance_message_box_row_two.php new file mode 100644 index 0000000..d467ae8 --- /dev/null +++ b/styles/views/alliance/alliance_message_box_row_two.php @@ -0,0 +1,10 @@ + + + {message} + + + + + + + \ No newline at end of file diff --git a/styles/views/alliance/alliance_requests_row.php b/styles/views/alliance/alliance_requests_row.php new file mode 100644 index 0000000..8d2f052 --- /dev/null +++ b/styles/views/alliance/alliance_requests_row.php @@ -0,0 +1,10 @@ + + + {al_requests} + + + + {request_count} {al_new_requests} + + + \ No newline at end of file diff --git a/styles/templates/alliance/alliance_searchform.tpl b/styles/views/alliance/alliance_searchform.php similarity index 100% rename from styles/templates/alliance/alliance_searchform.tpl rename to styles/views/alliance/alliance_searchform.php diff --git a/styles/templates/alliance/alliance_searchresult_row.tpl b/styles/views/alliance/alliance_searchresult_row.php similarity index 100% rename from styles/templates/alliance/alliance_searchresult_row.tpl rename to styles/views/alliance/alliance_searchresult_row.php diff --git a/styles/templates/alliance/alliance_searchresult_table.tpl b/styles/views/alliance/alliance_searchresult_table.php similarity index 100% rename from styles/templates/alliance/alliance_searchresult_table.tpl rename to styles/views/alliance/alliance_searchresult_table.php diff --git a/styles/views/alliance/index.html b/styles/views/alliance/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/templates/banned_body.tpl b/styles/views/banned/banned_body.php similarity index 60% rename from styles/templates/banned_body.tpl rename to styles/views/banned/banned_body.php index 4d5b7bc..594a4d8 100644 --- a/styles/templates/banned_body.tpl +++ b/styles/views/banned/banned_body.php @@ -2,7 +2,7 @@
    - + @@ -10,6 +10,9 @@ - {banned} + {banned_players} + + +
    {bn_players_banned_list}{bn_players_banned_list}
    {bn_player} {bn_reason}{bn_until} {bn_by}
    {banned_msg}
    \ No newline at end of file diff --git a/styles/views/banned/banned_row.php b/styles/views/banned/banned_row.php new file mode 100644 index 0000000..be01a45 --- /dev/null +++ b/styles/views/banned/banned_row.php @@ -0,0 +1,7 @@ + + {player} + {reason} + {since} + {until} + {by} + \ No newline at end of file diff --git a/styles/views/banned/index.html b/styles/views/banned/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/views/buddy/buddy_body.php b/styles/views/buddy/buddy_body.php new file mode 100644 index 0000000..69afa80 --- /dev/null +++ b/styles/views/buddy/buddy_body.php @@ -0,0 +1,29 @@ +
    +
    +
    + + + + + + + + + + + + + + + {request_received} + + + + {request_sended} + + + + {buddys} +
    {bu_buddy_list}
    {bu_player}{bu_alliance}{bu_coords}{bu_text}{bu_action}
    {bu_requests}
    {bu_my_requests}
    {bu_partners}
    +
    +
    \ No newline at end of file diff --git a/styles/views/buddy/buddy_request.php b/styles/views/buddy/buddy_request.php new file mode 100644 index 0000000..eff179c --- /dev/null +++ b/styles/views/buddy/buddy_request.php @@ -0,0 +1,31 @@ + +
    +
    + + + + + + + + + + + + + + + + + +
    {bu_request_message}
    {bu_player}{player}
    + {bu_request_text} (0 / 5000 {bu_characters}) + + +
    + {bu_back} + + +
    +
    +
    \ No newline at end of file diff --git a/styles/views/buddy/buddy_row.php b/styles/views/buddy/buddy_row.php new file mode 100644 index 0000000..122f7a9 --- /dev/null +++ b/styles/views/buddy/buddy_row.php @@ -0,0 +1,17 @@ + + + {username} + + + {ally_name} + + + {galaxy}:{system}:{planet} + + + {text} + + + {action} + + \ No newline at end of file diff --git a/styles/views/buddy/index.html b/styles/views/buddy/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/views/buildings/buildings_builds.php b/styles/views/buildings/buildings_builds.php new file mode 100644 index 0000000..f4e0b46 --- /dev/null +++ b/styles/views/buildings/buildings_builds.php @@ -0,0 +1,8 @@ +
    +
    +{BuildListScript} + + {BuildList} + {BuildingsList} +
    +
    \ No newline at end of file diff --git a/styles/templates/buildings/buildings_builds_row.tpl b/styles/views/buildings/buildings_builds_row.php similarity index 75% rename from styles/templates/buildings/buildings_builds_row.tpl rename to styles/views/buildings/buildings_builds_row.php index 18e00ae..943758e 100644 --- a/styles/templates/buildings/buildings_builds_row.tpl +++ b/styles/views/buildings/buildings_builds_row.php @@ -5,11 +5,10 @@ - {n}{nivel}{energia}
    + {n}{nivel}
    {descriptions}
    {price} {time} - {rest_price} {click} \ No newline at end of file diff --git a/styles/views/buildings/buildings_defense.php b/styles/views/buildings/buildings_defense.php new file mode 100644 index 0000000..69c07a4 --- /dev/null +++ b/styles/views/buildings/buildings_defense.php @@ -0,0 +1,11 @@ +
    +
    + {message} +
    + + {buildlist} + {build_defenses} +
    +
    + {buildinglist} +
    \ No newline at end of file diff --git a/styles/views/buildings/buildings_fleet.php b/styles/views/buildings/buildings_fleet.php new file mode 100644 index 0000000..b9ffff6 --- /dev/null +++ b/styles/views/buildings/buildings_fleet.php @@ -0,0 +1,11 @@ +
    +
    + {message} +
    + + {buildlist} + {build_fleet} +
    +
    + {buildinglist} +
    \ No newline at end of file diff --git a/styles/views/buildings/buildings_fleet_row.php b/styles/views/buildings/buildings_fleet_row.php new file mode 100644 index 0000000..ebe85f0 --- /dev/null +++ b/styles/views/buildings/buildings_fleet_row.php @@ -0,0 +1,16 @@ + + + + + + + + {element_name} {element_nbre}
    + {element_description}
    + {element_price} + {building_time} + + + {add_element} + + \ No newline at end of file diff --git a/styles/views/buildings/buildings_research.php b/styles/views/buildings/buildings_research.php new file mode 100644 index 0000000..3a54540 --- /dev/null +++ b/styles/views/buildings/buildings_research.php @@ -0,0 +1,9 @@ +
    +
    + {noresearch} + + + {technolist} + +
    +
    \ No newline at end of file diff --git a/styles/templates/buildings/buildings_research_row.tpl b/styles/views/buildings/buildings_research_row.php similarity index 59% rename from styles/templates/buildings/buildings_research_row.tpl rename to styles/views/buildings/buildings_research_row.php index c58a23c..d6cbbaf 100644 --- a/styles/templates/buildings/buildings_research_row.tpl +++ b/styles/views/buildings/buildings_research_row.php @@ -1,15 +1,15 @@ - + + - + {tech_name} {tech_level}
    {tech_descr}
    {tech_price} {search_time} - {tech_restp} - + {tech_link} \ No newline at end of file diff --git a/styles/templates/buildings/buildings_research_script.tpl b/styles/views/buildings/buildings_research_script.php similarity index 100% rename from styles/templates/buildings/buildings_research_script.tpl rename to styles/views/buildings/buildings_research_script.php diff --git a/styles/templates/buildings/buildings_script.tpl b/styles/views/buildings/buildings_script.php similarity index 98% rename from styles/templates/buildings/buildings_script.tpl rename to styles/views/buildings/buildings_script.php index 042c7af..916bf19 100644 --- a/styles/templates/buildings/buildings_script.tpl +++ b/styles/views/buildings/buildings_script.php @@ -83,7 +83,7 @@ function xd() {
    - +
    diff --git a/styles/views/buildings/index.html b/styles/views/buildings/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/templates/changelog_body.tpl b/styles/views/changelog/changelog_body.php similarity index 100% rename from styles/templates/changelog_body.tpl rename to styles/views/changelog/changelog_body.php diff --git a/styles/templates/changelog_table.tpl b/styles/views/changelog/changelog_table.php similarity index 100% rename from styles/templates/changelog_table.tpl rename to styles/views/changelog/changelog_table.php diff --git a/styles/views/changelog/index.html b/styles/views/changelog/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/templates/empire/empire_row.tpl b/styles/views/empire/empire_row.php similarity index 100% rename from styles/templates/empire/empire_row.tpl rename to styles/views/empire/empire_row.php diff --git a/styles/templates/empire/empire_table.tpl b/styles/views/empire/empire_table.php similarity index 100% rename from styles/templates/empire/empire_table.tpl rename to styles/views/empire/empire_table.php diff --git a/styles/views/empire/index.html b/styles/views/empire/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/views/fleet/fleet1_inputs.php b/styles/views/fleet/fleet1_inputs.php new file mode 100644 index 0000000..0cb1abb --- /dev/null +++ b/styles/views/fleet/fleet1_inputs.php @@ -0,0 +1,4 @@ + + + + diff --git a/styles/views/fleet/fleet1_shortcut_acs_row.php b/styles/views/fleet/fleet1_shortcut_acs_row.php new file mode 100644 index 0000000..6ba6531 --- /dev/null +++ b/styles/views/fleet/fleet1_shortcut_acs_row.php @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/styles/views/fleet/fleet1_shortcuts_noshortcuts_row.php b/styles/views/fleet/fleet1_shortcuts_noshortcuts_row.php new file mode 100644 index 0000000..d425345 --- /dev/null +++ b/styles/views/fleet/fleet1_shortcuts_noshortcuts_row.php @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/styles/views/fleet/fleet1_shortcuts_row.php b/styles/views/fleet/fleet1_shortcuts_row.php new file mode 100644 index 0000000..ab6bb33 --- /dev/null +++ b/styles/views/fleet/fleet1_shortcuts_row.php @@ -0,0 +1,8 @@ + + + \ No newline at end of file diff --git a/styles/templates/fleet/fleet1_table.tpl b/styles/views/fleet/fleet1_table.php similarity index 93% rename from styles/templates/fleet/fleet1_table.tpl rename to styles/views/fleet/fleet1_table.php index 6caa9d6..fa52ed2 100644 --- a/styles/templates/fleet/fleet1_table.tpl +++ b/styles/views/fleet/fleet1_table.php @@ -1,8 +1,18 @@ - + {fleetblock} diff --git a/styles/views/fleet/fleet2_inputs.php b/styles/views/fleet/fleet2_inputs.php new file mode 100644 index 0000000..552ad2f --- /dev/null +++ b/styles/views/fleet/fleet2_inputs.php @@ -0,0 +1,4 @@ + + + + diff --git a/styles/views/fleet/fleet2_mission_row.php b/styles/views/fleet/fleet2_mission_row.php new file mode 100644 index 0000000..7fce00e --- /dev/null +++ b/styles/views/fleet/fleet2_mission_row.php @@ -0,0 +1,8 @@ + + + diff --git a/styles/views/fleet/fleet2_stay_row.php b/styles/views/fleet/fleet2_stay_row.php new file mode 100644 index 0000000..a5cfaf7 --- /dev/null +++ b/styles/views/fleet/fleet2_stay_row.php @@ -0,0 +1,12 @@ + + + + + + diff --git a/styles/templates/fleet/fleet2_table.tpl b/styles/views/fleet/fleet2_table.php similarity index 98% rename from styles/templates/fleet/fleet2_table.tpl rename to styles/views/fleet/fleet2_table.php index 49f37d9..6a91ad1 100644 --- a/styles/templates/fleet/fleet2_table.tpl +++ b/styles/views/fleet/fleet2_table.php @@ -1,4 +1,4 @@ - + - + +
    {work_todo}
    + + ({name}) + +
    + {fl_shorcut_message} +
    + +
    + + +
    + {expedition_message} +
    + {fl_hold_time} +
    + {fl_hours} +
    @@ -27,6 +27,7 @@ {fleetpagerow} {message_nofreeslot}
    + {acs_members} @@ -40,6 +41,9 @@ {body} + {none_max_selector} + {noships_row} + {continue_button}
    {shipdata} @@ -49,6 +53,6 @@ - +
    \ No newline at end of file diff --git a/styles/views/fleet/index.html b/styles/views/fleet/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/views/galaxy/galaxy_alliance_block.php b/styles/views/galaxy/galaxy_alliance_block.php new file mode 100644 index 0000000..93a0215 --- /dev/null +++ b/styles/views/galaxy/galaxy_alliance_block.php @@ -0,0 +1,3 @@ + + {tag} + \ No newline at end of file diff --git a/styles/templates/galaxy/galaxy_body.tpl b/styles/views/galaxy/galaxy_body.php similarity index 100% rename from styles/templates/galaxy/galaxy_body.tpl rename to styles/views/galaxy/galaxy_body.php diff --git a/styles/views/galaxy/galaxy_debris_block.php b/styles/views/galaxy/galaxy_debris_block.php new file mode 100644 index 0000000..e19f8fc --- /dev/null +++ b/styles/views/galaxy/galaxy_debris_block.php @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/styles/templates/galaxy/galaxy_footer.tpl b/styles/views/galaxy/galaxy_footer.php similarity index 100% rename from styles/templates/galaxy/galaxy_footer.tpl rename to styles/views/galaxy/galaxy_footer.php diff --git a/styles/templates/galaxy/galaxy_missile_selector.tpl b/styles/views/galaxy/galaxy_missile_selector.php similarity index 97% rename from styles/templates/galaxy/galaxy_missile_selector.tpl rename to styles/views/galaxy/galaxy_missile_selector.php index a8e3291..6fa6432 100644 --- a/styles/templates/galaxy/galaxy_missile_selector.tpl +++ b/styles/views/galaxy/galaxy_missile_selector.php @@ -7,7 +7,7 @@ {missile_count} - {gl_objective}: + {gl_objective}: + + + + + + + + + {show_messages} + + + + + + + + + +
    {mg_message_title}
    {mg_action}{mg_date}{mg_from}{mg_subject}
    + {mg_show_only_header_spy_reports} +
    + + +
    + + + + + {show_operators} +
    {mg_game_operators}
    + + + + + +
    \ No newline at end of file diff --git a/styles/views/messages/messages_error_table.php b/styles/views/messages/messages_error_table.php new file mode 100644 index 0000000..3c08de6 --- /dev/null +++ b/styles/views/messages/messages_error_table.php @@ -0,0 +1,6 @@ + + + + +
    {error_text}
    +
    \ No newline at end of file diff --git a/styles/views/messages/messages_menu_body.php b/styles/views/messages/messages_menu_body.php new file mode 100644 index 0000000..00d94b2 --- /dev/null +++ b/styles/views/messages/messages_menu_body.php @@ -0,0 +1,23 @@ +
    +
    + + + + + + + + + + + + + {messages_menu_row} +
    {mg_message_title}
    {mg_message_type}{mg_total}
    + + {all_lang} + + + {all_total} +
    +
    \ No newline at end of file diff --git a/styles/views/messages/messages_menu_row.php b/styles/views/messages/messages_menu_row.php new file mode 100644 index 0000000..b9d53d0 --- /dev/null +++ b/styles/views/messages/messages_menu_row.php @@ -0,0 +1,10 @@ + + + + {lang} + + + + {total} + + \ No newline at end of file diff --git a/styles/views/messages/messages_pm_form.php b/styles/views/messages/messages_pm_form.php new file mode 100644 index 0000000..bae9cfe --- /dev/null +++ b/styles/views/messages/messages_pm_form.php @@ -0,0 +1,27 @@ + +
    +
    + {status_message} +
    + + + + + + + + + + + + + + + + + + + +
    {mg_send_message}
    {mg_to}
    {mg_subject}
    {mg_message} (0 / 5000 {mg_chars})
    +
    +
    \ No newline at end of file diff --git a/styles/views/messages/messages_row.php b/styles/views/messages/messages_row.php new file mode 100644 index 0000000..6829aec --- /dev/null +++ b/styles/views/messages/messages_row.php @@ -0,0 +1,11 @@ + + + + {message_date} + {message_from} + {message_subject} + + +   + {message_text} + \ No newline at end of file diff --git a/styles/views/notes/index.html b/styles/views/notes/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/templates/notes/notes_body.tpl b/styles/views/notes/notes_body.php similarity index 100% rename from styles/templates/notes/notes_body.tpl rename to styles/views/notes/notes_body.php diff --git a/styles/templates/notes/notes_body_entry.tpl b/styles/views/notes/notes_body_entry.php similarity index 100% rename from styles/templates/notes/notes_body_entry.tpl rename to styles/views/notes/notes_body_entry.php diff --git a/styles/templates/notes/notes_form.tpl b/styles/views/notes/notes_form.php similarity index 93% rename from styles/templates/notes/notes_form.tpl rename to styles/views/notes/notes_form.php index e3cfeae..8dc5fa2 100644 --- a/styles/templates/notes/notes_form.tpl +++ b/styles/views/notes/notes_form.php @@ -1,4 +1,4 @@ - +
    {inputs} diff --git a/styles/views/officier/index.html b/styles/views/officier/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/templates/officier/officier_row.tpl b/styles/views/officier/officier_row.php similarity index 50% rename from styles/templates/officier/officier_row.tpl rename to styles/views/officier/officier_row.php index c81256c..73972cd 100644 --- a/styles/templates/officier/officier_row.tpl +++ b/styles/views/officier/officier_row.php @@ -1,9 +1,9 @@ diff --git a/styles/views/officier/officier_table.php b/styles/views/officier/officier_table.php new file mode 100644 index 0000000..67ba003 --- /dev/null +++ b/styles/views/officier/officier_table.php @@ -0,0 +1,9 @@ +
    +
    +
    - + - {off_name} ({of_lvl} {off_lvl})
    + {off_name} ({off_status})
    {off_desc}
    {off_link}
    + + + + {disp_off_tbl} +
    {of_title}
    + \ No newline at end of file diff --git a/styles/views/options/index.html b/styles/views/options/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/templates/options/options_admadd.tpl b/styles/views/options/options_admadd.php similarity index 100% rename from styles/templates/options/options_admadd.tpl rename to styles/views/options/options_admadd.php diff --git a/styles/templates/options/options_body.tpl b/styles/views/options/options_body.php similarity index 97% rename from styles/templates/options/options_body.tpl rename to styles/views/options/options_body.php index 42f4149..9a566e5 100644 --- a/styles/templates/options/options_body.tpl +++ b/styles/views/options/options_body.php @@ -42,7 +42,11 @@ {op_skin_example} - + + + {op_show_skin} diff --git a/styles/templates/options/options_body_vmode.tpl b/styles/views/options/options_body_vmode.php similarity index 100% rename from styles/templates/options/options_body_vmode.tpl rename to styles/views/options/options_body_vmode.php diff --git a/styles/views/overview/index.html b/styles/views/overview/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/templates/overview/overview_body.tpl b/styles/views/overview/overview_body.php similarity index 81% rename from styles/templates/overview/overview_body.tpl rename to styles/views/overview/overview_body.php index 51dbcde..720293c 100644 --- a/styles/templates/overview/overview_body.tpl +++ b/styles/views/overview/overview_body.php @@ -1,4 +1,3 @@ -
    @@ -8,7 +7,7 @@ {Have_new_message} - + @@ -38,11 +37,6 @@ - - - -
    {ov_server_time}
    {date_time}
    {ov_events}
    {ov_points} {user_rank} -
    Ïîñëåäíèõ 5 ñîîáùåíèé èç ÷àòà
    {LastChat}
    \ No newline at end of file diff --git a/styles/templates/overview/overview_deleteplanet.tpl b/styles/views/overview/overview_deleteplanet.php similarity index 100% rename from styles/templates/overview/overview_deleteplanet.tpl rename to styles/views/overview/overview_deleteplanet.php diff --git a/styles/templates/overview/overview_fleet_event.tpl b/styles/views/overview/overview_fleet_event.php similarity index 100% rename from styles/templates/overview/overview_fleet_event.tpl rename to styles/views/overview/overview_fleet_event.php diff --git a/styles/templates/overview/overview_renameplanet.tpl b/styles/views/overview/overview_renameplanet.php similarity index 100% rename from styles/templates/overview/overview_renameplanet.tpl rename to styles/views/overview/overview_renameplanet.php diff --git a/styles/views/plugins/index.html b/styles/views/plugins/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/views/public/index.html b/styles/views/public/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/templates/public/index_body.tpl b/styles/views/public/index_body.php similarity index 71% rename from styles/templates/public/index_body.tpl rename to styles/views/public/index_body.php index 3783cc8..7ea303a 100644 --- a/styles/templates/public/index_body.tpl +++ b/styles/views/public/index_body.php @@ -1,3 +1,4 @@ +
    @@ -7,7 +8,7 @@ {user} - {pass} + {pass} @@ -26,7 +27,7 @@ {register} {forum}
    -
    +
    {welcome_to} {servername}
    @@ -37,15 +38,16 @@
    {server_register}
    -
    {server_message} {servername}!

    +
    {server_message} {servername}!
    -
    - {login_online} : {online_users}        - {login_lastreg} : {last_user}        - {login_numbreg} : {users_amount}
    - + + +
    -
    \ No newline at end of file +
    + \ No newline at end of file diff --git a/styles/templates/public/lostpassword.tpl b/styles/views/public/lostpassword.php similarity index 68% rename from styles/templates/public/lostpassword.tpl rename to styles/views/public/lostpassword.php index 78fb6d4..29a617d 100644 --- a/styles/templates/public/lostpassword.tpl +++ b/styles/views/public/lostpassword.php @@ -19,6 +19,11 @@
    {email}:
    + + +
    diff --git a/styles/templates/public/registry_form.tpl b/styles/views/public/registry_form.php similarity index 77% rename from styles/templates/public/registry_form.tpl rename to styles/views/public/registry_form.php index 2aa067a..aa566ff 100644 --- a/styles/templates/public/registry_form.tpl +++ b/styles/views/public/registry_form.php @@ -22,7 +22,7 @@ {pass_reg}: - + {email_reg}: @@ -35,6 +35,11 @@
    {accept_terms_and_conditions}
    + + + diff --git a/styles/views/resources/index.html b/styles/views/resources/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/templates/resources/resources.tpl b/styles/views/resources/resources.php similarity index 100% rename from styles/templates/resources/resources.tpl rename to styles/views/resources/resources.php diff --git a/styles/templates/resources/resources_row.tpl b/styles/views/resources/resources_row.php similarity index 100% rename from styles/templates/resources/resources_row.tpl rename to styles/views/resources/resources_row.php diff --git a/styles/views/search/index.html b/styles/views/search/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/templates/search/search_ally_row.tpl b/styles/views/search/search_ally_row.php similarity index 100% rename from styles/templates/search/search_ally_row.tpl rename to styles/views/search/search_ally_row.php diff --git a/styles/templates/search/search_ally_table.tpl b/styles/views/search/search_ally_table.php similarity index 100% rename from styles/templates/search/search_ally_table.tpl rename to styles/views/search/search_ally_table.php diff --git a/styles/templates/search/search_body.tpl b/styles/views/search/search_body.php similarity index 100% rename from styles/templates/search/search_body.tpl rename to styles/views/search/search_body.php diff --git a/styles/templates/search/search_user_row.tpl b/styles/views/search/search_user_row.php similarity index 100% rename from styles/templates/search/search_user_row.tpl rename to styles/views/search/search_user_row.php diff --git a/styles/templates/search/search_user_table.tpl b/styles/views/search/search_user_table.php similarity index 100% rename from styles/templates/search/search_user_table.tpl rename to styles/views/search/search_user_table.php diff --git a/styles/views/shortcuts/index.html b/styles/views/shortcuts/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/views/shortcuts/shortcuts_editPanel.php b/styles/views/shortcuts/shortcuts_editPanel.php new file mode 100644 index 0000000..6abea72 --- /dev/null +++ b/styles/views/shortcuts/shortcuts_editPanel.php @@ -0,0 +1,33 @@ +
    + + + + + + + + + + + + + + +
    {fl_shortcut_add_title}
    + + + + + +
    + + +
    + {fl_shortcuts} +
    + +
    \ No newline at end of file diff --git a/styles/views/shortcuts/shortcuts_row.php b/styles/views/shortcuts/shortcuts_row.php new file mode 100644 index 0000000..2a95566 --- /dev/null +++ b/styles/views/shortcuts/shortcuts_row.php @@ -0,0 +1,5 @@ + + + {shortcut_name} {shortcut_galaxy}:{shortcut_system}:{shortcut_planet} {shortcut_moon} + + \ No newline at end of file diff --git a/styles/views/shortcuts/shortcuts_table.php b/styles/views/shortcuts/shortcuts_table.php new file mode 100644 index 0000000..89a349c --- /dev/null +++ b/styles/views/shortcuts/shortcuts_table.php @@ -0,0 +1,15 @@ +
    + + + + + {block_rows} + + + +
    + {fl_shortcuts} ({fl_shortcut_add}) +
    + {fl_back} +
    +
    \ No newline at end of file diff --git a/styles/views/stat/index.html b/styles/views/stat/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/templates/stat/stat_alliancetable.tpl b/styles/views/stat/stat_alliancetable.php similarity index 100% rename from styles/templates/stat/stat_alliancetable.tpl rename to styles/views/stat/stat_alliancetable.php diff --git a/styles/templates/stat/stat_alliancetable_header.tpl b/styles/views/stat/stat_alliancetable_header.php similarity index 100% rename from styles/templates/stat/stat_alliancetable_header.tpl rename to styles/views/stat/stat_alliancetable_header.php diff --git a/styles/templates/stat/stat_body.tpl b/styles/views/stat/stat_body.php similarity index 100% rename from styles/templates/stat/stat_body.tpl rename to styles/views/stat/stat_body.php diff --git a/styles/templates/stat/stat_playertable.tpl b/styles/views/stat/stat_playertable.php similarity index 100% rename from styles/templates/stat/stat_playertable.tpl rename to styles/views/stat/stat_playertable.php diff --git a/styles/templates/stat/stat_playertable_header.tpl b/styles/views/stat/stat_playertable_header.php similarity index 100% rename from styles/templates/stat/stat_playertable_header.tpl rename to styles/views/stat/stat_playertable_header.php diff --git a/styles/views/techtree/index.html b/styles/views/techtree/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/templates/techtree/techtree_body.tpl b/styles/views/techtree/techtree_body.php similarity index 100% rename from styles/templates/techtree/techtree_body.tpl rename to styles/views/techtree/techtree_body.php diff --git a/styles/templates/techtree/techtree_head.tpl b/styles/views/techtree/techtree_head.php similarity index 100% rename from styles/templates/techtree/techtree_head.tpl rename to styles/views/techtree/techtree_head.php diff --git a/styles/templates/techtree/techtree_row.tpl b/styles/views/techtree/techtree_row.php similarity index 100% rename from styles/templates/techtree/techtree_row.tpl rename to styles/views/techtree/techtree_row.php diff --git a/styles/views/trader/index.html b/styles/views/trader/index.html new file mode 100644 index 0000000..e69de29 diff --git a/styles/templates/trader/trader_cristal.tpl b/styles/views/trader/trader_cristal.php similarity index 100% rename from styles/templates/trader/trader_cristal.tpl rename to styles/views/trader/trader_cristal.php diff --git a/styles/templates/trader/trader_deuterium.tpl b/styles/views/trader/trader_deuterium.php similarity index 100% rename from styles/templates/trader/trader_deuterium.tpl rename to styles/views/trader/trader_deuterium.php diff --git a/styles/templates/trader/trader_main.tpl b/styles/views/trader/trader_main.php similarity index 100% rename from styles/templates/trader/trader_main.tpl rename to styles/views/trader/trader_main.php diff --git a/styles/templates/trader/trader_metal.tpl b/styles/views/trader/trader_metal.php similarity index 100% rename from styles/templates/trader/trader_metal.tpl rename to styles/views/trader/trader_metal.php