@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
| 3 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
| 4 | 4 | { |
| 5 | 5 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | $template = gettemplate('ali_info', true); |
| 9 | 9 | |
| 10 | -if($mode == 'exit') |
|
| 10 | +if ($mode == 'exit') |
|
| 11 | 11 | { |
| 12 | 12 | if ($ally['ally_owner'] == $user['id']) |
| 13 | 13 | { |
@@ -24,25 +24,25 @@ discard block |
||
| 24 | 24 | messageBox(sprintf($lang['ali_info_leave_success'], $ally['ally_name']), $lang['sys_alliance']); |
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | -elseif($mode == 'ainfo') |
|
| 27 | +elseif ($mode == 'ainfo') |
|
| 28 | 28 | { |
| 29 | 29 | $tag = sys_get_param_str('tag'); |
| 30 | 30 | $id_ally = sys_get_param_id('a'); |
| 31 | - if($tag) |
|
| 31 | + if ($tag) |
|
| 32 | 32 | { |
| 33 | 33 | $ally = doquery("SELECT * FROM {{alliance}} WHERE ally_tag='{$tag}' LIMIT 1;", '', true); |
| 34 | 34 | } |
| 35 | - elseif($id_ally) |
|
| 35 | + elseif ($id_ally) |
|
| 36 | 36 | { |
| 37 | 37 | $ally = doquery("SELECT * FROM {{alliance}} WHERE id='{$id_ally}' LIMIT 1;", '', true); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - if(!$ally) |
|
| 40 | + if (!$ally) |
|
| 41 | 41 | { |
| 42 | 42 | messageBox($lang['ali_sys_notFound'], $lang['Ally_info_1']); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - if(!$ally['ally_description']) |
|
| 45 | + if (!$ally['ally_description']) |
|
| 46 | 46 | { |
| 47 | 47 | $ally['ally_description'] = $lang['Ally_nodescription']; |
| 48 | 48 | } |
@@ -51,17 +51,17 @@ discard block |
||
| 51 | 51 | 'EXTERNAL' => true, |
| 52 | 52 | 'USER_ALLY_ID' => $user['ally_id'], |
| 53 | 53 | )); |
| 54 | - $page_header = $lang['sys_alliance']; |
|
| 54 | + $page_header = $lang['sys_alliance']; |
|
| 55 | 55 | } |
| 56 | 56 | else |
| 57 | 57 | { |
| 58 | 58 | $page_header = $lang['your_alliance']; |
| 59 | 59 | |
| 60 | - if($ally['ally_owner'] == $user['id']) |
|
| 60 | + if ($ally['ally_owner'] == $user['id']) |
|
| 61 | 61 | { |
| 62 | 62 | $range = $ally['ally_owner_range'] ? $ally['ally_owner_range'] : $lang['Founder']; |
| 63 | 63 | } |
| 64 | - elseif($user['ally_rank_id'] != 0 && isset($ranks[$user['ally_rank_id']]['name'])) |
|
| 64 | + elseif ($user['ally_rank_id'] != 0 && isset($ranks[$user['ally_rank_id']]['name'])) |
|
| 65 | 65 | { |
| 66 | 66 | $range = $ranks[$user['ally_rank_id']]['name']; |
| 67 | 67 | } |
@@ -105,9 +105,9 @@ discard block |
||
| 105 | 105 | )); |
| 106 | 106 | |
| 107 | 107 | $relations = ali_relations($ally['id']); |
| 108 | -foreach($relations as $relation) |
|
| 108 | +foreach ($relations as $relation) |
|
| 109 | 109 | { |
| 110 | - if($relation['alliance_diplomacy_contr_ally_id'] && $relation['alliance_diplomacy_ally_id']) |
|
| 110 | + if ($relation['alliance_diplomacy_contr_ally_id'] && $relation['alliance_diplomacy_ally_id']) |
|
| 111 | 111 | { |
| 112 | 112 | $template->assign_block_vars('relation', array( |
| 113 | 113 | 'NAME' => $relation['alliance_diplomacy_contr_ally_name'], |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | -function ali_render(){$func_args = func_get_args();return sn_function_call(__FUNCTION__, $func_args);} |
|
| 120 | +function ali_render() {$func_args = func_get_args(); return sn_function_call(__FUNCTION__, $func_args); } |
|
| 121 | 121 | ali_render(); |
| 122 | 122 | |
| 123 | 123 | display($template, "{$lang['alliance']} [{$ally['ally_name']}]"); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
| 3 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
| 4 | 4 | { |
| 5 | 5 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
| 6 | 6 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | sys_redirect('alliance.php'); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - if($user_request['request_denied']) |
|
| 23 | + if ($user_request['request_denied']) |
|
| 24 | 24 | { |
| 25 | 25 | $lang['request_text'] = sprintf($lang['ali_req_deny_msg'], $ally['ally_tag'], $user_request['request_text']); |
| 26 | 26 | } |
@@ -43,12 +43,12 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | $ally = doquery("SELECT * FROM {{alliance}} WHERE `id` ='{$id_ally}'", true); |
| 45 | 45 | |
| 46 | -if(!$ally) |
|
| 46 | +if (!$ally) |
|
| 47 | 47 | { |
| 48 | 48 | messageBox($lang['ali_sys_notFound'], $lang['ali_req_title']); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | -if($ally['ally_request_notallow']) |
|
| 51 | +if ($ally['ally_request_notallow']) |
|
| 52 | 52 | { |
| 53 | 53 | messageBox($lang['ali_req_not_allowed'], $lang['ali_req_title']); |
| 54 | 54 | } |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | use \DBAL\DbQuery; |
| 4 | 4 | |
| 5 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
| 5 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
| 6 | 6 | { |
| 7 | 7 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
| 8 | 8 | } |
@@ -16,28 +16,28 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | $ally_name_safe = db_escape($user['ally_name']); |
| 18 | 18 | |
| 19 | -if(sys_get_param_str('ali_dip_offer_make')) |
|
| 19 | +if (sys_get_param_str('ali_dip_offer_make')) |
|
| 20 | 20 | { |
| 21 | 21 | $alliance_negotiation_relation = sys_get_param_str('alliance_negotiation_relation'); |
| 22 | - if(!array_key_exists($alliance_negotiation_relation, $sn_diplomacy_relation_list)) |
|
| 22 | + if (!array_key_exists($alliance_negotiation_relation, $sn_diplomacy_relation_list)) |
|
| 23 | 23 | { |
| 24 | 24 | messageBox($lang['ali_dip_err_wrong_offer'], $page_title); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | $alliance_negotiation_contr_ally_id = sys_get_param_id('alliance_negotiation_contr_ally_id'); |
| 28 | - if($alliance_negotiation_contr_ally_id == $user['ally_id']) |
|
| 28 | + if ($alliance_negotiation_contr_ally_id == $user['ally_id']) |
|
| 29 | 29 | { |
| 30 | 30 | messageBox($lang['ali_dip_err_same_ally'], $page_title); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | $contr_ally_row = doquery("SELECT `ally_name` FROM {{alliance}} WHERE `id` = {$alliance_negotiation_contr_ally_id} LIMIT 1;", '', true); |
| 34 | - if(!$contr_ally_row) |
|
| 34 | + if (!$contr_ally_row) |
|
| 35 | 35 | { |
| 36 | 36 | messageBox($lang['ali_dip_err_no_ally'], $page_title); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $relation_current_id = ali_relation($user['ally_id'], $alliance_negotiation_contr_ally_id); |
| 40 | - if($alliance_negotiation_relation == $relation_current_id) |
|
| 40 | + if ($alliance_negotiation_relation == $relation_current_id) |
|
| 41 | 41 | { |
| 42 | 42 | messageBox(sprintf($lang['ali_dip_err_offer_same'], $lang['ali_dip_relations'][$alliance_negotiation_relation]), $page_title); |
| 43 | 43 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $relation_new = $sn_diplomacy_relation_list[$alliance_negotiation_relation]; |
| 51 | 51 | $relation_current = $sn_diplomacy_relation_list[$relation_current_id]; |
| 52 | - if($relation_new['enter_delay'] == -1 || $relation_current['exit_delay'] == -1) |
|
| 52 | + if ($relation_new['enter_delay'] == -1 || $relation_current['exit_delay'] == -1) |
|
| 53 | 53 | { |
| 54 | 54 | DbQuery::build() |
| 55 | 55 | ->setTable('alliance_negotiation') |
@@ -82,39 +82,39 @@ discard block |
||
| 82 | 82 | else |
| 83 | 83 | { |
| 84 | 84 | $offer_id = sys_get_param_id('offer_id'); |
| 85 | - if($offer_id) |
|
| 85 | + if ($offer_id) |
|
| 86 | 86 | { |
| 87 | 87 | $offer_answer = sys_get_param_str('answer'); |
| 88 | 88 | |
| 89 | 89 | $negotiation = doquery("SELECT * FROM {{alliance_negotiation}} WHERE alliance_negotiation_id = {$offer_id} LIMIT 1;", '', true); |
| 90 | - if(!$negotiation) |
|
| 90 | + if (!$negotiation) |
|
| 91 | 91 | { |
| 92 | 92 | messageBox($lang['ali_dip_err_offer_none'], $page_title); |
| 93 | 93 | } |
| 94 | - elseif($negotiation['alliance_negotiation_ally_id'] != $user['ally_id'] && $negotiation['alliance_negotiation_contr_ally_id'] != $user['ally_id']) |
|
| 94 | + elseif ($negotiation['alliance_negotiation_ally_id'] != $user['ally_id'] && $negotiation['alliance_negotiation_contr_ally_id'] != $user['ally_id']) |
|
| 95 | 95 | { |
| 96 | 96 | // TODO: Add log of hack attempt |
| 97 | 97 | messageBox($lang['ali_dip_err_offer_alien'], $page_title); |
| 98 | 98 | } |
| 99 | - elseif($negotiation['alliance_negotiation_ally_id'] == $user['ally_id']) |
|
| 99 | + elseif ($negotiation['alliance_negotiation_ally_id'] == $user['ally_id']) |
|
| 100 | 100 | { |
| 101 | - if($offer_answer == 'accept') |
|
| 101 | + if ($offer_answer == 'accept') |
|
| 102 | 102 | { |
| 103 | 103 | // TODO: Add log of hack attempt |
| 104 | 104 | messageBox($lang['ali_dip_err_offer_accept_own'], $page_title); |
| 105 | 105 | } |
| 106 | - elseif($offer_answer == 'deny') |
|
| 106 | + elseif ($offer_answer == 'deny') |
|
| 107 | 107 | { |
| 108 | 108 | doquery("DELETE FROM {{alliance_negotiation}} WHERE alliance_negotiation_id = {$offer_id} LIMIT 1;"); |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | else |
| 112 | 112 | { |
| 113 | - if($offer_answer == 'accept') |
|
| 113 | + if ($offer_answer == 'accept') |
|
| 114 | 114 | { |
| 115 | 115 | $accept_offer = true; |
| 116 | 116 | } |
| 117 | - elseif($offer_answer == 'deny') |
|
| 117 | + elseif ($offer_answer == 'deny') |
|
| 118 | 118 | { |
| 119 | 119 | DBStaticAlly::db_ally_negotiation_update_status_1($offer_id); |
| 120 | 120 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | -if($accept_offer) |
|
| 125 | +if ($accept_offer) |
|
| 126 | 126 | { |
| 127 | 127 | sn_db_transaction_start(); |
| 128 | 128 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | sn_db_transaction_commit(); |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | -foreach($sn_diplomacy_relation_list as $diplomacy_relation_id => $diplomacy_relation) |
|
| 164 | +foreach ($sn_diplomacy_relation_list as $diplomacy_relation_id => $diplomacy_relation) |
|
| 165 | 165 | { |
| 166 | 166 | $template->assign_block_vars('relation', array( |
| 167 | 167 | 'ID' => $diplomacy_relation_id, |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | $query = doquery("SELECT id, ally_name, ally_tag FROM {{alliance}} WHERE `id` != {$user['ally_id']} ORDER BY ally_name;"); |
| 173 | -while($alliance = db_fetch($query)) |
|
| 173 | +while ($alliance = db_fetch($query)) |
|
| 174 | 174 | { |
| 175 | 175 | $template->assign_block_vars('alliance', array( |
| 176 | 176 | 'ID' => $alliance['id'], |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | WHERE |
| 190 | 190 | alliance_negotiation_ally_id = {$user['ally_id']} OR alliance_negotiation_contr_ally_id = {$user['ally_id']};" |
| 191 | 191 | ); |
| 192 | -while($offer = db_fetch($query)) |
|
| 192 | +while ($offer = db_fetch($query)) |
|
| 193 | 193 | { |
| 194 | 194 | $template->assign_block_vars('offer', array( |
| 195 | 195 | 'ID' => $offer['alliance_negotiation_id'], |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | // Pretty Safe |
| 3 | 3 | // TODO: Add ally_tag to usertable |
| 4 | 4 | |
| 5 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
| 5 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
| 6 | 6 | { |
| 7 | 7 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
| 8 | 8 | } |
@@ -12,15 +12,15 @@ discard block |
||
| 12 | 12 | $ally_name_raw = sys_get_param_str_unsafe('name'); |
| 13 | 13 | $ally_name = db_escape($ally_name_raw); |
| 14 | 14 | |
| 15 | -if($ally_tag) |
|
| 15 | +if ($ally_tag) |
|
| 16 | 16 | { |
| 17 | - if(!$ally_name_raw || !$ally_tag_raw) |
|
| 17 | + if (!$ally_name_raw || !$ally_tag_raw) |
|
| 18 | 18 | { |
| 19 | 19 | messageBox($lang['have_not_name'], $lang['make_alliance']); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | $query = doquery("SELECT ally_tag FROM {{alliance}} WHERE `ally_tag` = '{$ally_tag}' or `ally_name` = '{$ally_name}' LIMIT 1;", true); |
| 23 | - if($query) |
|
| 23 | + if ($query) |
|
| 24 | 24 | { |
| 25 | 25 | messageBox(str_replace('%s', $query['ally_tag'] == $ally_tag_raw ? $ally_tag_raw : $ally_name_raw, $lang['always_exist']), $lang['make_alliance']); |
| 26 | 26 | } |
@@ -4,18 +4,18 @@ discard block |
||
| 4 | 4 | // @version 1.0 |
| 5 | 5 | // @copyright 2008 by Chlorel for XNova |
| 6 | 6 | |
| 7 | -if(SN_IN_FLEET !== true) { |
|
| 7 | +if (SN_IN_FLEET !== true) { |
|
| 8 | 8 | $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403); |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | $template = gettemplate('fleet1', true); |
| 12 | 12 | |
| 13 | 13 | $ships = sys_get_param('ships', array()); |
| 14 | -if(!is_array($ships)) { |
|
| 14 | +if (!is_array($ships)) { |
|
| 15 | 15 | $ships = array(); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | -foreach(array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) { |
|
| 18 | +foreach (array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) { |
|
| 19 | 19 | $template->assign_block_vars('possible_planet_type_id', array( |
| 20 | 20 | 'ID' => $possible_planet_type_id, |
| 21 | 21 | 'NAME' => $lang['sys_planet_type_sh'][$possible_planet_type_id], |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | 'START_NAME' => $planetrow['name'], |
| 29 | 29 | ); |
| 30 | 30 | |
| 31 | -if(!empty($TargetPlanet)) { |
|
| 31 | +if (!empty($TargetPlanet)) { |
|
| 32 | 32 | $template_route += array( |
| 33 | 33 | 'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$TargetPlanet['planet_type']], |
| 34 | 34 | 'END_COORDS' => uni_render_coordinates($TargetPlanet), |
@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | $template->assign_block_vars('fleets', $template_route); |
| 40 | 40 | |
| 41 | 41 | $sn_groups_fleet = sn_get_groups('fleet'); |
| 42 | -foreach($ships as $ship_id => $ship_count) { |
|
| 43 | - if(in_array($ship_id, $sn_groups_fleet) && $ship_count) { |
|
| 42 | +foreach ($ships as $ship_id => $ship_count) { |
|
| 43 | + if (in_array($ship_id, $sn_groups_fleet) && $ship_count) { |
|
| 44 | 44 | $ship_info = get_unit_param($ship_id); |
| 45 | - if($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) { |
|
| 45 | + if ($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) { |
|
| 46 | 46 | $page .= $lang['fl_noenought']; |
| 47 | 47 | } else { |
| 48 | 48 | $fleet['fleetarray'][$ship_id] = $ship_count; |
@@ -61,13 +61,13 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | -if(empty($fleet['fleetarray'])) { |
|
| 64 | +if (empty($fleet['fleetarray'])) { |
|
| 65 | 65 | messageBox($lang['fl_err_no_ships'], $lang['fl_error'], 'fleet' . DOT_PHP_EX, 5); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // Building list of shortcuts |
| 69 | 69 | $query = doquery("SELECT * FROM {{notes}} WHERE `owner` = {$user['id']} AND `galaxy` <> 0 AND `system` <> 0 AND `planet` <> 0 ORDER BY `priority` DESC, `galaxy`, `system`, `planet`, `planet_type`;"); |
| 70 | -while($shortcut = db_fetch($query)) { |
|
| 70 | +while ($shortcut = db_fetch($query)) { |
|
| 71 | 71 | $template->assign_block_vars('shortcut', array( |
| 72 | 72 | 'NAME' => $shortcut['title'], |
| 73 | 73 | 'GALAXY' => $shortcut['galaxy'], |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | // Building list of own planets & moons |
| 84 | -$colonies = DBStaticPlanet::db_planet_list_sorted ( $user ); |
|
| 85 | -if(count($colonies) > 1) { |
|
| 84 | +$colonies = DBStaticPlanet::db_planet_list_sorted($user); |
|
| 85 | +if (count($colonies) > 1) { |
|
| 86 | 86 | // while($row = db_fetch($colonies)) |
| 87 | - foreach($colonies as $row) { |
|
| 87 | + foreach ($colonies as $row) { |
|
| 88 | 88 | $template->assign_block_vars('colonies', array( |
| 89 | 89 | 'NAME' => $row['name'], |
| 90 | 90 | 'GALAXY' => $row['galaxy'], |
@@ -99,9 +99,9 @@ discard block |
||
| 99 | 99 | //ACS Start |
| 100 | 100 | //Need to look for acs attacks. |
| 101 | 101 | $aks_madnessred = doquery('SELECT * FROM {{aks}};'); |
| 102 | -while($row = db_fetch($aks_madnessred)) { |
|
| 102 | +while ($row = db_fetch($aks_madnessred)) { |
|
| 103 | 103 | $members = explode(',', $row['eingeladen']); |
| 104 | - foreach($members as $a => $b) { |
|
| 104 | + foreach ($members as $a => $b) { |
|
| 105 | 105 | if ($b == $user['id']) { |
| 106 | 106 | $template->assign_block_vars('acss', array( |
| 107 | 107 | 'ID' => $row['id'], |
@@ -18,17 +18,17 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | $sensorLevel = mrc_get_level($user, $planetrow, STRUC_MOON_PHALANX); |
| 20 | 20 | if (!intval($sensorLevel)) { |
| 21 | - messageBox ($lang['phalanx_nosensoravailable'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
| 21 | + messageBox($lang['phalanx_nosensoravailable'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | if ($planetrow['planet_type'] != PT_MOON) { |
| 25 | - messageBox ($lang['phalanx_onlyformoons'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
| 25 | + messageBox($lang['phalanx_onlyformoons'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | $scan_galaxy = sys_get_param_int('galaxy'); |
| 29 | 29 | $scan_system = sys_get_param_int('system'); |
| 30 | 30 | $scan_planet = sys_get_param_int('planet'); |
| 31 | -$scan_planet_type = 1; // sys_get_param_int('planettype'); |
|
| 31 | +$scan_planet_type = 1; // sys_get_param_int('planettype'); |
|
| 32 | 32 | $id = sys_get_param_id('id'); |
| 33 | 33 | |
| 34 | 34 | $source_galaxy = $planetrow['galaxy']; |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | $sensorRange = GetPhalanxRange($sensorLevel); |
| 39 | 39 | |
| 40 | 40 | $system_distance = abs($source_system - $scan_system); |
| 41 | -if($system_distance > $sensorRange || $scan_galaxy != $source_galaxy) |
|
| 41 | +if ($system_distance > $sensorRange || $scan_galaxy != $source_galaxy) |
|
| 42 | 42 | { |
| 43 | - messageBox ($lang['phalanx_rangeerror'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
| 43 | + messageBox($lang['phalanx_rangeerror'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $cost = $sensorLevel * 1000; |
@@ -51,14 +51,14 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | $planet_scanned = DBStaticPlanet::db_planet_by_gspt($scan_galaxy, $scan_system, $scan_planet, $scan_planet_type); |
| 54 | -if(!$planet_scanned['id']) |
|
| 54 | +if (!$planet_scanned['id']) |
|
| 55 | 55 | { |
| 56 | 56 | messageBox($lang['phalanx_planet_not_exists'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | -if($planet_scanned['destruyed']) |
|
| 59 | +if ($planet_scanned['destruyed']) |
|
| 60 | 60 | { |
| 61 | - messageBox ($lang['phalanx_planet_destroyed'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
| 61 | + messageBox($lang['phalanx_planet_destroyed'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | DBStaticPlanet::db_planet_set_by_id($user['current_planet'], "deuterium = deuterium - {$cost}"); |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -define('INSIDE' , true); |
|
| 4 | -define('INSTALL' , false); |
|
| 3 | +define('INSIDE', true); |
|
| 4 | +define('INSTALL', false); |
|
| 5 | 5 | define('IN_ADMIN', true); |
| 6 | 6 | |
| 7 | 7 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR); |
| 12 | 12 | |
| 13 | 13 | $planet_active = sys_get_param_int('planet_active'); |
| 14 | -if(!$planet_active) { |
|
| 14 | +if (!$planet_active) { |
|
| 15 | 15 | $planet_type = sys_get_param_int('planet_type', 1); |
| 16 | 16 | $planet_type = $planet_type == 3 ? 3 : 1; |
| 17 | 17 | } else { |
@@ -40,8 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $page_title = |
| 42 | 42 | $lang['adm_planet_list_title'] . ': ' . |
| 43 | - ($planet_active ? $lang['adm_planet_active'] : |
|
| 44 | - ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '') |
|
| 43 | + ($planet_active ? $lang['adm_planet_active'] : ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '') |
|
| 45 | 44 | ); |
| 46 | 45 | $template->assign_vars(array( |
| 47 | 46 | 'PAGE_TITLE' => $page_title, |
@@ -18,26 +18,26 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR); |
| 20 | 20 | |
| 21 | -if($delete = sys_get_param_id('delete')) |
|
| 21 | +if ($delete = sys_get_param_id('delete')) |
|
| 22 | 22 | { |
| 23 | 23 | doquery("DELETE FROM `{{logs}}` WHERE `log_id` = {$delete} LIMIT 1;"); |
| 24 | 24 | } |
| 25 | -elseif(sys_get_param_str('delete_update_info')) |
|
| 25 | +elseif (sys_get_param_str('delete_update_info')) |
|
| 26 | 26 | { |
| 27 | 27 | doquery("DELETE FROM `{{logs}}` WHERE `log_code` in (103, 180, 191);"); |
| 28 | 28 | } |
| 29 | -elseif(sys_get_param_str('deleteall') == 'yes') |
|
| 29 | +elseif (sys_get_param_str('deleteall') == 'yes') |
|
| 30 | 30 | { |
| 31 | 31 | // doquery("TRUNCATE TABLE `{{logs}}`"); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | -if($detail = sys_get_param_id('detail')) |
|
| 34 | +if ($detail = sys_get_param_id('detail')) |
|
| 35 | 35 | { |
| 36 | 36 | $template = gettemplate('admin/adm_log_main_detail', true); |
| 37 | 37 | |
| 38 | 38 | $errorInfo = doquery("SELECT * FROM `{{logs}}` WHERE `log_id` = {$detail} LIMIT 1;", true); |
| 39 | 39 | $error_dump = unserialize($errorInfo['log_dump']); |
| 40 | - if(is_array($error_dump)) |
|
| 40 | + if (is_array($error_dump)) |
|
| 41 | 41 | { |
| 42 | 42 | foreach ($error_dump as $key => $value) |
| 43 | 43 | { |
@@ -57,11 +57,11 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | $i = 0; |
| 59 | 59 | $query = doquery("SELECT * FROM `{{logs}}` ORDER BY log_id DESC LIMIT 100;"); |
| 60 | - while($u = db_fetch($query)) |
|
| 60 | + while ($u = db_fetch($query)) |
|
| 61 | 61 | { |
| 62 | 62 | $i++; |
| 63 | 63 | $v = array(); |
| 64 | - foreach($u as $key => $value) |
|
| 64 | + foreach ($u as $key => $value) |
|
| 65 | 65 | { |
| 66 | 66 | $v[strtoupper($key)] = $value; |
| 67 | 67 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | $configValue = $forceLoad ? $this->config->db_loadItem($configName) : $this->config[$configName]; |
| 36 | 36 | $configType == WATCHDOG_TIME_SQL ? $configValue = strtotime($configValue, SN_TIME_NOW) : false; |
| 37 | 37 | |
| 38 | - if(SN_TIME_NOW - $configValue > $timeDiff) { |
|
| 38 | + if (SN_TIME_NOW - $configValue > $timeDiff) { |
|
| 39 | 39 | $callable(); |
| 40 | 40 | } |
| 41 | 41 | |