@@ -116,7 +116,7 @@ |
||
| 116 | 116 | 'log_lost_send_mail' => 'Send confirmation code', |
| 117 | 117 | 'log_lost_description2' => 'If you have a confirmation code, please enter it below and click "Reset password". An e-mail will be sent an email with a new password<br /><br /> |
| 118 | 118 | If you already asking for confirmation code but can not find email from us in your main folder - check your SPAM folder. Some mail servers can mark our letters as "SPAM"<br /><br /> |
| 119 | - If you absolutly sure that did not receive email from us - just write a email to Administration address <span class="ok">' . classSupernova::$config->server_email . '</span>', |
|
| 119 | + If you absolutly sure that did not receive email from us - just write a email to Administration address <span class="ok">' . classSupernova::$config->server_email.'</span>', |
|
| 120 | 120 | 'log_lost_reset_pass' => 'Reset password', |
| 121 | 121 | 'log_lost_sent_code' => 'Email sent to this email with further instructions on resetting your password', |
| 122 | 122 | 'log_lost_sent_pass' => 'Just sent to your email message with the new password', |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | global $skip_fleet_update; |
| 6 | 6 | $skip_fleet_update = true; |
| 7 | 7 | |
| 8 | -require_once('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
| 8 | +require_once('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
| 9 | 9 | |
| 10 | 10 | /* |
| 11 | 11 | $time_local = $time_server + $time_diff |
@@ -13,13 +13,13 @@ discard block |
||
| 13 | 13 | $time_server = $time_local - $time_diff |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -if($font_size = sys_get_param_str('font_size')) { |
|
| 17 | - if(strpos($font_size, '%') !== false) { |
|
| 16 | +if ($font_size = sys_get_param_str('font_size')) { |
|
| 17 | + if (strpos($font_size, '%') !== false) { |
|
| 18 | 18 | // Размер шрифта в процентах |
| 19 | - $font_size = min(max(floatval($font_size), FONT_SIZE_PERCENT_MIN), FONT_SIZE_PERCENT_MAX) . '%'; |
|
| 20 | - } elseif(strpos($font_size, 'px') !== false) { |
|
| 19 | + $font_size = min(max(floatval($font_size), FONT_SIZE_PERCENT_MIN), FONT_SIZE_PERCENT_MAX).'%'; |
|
| 20 | + } elseif (strpos($font_size, 'px') !== false) { |
|
| 21 | 21 | // Размер шрифта в пикселях |
| 22 | - $font_size = min(max(floatval($font_size), FONT_SIZE_PIXELS_MIN), FONT_SIZE_PIXELS_MAX) . 'px'; |
|
| 22 | + $font_size = min(max(floatval($font_size), FONT_SIZE_PIXELS_MIN), FONT_SIZE_PIXELS_MAX).'px'; |
|
| 23 | 23 | } else { |
| 24 | 24 | // Не мышонка, не лягушка... |
| 25 | 25 | $font_size = FONT_SIZE_PERCENT_DEFAULT_STRING; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | classSupernova::$user_options[PLAYER_OPTION_BASE_FONT_SIZE] = $font_size; |
| 30 | 30 | } else { |
| 31 | 31 | $user_time_diff = playerTimeDiff::user_time_diff_get(); |
| 32 | - if($user_time_diff[PLAYER_OPTION_TIME_DIFF_FORCED]) { |
|
| 32 | + if ($user_time_diff[PLAYER_OPTION_TIME_DIFF_FORCED]) { |
|
| 33 | 33 | $time_diff = intval($user_time_diff[PLAYER_OPTION_TIME_DIFF]); |
| 34 | 34 | } else { |
| 35 | 35 | $user_time_diff = playerTimeDiff::user_time_diff_probe(); |
@@ -22,17 +22,17 @@ discard block |
||
| 22 | 22 | $sn_group_factories = sn_get_groups('factories'); |
| 23 | 23 | $planet_density = sn_get_groups('planet_density'); |
| 24 | 24 | |
| 25 | - if(sys_get_param('save_production')) { |
|
| 25 | + if (sys_get_param('save_production')) { |
|
| 26 | 26 | $production = sys_get_param('percent'); |
| 27 | - if(is_array($production) && !empty($production)) { |
|
| 27 | + if (is_array($production) && !empty($production)) { |
|
| 28 | 28 | // sn_db_transaction_start(); |
| 29 | 29 | $query = array(); |
| 30 | 30 | $planet_row_list = db_planet_list_sorted($user, false, '*'); |
| 31 | 31 | // while($planet = db_fetch($planet_row_list)) |
| 32 | - foreach($planet_row_list as $planet) { |
|
| 33 | - foreach($sn_group_factories as $factory_unit_id) { |
|
| 32 | + foreach ($planet_row_list as $planet) { |
|
| 33 | + foreach ($sn_group_factories as $factory_unit_id) { |
|
| 34 | 34 | $unit_db_name_porcent = pname_factory_production_field_name($factory_unit_id); |
| 35 | - if( |
|
| 35 | + if ( |
|
| 36 | 36 | get_unit_param($factory_unit_id, P_MINING_IS_MANAGED) |
| 37 | 37 | && isset($production[$factory_unit_id][$planet['id']]) |
| 38 | 38 | && ($actual_porcent = intval($production[$factory_unit_id][$planet['id']] / 10)) >= 0 |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | - foreach($query as $planet_id => $query_data) { |
|
| 46 | + foreach ($query as $planet_id => $query_data) { |
|
| 47 | 47 | db_planet_set_by_id($planet_id, implode(',', $query_data)); |
| 48 | 48 | } |
| 49 | 49 | // sn_db_transaction_commit(); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $planet_row_list = db_planet_list_sorted($user); |
| 54 | 54 | // while ($planet = db_fetch($planet_row_list)) |
| 55 | - foreach($planet_row_list as $planet) { |
|
| 55 | + foreach ($planet_row_list as $planet) { |
|
| 56 | 56 | sn_db_transaction_start(); |
| 57 | 57 | $global_data = sys_o_get_updated($user, $planet['id'], SN_TIME_NOW, false, true); |
| 58 | 58 | $planets[$planet['id']] = $global_data['planet']; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $template = gettemplate('imperium', $template); |
| 65 | 65 | $template->assign_var('amount', count($planets) + 2); |
| 66 | 66 | |
| 67 | - for($i = 100; $i >= 0; $i -= 10) { |
|
| 67 | + for ($i = 100; $i >= 0; $i -= 10) { |
|
| 68 | 68 | $template->assign_block_vars('percent', array('PERCENT' => $i)); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -74,13 +74,13 @@ discard block |
||
| 74 | 74 | $total['temp_min'] = 1000; |
| 75 | 75 | $total['temp_max'] = -999; |
| 76 | 76 | |
| 77 | - foreach($planets as $planet_index => &$planet) { |
|
| 77 | + foreach ($planets as $planet_index => &$planet) { |
|
| 78 | 78 | $list_planet_que = $ques[$planet_index]; |
| 79 | 79 | $planet_template = tpl_parse_planet($planet); |
| 80 | 80 | |
| 81 | 81 | $planet_fleet_id = 0; |
| 82 | - $fleet_list = $planet_template['fleet_list'];//flt_get_fleets_to_planet($planet); |
|
| 83 | - if($fleet_list['own']['count']) { |
|
| 82 | + $fleet_list = $planet_template['fleet_list']; //flt_get_fleets_to_planet($planet); |
|
| 83 | + if ($fleet_list['own']['count']) { |
|
| 84 | 84 | $planet_fleet_id = "p{$fleet_id}"; |
| 85 | 85 | $fleets[] = tpl_parse_fleet_sn($fleet_list['own']['total'], $planet_fleet_id); |
| 86 | 86 | $fleet_id++; |
@@ -141,17 +141,17 @@ discard block |
||
| 141 | 141 | UNIT_DEFENCE => 'defense', |
| 142 | 142 | ); |
| 143 | 143 | |
| 144 | - foreach($show_groups as $unit_group_id => $mode) { |
|
| 144 | + foreach ($show_groups as $unit_group_id => $mode) { |
|
| 145 | 145 | $template->assign_block_vars('prods', array( |
| 146 | 146 | 'NAME' => classLocale::$lang['tech'][$unit_group_id], |
| 147 | 147 | )); |
| 148 | 148 | $unit_group = get_unit_param('techtree', $unit_group_id); |
| 149 | - foreach($unit_group as $unit_id) { |
|
| 149 | + foreach ($unit_group as $unit_id) { |
|
| 150 | 150 | $unit_count = $unit_count_abs = 0; |
| 151 | 151 | $block_vars = array(); |
| 152 | 152 | $unit_is_factory = in_array($unit_id, $sn_group_factories) && get_unit_param($unit_id, P_MINING_IS_MANAGED); |
| 153 | 153 | // $unit_db_name = pname_resource_name($unit_id); |
| 154 | - foreach($planets as $planet) { |
|
| 154 | + foreach ($planets as $planet) { |
|
| 155 | 155 | $unit_level_plain = mrc_get_level($user, $planet, $unit_id, false, true); |
| 156 | 156 | |
| 157 | 157 | $level_plus['FACTORY'] = $unit_is_factory; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $level_plus['LEVEL_PLUS_GREEN'] = 0; |
| 160 | 160 | |
| 161 | 161 | $level_plus['PERCENT'] = $unit_is_factory ? ($unit_level_plain ? $planet[pname_factory_production_field_name($unit_id)] * 10 : -1) : -1; |
| 162 | - switch($mode) { |
|
| 162 | + switch ($mode) { |
|
| 163 | 163 | /* |
| 164 | 164 | case 'structures': |
| 165 | 165 | $level_plus_build = $ques[$planet['id']]['in_que'][que_get_unit_que($unit_id)][$user['id']][$planet['id']][$unit_id]; |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | case 'structures': |
| 180 | 180 | case 'defense': |
| 181 | 181 | $level_plus_build = $ques[$planet['id']]['in_que'][que_get_unit_que($unit_id)][$user['id']][$planet['id']][$unit_id]; |
| 182 | - if($level_plus_build) { |
|
| 182 | + if ($level_plus_build) { |
|
| 183 | 183 | $level_plus['LEVEL_PLUS_GREEN'] = $level_plus_build < 0 ? $level_plus_build : "+{$level_plus_build}"; |
| 184 | 184 | // $level_plus['LEVEL_PLUS_GREEN'] = "+{$level_plus_build}"; |
| 185 | 185 | $total['units'][$unit_id]['LEVEL_PLUS_GREEN'] += $level_plus['LEVEL_PLUS_GREEN']; |
@@ -199,15 +199,15 @@ discard block |
||
| 199 | 199 | $unit_count_abs += $unit_level_plain + abs($level_plus['LEVEL_PLUS_YELLOW']) + abs($level_plus['LEVEL_PLUS_GREEN']); |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - if($unit_count_abs) { |
|
| 202 | + if ($unit_count_abs) { |
|
| 203 | 203 | $template->assign_block_vars('prods', array( |
| 204 | 204 | 'ID' => $unit_id, |
| 205 | - 'FIELD' => 'unit_' . $unit_id, // pname_resource_name($unit_id), // TODO Делать это прямо в темплейте |
|
| 205 | + 'FIELD' => 'unit_'.$unit_id, // pname_resource_name($unit_id), // TODO Делать это прямо в темплейте |
|
| 206 | 206 | 'NAME' => classLocale::$lang['tech'][$unit_id], |
| 207 | 207 | 'MODE' => $mode, |
| 208 | 208 | )); |
| 209 | 209 | |
| 210 | - foreach($block_vars as $block_var) { |
|
| 210 | + foreach ($block_vars as $block_var) { |
|
| 211 | 211 | $template->assign_block_vars('prods.planet', $block_var); |
| 212 | 212 | } |
| 213 | 213 | $unit_green = $total['units'][$unit_id]['LEVEL_PLUS_GREEN']; |
@@ -14,13 +14,13 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | $no_data = array('user' => false, 'planet' => false, 'que' => false); |
| 16 | 16 | |
| 17 | - if(!$planet) { |
|
| 17 | + if (!$planet) { |
|
| 18 | 18 | return $no_data; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - if(!$no_user_update) { |
|
| 21 | + if (!$no_user_update) { |
|
| 22 | 22 | $user = intval(is_array($user) && $user['id'] ? $user['id'] : $user); |
| 23 | - if(!$user) { |
|
| 23 | + if (!$user) { |
|
| 24 | 24 | // TODO - Убрать позже |
| 25 | 25 | print('<h1>СООБЩИТЕ ЭТО АДМИНУ: sys_o_get_updated() - USER пустой!</h1>'); |
| 26 | 26 | $backtrace = debug_backtrace(); |
@@ -32,17 +32,17 @@ discard block |
||
| 32 | 32 | $user = db_user_by_id($user, !$simulation, '*', true); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - if(empty($user['id'])) { |
|
| 35 | + if (empty($user['id'])) { |
|
| 36 | 36 | return $no_data; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - if(is_array($planet) && isset($planet['galaxy']) && $planet['galaxy']) { |
|
| 39 | + if (is_array($planet) && isset($planet['galaxy']) && $planet['galaxy']) { |
|
| 40 | 40 | $planet = db_planet_by_vector($planet, '', !$simulation); |
| 41 | 41 | } else { |
| 42 | 42 | $planet = intval(is_array($planet) && isset($planet['id']) ? $planet['id'] : $planet); |
| 43 | 43 | $planet = db_planet_by_id($planet, !$simulation); |
| 44 | 44 | } |
| 45 | - if(!is_array($planet) || !isset($planet['id'])) { |
|
| 45 | + if (!is_array($planet) || !isset($planet['id'])) { |
|
| 46 | 46 | return $no_data; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -65,19 +65,19 @@ discard block |
||
| 65 | 65 | RES_DEUTERIUM => 0, |
| 66 | 66 | ); |
| 67 | 67 | |
| 68 | - switch($planet['planet_type']) { |
|
| 68 | + switch ($planet['planet_type']) { |
|
| 69 | 69 | case PT_PLANET: |
| 70 | - foreach($resources_increase as $resource_id => &$increment) { |
|
| 70 | + foreach ($resources_increase as $resource_id => &$increment) { |
|
| 71 | 71 | $resource_name = pname_resource_name($resource_id); |
| 72 | 72 | $increment = $caps_real['total'][$resource_id] * $ProductionTime / 3600; |
| 73 | 73 | $store_free = $caps_real['total_storage'][$resource_id] - $planet[$resource_name]; |
| 74 | 74 | $increment = min($increment, max(0, $store_free)); |
| 75 | 75 | |
| 76 | - if($planet[$resource_name] + $increment < 0 && !$simulation) { |
|
| 76 | + if ($planet[$resource_name] + $increment < 0 && !$simulation) { |
|
| 77 | 77 | classSupernova::$debug->warning("Player ID {$user['id']} have negative resources on ID {$planet['id']}.{$planet['planet_type']} [{$planet['galaxy']}:{$planet['system']}:{$planet['planet']}]. Difference {$planet[$resource_name]} of {$resource_name}", 'Negative Resources', 501); |
| 78 | 78 | } |
| 79 | 79 | $planet[$resource_name] += $increment; |
| 80 | - $planet[$resource_name . '_perhour'] = $caps_real['total'][$resource_id]; |
|
| 80 | + $planet[$resource_name.'_perhour'] = $caps_real['total'][$resource_id]; |
|
| 81 | 81 | } |
| 82 | 82 | break; |
| 83 | 83 | |
@@ -94,13 +94,13 @@ discard block |
||
| 94 | 94 | // TODO пересчитывать размер планеты только при постройке чего-нибудь и при покупке сектора |
| 95 | 95 | $planet['field_current'] = 0; |
| 96 | 96 | $sn_group_build_allow = sn_get_groups('build_allow'); |
| 97 | - if(is_array($sn_group_build_allow[$planet['planet_type']])) { |
|
| 98 | - foreach($sn_group_build_allow[$planet['planet_type']] as $building_id) { |
|
| 97 | + if (is_array($sn_group_build_allow[$planet['planet_type']])) { |
|
| 98 | + foreach ($sn_group_build_allow[$planet['planet_type']] as $building_id) { |
|
| 99 | 99 | $planet['field_current'] += mrc_get_level($user, $planet, $building_id, !$simulation, true); |
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - if($simulation) { |
|
| 103 | + if ($simulation) { |
|
| 104 | 104 | return array('user' => $user, 'planet' => $planet, 'que' => $que); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -3,10 +3,10 @@ discard block |
||
| 3 | 3 | function ali_rank_list_save($ranks) { |
| 4 | 4 | global $user; |
| 5 | 5 | |
| 6 | - if(!empty($ranks)) { |
|
| 7 | - foreach($ranks as $rank => $rights) { |
|
| 6 | + if (!empty($ranks)) { |
|
| 7 | + foreach ($ranks as $rank => $rights) { |
|
| 8 | 8 | $rights = implode(',', $rights); |
| 9 | - $ranklist .= $rights . ';'; |
|
| 9 | + $ranklist .= $rights.';'; |
|
| 10 | 10 | } |
| 11 | 11 | } |
| 12 | 12 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $temp_array = array(); |
| 23 | 23 | $query = db_ally_diplomacy_get_relations($ally_from, $ally_to); |
| 24 | 24 | |
| 25 | - while($record = db_fetch($query)) { |
|
| 25 | + while ($record = db_fetch($query)) { |
|
| 26 | 26 | $temp_array[$record['alliance_diplomacy_contr_ally_id']] = $record; |
| 27 | 27 | } |
| 28 | 28 | |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | // ---------------------------------------------------------------------------------------------------------------- |
| 4 | 4 | function lng_try_filepath($path, $file_path_relative) |
| 5 | 5 | { |
| 6 | - $file_path = SN_ROOT_PHYSICAL . ($path && file_exists(SN_ROOT_PHYSICAL . $path . $file_path_relative) ? $path : '') . $file_path_relative; |
|
| 6 | + $file_path = SN_ROOT_PHYSICAL.($path && file_exists(SN_ROOT_PHYSICAL.$path.$file_path_relative) ? $path : '').$file_path_relative; |
|
| 7 | 7 | return file_exists($file_path) ? $file_path : false; |
| 8 | 8 | } |
| 9 | 9 | |
@@ -22,10 +22,10 @@ discard block |
||
| 22 | 22 | ), |
| 23 | 23 | ); |
| 24 | 24 | |
| 25 | - foreach($queries as &$query) { |
|
| 26 | - if(!empty($query['query'])) { |
|
| 25 | + foreach ($queries as &$query) { |
|
| 26 | + if (!empty($query['query'])) { |
|
| 27 | 27 | $query['result'] = doquery($query['query']); |
| 28 | - } elseif(!empty($query['callable']) && is_callable($query['callable'])) { |
|
| 28 | + } elseif (!empty($query['callable']) && is_callable($query['callable'])) { |
|
| 29 | 29 | call_user_func($query['callable']); |
| 30 | 30 | } |
| 31 | 31 | $query['error'] = classSupernova::$db->db_error(); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $today_array = array($today_array['seconds'], $today_array['minutes'], $today_array['hours'], $today_array['mday'], $today_array['mon'], $today_array['year']); |
| 70 | 70 | // pdump($prev_run_array); |
| 71 | 71 | $scheduleList = explode(',', $scheduleList); |
| 72 | - array_walk($scheduleList, function (&$schedule) use ($prev_run_array, $today_array, $date_part_names_reverse, &$possible_schedules) { |
|
| 72 | + array_walk($scheduleList, function(&$schedule) use ($prev_run_array, $today_array, $date_part_names_reverse, &$possible_schedules) { |
|
| 73 | 73 | // pdump($schedule); |
| 74 | 74 | $schedule = array('schedule_array' => array_reverse(explode(':', trim($schedule)))); |
| 75 | 75 | |
@@ -81,21 +81,21 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | // pdump($schedule); |
| 83 | 83 | |
| 84 | - foreach($prev_run_array as $index => $date_part) { |
|
| 84 | + foreach ($prev_run_array as $index => $date_part) { |
|
| 85 | 85 | $schedule['array']['recorded'][$index] = isset($schedule['schedule_array'][$index]) ? intval($schedule['schedule_array'][$index]) : $date_part; |
| 86 | 86 | $schedule['array']['now'][$index] = isset($schedule['schedule_array'][$index]) ? intval($schedule['schedule_array'][$index]) : $today_array[$index]; |
| 87 | 87 | } |
| 88 | - if($schedule['array']['recorded'] == $schedule['array']['now']) { |
|
| 88 | + if ($schedule['array']['recorded'] == $schedule['array']['now']) { |
|
| 89 | 89 | unset($schedule['array']['now']); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - foreach($schedule['array'] as $name => $array) { |
|
| 92 | + foreach ($schedule['array'] as $name => $array) { |
|
| 93 | 93 | $schedule['string'][$name] = "{$array[5]}-{$array[4]}-{$array[3]} {$array[2]}:{$array[1]}:{$array[0]}"; |
| 94 | - $schedule['string'][$name . '_next'] = $schedule['string'][$name] . ' +1 ' . $interval; |
|
| 95 | - $schedule['string'][$name . '_prev'] = $schedule['string'][$name] . ' -1 ' . $interval; |
|
| 94 | + $schedule['string'][$name.'_next'] = $schedule['string'][$name].' +1 '.$interval; |
|
| 95 | + $schedule['string'][$name.'_prev'] = $schedule['string'][$name].' -1 '.$interval; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - foreach($schedule['string'] as $string) { |
|
| 98 | + foreach ($schedule['string'] as $string) { |
|
| 99 | 99 | $timestamp = strtotime($string); |
| 100 | 100 | $schedule['timestamp'][$timestamp] = $possible_schedules[$timestamp] = date(FMT_DATE_TIME_SQL, strtotime($string)); |
| 101 | 101 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | $prev_run = 0; |
| 129 | 129 | $next_run = 0; |
| 130 | - foreach($possible_schedules as $timestamp => $string_date) { |
|
| 130 | + foreach ($possible_schedules as $timestamp => $string_date) { |
|
| 131 | 131 | $prev_run = SN_TIME_NOW >= $timestamp ? $timestamp : $prev_run; |
| 132 | 132 | $next_run = SN_TIME_NOW < $timestamp && !$next_run ? $timestamp : $next_run; |
| 133 | 133 | // pdump($schedule, '$schedule ' . date(FMT_DATE_TIME_SQL, $schedule)); |
@@ -107,23 +107,23 @@ |
||
| 107 | 107 | |
| 108 | 108 | !empty(classSupernova::$config->url_faq) ? $msg = str_replace('faq://', classSupernova::$config->url_faq, $msg) : false; |
| 109 | 109 | |
| 110 | - foreach($supernova->design['bbcodes'] as $auth_level => $replaces) { |
|
| 111 | - if($auth_level > $author_auth) { |
|
| 110 | + foreach ($supernova->design['bbcodes'] as $auth_level => $replaces) { |
|
| 111 | + if ($auth_level > $author_auth) { |
|
| 112 | 112 | continue; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - foreach($replaces as $key => $html) { |
|
| 115 | + foreach ($replaces as $key => $html) { |
|
| 116 | 116 | $msg = preg_replace(''.$key.'', $html, $msg); |
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - foreach($supernova->design['smiles'] as $auth_level => $replaces) { |
|
| 121 | - if($auth_level > $author_auth) { |
|
| 120 | + foreach ($supernova->design['smiles'] as $auth_level => $replaces) { |
|
| 121 | + if ($auth_level > $author_auth) { |
|
| 122 | 122 | continue; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - foreach($replaces as $key => $imgName) { |
|
| 126 | - $msg = preg_replace("#" . addcslashes($key, '()[]{}') . "#isU","<img src=\"design/images/smileys/".$imgName.".gif\" align=\"absmiddle\" title=\"".$key."\" alt=\"".$key."\">",$msg); |
|
| 125 | + foreach ($replaces as $key => $imgName) { |
|
| 126 | + $msg = preg_replace("#".addcslashes($key, '()[]{}')."#isU", "<img src=\"design/images/smileys/".$imgName.".gif\" align=\"absmiddle\" title=\"".$key."\" alt=\"".$key."\">", $msg); |
|
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | |
@@ -2,8 +2,8 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | // Compare function to sort fleet in time order |
| 4 | 4 | function tpl_assign_fleet_compare($a, $b) { |
| 5 | - if($a['fleet']['OV_THIS_PLANET'] == $b['fleet']['OV_THIS_PLANET']) { |
|
| 6 | - if($a['fleet']['OV_LEFT'] == $b['fleet']['OV_LEFT']) { |
|
| 5 | + if ($a['fleet']['OV_THIS_PLANET'] == $b['fleet']['OV_THIS_PLANET']) { |
|
| 6 | + if ($a['fleet']['OV_LEFT'] == $b['fleet']['OV_LEFT']) { |
|
| 7 | 7 | return 0; |
| 8 | 8 | } |
| 9 | 9 | |
@@ -19,17 +19,17 @@ discard block |
||
| 19 | 19 | * @param string $js_name |
| 20 | 20 | */ |
| 21 | 21 | function tpl_assign_fleet(&$template, $fleets, $js_name = 'fleets') { |
| 22 | - if(!$fleets) { |
|
| 22 | + if (!$fleets) { |
|
| 23 | 23 | return; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | usort($fleets, 'tpl_assign_fleet_compare'); |
| 27 | 27 | |
| 28 | - foreach($fleets as $fleet_data) { |
|
| 28 | + foreach ($fleets as $fleet_data) { |
|
| 29 | 29 | $template->assign_block_vars($js_name, $fleet_data['fleet']); |
| 30 | 30 | |
| 31 | - if($fleet_data['ships']) { |
|
| 32 | - foreach($fleet_data['ships'] as $ship_data) { |
|
| 31 | + if ($fleet_data['ships']) { |
|
| 32 | + foreach ($fleet_data['ships'] as $ship_data) { |
|
| 33 | 33 | $template->assign_block_vars("{$js_name}.ships", $ship_data); |
| 34 | 34 | } |
| 35 | 35 | } |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | 'DEUTERIUM' => $fleet[RES_DEUTERIUM], |
| 51 | 51 | ); |
| 52 | 52 | |
| 53 | - foreach($fleet as $ship_id => $ship_amount) { |
|
| 54 | - if(in_array($ship_id, sn_get_groups('fleet'))) { |
|
| 53 | + foreach ($fleet as $ship_id => $ship_amount) { |
|
| 54 | + if (in_array($ship_id, sn_get_groups('fleet'))) { |
|
| 55 | 55 | $single_ship_data = get_ship_data($ship_id, $user_data); |
| 56 | 56 | $return['ships'][$ship_id] = array( |
| 57 | 57 | 'ID' => $ship_id, |
@@ -90,11 +90,11 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | $result = array(); |
| 92 | 92 | |
| 93 | - if(!$user_data) { |
|
| 93 | + if (!$user_data) { |
|
| 94 | 94 | $user_data = $user; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - if(!$objFleet->isReturning() && $objFleet->mission_type == MT_ACS) { |
|
| 97 | + if (!$objFleet->isReturning() && $objFleet->mission_type == MT_ACS) { |
|
| 98 | 98 | $aks = db_acs_get_by_group_id($objFleet->group_id); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | 'MISSION' => $objFleet->mission_type, |
| 114 | 114 | 'MISSION_NAME' => classLocale::$lang['type_mission'][$objFleet->mission_type], |
| 115 | 115 | 'ACS' => !empty($aks['name']) ? $aks['name'] : (!empty($objFleet->group_id) ? $objFleet->group_id : ''), |
| 116 | - 'AMOUNT' => $spy_level >= 4 ? (pretty_number($objFleet->shipsGetTotal()) . (array_sum($fleet_resources) ? '+' : '')) : '?', |
|
| 116 | + 'AMOUNT' => $spy_level >= 4 ? (pretty_number($objFleet->shipsGetTotal()).(array_sum($fleet_resources) ? '+' : '')) : '?', |
|
| 117 | 117 | |
| 118 | 118 | 'METAL' => $spy_level >= 8 ? $fleet_resources[RES_METAL] : 0, |
| 119 | 119 | 'CRYSTAL' => $spy_level >= 8 ? $fleet_resources[RES_CRYSTAL] : 0, |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | 'STAY_LEFT' => floor($objFleet->time_mission_job_complete + 1 - SN_TIME_NOW), |
| 136 | 136 | ); |
| 137 | 137 | |
| 138 | - if(property_exists($objFleet, 'fleet_start_name')) { |
|
| 138 | + if (property_exists($objFleet, 'fleet_start_name')) { |
|
| 139 | 139 | $result['START_NAME'] = $objFleet->fleet_start_name; |
| 140 | 140 | } |
| 141 | - if(property_exists($objFleet, 'fleet_end_name')) { |
|
| 141 | + if (property_exists($objFleet, 'fleet_end_name')) { |
|
| 142 | 142 | $result['END_NAME'] = $objFleet->fleet_end_name; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - if(property_exists($objFleet, 'event_time')) { |
|
| 145 | + if (property_exists($objFleet, 'event_time')) { |
|
| 146 | 146 | $result['fleet'] = array_merge($result['fleet'], array( |
| 147 | 147 | 'OV_LABEL' => $objFleet->ov_label, |
| 148 | 148 | 'EVENT_TIME_TEXT' => property_exists($objFleet, 'event_time') ? date(FMT_DATE_TIME, $objFleet->event_time + SN_CLIENT_TIME_DIFF) : '', |
@@ -155,9 +155,9 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | $ship_id = 0; |
| 157 | 157 | $result['ships'] = array(); |
| 158 | - if($spy_level >= 6) { |
|
| 159 | - foreach($ship_list_fully_parsed as $ship_sn_id => $ship_amount) { |
|
| 160 | - if($spy_level >= 10) { |
|
| 158 | + if ($spy_level >= 6) { |
|
| 159 | + foreach ($ship_list_fully_parsed as $ship_sn_id => $ship_amount) { |
|
| 160 | + if ($spy_level >= 10) { |
|
| 161 | 161 | $single_ship_data = get_ship_data($ship_sn_id, $user_data); |
| 162 | 162 | $result['ships'][$ship_sn_id] = array( |
| 163 | 163 | 'ID' => $ship_sn_id, |
@@ -190,8 +190,8 @@ discard block |
||
| 190 | 190 | function tpl_parse_planet_que($que, $planet, $que_id) { |
| 191 | 191 | $hangar_que = array(); |
| 192 | 192 | $que_hangar = $que['ques'][$que_id][$planet['id_owner']][$planet['id']]; |
| 193 | - if(!empty($que_hangar)) { |
|
| 194 | - foreach($que_hangar as $que_item) { |
|
| 193 | + if (!empty($que_hangar)) { |
|
| 194 | + foreach ($que_hangar as $que_item) { |
|
| 195 | 195 | $hangar_que['que'][] = array('id' => $que_item['que_unit_id'], 'count' => $que_item['que_unit_amount']); |
| 196 | 196 | $hangar_que[$que_item['que_unit_id']] += $que_item['que_unit_amount']; |
| 197 | 197 | } |
@@ -251,10 +251,10 @@ discard block |
||
| 251 | 251 | 'PLANET_GOVERNOR_LEVEL_MAX' => get_unit_param($planet['PLANET_GOVERNOR_ID'], P_MAX_STACK), |
| 252 | 252 | ); |
| 253 | 253 | |
| 254 | - if(!empty($que['ques'][QUE_STRUCTURES][$planet['id_owner']][$planet['id']])) { |
|
| 254 | + if (!empty($que['ques'][QUE_STRUCTURES][$planet['id_owner']][$planet['id']])) { |
|
| 255 | 255 | $result['building_que'] = array(); |
| 256 | 256 | $building_que = &$que['ques'][QUE_STRUCTURES][$planet['id_owner']][$planet['id']]; |
| 257 | - foreach($building_que as $que_element) { |
|
| 257 | + foreach ($building_que as $que_element) { |
|
| 258 | 258 | $result['building_que'][] = que_tpl_parse_element($que_element); |
| 259 | 259 | } |
| 260 | 260 | } |
@@ -270,19 +270,19 @@ discard block |
||
| 270 | 270 | function flt_get_fleets_to_planet_by_array_of_Fleet($array_of_Fleet) { |
| 271 | 271 | global $user; |
| 272 | 272 | |
| 273 | - if(empty($array_of_Fleet)) { |
|
| 273 | + if (empty($array_of_Fleet)) { |
|
| 274 | 274 | return false; |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | $fleet_list = array(); |
| 278 | - foreach($array_of_Fleet as $fleet) { |
|
| 279 | - if($fleet->playerOwnerId == $user['id']) { |
|
| 280 | - if($fleet->mission_type == MT_MISSILE) { |
|
| 278 | + foreach ($array_of_Fleet as $fleet) { |
|
| 279 | + if ($fleet->playerOwnerId == $user['id']) { |
|
| 280 | + if ($fleet->mission_type == MT_MISSILE) { |
|
| 281 | 281 | continue; |
| 282 | 282 | } |
| 283 | 283 | $fleet_ownage = 'own'; |
| 284 | 284 | } else { |
| 285 | - switch($fleet->mission_type) { |
|
| 285 | + switch ($fleet->mission_type) { |
|
| 286 | 286 | case MT_ATTACK: |
| 287 | 287 | case MT_ACS: |
| 288 | 288 | case MT_DESTROY: |
@@ -299,10 +299,10 @@ discard block |
||
| 299 | 299 | |
| 300 | 300 | $fleet_list[$fleet_ownage]['fleets'][$fleet->dbId] = $fleet; |
| 301 | 301 | |
| 302 | - if($fleet->isReturning() || (!$fleet->isReturning() && $fleet->mission_type == MT_RELOCATE) || ($fleet->target_owner_id != $user['id'])) { |
|
| 302 | + if ($fleet->isReturning() || (!$fleet->isReturning() && $fleet->mission_type == MT_RELOCATE) || ($fleet->target_owner_id != $user['id'])) { |
|
| 303 | 303 | $fleet_sn = $fleet->shipsGetArray(); |
| 304 | - foreach($fleet_sn as $ship_id => $ship_amount) { |
|
| 305 | - if(in_array($ship_id, sn_get_groups('fleet'))) { |
|
| 304 | + foreach ($fleet_sn as $ship_id => $ship_amount) { |
|
| 305 | + if (in_array($ship_id, sn_get_groups('fleet'))) { |
|
| 306 | 306 | $fleet_list[$fleet_ownage]['total'][$ship_id] += $ship_amount; |
| 307 | 307 | } |
| 308 | 308 | } |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | return $fleet_list; |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | -function tpl_set_resource_info(template &$template, $planet_row, $fleets_to_planet = array(), $round = 0) { |
|
| 322 | +function tpl_set_resource_info(template & $template, $planet_row, $fleets_to_planet = array(), $round = 0) { |
|
| 323 | 323 | $template->assign_vars(array( |
| 324 | 324 | 'RESOURCE_ROUNDING' => $round, |
| 325 | 325 | |