Completed
Push — work-fleets ( fff2b6...e0e753 )
by SuperNova.WS
06:54
created
admin/adm_planet_list.php 1 patch
Spacing   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
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
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
7
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
8 8
 
9 9
 global $user;
10 10
 
11 11
 // if($user['authlevel'] < 1)
12
-if($user['authlevel'] < 3) {
12
+if ($user['authlevel'] < 3) {
13 13
   AdminMessage(classLocale::$lang['adm_err_denied']);
14 14
 }
15 15
 
16 16
 $planet_active = sys_get_param_int('planet_active');
17
-if(!$planet_active) {
17
+if (!$planet_active) {
18 18
   $planet_type = sys_get_param_int('planet_type', 1);
19 19
   $planet_type = $planet_type == 3 ? 3 : 1;
20 20
 } else {
@@ -42,9 +42,8 @@  discard block
 block discarded – undo
42 42
 }
43 43
 
44 44
 $page_title =
45
-  classLocale::$lang['adm_planet_list_title'] . ': ' .
46
-  ($planet_active ? classLocale::$lang['adm_planet_active'] :
47
-    ($planet_type ? ($planet_type == 3 ? classLocale::$lang['sys_moons'] : classLocale::$lang['sys_planets']) : '')
45
+  classLocale::$lang['adm_planet_list_title'].': '.
46
+  ($planet_active ? classLocale::$lang['adm_planet_active'] : ($planet_type ? ($planet_type == 3 ? classLocale::$lang['sys_moons'] : classLocale::$lang['sys_planets']) : '')
48 47
   );
49 48
 $template->assign_vars(array(
50 49
   'PAGE_TITLE' => $page_title,
Please login to merge, or discard this patch.
admin/userlist.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
 define('INSIDE', true);
13 13
 define('INSTALL', false);
14 14
 define('IN_ADMIN', true);
15
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
15
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
16 16
 
17 17
 global $user;
18
-if($user['authlevel'] < 3) {
18
+if ($user['authlevel'] < 3) {
19 19
   AdminMessage(classLocale::$lang['adm_err_denied']);
20 20
 }
21 21
 
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
 $sort = sys_get_param_int('sort', SORT_ID);
40 40
 $sort = $sort_fields[$sort] ? $sort : SORT_ID;
41 41
 
42
-if(($action = sys_get_param_int('action')) && ($user_id = sys_get_param_id('uid'))) {
42
+if (($action = sys_get_param_int('action')) && ($user_id = sys_get_param_id('uid'))) {
43 43
   $user_selected = db_user_by_id($user_id, false, 'id, username, authlevel');
44
-  if($user_selected['authlevel'] < $user['authlevel'] && $user['authlevel'] >= 3) {
45
-    switch($action) {
44
+  if ($user_selected['authlevel'] < $user['authlevel'] && $user['authlevel'] >= 3) {
45
+    switch ($action) {
46 46
       case ACTION_DELETE:
47 47
         DeleteSelectedUser($user_id);
48 48
         sys_redirect("{$_SERVER['SCRIPT_NAME']}?sort={$sort}");
@@ -63,20 +63,20 @@  discard block
 block discarded – undo
63 63
 
64 64
 $multi_ip = array();
65 65
 $ip_query = db_user_list_admin_multiaccounts();
66
-while($ip = db_fetch($ip_query)) {
66
+while ($ip = db_fetch($ip_query)) {
67 67
   $multi_ip[$ip['user_lastip']] = $ip['ip_count'];
68 68
 }
69 69
 
70 70
 $geoip = geoip_status();
71 71
 
72 72
 $query = db_user_list_admin_sorted($sort_fields[$sort], $is_players_online_page);
73
-while($user_row = db_fetch($query)) {
74
-  if($user_row['banaday']) {
73
+while ($user_row = db_fetch($query)) {
74
+  if ($user_row['banaday']) {
75 75
     $ban_details = db_ban_list_get_details($user_row);
76 76
   }
77 77
 
78 78
   $geoip_info = $geoip ? geoip_ip_info(ip2longu($user_row['user_lastip'])) : array();
79
-  foreach($geoip_info as $key => $value) {
79
+  foreach ($geoip_info as $key => $value) {
80 80
     $geoip_info[strtoupper($key)] = $value;
81 81
     unset($geoip_info[$key]);
82 82
   }
Please login to merge, or discard this patch.
admin/settings.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@  discard block
 block discarded – undo
8 8
  * @copyright 2008 by ??????? for XNova
9 9
  */
10 10
 
11
-define('INSIDE'  , true);
12
-define('INSTALL' , false);
11
+define('INSIDE', true);
12
+define('INSTALL', false);
13 13
 define('IN_ADMIN', true);
14
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
14
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
15 15
 
16
-if($user['authlevel'] < 3) {
16
+if ($user['authlevel'] < 3) {
17 17
   AdminMessage(classLocale::$lang['adm_err_denied']);
18 18
 }
19 19
 
20 20
 $template = gettemplate('admin/settings', true);
21 21
 
22
-if(sys_get_param('save')) {
22
+if (sys_get_param('save')) {
23 23
   classSupernova::$config->game_name               = sys_get_param_str_unsafe('game_name');
24 24
   classSupernova::$config->game_mode               = sys_get_param_int('game_mode');
25 25
   classSupernova::$config->game_speed              = sys_get_param_float('game_speed', 1);
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
   classSupernova::$config->url_faq                 = sys_get_param_str_unsafe('url_faq');
30 30
   classSupernova::$config->url_forum               = sys_get_param_str_unsafe('url_forum');
31 31
   classSupernova::$config->url_rules               = sys_get_param_str_unsafe('url_rules');
32
-  classSupernova::$config->url_purchase_metamatter         = sys_get_param_str_unsafe('url_purchase_metamatter');
32
+  classSupernova::$config->url_purchase_metamatter = sys_get_param_str_unsafe('url_purchase_metamatter');
33 33
   classSupernova::$config->game_disable            = sys_get_param_int('game_disable');
34 34
   classSupernova::$config->game_disable_reason     = sys_get_param_str_unsafe('game_disable_reason');
35 35
   classSupernova::$config->server_updater_check_auto = sys_get_param_int('server_updater_check_auto');
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
   classSupernova::$config->stats_schedule          = sys_get_param_str('stats_schedule');
97 97
 
98 98
   classSupernova::$config->empire_mercenary_base_period = sys_get_param_int('empire_mercenary_base_period');
99
-  if(classSupernova::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) {
100
-    if(classSupernova::$config->empire_mercenary_temporary) {
99
+  if (classSupernova::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) {
100
+    if (classSupernova::$config->empire_mercenary_temporary) {
101 101
       db_unit_list_admin_delete_mercenaries_finished();
102 102
     } else {
103 103
       db_unit_list_admin_set_mercenaries_expire_time(classSupernova::$config->empire_mercenary_base_period);
@@ -138,21 +138,21 @@  discard block
 block discarded – undo
138 138
   'STATS_HIDE_PM_LINK' => classSupernova::$config->stats_hide_pm_link,
139 139
 ));
140 140
 
141
-foreach(classLocale::$lang['sys_game_disable_reason'] as $id => $name) {
141
+foreach (classLocale::$lang['sys_game_disable_reason'] as $id => $name) {
142 142
   $template->assign_block_vars('sys_game_disable_reason', array(
143 143
     'ID'   => $id,
144 144
     'NAME' => $name,
145 145
   ));
146 146
 }
147 147
 
148
-foreach(classLocale::$lang['sys_game_mode'] as $mode_id => $mode_name) {
148
+foreach (classLocale::$lang['sys_game_mode'] as $mode_id => $mode_name) {
149 149
   $template->assign_block_vars('game_modes', array(
150 150
     'ID'   => $mode_id,
151 151
     'NAME' => $mode_name,
152 152
   ));
153 153
 }
154 154
 
155
-foreach(classLocale::$lang['adm_opt_ver_response'] as $ver_id => $ver_response) {
155
+foreach (classLocale::$lang['adm_opt_ver_response'] as $ver_id => $ver_response) {
156 156
   $template->assign_block_vars('ver_response', array(
157 157
     'ID'   => $ver_id,
158 158
     'NAME' => js_safe_string($ver_response),
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 }
161 161
 
162 162
 $lang_list = lng_get_list();
163
-foreach($lang_list as $lang_id => $lang_data) {
163
+foreach ($lang_list as $lang_id => $lang_data) {
164 164
   $template->assign_block_vars('game_languages', array(
165 165
     'ID'   => $lang_id,
166 166
     'NAME' => "{$lang_data['LANG_NAME_NATIVE']} ({$lang_data['LANG_NAME_ENGLISH']})",
Please login to merge, or discard this patch.
admin/adm_message_list.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  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
 
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
   ),
29 29
 );
30 30
 $template->assign_block_vars('int_type_selected', $allowed_types[-1]);
31
-foreach($sn_message_class_list as $key => $value) {
32
-  if($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX) {
31
+foreach ($sn_message_class_list as $key => $value) {
32
+  if ($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX) {
33 33
     continue;
34 34
   }
35 35
 
@@ -41,17 +41,17 @@  discard block
 block discarded – undo
41 41
 
42 42
 
43 43
 $message_delete = sys_get_param_id('msg_del');
44
-if(sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete)) {
44
+if (sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete)) {
45 45
   $message_delete = implode(', ', $message_delete);
46 46
 }
47 47
 
48
-if($message_delete) {
48
+if ($message_delete) {
49 49
   db_message_list_delete_set($message_delete);
50 50
   $template->assign_block_vars('result', array('MESSAGE' => sprintf(classLocale::$lang['mlst_messages_deleted'], $message_delete)));
51 51
 }
52 52
 
53 53
 
54
-if(sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year'))) {
54
+if (sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year'))) {
55 55
   $delete_date = "{$year}-{$month}-{$day}";
56 56
   db_message_list_delete_by_date($delete_date, $int_type_selected);
57 57
   $template->assign_block_vars('result', array('MESSAGE' => sprintf(classLocale::$lang['mlst_messages_deleted_date'], $allowed_types[$int_type_selected]['TEXT'], $delete_date)));
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
 
64 64
 $int_page_current = min(sys_get_param_id('int_page_current', 1), $page_max);
65 65
 
66
-if(sys_get_param('page_prev') && $int_page_current > 1) {
66
+if (sys_get_param('page_prev') && $int_page_current > 1) {
67 67
   $int_page_current--;
68
-} elseif(sys_get_param('page_next') && $int_page_current < $page_max) {
68
+} elseif (sys_get_param('page_next') && $int_page_current < $page_max) {
69 69
   $int_page_current++;
70 70
 }
71 71
 
72
-for($i = 1; $i <= $page_max; $i++) {
72
+for ($i = 1; $i <= $page_max; $i++) {
73 73
   $template->assign_block_vars('page', array('NUMBER' => $i));
74 74
 }
75 75
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 $StartRec = ($int_page_current - 1) * 25;
78 78
 
79 79
 $Messages = db_message_list_admin_by_type($int_type_selected, $StartRec);
80
-while($row = db_fetch($Messages)) {
80
+while ($row = db_fetch($Messages)) {
81 81
   $row['FROM'] = htmlentities($row['FROM'], ENT_COMPAT, 'UTF-8');
82 82
   $row['OWNER_NAME'] = htmlentities($row['OWNER_NAME'], ENT_COMPAT, 'UTF-8');
83 83
   $row['TEXT'] = nl2br($row['TEXT']);
Please login to merge, or discard this patch.
admin/tools.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@  discard block
 block discarded – undo
9 9
 define('INSIDE', true);
10 10
 define('INSTALL', false);
11 11
 define('IN_ADMIN', true);
12
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
12
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
13 13
 
14 14
 // if($user['authlevel'] < 1)
15
-if($user['authlevel'] < 3) {
15
+if ($user['authlevel'] < 3) {
16 16
   AdminMessage(classLocale::$lang['adm_err_denied']);
17 17
 }
18 18
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  */
26 26
 function templateAssignTable($template, $str, $status) {
27 27
   $template->assign_block_vars('table', classLocale::$lang['adm_tool_sql_table'][$str]);
28
-  foreach($status as $key => $value) {
28
+  foreach ($status as $key => $value) {
29 29
     $template->assign_block_vars('table.row', array(
30 30
       'VALUE_1' => $key,
31 31
       'VALUE_2' => $value,
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
   }
34 34
 }
35 35
 
36
-switch($mode) {
36
+switch ($mode) {
37 37
   case ADM_TOOL_CONFIG_RELOAD:
38 38
     classSupernova::$config->db_loadAll();
39 39
     sys_refresh_tablelist();
40 40
 
41 41
     classSupernova::$config->db_loadItem('game_watchlist');
42
-    if(classSupernova::$config->game_watchlist) {
42
+    if (classSupernova::$config->game_watchlist) {
43 43
       classSupernova::$config->game_watchlist_array = explode(';', classSupernova::$config->game_watchlist);
44 44
     } else {
45 45
       unset(classSupernova::$config->game_watchlist_array);
Please login to merge, or discard this patch.
admin/adm_quest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-define('INSIDE'  , true);
11
-define('INSTALL' , false);
12
-define('IN_ADMIN'  , true);
10
+define('INSIDE', true);
11
+define('INSTALL', false);
12
+define('IN_ADMIN', true);
13 13
 
14
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
14
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
15 15
 
16
-if($user['authlevel'] < 2)
16
+if ($user['authlevel'] < 2)
17 17
 {
18 18
   AdminMessage(classLocale::$lang['adm_err_denied']);
19 19
 }
Please login to merge, or discard this patch.
admin/admin_locale.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -7,25 +7,25 @@  discard block
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-define('INSIDE'  , true);
11
-define('INSTALL' , false);
12
-define('IN_ADMIN'  , true);
10
+define('INSIDE', true);
11
+define('INSTALL', false);
12
+define('IN_ADMIN', true);
13 13
 
14
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
14
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
15 15
 
16
-if($user['authlevel'] < 3) {
16
+if ($user['authlevel'] < 3) {
17 17
   AdminMessage(classLocale::$lang['adm_err_denied']);
18 18
 }
19 19
 
20 20
 function adm_lng_assign_string($lang_id, $locale_string_name, $value) {
21 21
   global $locale_string_template, $languages_info, $languages, $domain;
22 22
 
23
-  if(is_array($value)) {
24
-    foreach($value as $sub_key => $sub_value) {
23
+  if (is_array($value)) {
24
+    foreach ($value as $sub_key => $sub_value) {
25 25
       adm_lng_assign_string($lang_id, "{$locale_string_name}[{$sub_key}]", $sub_value);
26 26
     }
27
-  } elseif($value) {
28
-    if(!isset($locale_string_template[$locale_string_name])) {
27
+  } elseif ($value) {
28
+    if (!isset($locale_string_template[$locale_string_name])) {
29 29
       $locale_string_template[$locale_string_name] = array();
30 30
     }
31 31
     $locale_string_template[$locale_string_name] = array_merge($locale_string_template[$locale_string_name], array("[{$lang_id}]" => htmlentities($value, ENT_COMPAT, 'utf-8')));
@@ -41,17 +41,17 @@  discard block
 block discarded – undo
41 41
   global $domain, $lang_id;
42 42
 
43 43
   $return = "{$ident}'{$string_name}' => ";
44
-  if(isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) {
45
-    $return .= "'" . str_replace(array("\\", "'"), array('\\\\', "\\'"), $string_value[$lang_id]) . "',";
44
+  if (isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) {
45
+    $return .= "'".str_replace(array("\\", "'"), array('\\\\', "\\'"), $string_value[$lang_id])."',";
46 46
   } else {
47 47
     $return .= "array(\r\n";
48
-    foreach($string_value as $arr_name => $arr_data) {
49
-      $return .= adm_lng_parse_string($arr_name, $arr_data, $ident . '  ');
48
+    foreach ($string_value as $arr_name => $arr_data) {
49
+      $return .= adm_lng_parse_string($arr_name, $arr_data, $ident.'  ');
50 50
     }
51 51
     $return .= "{$ident}),\r\n";
52 52
   }
53 53
 
54
-  return $return . "\r\n";
54
+  return $return."\r\n";
55 55
 }
56 56
 
57 57
 $honor_constants = array(
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 
99 99
   $string_name_new = false;
100 100
 
101
-  if(isset($honor_constants[$domain][$string_name_prefix])) {
101
+  if (isset($honor_constants[$domain][$string_name_prefix])) {
102 102
     $found_constants = array_keys($constants, $string_name);
103
-    foreach($found_constants as $constant_name) {
103
+    foreach ($found_constants as $constant_name) {
104 104
       $honor_prefix_list = is_array($honor_constants[$domain][$string_name_prefix]) ? $honor_constants[$domain][$string_name_prefix] : array($honor_constants[$domain][$string_name_prefix]);
105
-      foreach($honor_prefix_list as $honor_prefix) {
106
-        if(strpos($constant_name, $honor_prefix) === 0) {
105
+      foreach ($honor_prefix_list as $honor_prefix) {
106
+        if (strpos($constant_name, $honor_prefix) === 0) {
107 107
           $string_name_new = $constant_name;
108 108
           break;
109 109
         }
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
 
114 114
   $string_name_new = $string_name_new ? $string_name_new : "'{$string_name}'";
115 115
   fwrite($file_handler, "{$ident}{$string_name_new} => ");
116
-  if(isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) {
117
-    fwrite($file_handler, "'" . str_replace(array("\\", "'"), array('\\\\', "\\'"), $string_value[$lang_id]) . "',");
116
+  if (isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) {
117
+    fwrite($file_handler, "'".str_replace(array("\\", "'"), array('\\\\', "\\'"), $string_value[$lang_id])."',");
118 118
   } else {
119
-    $string_name_prefix = $string_name_prefix . "[{$string_name}]";
119
+    $string_name_prefix = $string_name_prefix."[{$string_name}]";
120 120
     fwrite($file_handler, "array(\r\n");
121
-    foreach($string_value as $arr_name => $arr_data) {
122
-      adm_lng_write_string($arr_name, $arr_data, $ident . '  ', $string_name_prefix);
121
+    foreach ($string_value as $arr_name => $arr_data) {
122
+      adm_lng_write_string($arr_name, $arr_data, $ident.'  ', $string_name_prefix);
123 123
     }
124 124
     fwrite($file_handler, "{$ident}),\r\n");
125 125
   }
@@ -138,29 +138,29 @@  discard block
 block discarded – undo
138 138
 $languages_info = lng_get_list();
139 139
 $domain = sys_get_param_str('domain');
140 140
 
141
-if($domain) {
141
+if ($domain) {
142 142
   $lang_new = sys_get_param('lang_new');
143
-  if(!empty($lang_new)) {
143
+  if (!empty($lang_new)) {
144 144
     $constants = get_defined_constants(true);
145 145
     $constants = $constants['user'];
146 146
     ksort($constants);
147
-    foreach($languages_info as $lang_id => $land_data) {
148
-      $file_handler = fopen(SN_ROOT_PHYSICAL . "language/{$lang_id}/{$domain}.mo.php.new", 'w');
147
+    foreach ($languages_info as $lang_id => $land_data) {
148
+      $file_handler = fopen(SN_ROOT_PHYSICAL."language/{$lang_id}/{$domain}.mo.php.new", 'w');
149 149
       fwrite($file_handler, "<?php\r\n\r\n/*\r\n#############################################################################
150 150
 #  Filename: {$domain}.mo.php
151 151
 #  Project: SuperNova.WS
152 152
 #  Website: http://www.supernova.ws
153 153
 #  Description: Massive Multiplayer Online Browser Space Startegy Game\r\n#\r\n");
154 154
 
155
-      foreach($land_data['LANG_COPYRIGHT'] as $lang_copyright) {
155
+      foreach ($land_data['LANG_COPYRIGHT'] as $lang_copyright) {
156 156
         $lang_copyright = str_replace(array('&copy;', '&quot;', '&lt;', '&gt;'), array('©', '"', '<', '>'), $lang_copyright);
157 157
         fwrite($file_handler, "#  {$lang_copyright}\r\n");
158 158
       }
159 159
       fwrite($file_handler, "#############################################################################\r\n*/\r\n
160
-/**\r\n*\r\n* @package language\r\n* @system [{$land_data['LANG_NAME_ENGLISH']}]\r\n* @version " . SN_VERSION . "\r\n*\r\n*/\r\n
160
+/**\r\n*\r\n* @package language\r\n* @system [{$land_data['LANG_NAME_ENGLISH']}]\r\n* @version ".SN_VERSION."\r\n*\r\n*/\r\n
161 161
 /**\r\n* DO NOT CHANGE\r\n*/\r\n\r\nif (!defined('INSIDE')) die();\r\n
162 162
 \$a_lang_array = array(\r\n");
163
-      foreach($lang_new as $string_name => $string_value) {
163
+      foreach ($lang_new as $string_name => $string_value) {
164 164
         adm_lng_write_string($string_name, $string_value);
165 165
       }
166 166
       fwrite($file_handler, ");\r\n");
@@ -171,21 +171,21 @@  discard block
 block discarded – undo
171 171
     die();
172 172
   }
173 173
 
174
-  foreach($languages_info as $lang_id => $lang_data) {
174
+  foreach ($languages_info as $lang_id => $lang_data) {
175 175
     $template->assign_block_vars('language', $lang_data);
176
-    $full_filename = SN_ROOT_PHYSICAL . "language/{$lang_id}/{$domain}.mo.php";
177
-    $languages[$lang_id] = adm_lng_load($full_filename . (file_exists($full_filename . '.new') ? '.new' : ''));
178
-    foreach($languages[$lang_id] as $locale_string_name => $cork) {
176
+    $full_filename = SN_ROOT_PHYSICAL."language/{$lang_id}/{$domain}.mo.php";
177
+    $languages[$lang_id] = adm_lng_load($full_filename.(file_exists($full_filename.'.new') ? '.new' : ''));
178
+    foreach ($languages[$lang_id] as $locale_string_name => $cork) {
179 179
       adm_lng_assign_string($lang_id, "[{$locale_string_name}]", $languages[$lang_id][$locale_string_name]);
180 180
     }
181 181
   }
182 182
 
183
-  foreach($locale_string_template as $locale_string_name => $locale_string_list) {
183
+  foreach ($locale_string_template as $locale_string_name => $locale_string_list) {
184 184
     $template->assign_block_vars('string', array(
185 185
       'NAME' => $locale_string_name,
186 186
     ));
187 187
 
188
-    foreach($languages_info as $lang_id => $cork2) {
188
+    foreach ($languages_info as $lang_id => $cork2) {
189 189
       $template->assign_block_vars('string.locale', array(
190 190
         'LANG' => $lang_id,
191 191
         'VALUE' => $locale_string_list["[{$lang_id}]"],
@@ -197,21 +197,21 @@  discard block
 block discarded – undo
197 197
     'DOMAIN' => $domain,
198 198
   ));
199 199
 } else {
200
-  $path = SN_ROOT_PHYSICAL . "language/";
200
+  $path = SN_ROOT_PHYSICAL."language/";
201 201
   $dir = dir($path);
202 202
   while (false !== ($lang_id = $dir->read())) {
203
-    $full_path = $path . $lang_id;
204
-    if($lang_id[0] != "." && is_dir($full_path)) {
203
+    $full_path = $path.$lang_id;
204
+    if ($lang_id[0] != "." && is_dir($full_path)) {
205 205
       $lang_file_list = dir($full_path);
206 206
       while (false !== ($filename = $lang_file_list->read())) {
207 207
         $lang_domain = strtolower(substr($filename, 0, strpos($filename, '.')));
208
-        if(!$lang_domain) {
208
+        if (!$lang_domain) {
209 209
           continue;
210 210
         }
211 211
 
212 212
         $file_ext = strtolower(substr($filename, strpos($filename, '.')));
213
-        if($lang_domain != 'language') {
214
-          if($file_ext == '.mo.php.new' || ($file_ext == '.mo.php' && empty($languages[$lang_id][$lang_domain]))) {
213
+        if ($lang_domain != 'language') {
214
+          if ($file_ext == '.mo.php.new' || ($file_ext == '.mo.php' && empty($languages[$lang_id][$lang_domain]))) {
215 215
             $language_domains[$lang_domain] = $lang_domain;
216 216
             $languages[$lang_id][$lang_domain] = $lang_domain;
217 217
           }
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
   }
222 222
   $dir->close();
223 223
 
224
-  foreach($language_domains as $lang_domain) {
224
+  foreach ($language_domains as $lang_domain) {
225 225
     $template->assign_block_vars('domain', array(
226 226
       'NAME' => $lang_domain,
227 227
     ));
Please login to merge, or discard this patch.
admin/adm_user_analyze.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -10,22 +10,22 @@  discard block
 block discarded – undo
10 10
 define('INSTALL', false);
11 11
 define('IN_ADMIN', true);
12 12
 
13
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
13
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
14 14
 
15
-if($user['authlevel'] < 3) {
15
+if ($user['authlevel'] < 3) {
16 16
   AdminMessage(classLocale::$lang['adm_err_denied']);
17 17
 }
18 18
 
19 19
 // define('SESSION_INTERRUPT', 15*60); // Можно увеличить до 4 часов - никито не может сидеть 2 суток с перерывом менее 4 часов
20 20
 // define('SUSPICIOUS_LONG', 2 * 60*60); // Тогда это увеличиваем до, скажем суток - и там смотрим
21 21
 
22
-define('SESSION_INTERRUPT', 1 * 60*60); // Можно увеличить до 4 часов - никито не может сидеть 2 суток с перерывом менее 4 часов
23
-define('SUSPICIOUS_LONG', 16 * 60*60); // Тогда это увеличиваем до, скажем суток - и там смотрим
22
+define('SESSION_INTERRUPT', 1 * 60 * 60); // Можно увеличить до 4 часов - никито не может сидеть 2 суток с перерывом менее 4 часов
23
+define('SUSPICIOUS_LONG', 16 * 60 * 60); // Тогда это увеличиваем до, скажем суток - и там смотрим
24 24
 
25 25
 
26 26
 function check_suspicious(&$session, &$session_list_last_id, &$row) {
27 27
   $session[2] = $session[1] - $session[0];
28
-  if($session[2] > SUSPICIOUS_LONG)
28
+  if ($session[2] > SUSPICIOUS_LONG)
29 29
   {
30 30
     $session[2] = pretty_time($session[2]);
31 31
     $session[0] = date(FMT_DATE_TIME_SQL, $session[0]);
@@ -46,24 +46,24 @@  discard block
 block discarded – undo
46 46
 $session_list = array();
47 47
 $query = db_counter_list_by_week();
48 48
 $session = array();
49
-if($row = db_fetch($query)) {
49
+if ($row = db_fetch($query)) {
50 50
   $session = array(
51 51
     0 => strtotime($row['visit_time']), // start
52 52
     1 => strtotime($row['visit_time']), // end
53 53
   );
54 54
   $last_id = $row['user_id'];
55 55
 }
56
-while($row = db_fetch($query)) {
56
+while ($row = db_fetch($query)) {
57 57
   $row['visit_time'] = strtotime($row['visit_time']);
58
-  if($last_id == $row['user_id']) {
58
+  if ($last_id == $row['user_id']) {
59 59
     // Тот же юзер
60
-    if($row['visit_time'] - $session[1] <= SESSION_INTERRUPT) { // Та же сессия
60
+    if ($row['visit_time'] - $session[1] <= SESSION_INTERRUPT) { // Та же сессия
61 61
       $session[1] = $row['visit_time'];
62 62
     } else {
63 63
       // Новая сессия
64 64
 //      check_suspicious($session, $session_list[$last_id], $row);
65 65
       $session[2] = $session[1] - $session[0];
66
-      if($session[2] > SUSPICIOUS_LONG)
66
+      if ($session[2] > SUSPICIOUS_LONG)
67 67
       {
68 68
         $session[2] = pretty_time($session[2]);
69 69
         $session[0] = date(FMT_DATE_TIME_SQL, $session[0]);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
   } else {
79 79
 //    check_suspicious($session, $session_list[$last_id], $row);
80 80
     $session[2] = $session[1] - $session[0];
81
-      if($session[2] > SUSPICIOUS_LONG)
81
+      if ($session[2] > SUSPICIOUS_LONG)
82 82
       {
83 83
         $session[2] = pretty_time($session[2]);
84 84
         $session[0] = date(FMT_DATE_TIME_SQL, $session[0]);
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
   }
94 94
 }
95 95
 
96
-if($last_id) {
96
+if ($last_id) {
97 97
   // check_suspicious($session, $session_list[$last_id], $row = array('time' => 0));
98 98
   $session[2] = $session[1] - $session[0];
99 99
 
100
-  if($session[2] > SUSPICIOUS_LONG)
100
+  if ($session[2] > SUSPICIOUS_LONG)
101 101
   {
102 102
     $session[2] = pretty_time($session[2]);
103 103
     $session[0] = date(FMT_DATE_TIME_SQL, $session[0]);
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
 print("<td>ID</td><td>Username</td><td>Start</td><td>End</td><td>Length</td>");
112 112
 print("<td>Last online</td>");
113 113
 print("</tr>");
114
-foreach($session_list as $user_id => $value) {
114
+foreach ($session_list as $user_id => $value) {
115 115
   $user_record = db_player_list_online_by_id($user_id);
116
-  foreach($value as $interval_data) {
116
+  foreach ($value as $interval_data) {
117 117
     print("<tr>");
118 118
     print("<td>{$user_id}</td><td>{$user_record['username']}</td><td>{$interval_data[0]}</td><td>{$interval_data[1]}</td><td>{$interval_data[2]}</td>");
119
-    print("<td>" . date(FMT_DATE_TIME_SQL, $user_record['onlinetime']) . "</td>");
119
+    print("<td>".date(FMT_DATE_TIME_SQL, $user_record['onlinetime'])."</td>");
120 120
     print("</tr>");
121 121
   }
122 122
 }
Please login to merge, or discard this patch.
admin/adm_flying_fleets.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@  discard block
 block discarded – undo
9 9
 define('INSIDE', true);
10 10
 define('INSTALL', false);
11 11
 define('IN_ADMIN', true);
12
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
12
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
13 13
 
14 14
 // if ($user['authlevel'] < 2)
15
-if($user['authlevel'] < 3) {
15
+if ($user['authlevel'] < 3) {
16 16
   AdminMessage(classLocale::$lang['adm_err_denied']);
17 17
 }
18 18
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 //while($CurrentFleet = db_fetch($FlyingFleets))
23 23
 
24 24
 $all_flying_fleets = FleetList::dbGetFleetList();
25
-foreach($all_flying_fleets->_container as $fleet_id => $objFleet) {
25
+foreach ($all_flying_fleets->_container as $fleet_id => $objFleet) {
26 26
   $FleetOwner = db_user_by_id($objFleet->playerOwnerId);
27 27
   $TargetOwner = db_user_by_id($objFleet->target_owner_id);
28 28
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
   $fleet_data['fleet']['STAY_TIME_INT'] = $objFleet->time_mission_job_complete;
34 34
 
35 35
   $template->assign_block_vars('fleets', $fleet_data['fleet']);
36
-  foreach($fleet_data['ships'] as $ship_data) {
36
+  foreach ($fleet_data['ships'] as $ship_data) {
37 37
     $template->assign_block_vars('fleets.ships', $ship_data);
38 38
   }
39 39
 }
Please login to merge, or discard this patch.