Completed
Push — work-fleets ( 47cb39...a1ac53 )
by SuperNova.WS
05:19
created
banned.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@
 block discarded – undo
14 14
  */
15 15
 
16 16
 $allow_anonymous = true;
17
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
17
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
18 18
 
19 19
 $template = gettemplate('banned_body', true);
20 20
 
21 21
 $query = db_banned_list_select();
22 22
 $i = 0;
23
-while($ban_row = db_fetch($query)) {
23
+while ($ban_row = db_fetch($query)) {
24 24
   $template->assign_block_vars('banlist', array(
25 25
     'USER_NAME'   => $ban_row['ban_user_name'],
26 26
     'REASON'      => $ban_row['ban_reason'],
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) {
4
-  require_once('common.' . substr(strrchr(__FILE__, '.'), 1));
3
+if (isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) {
4
+  require_once('common.'.substr(strrchr(__FILE__, '.'), 1));
5 5
 
6
-  if($sn_page_name) {
6
+  if ($sn_page_name) {
7 7
     // Loading page-specific language files
8 8
     global $template;
9 9
     !empty(classSupernova::$sn_mvc['model'][$sn_page_name]) ? execute_hooks(classSupernova::$sn_mvc['model'][$sn_page_name], $template, 'model', $sn_page_name) : false;
10 10
     !empty(classSupernova::$sn_mvc['view'][$sn_page_name]) ? execute_hooks(classSupernova::$sn_mvc['view'][$sn_page_name], $template, 'view', $sn_page_name) : false;
11 11
 
12
-    if(!empty($template_result) && is_object($template)) {
12
+    if (!empty($template_result) && is_object($template)) {
13 13
       $template->assign_recursive($template_result);
14 14
     }
15 15
     display($template, '', true, '', defined('IN_ADMIN') && (IN_ADMIN === true), true);
Please login to merge, or discard this patch.
flying_fleets.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
3
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
4 4
 
5 5
 global $user, $planetrow;
6 6
 
7
-if(!empty($_POST['return']) && is_array($_POST['return'])) {
8
-  foreach($_POST['return'] as $fleet_id) {
9
-    if($fleet_id = idval($fleet_id)) {
7
+if (!empty($_POST['return']) && is_array($_POST['return'])) {
8
+  foreach ($_POST['return'] as $fleet_id) {
9
+    if ($fleet_id = idval($fleet_id)) {
10 10
       sn_db_transaction_start();
11 11
       $objFleet = new Fleet();
12 12
       $objFleet->dbLoad($fleet_id);
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 lng_include('overview');
31 31
 lng_include('fleet');
32 32
 
33
-if(!$planetrow) {
33
+if (!$planetrow) {
34 34
   message(classLocale::$lang['fl_noplanetrow'], classLocale::$lang['fl_error']);
35 35
 }
36 36
 
@@ -38,14 +38,14 @@  discard block
 block discarded – undo
38 38
 
39 39
 $i = 0;
40 40
 $objFleetList = FleetList::dbGetFleetListByOwnerId($user['id']);
41
-if(!empty($objFleetList)) {
42
-  foreach($objFleetList->_container as $fleet_id => $objFleet) {
41
+if (!empty($objFleetList)) {
42
+  foreach ($objFleetList->_container as $fleet_id => $objFleet) {
43 43
     $i++;
44 44
     $fleet_data = tplParseFleetObject($objFleet, $i, $user);
45 45
 
46 46
     $template->assign_block_vars('fleets', $fleet_data['fleet']);
47 47
 
48
-    foreach($fleet_data['ships'] as $ship_data) {
48
+    foreach ($fleet_data['ships'] as $ship_data) {
49 49
       $template->assign_block_vars('fleets.ships', $ship_data);
50 50
     }
51 51
   }
Please login to merge, or discard this patch.
blitz_register.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
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
     message(classLocale::$lang[$error_message], classLocale::$lang['sys_error'], 'overview.php', 10);
12 12
     die();
13 13
   }
@@ -16,16 +16,16 @@  discard block
 block discarded – undo
16 16
 $current_round = intval(classSupernova::$config->db_loadItem('game_blitz_register_round'));
17 17
 $current_price = intval(classSupernova::$config->db_loadItem('game_blitz_register_price'));
18 18
 
19
-if(classSupernova::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) {
19
+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 20
   sn_db_transaction_start();
21 21
   $user = db_user_by_id($user['id'], true);
22 22
   $is_registered = db_blitz_reg_get_id_by_player_and_round($user, $current_round);
23
-  if(sys_get_param_str('register_me')) {
24
-    if(empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) {
23
+  if (sys_get_param_str('register_me')) {
24
+    if (empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) {
25 25
       db_blitz_reg_insert($user, $current_round);
26 26
       classSupernova::$auth->account->metamatter_change(RPG_BLITZ_REGISTRATION, -$current_price, "Регистрация в раунде {$current_round} Блица");
27 27
     }
28
-  } elseif(sys_get_param_str('register_me_not') && !empty($is_registered)) {
28
+  } elseif (sys_get_param_str('register_me_not') && !empty($is_registered)) {
29 29
     db_blitz_reg_delete($user, $current_round);
30 30
     classSupernova::$auth->account->metamatter_change(RPG_BLITZ_REGISTRATION_CANCEL, $current_price, "Отмена регистрации в раунде {$current_round} Блица");
31 31
   }
@@ -40,17 +40,17 @@  discard block
 block discarded – undo
40 40
 $blitz_players = 0;
41 41
 $blitz_prize_dark_matter = 0;
42 42
 $blitz_prize_places = 0;
43
-if($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) {
44
-  if(sys_get_param_str('generate')) {
43
+if ($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) {
44
+  if (sys_get_param_str('generate')) {
45 45
     $next_id = 0;
46 46
     $query = db_blitz_reg_get_random_id($current_round);
47
-    while($row = db_fetch($query)) {
47
+    while ($row = db_fetch($query)) {
48 48
       $next_id++;
49
-      $blitz_name = 'Игрок' . $next_id;
49
+      $blitz_name = 'Игрок'.$next_id;
50 50
       $blitz_password = sys_random_string(8);
51 51
       db_blitz_reg_update_with_name_and_password($blitz_name, $blitz_password, $row, $current_round);
52 52
     }
53
-  } elseif(sys_get_param_str('import_generated')) {
53
+  } elseif (sys_get_param_str('import_generated')) {
54 54
     // ЭТО НА БЛИЦЕ!!!
55 55
     db_player_list_blitz_delete_players();
56 56
     db_planets_purge();
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     $system = $system_step;
73 73
     $planet = round(Vector::$knownPlanets / 2);
74 74
 
75
-    foreach($imported_string as &$string_data) {
75
+    foreach ($imported_string as &$string_data) {
76 76
       $string_data = explode(',', $string_data);
77 77
       $username_safe = $string_data[0];
78 78
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
       $moon_row = uni_create_moon($galaxy, $system, $planet, $user_new['id'], 30, '', false);
94 94
 
95
-      if(($system += $system_step) >= Vector::$knownSystems) {
95
+      if (($system += $system_step) >= Vector::$knownSystems) {
96 96
         $galaxy++;
97 97
         $system = $system_step;
98 98
       }
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
     classSupernova::$config->db_saveItem('users_amount', classSupernova::$config->users_amount + $new_players);
103 103
     // pdump($imported_string);
104 104
     // generated_string
105
-  } elseif(sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) {
105
+  } elseif (sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) {
106 106
     $blitz_result = explode(';', $blitz_result_string);
107 107
     $blitz_last_update = $blitz_result[0]; // Пока не используется
108 108
     unset($blitz_result[0]);
109
-    foreach($blitz_result as $blitz_result_data) {
109
+    foreach ($blitz_result as $blitz_result_data) {
110 110
       $blitz_result_data = explode(',', $blitz_result_data);
111
-      if(count($blitz_result_data) == 5) {
111
+      if (count($blitz_result_data) == 5) {
112 112
         $blitz_result_data[1] = db_escape($blitz_result_data[1]);
113 113
         db_blitz_reg_update_results($blitz_result_data, $current_round);
114 114
       }
@@ -116,15 +116,15 @@  discard block
 block discarded – undo
116 116
     $blitz_result = array();
117 117
   }
118 118
 
119
-  if(classSupernova::$config->game_mode == GAME_BLITZ) {
119
+  if (classSupernova::$config->game_mode == GAME_BLITZ) {
120 120
     $blitz_result = array(classSupernova::$config->db_loadItem('var_stat_update'));
121 121
     $query = db_player_list_export_blitz_info();
122
-    while($row = db_fetch($query)) {
122
+    while ($row = db_fetch($query)) {
123 123
       $blitz_result[] = "{$row['id']},{$row['username']},{$row['onlinetime']},{$row['total_rank']},{$row['total_points']}";
124 124
     }
125 125
   } else {
126 126
     $query = db_blitz_reg_get_player_list($current_round);
127
-    while($row = db_fetch($query)) {
127
+    while ($row = db_fetch($query)) {
128 128
       $blitz_generated[] = "{$row['blitz_name']},{$row['blitz_password']}";
129 129
       $row['blitz_online'] ? $blitz_prize_players_active++ : false;
130 130
       $blitz_players++;
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
     $blitz_prize_dark_matter = $blitz_prize_players_active * 20000;
133 133
     $blitz_prize_places = ceil($blitz_prize_players_active / 5);
134 134
 
135
-    if(sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) {
135
+    if (sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) {
136 136
       // $blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter');
137 137
       $blitz_prize_places_actual = sys_get_param_int('blitz_prize_places');
138 138
       sn_db_transaction_start();
139 139
       $query = db_blitz_reg_get_player_list_order_by_place($current_round);
140
-      while($row = db_fetch($query)) {
141
-        if(!$row['blitz_place']) {
140
+      while ($row = db_fetch($query)) {
141
+        if (!$row['blitz_place']) {
142 142
           continue;
143 143
         }
144 144
 
@@ -147,14 +147,14 @@  discard block
 block discarded – undo
147 147
 
148 148
         $reward = $blitz_prize_dark_matter_actual - $row['blitz_reward_dark_matter'];
149 149
         pdump("{{$row['id']}} {$row['blitz_name']}, Place {$row['blitz_place']}, Prize places {$blitz_prize_places_actual}, Prize {$reward}", $row['id']);
150
-        if($reward) {
150
+        if ($reward) {
151 151
           rpg_points_change($row['user_id'], RPG_BLITZ, $reward, sprintf(
152 152
             classLocale::$lang['sys_blitz_reward_log_message'], $row['blitz_place'], $row['blitz_name']
153 153
           ));
154 154
           db_blitz_reg_update_apply_results($reward, $row, $current_round);
155 155
         }
156 156
 
157
-        if(!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) {
157
+        if (!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) {
158 158
           break;
159 159
         }
160 160
       }
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
 
170 170
 $player_registered = false;
171 171
 $query = db_blitz_reg_get_player_list_and_users($current_round);
172
-while($row = db_fetch($query)) {
172
+while ($row = db_fetch($query)) {
173 173
   $tpl_player_data = array(
174 174
     'NAME' => player_nick_render_to_html($row, array('icons' => true, 'color' => true, 'ally' => true)),
175 175
   );
176 176
 
177
-  if(classSupernova::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) {
177
+  if (classSupernova::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) {
178 178
     // Вот так хитро, что бы не было не единого шанса попадания на страницу данных об игроках Блиц-сервера до закрытия раунда
179 179
     $tpl_player_data = array_merge($tpl_player_data, array(
180 180
       'ID'                       => $row['id'],
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
   }
188 188
 
189 189
   $template->assign_block_vars('registrations', $tpl_player_data);
190
-  if($row['id'] == $user['id']) {
190
+  if ($row['id'] == $user['id']) {
191 191
     $player_registered = $row;
192 192
   }
193 193
 }
Please login to merge, or discard this patch.
market.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  *
10 10
  */
11 11
 
12
-require_once('common.' . substr(strrchr(__FILE__, '.'), 1));
12
+require_once('common.'.substr(strrchr(__FILE__, '.'), 1));
13 13
 
14 14
 define('SN_IN_MARKET', true);
15 15
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 $newstock = $stock;
27 27
 $intError = MARKET_DEAL;
28 28
 
29
-switch($mode)
29
+switch ($mode)
30 30
 {
31 31
   case MARKET_RESOURCES: // Resource trader
32 32
     require('includes/includes/market_trader.inc');
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
 }
83 83
 
84 84
 $message_id = sys_get_param_int('message');
85
-if($message_id != MARKET_NOTHING)
85
+if ($message_id != MARKET_NOTHING)
86 86
 {
87 87
   $template->assign_block_vars('result', array('MESSAGE' => classLocale::$lang['eco_mrk_errors'][$message_id]));
88 88
 }
89 89
 
90
-if($message)
90
+if ($message)
91 91
 {
92 92
   $template->assign_block_vars('result', array('MESSAGE' => $message));
93 93
 }
Please login to merge, or discard this patch.
banner.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 */
14 14
 
15 15
 $allow_anonymous = true;
16
-include('includes/init.' . substr(strrchr(__FILE__, '.'), 1));
16
+include('includes/init.'.substr(strrchr(__FILE__, '.'), 1));
17 17
 
18 18
 lng_include('overview');
19 19
 
Please login to merge, or discard this patch.
admin/ajax_maintenance.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@  discard block
 block discarded – undo
2 2
 
3 3
 define('IN_ADMIN', true);
4 4
 
5
-require('../includes/init.' . substr(strrchr(__FILE__, '.'), 1));
5
+require('../includes/init.'.substr(strrchr(__FILE__, '.'), 1));
6 6
 
7
-if($user['authlevel'] < 3)
7
+if ($user['authlevel'] < 3)
8 8
 {
9 9
   message(classLocale::$lang['sys_noalloaw'], classLocale::$lang['sys_noaccess']);
10 10
   die();
@@ -20,13 +20,13 @@  discard block
 block discarded – undo
20 20
 // [#] info_best_battles 1b0
21 21
 $best_reports = array();
22 22
 
23
-if(defined('MODULE_INFO_BEST_BATTLES_QUERY')) {
23
+if (defined('MODULE_INFO_BEST_BATTLES_QUERY')) {
24 24
   $query = db_ube_report_get_best_battles();
25
-  while($row = db_fetch($query)) {
25
+  while ($row = db_fetch($query)) {
26 26
     $best_reports[] = $row['ube_report_id'];
27 27
   }
28 28
 }
29
-$best_reports = !empty($best_reports) ? ' AND ube_report_id NOT IN (' . implode(',', $best_reports) . ')' : '';
29
+$best_reports = !empty($best_reports) ? ' AND ube_report_id NOT IN ('.implode(',', $best_reports).')' : '';
30 30
 
31 31
 
32 32
 $ques = array(
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
   // Удаляем юниты без планет
91 91
   'DELETE un FROM {{unit}} AS un
92 92
     LEFT JOIN {{planets}} AS pl ON pl.id = un.unit_location_id
93
-  WHERE unit_location_type = ' . LOC_PLANET . ' AND pl.id IS NULL;',
93
+  WHERE unit_location_type = ' . LOC_PLANET.' AND pl.id IS NULL;',
94 94
   // Удаляем пустые юниты с 0 уровнем (кроме Капитана)
95
-  'DELETE FROM {{unit}} WHERE unit_location_type = ' . LOC_PLANET . ' AND unit_level = 0 AND unit_type <> ' . UNIT_CAPTAIN,
95
+  'DELETE FROM {{unit}} WHERE unit_location_type = '.LOC_PLANET.' AND unit_level = 0 AND unit_type <> '.UNIT_CAPTAIN,
96 96
   // Удаляем очереди на ничьих планетах
97 97
   'DELETE q FROM {{que}} AS q
98 98
     LEFT JOIN {{planets}} AS p ON p.id = q.que_planet_id
99 99
   WHERE
100
-    que_type IN (' . QUE_STRUCTURES . ', ' . QUE_HANGAR . ', ' . SUBQUE_FLEET . ', ' . SUBQUE_DEFENSE . ')
100
+    que_type IN (' . QUE_STRUCTURES.', '.QUE_HANGAR.', '.SUBQUE_FLEET.', '.SUBQUE_DEFENSE.')
101 101
     AND
102 102
     (p.id_owner = 0 OR p.id_owner IS NULL);',
103 103
 
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
   // Удаляются сообщения, старше  4 недель, кроме личных и Альянсовских
113 113
   'DELETE FROM {{messages}} WHERE
114 114
     UNIX_TIMESTAMP() - message_time > 4*7 * 24 * 60 * 60 AND
115
-    message_type NOT IN (' . MSG_TYPE_PLAYER . ', ' . MSG_TYPE_ALLIANCE . ');',
115
+    message_type NOT IN (' . MSG_TYPE_PLAYER.', '.MSG_TYPE_ALLIANCE.');',
116 116
   // Удаляются сообщения у пользователей, которые неактивны больше 4 недель - кроме личных и Альянсовских
117 117
   'DELETE m FROM `{{users}}` AS u
118 118
   JOIN {{messages}} AS m ON m.message_owner = u.id
119 119
   WHERE
120
-    message_type NOT IN (' . MSG_TYPE_PLAYER . ', ' . MSG_TYPE_ALLIANCE . ') AND
120
+    message_type NOT IN (' . MSG_TYPE_PLAYER.', '.MSG_TYPE_ALLIANCE.') AND
121 121
     authlevel = 0 AND  user_as_ally IS NULL AND /* Не админы, Не Альянсы */
122 122
     UNIX_TIMESTAMP() - onlinetime > 4*7 *86400;',
123 123
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
       (log_dark_matter_timestamp, log_dark_matter_username, log_dark_matter_reason, log_dark_matter_amount,
138 138
       log_dark_matter_comment, log_dark_matter_page, log_dark_matter_sender)
139 139
     SELECT
140
-      '{$pack_until}', IF(u.username IS NULL, ldm.log_dark_matter_username, u.username), " . RPG_CUMULATIVE . ", sum(ldm.log_dark_matter_amount),
140
+      '{$pack_until}', IF(u.username IS NULL, ldm.log_dark_matter_username, u.username), ".RPG_CUMULATIVE.", sum(ldm.log_dark_matter_amount),
141 141
       'Баланс на {$pack_until}', 'admin/ajax_maintenance.php', ldm.log_dark_matter_sender
142 142
     FROM
143 143
       {{log_dark_matter}} AS ldm
@@ -155,22 +155,22 @@  discard block
 block discarded – undo
155 155
     "REPLACE INTO `{{log_users_online}}`
156 156
       (online_timestamp, online_count, online_aggregated)
157 157
     SELECT
158
-      FROM_UNIXTIME((UNIX_TIMESTAMP(online_timestamp) DIV " . PERIOD_MINUTE_10 . ") * (" . PERIOD_MINUTE_10 . ")), ceil(avg(online_count)), " . LOG_ONLIINE_AGGREGATE_PERIOD_MINUTE_10 . "
158
+      FROM_UNIXTIME((UNIX_TIMESTAMP(online_timestamp) DIV " . PERIOD_MINUTE_10.") * (".PERIOD_MINUTE_10.")), ceil(avg(online_count)), ".LOG_ONLIINE_AGGREGATE_PERIOD_MINUTE_10."
159 159
     FROM
160 160
       `{{log_users_online}}`
161 161
     WHERE
162
-      online_timestamp < '{$pack_until}' AND online_aggregated = " . LOG_ONLIINE_AGGREGATE_NONE . "
162
+      online_timestamp < '{$pack_until}' AND online_aggregated = ".LOG_ONLIINE_AGGREGATE_NONE."
163 163
     GROUP BY
164
-      (UNIX_TIMESTAMP(online_timestamp) DIV " . PERIOD_MINUTE_10 . ") * (" . PERIOD_MINUTE_10 . ");",
164
+      (UNIX_TIMESTAMP(online_timestamp) DIV " . PERIOD_MINUTE_10.") * (".PERIOD_MINUTE_10.");",
165 165
 
166
-    "DELETE FROM {{log_users_online}} WHERE online_timestamp < '{$pack_until}' AND online_aggregated = " . LOG_ONLIINE_AGGREGATE_NONE,
166
+    "DELETE FROM {{log_users_online}} WHERE online_timestamp < '{$pack_until}' AND online_aggregated = ".LOG_ONLIINE_AGGREGATE_NONE,
167 167
   ),
168 168
 
169 169
   // Удаляем старые записи из логов
170 170
   "DELETE FROM `{{logs}}` WHERE log_timestamp < '{$pack_until}';",
171 171
   // Удаляем записи о маинтенансе, апдейте и пересчете статистики более чем недельной давности - они нам уже не нужны
172 172
   'DELETE FROM `{{logs}}` WHERE
173
-    `log_code` IN (' . LOG_INFO_DB_CHANGE . ', ' . LOG_INFO_MAINTENANCE . ', ' . LOG_INFO_STAT_START . ', ' . LOG_INFO_STAT_PROCESS . ', ' . LOG_INFO_STAT_FINISH . ')
173
+    `log_code` IN (' . LOG_INFO_DB_CHANGE.', '.LOG_INFO_MAINTENANCE.', '.LOG_INFO_STAT_START.', '.LOG_INFO_STAT_PROCESS.', '.LOG_INFO_STAT_FINISH.')
174 174
     AND `log_timestamp` < DATE_SUB(NOW(),INTERVAL 7 DAY);',
175 175
 
176 176
 
@@ -186,16 +186,16 @@  discard block
 block discarded – undo
186 186
 
187 187
 function sn_maintenance_pack_user_list($user_list) {
188 188
   $user_list = explode(',', $user_list);
189
-  foreach($user_list as $key => $user_id) {
190
-    if(!ceil(floatval($user_id))) {
189
+  foreach ($user_list as $key => $user_id) {
190
+    if (!ceil(floatval($user_id))) {
191 191
       unset($user_list[$key]);
192 192
     }
193 193
   }
194 194
 
195 195
   $result = array();
196
-  if(!empty($user_list)) {
196
+  if (!empty($user_list)) {
197 197
     $query = db_user_list_get_by_id_array($user_list);
198
-    while($row = db_fetch($query)) {
198
+    while ($row = db_fetch($query)) {
199 199
       $result[] = $row['id'];
200 200
     }
201 201
   }
@@ -208,13 +208,13 @@  discard block
 block discarded – undo
208 208
 $old_server_status == GAME_DISABLE_NONE ? classSupernova::$config->db_saveItem('game_disable', GAME_DISABLE_MAINTENANCE) : false;
209 209
 sn_db_transaction_commit();
210 210
 
211
-foreach($ques as $que_transaction) {
211
+foreach ($ques as $que_transaction) {
212 212
   sn_db_transaction_start();
213 213
 
214 214
   !is_array($que_transaction) ? $que_transaction = array($que_transaction) : false;
215
-  foreach($que_transaction as $que) {
215
+  foreach ($que_transaction as $que) {
216 216
     set_time_limit(120);
217
-    if(is_callable($que)) {
217
+    if (is_callable($que)) {
218 218
       $QryResult = call_user_func($que);
219 219
     } else {
220 220
       $QryResult = doquery($que);
@@ -225,12 +225,12 @@  discard block
 block discarded – undo
225 225
     //$que = str_replace('}}', '', $que);
226 226
 
227 227
     $msg .=
228
-      '<li>' . htmlspecialchars($que) .
229
-        ' --- <span style="' . ($QryResult ? 'ok">OK' : 'error">FAILED!') . '</span> ' .
230
-      classSupernova::$db->db_affected_rows() . ' ' . classLocale::$lang['adm_records'] .
228
+      '<li>'.htmlspecialchars($que).
229
+        ' --- <span style="'.($QryResult ? 'ok">OK' : 'error">FAILED!').'</span> '.
230
+      classSupernova::$db->db_affected_rows().' '.classLocale::$lang['adm_records'].
231 231
       "</li>";
232 232
 
233
-    classSupernova::$debug->warning($que . ' --- ' . ($QryResult ? 'OK' : 'FAILED!') . ' ' . classSupernova::$db->db_affected_rows() . ' ' . classLocale::$lang['adm_records'], 'System maintenance', LOG_INFO_MAINTENANCE);
233
+    classSupernova::$debug->warning($que.' --- '.($QryResult ? 'OK' : 'FAILED!').' '.classSupernova::$db->db_affected_rows().' '.classLocale::$lang['adm_records'], 'System maintenance', LOG_INFO_MAINTENANCE);
234 234
   }
235 235
 
236 236
   sn_db_transaction_commit();
@@ -256,5 +256,5 @@  discard block
 block discarded – undo
256 256
 
257 257
 $adm_stat_title = classLocale::$lang['adm_stat_title'];
258 258
 $result = $result ? "<li>{$adm_stat_title} - {$result}</li>" : '';
259
-$result = '<div align="left"><ul>' . $msg . $result . '</ul></div>';
260
-echo json_encode($result . ' ' . $totaltime);
259
+$result = '<div align="left"><ul>'.$msg.$result.'</ul></div>';
260
+echo json_encode($result.' '.$totaltime);
Please login to merge, or discard this patch.
admin/adm_log_main.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -12,27 +12,27 @@  discard block
 block discarded – undo
12 12
 define('INSTALL', false);
13 13
 define('IN_ADMIN', true);
14 14
 
15
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
15
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
16 16
 
17
-if($user['authlevel'] < 3) {
17
+if ($user['authlevel'] < 3) {
18 18
   AdminMessage(classLocale::$lang['adm_err_denied']);
19 19
 }
20 20
 
21
-if($delete = sys_get_param_id('delete')) {
21
+if ($delete = sys_get_param_id('delete')) {
22 22
   db_log_delete_by_id($delete);
23
-} elseif(sys_get_param_str('delete_update_info')) {
23
+} elseif (sys_get_param_str('delete_update_info')) {
24 24
   db_log_delete_update_and_stat_calc();
25
-} elseif(sys_get_param_str('deleteall') == 'yes') {
25
+} elseif (sys_get_param_str('deleteall') == 'yes') {
26 26
 //  doquery("TRUNCATE TABLE `{{logs}}`");
27 27
 }
28 28
 
29
-if($detail = sys_get_param_id('detail')) {
29
+if ($detail = sys_get_param_id('detail')) {
30 30
   $template = gettemplate('admin/adm_log_main_detail', true);
31 31
 
32 32
   $errorInfo = db_log_get_by_id($detail);
33 33
   $error_dump = unserialize($errorInfo['log_dump']);
34
-  if(is_array($error_dump)) {
35
-    foreach($error_dump as $key => $value) {
34
+  if (is_array($error_dump)) {
35
+    foreach ($error_dump as $key => $value) {
36 36
       $v = array(
37 37
         'VAR_NAME'  => $key,
38 38
         'VAR_VALUE' => $key == 'query_log' ? $value : dump($value, $key)
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
 
48 48
   $i = 0;
49 49
   $query = db_log_list_get_last_100();
50
-  while($u = db_fetch($query)) {
50
+  while ($u = db_fetch($query)) {
51 51
     $i++;
52 52
     $v = array();
53
-    foreach($u as $key => $value) {
53
+    foreach ($u as $key => $value) {
54 54
       $v[strtoupper($key)] = $value;
55 55
     }
56 56
     $template->assign_block_vars('error', $v);
Please login to merge, or discard this patch.
admin/banned.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@  discard block
 block discarded – undo
14 14
 define('INSTALL', false);
15 15
 define('IN_ADMIN', true);
16 16
 
17
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
17
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
18 18
 
19
-if($user['authlevel'] < 1) {
19
+if ($user['authlevel'] < 1) {
20 20
   AdminMessage(classLocale::$lang['adm_err_denied']);
21 21
 }
22 22
 
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 $template = gettemplate("admin/admin_ban", true);
29 29
 
30 30
 $player_banned_row = db_user_by_username($name_unsafe);
31
-if($mode == 'banit' && $action) {
32
-  if($player_banned_row) {
31
+if ($mode == 'banit' && $action) {
32
+  if ($player_banned_row) {
33 33
     $reas = $_POST['why'];
34 34
     $days = $_POST['days'];
35 35
     $hour = $_POST['hour'];
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     $adm_bn_thpl = classLocale::$lang['adm_bn_thpl'];
50 50
     $DoneMessage = "{$adm_bn_thpl} {$name_output} {$adm_bn_isbn}";
51 51
 
52
-    if($is_vacation) {
52
+    if ($is_vacation) {
53 53
       $DoneMessage .= classLocale::$lang['adm_bn_vctn'];
54 54
     }
55 55
 
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
   }
60 60
 
61 61
   AdminMessage($DoneMessage, classLocale::$lang['adm_ban_title']);
62
-} elseif($mode == 'unbanit' && $action) {
62
+} elseif ($mode == 'unbanit' && $action) {
63 63
   sys_admin_player_ban_unset($user, $player_banned_row, ($reason = sys_get_param_str('why')) ? $reason : classLocale::$lang['sys_unbanned']);
64 64
 
65
-  $DoneMessage = classLocale::$lang['adm_unbn_thpl'] . " " . $name_output . " " . classLocale::$lang['adm_unbn_isbn'];
65
+  $DoneMessage = classLocale::$lang['adm_unbn_thpl']." ".$name_output." ".classLocale::$lang['adm_unbn_isbn'];
66 66
   AdminMessage($DoneMessage, classLocale::$lang['adm_unbn_ttle']);
67 67
 };
68 68
 
Please login to merge, or discard this patch.