@@ -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}"); |
@@ -18,13 +18,13 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR); |
| 20 | 20 | |
| 21 | -$template = gettemplate('admin/adm_payment', true); |
|
| 21 | +$template = gettemplate('admin/adm_payment', true); |
|
| 22 | 22 | |
| 23 | 23 | $payer_list = array( |
| 24 | 24 | -1 => $lang['adm_pay_filter_all'], |
| 25 | 25 | ); |
| 26 | 26 | $query = doquery("SELECT payment_user_id, payment_user_name FROM `{{payment}}` GROUP BY payment_user_id ORDER BY payment_user_name"); |
| 27 | -while($row = db_fetch($query)) { |
|
| 27 | +while ($row = db_fetch($query)) { |
|
| 28 | 28 | $payer_list[$row['payment_user_id']] = '[' . $row['payment_user_id'] . '] ' . $row['payment_user_name']; |
| 29 | 29 | } |
| 30 | 30 | tpl_assign_select($template, 'payer', $payer_list); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | '' => $lang['adm_pay_filter_all'], |
| 34 | 34 | ); |
| 35 | 35 | $query = doquery("SELECT distinct payment_module_name FROM `{{payment}}` ORDER BY payment_module_name"); |
| 36 | -while($row = db_fetch($query)) { |
|
| 36 | +while ($row = db_fetch($query)) { |
|
| 37 | 37 | $module_list[$row['payment_module_name']] = $row['payment_module_name']; |
| 38 | 38 | } |
| 39 | 39 | tpl_assign_select($template, 'module', $module_list); |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | ($flt_module ? "AND payment_module_name = '{$flt_module}' " : '') . |
| 54 | 54 | " ORDER BY payment_id desc"); |
| 55 | 55 | |
| 56 | -while($row = db_fetch($query)) { |
|
| 56 | +while ($row = db_fetch($query)) { |
|
| 57 | 57 | $row2 = array(); |
| 58 | - foreach($row as $key => $value) { |
|
| 58 | + foreach ($row as $key => $value) { |
|
| 59 | 59 | $row2[strtoupper($key)] = $value; |
| 60 | 60 | } |
| 61 | 61 | $template->assign_block_vars('payment', $row2); |
@@ -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, |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | require('../includes/init.' . substr(strrchr(__FILE__, '.'), 1)); |
| 6 | 6 | |
| 7 | -if($user['authlevel'] < 3) |
|
| 7 | +if ($user['authlevel'] < 3) |
|
| 8 | 8 | { |
| 9 | 9 | messageBox($lang['sys_noalloaw'], $lang['sys_noaccess']); |
| 10 | 10 | die(); |
@@ -19,9 +19,9 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | // [#] info_best_battles 1b0 |
| 21 | 21 | $best_reports = array(); |
| 22 | -if(defined('MODULE_INFO_BEST_BATTLES_QUERY')) { |
|
| 22 | +if (defined('MODULE_INFO_BEST_BATTLES_QUERY')) { |
|
| 23 | 23 | $query = doquery(MODULE_INFO_BEST_BATTLES_QUERY); |
| 24 | - while($row = db_fetch($query)) { |
|
| 24 | + while ($row = db_fetch($query)) { |
|
| 25 | 25 | $best_reports[] = $row['ube_report_id']; |
| 26 | 26 | } |
| 27 | 27 | } |
@@ -185,16 +185,16 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | function sn_maintenance_pack_user_list($user_list) { |
| 187 | 187 | $user_list = explode(',', $user_list); |
| 188 | - foreach($user_list as $key => $user_id) { |
|
| 189 | - if(!ceil(floatval($user_id))) { |
|
| 188 | + foreach ($user_list as $key => $user_id) { |
|
| 189 | + if (!ceil(floatval($user_id))) { |
|
| 190 | 190 | unset($user_list[$key]); |
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | $result = array(); |
| 195 | - if(!empty($user_list)) { |
|
| 195 | + if (!empty($user_list)) { |
|
| 196 | 196 | $query = doquery("SELECT `id` FROM {{users}} WHERE `id` in (" . implode(',', $user_list) . ")"); |
| 197 | - while($row = db_fetch($query)) { |
|
| 197 | + while ($row = db_fetch($query)) { |
|
| 198 | 198 | $result[] = $row['id']; |
| 199 | 199 | } |
| 200 | 200 | } |
@@ -209,11 +209,11 @@ discard block |
||
| 209 | 209 | $old_server_status == GAME_DISABLE_NONE ? classSupernova::$config->db_saveItem('game_disable', GAME_DISABLE_MAINTENANCE) : false; |
| 210 | 210 | sn_db_transaction_commit(); |
| 211 | 211 | |
| 212 | -foreach($ques as $que_transaction) { |
|
| 212 | +foreach ($ques as $que_transaction) { |
|
| 213 | 213 | sn_db_transaction_start(); |
| 214 | 214 | |
| 215 | 215 | !is_array($que_transaction) ? $que_transaction = array($que_transaction) : false; |
| 216 | - foreach($que_transaction as $que) { |
|
| 216 | + foreach ($que_transaction as $que) { |
|
| 217 | 217 | set_time_limit(120); |
| 218 | 218 | $QryResult = doquery($que); |
| 219 | 219 | //$msg .= '<hr>' . $que . '<hr>'; |
@@ -9,8 +9,8 @@ discard block |
||
| 9 | 9 | * @copyright 2008 by Chlorel for XNova |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -define('INSIDE' , true); |
|
| 13 | -define('INSTALL' , false); |
|
| 12 | +define('INSIDE', true); |
|
| 13 | +define('INSTALL', false); |
|
| 14 | 14 | define('IN_ADMIN', true); |
| 15 | 15 | require_once('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
| 16 | 16 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR); |
| 20 | 20 | |
| 21 | -if(SN_TIME_NOW >= classSupernova::$config->db_loadItem('var_stat_update_admin_forced') && SN_TIME_NOW >= classSupernova::$config->db_loadItem('var_stat_update_end')) |
|
| 21 | +if (SN_TIME_NOW >= classSupernova::$config->db_loadItem('var_stat_update_admin_forced') && SN_TIME_NOW >= classSupernova::$config->db_loadItem('var_stat_update_end')) |
|
| 22 | 22 | { |
| 23 | 23 | classSupernova::$config->db_saveItem('var_stat_update_admin_forced', SN_TIME_NOW + 120); |
| 24 | 24 | |
@@ -37,8 +37,7 @@ |
||
| 37 | 37 | </script>'; |
| 38 | 38 | |
| 39 | 39 | messageBoxAdmin("{$script}<img src=\"design/images/progressbar.gif\"><br>{$lang['sys_wait']}", $lang['adm_stat_title'], '', 0); |
| 40 | -} |
|
| 41 | -else |
|
| 40 | +} else |
|
| 42 | 41 | { |
| 43 | 42 | messageBoxAdmin($lang['adm_stat_already_started'], $lang['adm_stat_title'], 'admin/overview.php'); |
| 44 | 43 | } |
@@ -2,12 +2,12 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
| 4 | 4 | |
| 5 | -if($user['authlevel'] < AUTH_LEVEL_DEVELOPER) { |
|
| 5 | +if ($user['authlevel'] < AUTH_LEVEL_DEVELOPER) { |
|
| 6 | 6 | $error_message = classSupernova::$config->game_mode == GAME_BLITZ ? 'sys_blitz_page_disabled' : ( |
| 7 | 7 | !classSupernova::$config->game_blitz_register ? 'sys_blitz_registration_disabled' : '' |
| 8 | 8 | ); |
| 9 | 9 | |
| 10 | - if($error_message) { |
|
| 10 | + if ($error_message) { |
|
| 11 | 11 | messageBox($lang[$error_message], $lang['sys_error'], 'overview.php', 10); |
| 12 | 12 | die(); |
| 13 | 13 | } |
@@ -17,12 +17,12 @@ discard block |
||
| 17 | 17 | $current_round = intval(classSupernova::$config->db_loadItem('game_blitz_register_round')); |
| 18 | 18 | $current_price = intval(classSupernova::$config->db_loadItem('game_blitz_register_price')); |
| 19 | 19 | |
| 20 | -if(classSupernova::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) { |
|
| 20 | +if (classSupernova::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) { |
|
| 21 | 21 | sn_db_transaction_start(); |
| 22 | 22 | $user = db_user_by_id($user['id'], true); |
| 23 | 23 | $is_registered = doquery("SELECT `id` FROM {{blitz_registrations}} WHERE `user_id` = {$user['id']} AND `round_number` = {$current_round} FOR UPDATE;", true); |
| 24 | - if(sys_get_param_str('register_me')) { |
|
| 25 | - if(empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) { |
|
| 24 | + if (sys_get_param_str('register_me')) { |
|
| 25 | + if (empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) { |
|
| 26 | 26 | doquery("INSERT IGNORE INTO {{blitz_registrations}} SET `user_id` = {$user['id']}, `round_number` = {$current_round};"); |
| 27 | 27 | //mm_points_change($user['id'], RPG_BLITZ_REGISTRATION, -$current_price, "Регистрация в раунде {$current_round} Блица"); |
| 28 | 28 | classSupernova::$auth->account->metamatter_change(RPG_BLITZ_REGISTRATION, -$current_price, "Регистрация в раунде {$current_round} Блица"); |
@@ -43,17 +43,17 @@ discard block |
||
| 43 | 43 | $blitz_players = 0; |
| 44 | 44 | $blitz_prize_dark_matter = 0; |
| 45 | 45 | $blitz_prize_places = 0; |
| 46 | -if($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) { |
|
| 47 | - if(sys_get_param_str('generate')) { |
|
| 46 | +if ($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) { |
|
| 47 | + if (sys_get_param_str('generate')) { |
|
| 48 | 48 | $next_id = 0; |
| 49 | 49 | $query = doquery("SELECT `id` FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY RAND();"); |
| 50 | - while($row = db_fetch($query)) { |
|
| 50 | + while ($row = db_fetch($query)) { |
|
| 51 | 51 | $next_id++; |
| 52 | 52 | $blitz_name = 'Игрок' . $next_id; |
| 53 | 53 | $blitz_password = sys_random_string(8); |
| 54 | 54 | doquery("UPDATE {{blitz_registrations}} SET blitz_name = '{$blitz_name}', blitz_password = '{$blitz_password}' WHERE `id` = {$row['id']} AND `round_number` = {$current_round};"); |
| 55 | 55 | } |
| 56 | - } elseif(sys_get_param_str('import_generated')) { |
|
| 56 | + } elseif (sys_get_param_str('import_generated')) { |
|
| 57 | 57 | // ЭТО НА БЛИЦЕ!!! |
| 58 | 58 | doquery("DELETE FROM {{users}} WHERE username like 'Игрок%';"); |
| 59 | 59 | doquery("DELETE FROM {{planets}} WHERE id_owner not in (SELECT `id` FROM {{users}});"); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $system = $system_step; |
| 76 | 76 | $planet = round(classSupernova::$config->game_maxPlanet / 2); |
| 77 | 77 | |
| 78 | - foreach($imported_string as &$string_data) { |
|
| 78 | + foreach ($imported_string as &$string_data) { |
|
| 79 | 79 | $string_data = explode(',', $string_data); |
| 80 | 80 | $username_safe = $string_data[0]; |
| 81 | 81 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | $moon_row = uni_create_moon($galaxy, $system, $planet, $user_new['id'], 30, '', false); |
| 97 | 97 | |
| 98 | - if(($system += $system_step) >= classSupernova::$config->game_maxSystem) { |
|
| 98 | + if (($system += $system_step) >= classSupernova::$config->game_maxSystem) { |
|
| 99 | 99 | $galaxy++; |
| 100 | 100 | $system = $system_step; |
| 101 | 101 | } |
@@ -104,13 +104,13 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | classSupernova::$config->db_saveItem('users_amount', classSupernova::$config->users_amount + $new_players); |
| 106 | 106 | // generated_string |
| 107 | - } elseif(sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) { |
|
| 107 | + } elseif (sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) { |
|
| 108 | 108 | $blitz_result = explode(';', $blitz_result_string); |
| 109 | 109 | $blitz_last_update = $blitz_result[0]; // Пока не используется |
| 110 | 110 | unset($blitz_result[0]); |
| 111 | - foreach($blitz_result as $blitz_result_data) { |
|
| 111 | + foreach ($blitz_result as $blitz_result_data) { |
|
| 112 | 112 | $blitz_result_data = explode(',', $blitz_result_data); |
| 113 | - if(count($blitz_result_data) == 5) { |
|
| 113 | + if (count($blitz_result_data) == 5) { |
|
| 114 | 114 | $blitz_result_data[1] = db_escape($blitz_result_data[1]); |
| 115 | 115 | doquery( |
| 116 | 116 | "UPDATE `{{blitz_registrations}}` SET |
@@ -124,15 +124,15 @@ discard block |
||
| 124 | 124 | $blitz_result = array(); |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - if(classSupernova::$config->game_mode == GAME_BLITZ) { |
|
| 127 | + if (classSupernova::$config->game_mode == GAME_BLITZ) { |
|
| 128 | 128 | $blitz_result = array(classSupernova::$config->db_loadItem('var_stat_update')); |
| 129 | 129 | $query = doquery("SELECT id, username, total_rank, total_points, onlinetime FROM {{users}} ORDER BY `id`;"); |
| 130 | - while($row = db_fetch($query)) { |
|
| 130 | + while ($row = db_fetch($query)) { |
|
| 131 | 131 | $blitz_result[] = "{$row['id']},{$row['username']},{$row['onlinetime']},{$row['total_rank']},{$row['total_points']}"; |
| 132 | 132 | } |
| 133 | 133 | } else { |
| 134 | 134 | $query = doquery("SELECT blitz_name, blitz_password, blitz_online FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY `id`;"); |
| 135 | - while($row = db_fetch($query)) { |
|
| 135 | + while ($row = db_fetch($query)) { |
|
| 136 | 136 | $blitz_generated[] = "{$row['blitz_name']},{$row['blitz_password']}"; |
| 137 | 137 | $row['blitz_online'] ? $blitz_prize_players_active++ : false; |
| 138 | 138 | $blitz_players++; |
@@ -147,13 +147,13 @@ discard block |
||
| 147 | 147 | 'Игрок40' |
| 148 | 148 | */ |
| 149 | 149 | |
| 150 | - if(sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) { |
|
| 150 | + if (sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) { |
|
| 151 | 151 | // $blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'); |
| 152 | 152 | $blitz_prize_places_actual = sys_get_param_int('blitz_prize_places'); |
| 153 | 153 | sn_db_transaction_start(); |
| 154 | 154 | $query = doquery("SELECT * FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY `blitz_place` FOR UPDATE;"); |
| 155 | - while($row = db_fetch($query)) { |
|
| 156 | - if(!$row['blitz_place']) { |
|
| 155 | + while ($row = db_fetch($query)) { |
|
| 156 | + if (!$row['blitz_place']) { |
|
| 157 | 157 | continue; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -161,15 +161,15 @@ discard block |
||
| 161 | 161 | $blitz_prize_places_actual--; |
| 162 | 162 | |
| 163 | 163 | $reward = $blitz_prize_dark_matter_actual - $row['blitz_reward_dark_matter']; |
| 164 | -pdump("{{$row['id']}} {$row['blitz_name']}, Place {$row['blitz_place']}, Prize places {$blitz_prize_places_actual}, Prize {$reward}",$row['id']); |
|
| 165 | - if($reward) { |
|
| 164 | +pdump("{{$row['id']}} {$row['blitz_name']}, Place {$row['blitz_place']}, Prize places {$blitz_prize_places_actual}, Prize {$reward}", $row['id']); |
|
| 165 | + if ($reward) { |
|
| 166 | 166 | rpg_points_change($row['user_id'], RPG_BLITZ, $reward, sprintf( |
| 167 | 167 | $lang['sys_blitz_reward_log_message'], $row['blitz_place'], $row['blitz_name'] |
| 168 | 168 | )); |
| 169 | 169 | doquery("UPDATE {{blitz_registrations}} SET blitz_reward_dark_matter = blitz_reward_dark_matter + ($reward) WHERE id = {$row['id']} AND `round_number` = {$current_round};"); |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - if(!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) { |
|
| 172 | + if (!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) { |
|
| 173 | 173 | break; |
| 174 | 174 | } |
| 175 | 175 | } |
@@ -189,12 +189,12 @@ discard block |
||
| 189 | 189 | JOIN {{users}} AS u ON u.id = br.user_id |
| 190 | 190 | WHERE br.`round_number` = {$current_round} |
| 191 | 191 | order by `blitz_place`, `timestamp`;"); |
| 192 | -while($row = db_fetch($query)) { |
|
| 192 | +while ($row = db_fetch($query)) { |
|
| 193 | 193 | $tpl_player_data = array( |
| 194 | 194 | 'NAME' => player_nick_render_to_html($row, array('icons' => true, 'color' => true, 'ally' => true)), |
| 195 | 195 | ); |
| 196 | 196 | |
| 197 | - if(classSupernova::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) { |
|
| 197 | + if (classSupernova::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) { |
|
| 198 | 198 | // Вот так хитро, что бы не было не единого шанса попадания на страницу данных об игроках Блиц-сервера до закрытия раунда |
| 199 | 199 | $tpl_player_data = array_merge($tpl_player_data, array( |
| 200 | 200 | 'ID' => $row['id'], |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | $template->assign_block_vars('registrations', $tpl_player_data); |
| 210 | - if($row['id'] == $user['id']) { |
|
| 210 | + if ($row['id'] == $user['id']) { |
|
| 211 | 211 | $player_registered = $row; |
| 212 | 212 | } |
| 213 | 213 | } |
@@ -39,8 +39,7 @@ discard block |
||
| 39 | 39 | $galaxy = isset($vector[$prefix . 'galaxy']) ? intval($vector[$prefix . 'galaxy']) : 0; |
| 40 | 40 | $system = isset($vector[$prefix . 'system']) ? intval($vector[$prefix . 'system']) : 0; |
| 41 | 41 | $planet = isset($vector[$prefix . 'planet']) ? intval($vector[$prefix . 'planet']) : 0; |
| 42 | - $planet_type = isset($vector[$prefix . 'planet_type']) ? intval($vector[$prefix . 'planet_type']) : |
|
| 43 | - (isset($vector[$prefix . 'type']) ? intval($vector[$prefix . 'type']) : 0); |
|
| 42 | + $planet_type = isset($vector[$prefix . 'planet_type']) ? intval($vector[$prefix . 'planet_type']) : (isset($vector[$prefix . 'type']) ? intval($vector[$prefix . 'type']) : 0); |
|
| 44 | 43 | $planet_type = $planet_type == PT_DEBRIS ? PT_PLANET : $planet_type; |
| 45 | 44 | |
| 46 | 45 | return DBStaticPlanet::db_planet_by_gspt_safe($galaxy, $system, $planet, $planet_type, $for_update, $fields); |
@@ -61,7 +60,7 @@ discard block |
||
| 61 | 60 | // } |
| 62 | 61 | |
| 63 | 62 | public static function db_planet_by_parent($parent_id, $for_update = false, $fields = '*') { |
| 64 | - if(!($parent_id = idval($parent_id))) { |
|
| 63 | + if (!($parent_id = idval($parent_id))) { |
|
| 65 | 64 | return false; |
| 66 | 65 | } |
| 67 | 66 | |
@@ -70,7 +69,7 @@ discard block |
||
| 70 | 69 | } |
| 71 | 70 | |
| 72 | 71 | public static function db_planet_by_id_and_owner($planet_id, $owner_id, $for_update = false, $fields = '*') { |
| 73 | - if(!($planet_id = idval($planet_id)) || !($owner_id = idval($owner_id))) { |
|
| 72 | + if (!($planet_id = idval($planet_id)) || !($owner_id = idval($owner_id))) { |
|
| 74 | 73 | return false; |
| 75 | 74 | } |
| 76 | 75 | return classSupernova::db_get_record_list(LOC_PLANET, |
@@ -79,7 +78,7 @@ discard block |
||
| 79 | 78 | |
| 80 | 79 | |
| 81 | 80 | public static function db_planet_list_moon_other($user_id, $this_moon_id) { |
| 82 | - if(!($user_id = idval($user_id)) || !($this_moon_id = idval($this_moon_id))) { |
|
| 81 | + if (!($user_id = idval($user_id)) || !($this_moon_id = idval($this_moon_id))) { |
|
| 83 | 82 | return false; |
| 84 | 83 | } |
| 85 | 84 | return classSupernova::db_get_record_list(LOC_PLANET, |
@@ -94,7 +93,7 @@ discard block |
||
| 94 | 93 | } |
| 95 | 94 | |
| 96 | 95 | public static function db_planet_list_sorted($user_row, $skip_planet_id = false, $field_list = '', $conditions = '') { |
| 97 | - if(!is_array($user_row)) { |
|
| 96 | + if (!is_array($user_row)) { |
|
| 98 | 97 | return false; |
| 99 | 98 | } |
| 100 | 99 | $conditions .= $skip_planet_id ? " AND `id` <> {$skip_planet_id} " : ''; |
@@ -115,7 +114,7 @@ discard block |
||
| 115 | 114 | } |
| 116 | 115 | |
| 117 | 116 | public static function db_planet_list_by_user_or_planet($user_id, $planet_id) { |
| 118 | - if(!($user_id = idval($user_id)) && !($planet_id = idval($planet_id))) { |
|
| 117 | + if (!($user_id = idval($user_id)) && !($planet_id = idval($planet_id))) { |
|
| 119 | 118 | return false; |
| 120 | 119 | } |
| 121 | 120 | |
@@ -124,14 +123,14 @@ discard block |
||
| 124 | 123 | } |
| 125 | 124 | |
| 126 | 125 | public static function db_planet_set_by_id($planet_id, $set) { |
| 127 | - if(!($planet_id = idval($planet_id))) { |
|
| 126 | + if (!($planet_id = idval($planet_id))) { |
|
| 128 | 127 | return false; |
| 129 | 128 | } |
| 130 | 129 | return classSupernova::db_upd_record_by_id(LOC_PLANET, $planet_id, $set); |
| 131 | 130 | } |
| 132 | 131 | |
| 133 | 132 | public static function db_planet_set_by_gspt($ui_galaxy, $ui_system, $ui_planet, $ui_planet_type = PT_ALL, $set) { |
| 134 | - if(!($set = trim($set))) { |
|
| 133 | + if (!($set = trim($set))) { |
|
| 135 | 134 | return false; |
| 136 | 135 | } |
| 137 | 136 | |
@@ -144,14 +143,14 @@ discard block |
||
| 144 | 143 | } |
| 145 | 144 | |
| 146 | 145 | public static function db_planet_set_by_parent($ui_parent_id, $ss_set) { |
| 147 | - if(!($si_parent_id = idval($ui_parent_id)) || !($ss_set = trim($ss_set))) { |
|
| 146 | + if (!($si_parent_id = idval($ui_parent_id)) || !($ss_set = trim($ss_set))) { |
|
| 148 | 147 | return false; |
| 149 | 148 | } |
| 150 | 149 | return classSupernova::db_upd_record_list(LOC_PLANET, "`parent_planet` = {$si_parent_id}", $ss_set); |
| 151 | 150 | } |
| 152 | 151 | |
| 153 | 152 | public static function db_planet_set_by_owner($ui_owner_id, $ss_set) { |
| 154 | - if(!($si_owner_id = idval($ui_owner_id)) || !($ss_set = trim($ss_set))) { |
|
| 153 | + if (!($si_owner_id = idval($ui_owner_id)) || !($ss_set = trim($ss_set))) { |
|
| 155 | 154 | return false; |
| 156 | 155 | } |
| 157 | 156 | return classSupernova::db_upd_record_list(LOC_PLANET, "`id_owner` = {$si_owner_id}", $ss_set); |
@@ -159,7 +158,7 @@ discard block |
||
| 159 | 158 | |
| 160 | 159 | |
| 161 | 160 | public static function db_planet_delete_by_id($planet_id) { |
| 162 | - if(!($planet_id = idval($planet_id))) { |
|
| 161 | + if (!($planet_id = idval($planet_id))) { |
|
| 163 | 162 | return false; |
| 164 | 163 | } |
| 165 | 164 | classSupernova::db_del_record_by_id(LOC_PLANET, $planet_id); |
@@ -169,7 +168,7 @@ discard block |
||
| 169 | 168 | } |
| 170 | 169 | |
| 171 | 170 | public static function db_planet_list_delete_by_owner($ui_owner_id) { |
| 172 | - if(!($si_owner_id = idval($ui_owner_id))) { |
|
| 171 | + if (!($si_owner_id = idval($ui_owner_id))) { |
|
| 173 | 172 | return false; |
| 174 | 173 | } |
| 175 | 174 | classSupernova::db_del_record_list(LOC_PLANET, "`id_owner` = {$si_owner_id}"); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | |
| 18 | 18 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
| 19 | 19 | |
| 20 | -if(!sn_module_get_active_count('payment')) { |
|
| 20 | +if (!sn_module_get_active_count('payment')) { |
|
| 21 | 21 | sys_redirect(SN_ROOT_VIRTUAL . 'admin/overview.php'); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | $this->secret_word = classSupernova::$sn_secret_word; |
| 90 | 90 | |
| 91 | 91 | $snTableNames = $this->db->schema()->getSnTables(); |
| 92 | - foreach($this->table_check as $table_name) { |
|
| 93 | - if(empty($snTableNames[$table_name])) { |
|
| 92 | + foreach ($this->table_check as $table_name) { |
|
| 93 | + if (empty($snTableNames[$table_name])) { |
|
| 94 | 94 | die('Если вы видите это сообщение первый раз после обновления релиза - просто перегрузите страницу.<br /> |
| 95 | 95 | В противном случае - сообщите Администрации сервера об ошибке.<br/> |
| 96 | 96 | Не хватает таблицы для работы системы авторизации: ' . $table_name); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | // OK v4.6 |
| 116 | 116 | public function password_change($old_password_unsafe, $new_password_unsafe, $salt_unsafe = null) { |
| 117 | - if(!$this->password_check($old_password_unsafe)) { |
|
| 117 | + if (!$this->password_check($old_password_unsafe)) { |
|
| 118 | 118 | return false; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | // OK v4.5 |
| 136 | 136 | public function assign_from_db_row($row) { |
| 137 | 137 | $this->reset(); |
| 138 | - if(empty($row) || !is_array($row)) { |
|
| 138 | + if (empty($row) || !is_array($row)) { |
|
| 139 | 139 | return false; |
| 140 | 140 | } |
| 141 | 141 | $this->account_id = $row['account_id']; |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $this->reset(); |
| 201 | 201 | |
| 202 | 202 | $email_safe = $this->db->db_escape($email_unsafe); |
| 203 | - if($email_safe) { |
|
| 203 | + if ($email_safe) { |
|
| 204 | 204 | $account_row = $this->db->doquery("SELECT * FROM {{account}} WHERE LOWER(`account_email`) = LOWER('{$email_safe}') FOR UPDATE;", true); |
| 205 | 205 | |
| 206 | 206 | return $this->assign_from_db_row($account_row); |
@@ -273,11 +273,11 @@ discard block |
||
| 273 | 273 | `account_email` = LOWER('{$email_safe}'), |
| 274 | 274 | `account_language` = '{$language_safe}'" |
| 275 | 275 | ); |
| 276 | - if(!$result) { |
|
| 276 | + if (!$result) { |
|
| 277 | 277 | throw new Exception(REGISTER_ERROR_ACCOUNT_CREATE, ERR_ERROR); |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | - if(!($account_id = $this->db->db_insert_id())) { |
|
| 280 | + if (!($account_id = $this->db->db_insert_id())) { |
|
| 281 | 281 | throw new Exception(REGISTER_ERROR_ACCOUNT_CREATE, ERR_ERROR); |
| 282 | 282 | } |
| 283 | 283 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | WHERE `account_id` = '{$account_id_safe}'" |
| 308 | 308 | ) ? true : false; |
| 309 | 309 | |
| 310 | - if($result) { |
|
| 310 | + if ($result) { |
|
| 311 | 311 | $result = $this->db_get_by_id($this->account_id); |
| 312 | 312 | } |
| 313 | 313 | |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | public function metamatter_change($change_type, $metamatter, $comment = false, $already_changed = false) { |
| 388 | 388 | global $debug, $mm_change_legit, $config; |
| 389 | 389 | |
| 390 | - if(!$this->is_exists || !($metamatter = round(floatval($metamatter)))) { |
|
| 390 | + if (!$this->is_exists || !($metamatter = round(floatval($metamatter)))) { |
|
| 391 | 391 | $debug->error('Ошибка при попытке манипуляции с ММ'); |
| 392 | 392 | return false; |
| 393 | 393 | } |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | |
| 397 | 397 | $mm_change_legit = true; |
| 398 | 398 | // $sn_data_metamatter_db_name = pname_resource_name(RES_METAMATTER); |
| 399 | - if($already_changed) { |
|
| 399 | + if ($already_changed) { |
|
| 400 | 400 | $metamatter_total_delta = 0; |
| 401 | 401 | $result = -1; |
| 402 | 402 | } else { |
@@ -409,13 +409,13 @@ discard block |
||
| 409 | 409 | ($metamatter_total_delta ? ", `account_immortal` = IF(`account_metamatter_total` + '{$metamatter_total_delta}' >= {$config->player_metamatter_immortal}, NOW(), `account_immortal`), `account_metamatter_total` = `account_metamatter_total` + '{$metamatter_total_delta}'" : '') . |
| 410 | 410 | " WHERE `account_id` = {$account_id_safe}" |
| 411 | 411 | ); |
| 412 | - if(!$result) { |
|
| 412 | + if (!$result) { |
|
| 413 | 413 | $debug->error("Error adjusting Metamatter for player ID {$this->account_id} (Player Not Found?) with {$metamatter}. Reason: {$comment}", 'Metamatter Change', 402); |
| 414 | 414 | } |
| 415 | 415 | $result = classSupernova::$db->db_affected_rows(); |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | - if(empty(core_auth::$user['id'])) { |
|
| 418 | + if (empty(core_auth::$user['id'])) { |
|
| 419 | 419 | $user_list = PlayerToAccountTranslate::db_translate_get_users_from_account_list(core_auth::$main_provider->provider_id, $this->account_id); |
| 420 | 420 | reset($user_list); |
| 421 | 421 | $user_id_unsafe = key($user_list); |
@@ -424,30 +424,30 @@ discard block |
||
| 424 | 424 | } |
| 425 | 425 | $user_id_safe = $this->db->db_escape($user_id_unsafe); |
| 426 | 426 | |
| 427 | - if(!$result) { |
|
| 427 | + if (!$result) { |
|
| 428 | 428 | $debug->error("Error adjusting Metamatter for player ID {$this->account_id} (Player Not Found?) with {$metamatter}. Reason: {$comment}", 'Metamatter Change', 402); |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | - if(!$already_changed) { |
|
| 431 | + if (!$already_changed) { |
|
| 432 | 432 | $this->account_metamatter += $metamatter; |
| 433 | 433 | $this->account_metamatter_total += $metamatter_total_delta; |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | - if(is_array($comment)) { |
|
| 436 | + if (is_array($comment)) { |
|
| 437 | 437 | $comment = call_user_func_array('sprintf', $comment); |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | $result = $this->db_mm_log_insert($comment, $change_type, $metamatter, $user_id_unsafe); |
| 441 | 441 | |
| 442 | - if($metamatter > 0 && !empty($user_id_safe)) { |
|
| 442 | + if ($metamatter > 0 && !empty($user_id_safe)) { |
|
| 443 | 443 | $old_referral = doquery("SELECT * FROM {{referrals}} WHERE `id` = {$user_id_safe} LIMIT 1 FOR UPDATE;", '', true); |
| 444 | - if($old_referral['id']) { |
|
| 444 | + if ($old_referral['id']) { |
|
| 445 | 445 | $dark_matter_from_metamatter = $metamatter * AFFILIATE_MM_TO_REFERRAL_DM; |
| 446 | 446 | doquery("UPDATE {{referrals}} SET dark_matter = dark_matter + '{$dark_matter_from_metamatter}' WHERE `id` = {$user_id_safe} LIMIT 1;"); |
| 447 | 447 | $new_referral = doquery("SELECT * FROM {{referrals}} WHERE `id` = {$user_id_safe} LIMIT 1;", '', true); |
| 448 | 448 | |
| 449 | 449 | $partner_bonus = floor($new_referral['dark_matter'] / $config->rpg_bonus_divisor) - ($old_referral['dark_matter'] >= $config->rpg_bonus_minimum ? floor($old_referral['dark_matter'] / $config->rpg_bonus_divisor) : 0); |
| 450 | - if($partner_bonus > 0 && $new_referral['dark_matter'] >= $config->rpg_bonus_minimum) { |
|
| 450 | + if ($partner_bonus > 0 && $new_referral['dark_matter'] >= $config->rpg_bonus_minimum) { |
|
| 451 | 451 | rpg_points_change($new_referral['id_partner'], RPG_REFERRAL_BOUGHT_MM, $partner_bonus, "Incoming MM From Referral ID {$user_id_safe}"); |
| 452 | 452 | } |
| 453 | 453 | } |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | * @throws Exception |
| 464 | 464 | */ |
| 465 | 465 | public function cookieSet($rememberMe = false, $domain = null) { |
| 466 | - if(!$this->is_exists) { |
|
| 466 | + if (!$this->is_exists) { |
|
| 467 | 467 | throw new Exception(LOGIN_ERROR_NO_ACCOUNT_FOR_COOKIE_SET, ERR_ERROR); |
| 468 | 468 | } |
| 469 | 469 | |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | // OK v4.1 |
| 483 | 483 | public function cookieClear($domain = null) { |
| 484 | 484 | // Автоматически вообще-то - если установлена кука имперсонатора - то чистим обычную, а куку имперсонатора - копируем в неё |
| 485 | - if(!empty($_COOKIE[$this->cookie_name_impersonate])) { |
|
| 485 | + if (!empty($_COOKIE[$this->cookie_name_impersonate])) { |
|
| 486 | 486 | sn_setcookie($this->cookie_name, $_COOKIE[$this->cookie_name_impersonate], SN_TIME_NOW + PERIOD_YEAR, $this->sn_root_path, $domain); |
| 487 | 487 | sn_setcookie($this->cookie_name_impersonate, '', SN_TIME_NOW - PERIOD_WEEK, $this->sn_root_path, $domain); |
| 488 | 488 | } else { |
@@ -492,14 +492,14 @@ discard block |
||
| 492 | 492 | |
| 493 | 493 | public function cookieLogin(&$rememberMe = false) { |
| 494 | 494 | // Пытаемся войти по куке |
| 495 | - if(!empty($_COOKIE[$this->cookie_name])) { |
|
| 496 | - if(count(explode("/%/", $_COOKIE[$this->cookie_name])) < 4) { |
|
| 495 | + if (!empty($_COOKIE[$this->cookie_name])) { |
|
| 496 | + if (count(explode("/%/", $_COOKIE[$this->cookie_name])) < 4) { |
|
| 497 | 497 | list($account_id_unsafe, $cookie_password_hash_salted, $user_remember_me) = explode(AUTH_COOKIE_DELIMETER, $_COOKIE[$this->cookie_name]); |
| 498 | 498 | } else { |
| 499 | 499 | list($account_id_unsafe, $user_name, $cookie_password_hash_salted, $user_remember_me) = explode("/%/", $_COOKIE[$this->cookie_name]); |
| 500 | 500 | } |
| 501 | 501 | |
| 502 | - if( |
|
| 502 | + if ( |
|
| 503 | 503 | $this->db_get_by_id($account_id_unsafe) |
| 504 | 504 | && ($this->password_encode_for_cookie($this->account_password) == $cookie_password_hash_salted) |
| 505 | 505 | ) { |