@@ -15,34 +15,34 @@ discard block |
||
| 15 | 15 | $template = SnTemplate::gettemplate('notes', true); |
| 16 | 16 | |
| 17 | 17 | $result = array(); |
| 18 | -if(($result_message = sys_get_param_str('MESSAGE')) && isset($lang[$result_message])) { |
|
| 18 | +if (($result_message = sys_get_param_str('MESSAGE')) && isset($lang[$result_message])) { |
|
| 19 | 19 | $result[] = array('STATUS' => sys_get_param_int('STATUS'), 'MESSAGE' => $lang[$result_message]); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | $note_id_edit = sys_get_param_id('note_id_edit'); |
| 23 | -if(sys_get_param('note_delete')) { |
|
| 23 | +if (sys_get_param('note_delete')) { |
|
| 24 | 24 | try { |
| 25 | 25 | $not = ''; |
| 26 | 26 | $query_where = ''; |
| 27 | - switch(sys_get_param_str('note_delete_range')) { |
|
| 27 | + switch (sys_get_param_str('note_delete_range')) { |
|
| 28 | 28 | case 'all': |
| 29 | 29 | break; |
| 30 | 30 | |
| 31 | 31 | case 'marked_not': |
| 32 | 32 | $not = 'NOT'; |
| 33 | 33 | case 'marked': |
| 34 | - if(!is_array($notes_marked = sys_get_param('note'))) { |
|
| 34 | + if (!is_array($notes_marked = sys_get_param('note'))) { |
|
| 35 | 35 | throw new exception('note_err_none_selected', ERR_WARNING); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $notes_marked_filtered = array(); |
| 39 | - foreach($notes_marked as $note_id => $note_select) { |
|
| 40 | - if($note_select == 'on' && $note_id = idval($note_id)) { |
|
| 39 | + foreach ($notes_marked as $note_id => $note_select) { |
|
| 40 | + if ($note_select == 'on' && $note_id = idval($note_id)) { |
|
| 41 | 41 | $notes_marked_filtered[] = $note_id; |
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - if(empty($notes_marked_filtered)) { |
|
| 45 | + if (empty($notes_marked_filtered)) { |
|
| 46 | 46 | throw new exception('note_err_none_selected', ERR_WARNING); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | doquery("DELETE FROM {{notes}} WHERE `owner` = {$user['id']} {$query_where};"); |
| 60 | 60 | SN::db_transaction_commit(); |
| 61 | 61 | throw new exception($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added', ERR_NONE); |
| 62 | - } catch(exception $e) { |
|
| 62 | + } catch (exception $e) { |
|
| 63 | 63 | $note_id_edit = 0; |
| 64 | 64 | SN::db_transaction_rollback(); |
| 65 | 65 | $result[] = array( |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | 'MESSAGE' => $lang[$e->getMessage()], |
| 68 | 68 | ); |
| 69 | 69 | } |
| 70 | -} elseif(($note_title = sys_get_param_str('note_title')) || ($note_text = sys_get_param_str('note_text'))) { |
|
| 70 | +} elseif (($note_title = sys_get_param_str('note_title')) || ($note_text = sys_get_param_str('note_text'))) { |
|
| 71 | 71 | $note_title == SN::$db->db_escape($lang['note_new_title']) ? $note_title = '' : false; |
| 72 | 72 | ($note_text = sys_get_param_str('note_text')) == SN::$db->db_escape($lang['note_new_text']) ? $note_text = '' : false; |
| 73 | 73 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $note_system = max(0, min(sys_get_param_id('note_system'), SN::$config->game_maxSystem)); |
| 77 | 77 | $note_planet = max(0, min(sys_get_param_id('note_planet'), SN::$config->game_maxPlanet + 1)); |
| 78 | 78 | |
| 79 | - if(!$note_text && !$note_title && !$note_galaxy && !$note_system && !$note_planet) { |
|
| 79 | + if (!$note_text && !$note_title && !$note_galaxy && !$note_system && !$note_planet) { |
|
| 80 | 80 | throw new exception('note_err_note_empty', ERR_WARNING); |
| 81 | 81 | } |
| 82 | 82 | |
@@ -85,15 +85,15 @@ discard block |
||
| 85 | 85 | $note_sticky = intval(sys_get_param_id('note_sticky')) ? 1 : 0; |
| 86 | 86 | |
| 87 | 87 | SN::db_transaction_start(); |
| 88 | - if($note_id_edit) { |
|
| 88 | + if ($note_id_edit) { |
|
| 89 | 89 | $check_note_id = doquery("SELECT `id`, `owner` FROM {{notes}} WHERE `id` = {$note_id_edit} LIMIT 1 FOR UPDATE", true); |
| 90 | - if(!$check_note_id) { |
|
| 90 | + if (!$check_note_id) { |
|
| 91 | 91 | throw new exception('note_err_note_not_found', ERR_ERROR); |
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - if($note_id_edit) { |
|
| 96 | - if($check_note_id['owner'] != $user['id']) { |
|
| 95 | + if ($note_id_edit) { |
|
| 96 | + if ($check_note_id['owner'] != $user['id']) { |
|
| 97 | 97 | throw new exception('note_err_owner_wrong', ERR_ERROR); |
| 98 | 98 | } |
| 99 | 99 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | SN::db_transaction_commit(); |
| 109 | 109 | sys_redirect('notes.php?STATUS=' . ERR_NONE . '&MESSAGE=' . ($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added')); |
| 110 | 110 | // throw new exception($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added', ERR_NONE); |
| 111 | - } catch(exception $e) { |
|
| 111 | + } catch (exception $e) { |
|
| 112 | 112 | $note_id_edit = 0; |
| 113 | 113 | SN::db_transaction_rollback(); |
| 114 | 114 | $result[] = array( |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | -if(!$note_id_edit) { |
|
| 121 | +if (!$note_id_edit) { |
|
| 122 | 122 | \Note\Note::note_assign($template, array( |
| 123 | 123 | 'id' => 0, |
| 124 | 124 | 'time' => SN_TIME_NOW, |
@@ -131,13 +131,13 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | $note_exist = false; |
| 133 | 133 | $notes_query = doquery("SELECT * FROM {{notes}} WHERE owner={$user['id']} ORDER BY priority DESC, galaxy ASC, system ASC, planet ASC, planet_type ASC, `time` DESC"); |
| 134 | -while($note_row = db_fetch($notes_query)) { |
|
| 134 | +while ($note_row = db_fetch($notes_query)) { |
|
| 135 | 135 | \Note\Note::note_assign($template, $note_row); |
| 136 | 136 | $note_exist = $note_exist || $note_row['id'] == $note_id_edit; |
| 137 | 137 | } |
| 138 | 138 | $note_id_edit = $note_exist ? $note_id_edit : 0; |
| 139 | 139 | |
| 140 | -foreach($note_priority_classes as $note_priority_id => $note_priority_class) { |
|
| 140 | +foreach ($note_priority_classes as $note_priority_id => $note_priority_class) { |
|
| 141 | 141 | $template->assign_block_vars('note_priority', array( |
| 142 | 142 | 'ID' => $note_priority_id, |
| 143 | 143 | 'CLASS' => $note_priority_classes[$note_priority_id], |
@@ -145,14 +145,14 @@ discard block |
||
| 145 | 145 | )); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | -foreach($lang['sys_planet_type'] as $planet_type_id => $planet_type_string) { |
|
| 148 | +foreach ($lang['sys_planet_type'] as $planet_type_id => $planet_type_string) { |
|
| 149 | 149 | $template->assign_block_vars('planet_type', array( |
| 150 | 150 | 'ID' => $planet_type_id, |
| 151 | 151 | 'TEXT' => $planet_type_string, |
| 152 | 152 | )); |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | -foreach($result as $result_data) { |
|
| 155 | +foreach ($result as $result_data) { |
|
| 156 | 156 | $template->assign_block_vars('result', $result_data); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -12,24 +12,24 @@ discard block |
||
| 12 | 12 | global $debug, $template_result, $user, $lang, $planetrow; |
| 13 | 13 | |
| 14 | 14 | // Напоминание для Администрации, что игра отключена |
| 15 | -if($template_result[F_GAME_DISABLE]) { |
|
| 15 | +if ($template_result[F_GAME_DISABLE]) { |
|
| 16 | 16 | echo '<div class="global_admin_warning">', $template_result[F_GAME_DISABLE_REASON], '</div>'; |
| 17 | 17 | } |
| 18 | 18 | unset($disable_reason); |
| 19 | 19 | |
| 20 | 20 | |
| 21 | -if(defined('IN_ADMIN') && IN_ADMIN === true) { |
|
| 21 | +if (defined('IN_ADMIN') && IN_ADMIN === true) { |
|
| 22 | 22 | lng_include('admin'); |
| 23 | -} elseif($sys_user_logged_in) { |
|
| 23 | +} elseif ($sys_user_logged_in) { |
|
| 24 | 24 | sys_user_vacation($user); |
| 25 | 25 | |
| 26 | 26 | $planet_id = SetSelectedPlanet($user); |
| 27 | 27 | |
| 28 | 28 | // TODO НЕ НУЖНО АЛЬЯНС КАЖДЫЙ РАЗ ОБНОВЛЯТЬ!!! |
| 29 | - if($user['ally_id']) { |
|
| 29 | + if ($user['ally_id']) { |
|
| 30 | 30 | SN::db_transaction_start(); |
| 31 | 31 | \Alliance\Alliance::sn_ali_fill_user_ally($user); |
| 32 | - if(!$user['ally']['player']['id']) { |
|
| 32 | + if (!$user['ally']['player']['id']) { |
|
| 33 | 33 | // sn_sys_logout(false, true); |
| 34 | 34 | // core_auth::logout(false); |
| 35 | 35 | SN::$auth->logout(false); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | SN::db_transaction_commit(); |
| 49 | 49 | |
| 50 | 50 | $planetrow = $global_data['planet']; |
| 51 | - if(!($planetrow && isset($planetrow['id']) && $planetrow['id'])) { |
|
| 51 | + if (!($planetrow && isset($planetrow['id']) && $planetrow['id'])) { |
|
| 52 | 52 | // sn_sys_logout(false, true); |
| 53 | 53 | // core_auth::logout(false); |
| 54 | 54 | SN::$auth->logout(false); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | sys_user_options_unpack($user); |
| 64 | 64 | |
| 65 | 65 | global $sn_page_name, $sn_mvc; |
| 66 | -if(!empty($sn_mvc['pages'][INITIAL_PAGE][PAGE_OPTION_EARLY_HEADER])) { |
|
| 66 | +if (!empty($sn_mvc['pages'][INITIAL_PAGE][PAGE_OPTION_EARLY_HEADER])) { |
|
| 67 | 67 | $title = !empty($sn_mvc['pages'][INITIAL_PAGE][PAGE_OPTION_TITLE]) ? $sn_mvc['pages'][INITIAL_PAGE][PAGE_OPTION_TITLE] : ''; |
| 68 | 68 | SnTemplate::renderHeader($page, $title, $template_result, false, $user, SN::$config, $lang, $planetrow); |
| 69 | 69 | } |
@@ -4,12 +4,12 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
| 6 | 6 | |
| 7 | -if($user['authlevel'] < AUTH_LEVEL_DEVELOPER) { |
|
| 7 | +if ($user['authlevel'] < AUTH_LEVEL_DEVELOPER) { |
|
| 8 | 8 | $error_message = SN::$config->game_mode == GAME_BLITZ ? 'sys_blitz_page_disabled' : ( |
| 9 | 9 | !SN::$config->game_blitz_register ? 'sys_blitz_registration_disabled' : '' |
| 10 | 10 | ); |
| 11 | 11 | |
| 12 | - if($error_message) { |
|
| 12 | + if ($error_message) { |
|
| 13 | 13 | SnTemplate::messageBox($lang[$error_message], $lang['sys_error'], 'overview.php', 10); |
| 14 | 14 | die(); |
| 15 | 15 | } |
@@ -19,12 +19,12 @@ discard block |
||
| 19 | 19 | $current_round = intval(SN::$config->db_loadItem('game_blitz_register_round')); |
| 20 | 20 | $current_price = intval(SN::$config->db_loadItem('game_blitz_register_price')); |
| 21 | 21 | |
| 22 | -if(SN::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) { |
|
| 22 | +if (SN::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) { |
|
| 23 | 23 | SN::db_transaction_start(); |
| 24 | 24 | $user = db_user_by_id($user['id'], true); |
| 25 | 25 | $is_registered = doquery("SELECT `id` FROM {{blitz_registrations}} WHERE `user_id` = {$user['id']} AND `round_number` = {$current_round} FOR UPDATE;", true); |
| 26 | - if(sys_get_param_str('register_me')) { |
|
| 27 | - if(empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) { |
|
| 26 | + if (sys_get_param_str('register_me')) { |
|
| 27 | + if (empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) { |
|
| 28 | 28 | doquery("INSERT IGNORE INTO {{blitz_registrations}} SET `user_id` = {$user['id']}, `round_number` = {$current_round};"); |
| 29 | 29 | //mm_points_change($user['id'], RPG_BLITZ_REGISTRATION, -$current_price, "Регистрация в раунде {$current_round} Блица"); |
| 30 | 30 | SN::$auth->account->metamatter_change(RPG_BLITZ_REGISTRATION, -$current_price, "Регистрация в раунде {$current_round} Блица"); |
@@ -45,17 +45,17 @@ discard block |
||
| 45 | 45 | $blitz_players = 0; |
| 46 | 46 | $blitz_prize_dark_matter = 0; |
| 47 | 47 | $blitz_prize_places = 0; |
| 48 | -if($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) { |
|
| 49 | - if(sys_get_param_str('generate')) { |
|
| 48 | +if ($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) { |
|
| 49 | + if (sys_get_param_str('generate')) { |
|
| 50 | 50 | $next_id = 0; |
| 51 | 51 | $query = doquery("SELECT `id` FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY RAND();"); |
| 52 | - while($row = db_fetch($query)) { |
|
| 52 | + while ($row = db_fetch($query)) { |
|
| 53 | 53 | $next_id++; |
| 54 | 54 | $blitz_name = 'Игрок' . $next_id; |
| 55 | 55 | $blitz_password = sys_random_string(8); |
| 56 | 56 | doquery("UPDATE {{blitz_registrations}} SET blitz_name = '{$blitz_name}', blitz_password = '{$blitz_password}' WHERE `id` = {$row['id']} AND `round_number` = {$current_round};"); |
| 57 | 57 | } |
| 58 | - } elseif(sys_get_param_str('import_generated')) { |
|
| 58 | + } elseif (sys_get_param_str('import_generated')) { |
|
| 59 | 59 | // ЭТО НА БЛИЦЕ!!! |
| 60 | 60 | doquery("DELETE FROM {{users}} WHERE username like 'Игрок%';"); |
| 61 | 61 | doquery("DELETE FROM {{planets}} WHERE id_owner not in (SELECT `id` FROM {{users}});"); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $system = $system_step; |
| 78 | 78 | $planet = round(SN::$config->game_maxPlanet / 2); |
| 79 | 79 | |
| 80 | - foreach($imported_string as &$string_data) { |
|
| 80 | + foreach ($imported_string as &$string_data) { |
|
| 81 | 81 | $string_data = explode(',', $string_data); |
| 82 | 82 | $username_safe = $string_data[0]; |
| 83 | 83 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | $moon_row = uni_create_moon($galaxy, $system, $planet, $user_new['id'], Universe::MOON_MAX_SIZE, false); |
| 93 | 93 | |
| 94 | - if(($system += $system_step) >= SN::$config->game_maxSystem) { |
|
| 94 | + if (($system += $system_step) >= SN::$config->game_maxSystem) { |
|
| 95 | 95 | $galaxy++; |
| 96 | 96 | $system = $system_step; |
| 97 | 97 | } |
@@ -100,13 +100,13 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | SN::$config->db_saveItem('users_amount', SN::$config->users_amount + $new_players); |
| 102 | 102 | // generated_string |
| 103 | - } elseif(sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) { |
|
| 103 | + } elseif (sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) { |
|
| 104 | 104 | $blitz_result = explode(';', $blitz_result_string); |
| 105 | 105 | $blitz_last_update = $blitz_result[0]; // Пока не используется |
| 106 | 106 | unset($blitz_result[0]); |
| 107 | - foreach($blitz_result as $blitz_result_data) { |
|
| 107 | + foreach ($blitz_result as $blitz_result_data) { |
|
| 108 | 108 | $blitz_result_data = explode(',', $blitz_result_data); |
| 109 | - if(count($blitz_result_data) == 5) { |
|
| 109 | + if (count($blitz_result_data) == 5) { |
|
| 110 | 110 | $blitz_result_data[1] = SN::$db->db_escape($blitz_result_data[1]); |
| 111 | 111 | doquery( |
| 112 | 112 | "UPDATE `{{blitz_registrations}}` SET |
@@ -120,15 +120,15 @@ discard block |
||
| 120 | 120 | $blitz_result = array(); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if(SN::$config->game_mode == GAME_BLITZ) { |
|
| 123 | + if (SN::$config->game_mode == GAME_BLITZ) { |
|
| 124 | 124 | $blitz_result = array(SN::$config->db_loadItem('var_stat_update')); |
| 125 | 125 | $query = doquery("SELECT id, username, total_rank, total_points, onlinetime FROM {{users}} ORDER BY `id`;"); |
| 126 | - while($row = db_fetch($query)) { |
|
| 126 | + while ($row = db_fetch($query)) { |
|
| 127 | 127 | $blitz_result[] = "{$row['id']},{$row['username']},{$row['onlinetime']},{$row['total_rank']},{$row['total_points']}"; |
| 128 | 128 | } |
| 129 | 129 | } else { |
| 130 | 130 | $query = doquery("SELECT blitz_name, blitz_password, blitz_online FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY `id`;"); |
| 131 | - while($row = db_fetch($query)) { |
|
| 131 | + while ($row = db_fetch($query)) { |
|
| 132 | 132 | $blitz_generated[] = "{$row['blitz_name']},{$row['blitz_password']}"; |
| 133 | 133 | $row['blitz_online'] ? $blitz_prize_players_active++ : false; |
| 134 | 134 | $blitz_players++; |
@@ -143,13 +143,13 @@ discard block |
||
| 143 | 143 | 'Игрок40' |
| 144 | 144 | */ |
| 145 | 145 | |
| 146 | - if(sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) { |
|
| 146 | + if (sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) { |
|
| 147 | 147 | // $blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'); |
| 148 | 148 | $blitz_prize_places_actual = sys_get_param_int('blitz_prize_places'); |
| 149 | 149 | SN::db_transaction_start(); |
| 150 | 150 | $query = doquery("SELECT * FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY `blitz_place` FOR UPDATE;"); |
| 151 | - while($row = db_fetch($query)) { |
|
| 152 | - if(!$row['blitz_place']) { |
|
| 151 | + while ($row = db_fetch($query)) { |
|
| 152 | + if (!$row['blitz_place']) { |
|
| 153 | 153 | continue; |
| 154 | 154 | } |
| 155 | 155 | |
@@ -157,15 +157,15 @@ discard block |
||
| 157 | 157 | $blitz_prize_places_actual--; |
| 158 | 158 | |
| 159 | 159 | $reward = $blitz_prize_dark_matter_actual - $row['blitz_reward_dark_matter']; |
| 160 | -pdump("{{$row['id']}} {$row['blitz_name']}, Place {$row['blitz_place']}, Prize places {$blitz_prize_places_actual}, Prize {$reward}",$row['id']); |
|
| 161 | - if($reward) { |
|
| 160 | +pdump("{{$row['id']}} {$row['blitz_name']}, Place {$row['blitz_place']}, Prize places {$blitz_prize_places_actual}, Prize {$reward}", $row['id']); |
|
| 161 | + if ($reward) { |
|
| 162 | 162 | rpg_points_change($row['user_id'], RPG_BLITZ, $reward, sprintf( |
| 163 | 163 | $lang['sys_blitz_reward_log_message'], $row['blitz_place'], $row['blitz_name'] |
| 164 | 164 | )); |
| 165 | 165 | doquery("UPDATE {{blitz_registrations}} SET blitz_reward_dark_matter = blitz_reward_dark_matter + ($reward) WHERE id = {$row['id']} AND `round_number` = {$current_round};"); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - if(!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) { |
|
| 168 | + if (!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) { |
|
| 169 | 169 | break; |
| 170 | 170 | } |
| 171 | 171 | } |
@@ -185,12 +185,12 @@ discard block |
||
| 185 | 185 | JOIN {{users}} AS u ON u.id = br.user_id |
| 186 | 186 | WHERE br.`round_number` = {$current_round} |
| 187 | 187 | order by `blitz_place`, `timestamp`;"); |
| 188 | -while($row = db_fetch($query)) { |
|
| 188 | +while ($row = db_fetch($query)) { |
|
| 189 | 189 | $tpl_player_data = array( |
| 190 | 190 | 'NAME' => player_nick_render_to_html($row, array('icons' => true, 'color' => true, 'ally' => true)), |
| 191 | 191 | ); |
| 192 | 192 | |
| 193 | - if(SN::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) { |
|
| 193 | + if (SN::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) { |
|
| 194 | 194 | // Вот так хитро, что бы не было не единого шанса попадания на страницу данных об игроках Блиц-сервера до закрытия раунда |
| 195 | 195 | $tpl_player_data = array_merge($tpl_player_data, array( |
| 196 | 196 | 'ID' => $row['id'], |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $template->assign_block_vars('registrations', $tpl_player_data); |
| 206 | - if($row['id'] == $user['id']) { |
|
| 206 | + if ($row['id'] == $user['id']) { |
|
| 207 | 207 | $player_registered = $row; |
| 208 | 208 | } |
| 209 | 209 | } |
@@ -17,39 +17,39 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | lng_include('fleet'); |
| 19 | 19 | |
| 20 | -if($TargetPlanet = sys_get_param_id('jmpto')) |
|
| 20 | +if ($TargetPlanet = sys_get_param_id('jmpto')) |
|
| 21 | 21 | { |
| 22 | 22 | SN::db_transaction_start(); |
| 23 | 23 | db_user_by_id($user['id'], true, 'id'); |
| 24 | 24 | $planetrow = DBStaticPlanet::db_planet_by_id($planetrow['id'], true); |
| 25 | - if(!($NextJumpTime = uni_get_time_to_jump($planetrow))) |
|
| 25 | + if (!($NextJumpTime = uni_get_time_to_jump($planetrow))) |
|
| 26 | 26 | { |
| 27 | 27 | $TargetGate = DBStaticPlanet::db_planet_by_id($TargetPlanet, true, '`id`, `last_jump_time`'); |
| 28 | - if(mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0) |
|
| 28 | + if (mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0) |
|
| 29 | 29 | { |
| 30 | - $NextDestTime = uni_get_time_to_jump ( $TargetGate ); |
|
| 31 | - if(!$NextDestTime) |
|
| 30 | + $NextDestTime = uni_get_time_to_jump($TargetGate); |
|
| 31 | + if (!$NextDestTime) |
|
| 32 | 32 | { |
| 33 | 33 | // $SubQueryOri = ""; |
| 34 | 34 | // $SubQueryDes = ""; |
| 35 | 35 | $ship_list = sys_get_param('ships'); |
| 36 | 36 | $db_changeset = array(); |
| 37 | - foreach($ship_list as $ship_id => $ship_count) |
|
| 37 | + foreach ($ship_list as $ship_id => $ship_count) |
|
| 38 | 38 | { |
| 39 | - if(!in_array($ship_id, sn_get_groups('fleet'))) |
|
| 39 | + if (!in_array($ship_id, sn_get_groups('fleet'))) |
|
| 40 | 40 | { |
| 41 | 41 | continue; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $ship_count = max(0, min(floor($ship_count), mrc_get_level($user, $planetrow, $ship_id))); |
| 45 | - if($ship_count) |
|
| 45 | + if ($ship_count) |
|
| 46 | 46 | { |
| 47 | 47 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($ship_id, -$ship_count, $user, $planetrow['id']); |
| 48 | 48 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($ship_id, $ship_count, $user, $TargetGate['id']); |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | // Dit monsieur, y avait quelque chose a envoyer ??? |
| 52 | - if(!empty($db_changeset)) |
|
| 52 | + if (!empty($db_changeset)) |
|
| 53 | 53 | { |
| 54 | 54 | DBStaticPlanet::db_planet_set_by_id($TargetGate['id'], "`last_jump_time` = " . SN_TIME_NOW . ""); |
| 55 | 55 | DBStaticPlanet::db_planet_set_by_id($planetrow['id'], "`last_jump_time` = " . SN_TIME_NOW . ""); |
@@ -58,31 +58,31 @@ discard block |
||
| 58 | 58 | db_user_set_by_id($user['id'], "`current_planet` = '{$TargetGate['id']}'"); |
| 59 | 59 | |
| 60 | 60 | $planetrow['last_jump_time'] = SN_TIME_NOW; |
| 61 | - $RetMessage = $lang['gate_jump_done'] ." - ". pretty_time(uni_get_time_to_jump($planetrow)); |
|
| 61 | + $RetMessage = $lang['gate_jump_done'] . " - " . pretty_time(uni_get_time_to_jump($planetrow)); |
|
| 62 | 62 | } else { |
| 63 | 63 | $RetMessage = $lang['gate_wait_data']; |
| 64 | 64 | } |
| 65 | 65 | } else { |
| 66 | - $RetMessage = $lang['gate_wait_dest'] ." - ". pretty_time($NextDestTime); |
|
| 66 | + $RetMessage = $lang['gate_wait_dest'] . " - " . pretty_time($NextDestTime); |
|
| 67 | 67 | } |
| 68 | 68 | } else { |
| 69 | 69 | $RetMessage = $lang['gate_no_dest_g']; |
| 70 | 70 | } |
| 71 | 71 | } else { |
| 72 | - $RetMessage = $lang['gate_wait_star'] ." - ". pretty_time($NextJumpTime); |
|
| 72 | + $RetMessage = $lang['gate_wait_star'] . " - " . pretty_time($NextJumpTime); |
|
| 73 | 73 | } |
| 74 | 74 | SN::db_transaction_commit(); |
| 75 | 75 | SnTemplate::messageBox($RetMessage, $lang['tech'][STRUC_MOON_GATE], "jumpgate.php", 10); |
| 76 | 76 | } else { |
| 77 | 77 | $template = SnTemplate::gettemplate('jumpgate', true); |
| 78 | - if(mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0) |
|
| 78 | + if (mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0) |
|
| 79 | 79 | { |
| 80 | 80 | $Combo = ''; |
| 81 | 81 | $MoonList = DBStaticPlanet::db_planet_list_moon_other($user['id'], $planetrow['id']); |
| 82 | 82 | // while($CurMoon = db_fetch($MoonList)) |
| 83 | - foreach($MoonList as $CurMoon) |
|
| 83 | + foreach ($MoonList as $CurMoon) |
|
| 84 | 84 | { |
| 85 | - if(mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1) |
|
| 85 | + if (mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1) |
|
| 86 | 86 | { |
| 87 | 87 | $NextJumpTime = uni_get_time_to_jump($CurMoon); |
| 88 | 88 | $template->assign_block_vars('moon', array( |
@@ -96,9 +96,9 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - foreach(sn_get_groups('fleet') as $Ship) |
|
| 99 | + foreach (sn_get_groups('fleet') as $Ship) |
|
| 100 | 100 | { |
| 101 | - if(($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0) |
|
| 101 | + if (($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0) |
|
| 102 | 102 | { |
| 103 | 103 | continue; |
| 104 | 104 | } |