Completed
Push — work-fleets ( f5fbda...1bdd41 )
by SuperNova.WS
06:04
created
resources.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
   ));
47 47
 };
48 48
 
49
-$ValidList['percent'] = array (  0,  10,  20,  30,  40,  50,  60,  70,  80,  90, 100 );
49
+$ValidList['percent'] = array(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100);
50 50
 $template = gettemplate('resources', true);
51 51
 
52 52
 $transmutation_result = sn_sys_planet_core_transmute($user, $planetrow);
53
-if(!empty($transmutation_result))
53
+if (!empty($transmutation_result))
54 54
 {
55 55
   $template->assign_block_vars('result', $transmutation_result); // array('STATUS' => $transmutation_result['STATUS'], 'MESSAGE' => $transmutation_result['MESSAGE']));
56 56
 }
@@ -59,20 +59,20 @@  discard block
 block discarded – undo
59 59
 $production = $_POST['production'];
60 60
 //$SubQry     = '';
61 61
 $SubQry     = array();
62
-if(is_array($production)) {
63
-  foreach($production as $prod_id => $percent) {
64
-    if($percent > 100 || $percent < 0) {
62
+if (is_array($production)) {
63
+  foreach ($production as $prod_id => $percent) {
64
+    if ($percent > 100 || $percent < 0) {
65 65
       $debug->warning('Supplying wrong production percent (less then 0 or greater then 100)', 'Hack attempt', 302, array('base_dump' => true));
66 66
       die();
67 67
     }
68 68
 
69 69
     $prod_id = intval($prod_id);
70
-    if(in_array($prod_id, $sn_group_factories) && get_unit_param($prod_id, P_MINING_IS_MANAGED)) {
70
+    if (in_array($prod_id, $sn_group_factories) && get_unit_param($prod_id, P_MINING_IS_MANAGED)) {
71 71
       $field_name              = pname_factory_production_field_name($prod_id);
72 72
       $percent                 = floor($percent / 10);
73 73
       $planetrow[$field_name]  = $percent;
74 74
       //$SubQry                 .= "`{$field_name}` = '{$percent}',";
75
-      $SubQry[]                 = "`{$field_name}` = '{$percent}'";
75
+      $SubQry[] = "`{$field_name}` = '{$percent}'";
76 76
     } else {
77 77
       $debug->warning('Supplying wrong ID in production array - attempt to change some field - ID' . $prod_id, 'Resource Page', 301);
78 78
       continue;
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
   'ENERGY_TYPE'    => pretty_number($caps_real['production'][RES_ENERGY][0], true, true),
109 109
 ));
110 110
 
111
-foreach($sn_group_factories as $unit_id)
111
+foreach ($sn_group_factories as $unit_id)
112 112
 {
113
-  if(mrc_get_level($user, $planetrow, $unit_id) > 0 && get_unit_param($unit_id))
113
+  if (mrc_get_level($user, $planetrow, $unit_id) > 0 && get_unit_param($unit_id))
114 114
   {
115 115
     $level_plain = mrc_get_level($user, $planetrow, $unit_id, false, true);
116 116
     $template->assign_block_vars('production', array(
Please login to merge, or discard this patch.
admin/adm_user_analyze.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -12,20 +12,20 @@  discard block
 block discarded – undo
12 12
 
13 13
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
14 14
 
15
-if($user['authlevel'] < 3) {
15
+if ($user['authlevel'] < 3) {
16 16
   AdminMessage($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 = doquery("SELECT `visit_time`, user_id FROM {{counter}} where user_id <> 0 and visit_time > UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY)) order by user_id, visit_time;");
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,9 +111,9 @@  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 = doquery("SELECT `username`, onlinetime FROM {{users}} WHERE id = {$user_id};", true);
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 119
     print("<td>" . date(FMT_DATE_TIME_SQL, $user_record['onlinetime']) . "</td>");
Please login to merge, or discard this patch.
admin/add_moon.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@
 block discarded – undo
14 14
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
15 15
 
16 16
 // if ($user['authlevel'] < 2)
17
-if($user['authlevel'] < 3)
17
+if ($user['authlevel'] < 3)
18 18
 {
19 19
   AdminMessage($lang['adm_err_denied']);
20 20
 }
21 21
 
22 22
 $template = gettemplate("admin/add_moon", true);
23 23
 
24
-if(sys_get_param_str('mode') == 'addit')
24
+if (sys_get_param_str('mode') == 'addit')
25 25
 {
26 26
   $PlanetID = sys_get_param_id('user');
27 27
   $MoonName = sys_get_param_str('name');
Please login to merge, or discard this patch.
admin/planet_edit.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
8 8
 
9 9
 // if($user['authlevel'] < 2)
10
-if($user['authlevel'] < 3)
10
+if ($user['authlevel'] < 3)
11 11
 {
12 12
   AdminMessage($lang['adm_err_denied']);
13 13
 }
@@ -21,30 +21,30 @@  discard block
 block discarded – undo
21 21
 $planet_id = sys_get_param_id('planet_id');
22 22
 
23 23
 $unit_list = sys_get_param('unit_list');
24
-if(sys_get_param('change_data') && !empty($unit_list))
24
+if (sys_get_param('change_data') && !empty($unit_list))
25 25
 {
26 26
   $query_string = array();
27
-  foreach($unit_list as $unit_id => $unit_amount)
27
+  foreach ($unit_list as $unit_id => $unit_amount)
28 28
   {
29
-    if($unit_query_string = admin_planet_edit_query_string($unit_id, $unit_amount, $mode))
29
+    if ($unit_query_string = admin_planet_edit_query_string($unit_id, $unit_amount, $mode))
30 30
     {
31 31
       $query_string[] = $unit_query_string;
32 32
     }
33 33
   }
34 34
 
35
-  if(!empty($query_string))
35
+  if (!empty($query_string))
36 36
   {
37 37
     db_planet_set_by_id($planet_id, implode(', ', $query_string));
38 38
   }
39 39
 }
40 40
 
41
-if($planet_id)
41
+if ($planet_id)
42 42
 {
43 43
   $edit_planet_row = db_planet_by_id($planet_id);
44 44
   admin_planet_edit_template($template, $edit_planet_row, $mode);
45 45
 }
46 46
 
47
-foreach($admin_planet_edit_mode_list as $page_mode => $mode_locale)
47
+foreach ($admin_planet_edit_mode_list as $page_mode => $mode_locale)
48 48
 {
49 49
   $template->assign_block_vars('page_menu', array(
50 50
     'ID' => $page_mode,
Please login to merge, or discard this patch.
admin/adm_quest.php 1 patch
Spacing   +4 added lines, -4 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 14
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
15 15
 
16
-if($user['authlevel'] < 2)
16
+if ($user['authlevel'] < 2)
17 17
 {
18 18
   AdminMessage($lang['adm_err_denied']);
19 19
 }
Please login to merge, or discard this patch.
admin/admin_locale.php 1 patch
Spacing   +30 added lines, -30 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 14
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
15 15
 
16
-if($user['authlevel'] < 3) {
16
+if ($user['authlevel'] < 3) {
17 17
   AdminMessage($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')));
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
   global $domain, $lang_id;
47 47
 
48 48
   $return = "{$ident}'{$string_name}' => ";
49
-  if(isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) {
49
+  if (isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) {
50 50
     $return .= "'" . str_replace(array("\\", "'"), array('\\\\', "\\'"), $string_value[$lang_id]) . "',";
51 51
   } else {
52 52
     $return .= "array(\r\n";
53
-    foreach($string_value as $arr_name => $arr_data) {
53
+    foreach ($string_value as $arr_name => $arr_data) {
54 54
       $return .= adm_lng_parse_string($arr_name, $arr_data, $ident . '  ');
55 55
     }
56 56
     $return .= "{$ident}),\r\n";
@@ -103,12 +103,12 @@  discard block
 block discarded – undo
103 103
 
104 104
   $string_name_new = false;
105 105
 
106
-  if(isset($honor_constants[$domain][$string_name_prefix])) {
106
+  if (isset($honor_constants[$domain][$string_name_prefix])) {
107 107
     $found_constants = array_keys($constants, $string_name);
108
-    foreach($found_constants as $constant_name) {
108
+    foreach ($found_constants as $constant_name) {
109 109
       $honor_prefix_list = is_array($honor_constants[$domain][$string_name_prefix]) ? $honor_constants[$domain][$string_name_prefix] : array($honor_constants[$domain][$string_name_prefix]);
110
-      foreach($honor_prefix_list as $honor_prefix) {
111
-        if(strpos($constant_name, $honor_prefix) === 0) {
110
+      foreach ($honor_prefix_list as $honor_prefix) {
111
+        if (strpos($constant_name, $honor_prefix) === 0) {
112 112
           $string_name_new = $constant_name;
113 113
           break;
114 114
         }
@@ -118,12 +118,12 @@  discard block
 block discarded – undo
118 118
 
119 119
   $string_name_new = $string_name_new ? $string_name_new : "'{$string_name}'";
120 120
   fwrite($file_handler, "{$ident}{$string_name_new} => ");
121
-  if(isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) {
121
+  if (isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) {
122 122
     fwrite($file_handler, "'" . str_replace(array("\\", "'"), array('\\\\', "\\'"), $string_value[$lang_id]) . "',");
123 123
   } else {
124 124
     $string_name_prefix = $string_name_prefix . "[{$string_name}]";
125 125
     fwrite($file_handler, "array(\r\n");
126
-    foreach($string_value as $arr_name => $arr_data) {
126
+    foreach ($string_value as $arr_name => $arr_data) {
127 127
       adm_lng_write_string($arr_name, $arr_data, $ident . '  ', $string_name_prefix);
128 128
     }
129 129
     fwrite($file_handler, "{$ident}),\r\n");
@@ -143,13 +143,13 @@  discard block
 block discarded – undo
143 143
 $languages_info = lng_get_list();
144 144
 $domain = sys_get_param_str('domain');
145 145
 
146
-if($domain) {
146
+if ($domain) {
147 147
   $lang_new = sys_get_param('lang_new');
148
-  if(!empty($lang_new)) {
148
+  if (!empty($lang_new)) {
149 149
     $constants = get_defined_constants(true);
150 150
     $constants = $constants['user'];
151 151
     ksort($constants);
152
-    foreach($languages_info as $lang_id => $land_data) {
152
+    foreach ($languages_info as $lang_id => $land_data) {
153 153
       $file_handler = fopen(SN_ROOT_PHYSICAL . "language/{$lang_id}/{$domain}.mo.php.new", 'w');
154 154
       fwrite($file_handler, "<?php\r\n\r\n/*\r\n#############################################################################
155 155
 #  Filename: {$domain}.mo.php
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 #  Website: http://www.supernova.ws
158 158
 #  Description: Massive Multiplayer Online Browser Space Startegy Game\r\n#\r\n");
159 159
 
160
-      foreach($land_data['LANG_COPYRIGHT'] as $lang_copyright) {
160
+      foreach ($land_data['LANG_COPYRIGHT'] as $lang_copyright) {
161 161
         $lang_copyright = str_replace(array('&copy;', '&quot;', '&lt;', '&gt;'), array('©', '"', '<', '>'), $lang_copyright);
162 162
         fwrite($file_handler, "#  {$lang_copyright}\r\n");
163 163
       }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 /**\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
166 166
 /**\r\n* DO NOT CHANGE\r\n*/\r\n\r\nif (!defined('INSIDE')) die();\r\n
167 167
 \$a_lang_array = array(\r\n");
168
-      foreach($lang_new as $string_name => $string_value) {
168
+      foreach ($lang_new as $string_name => $string_value) {
169 169
         adm_lng_write_string($string_name, $string_value);
170 170
       }
171 171
       fwrite($file_handler, ");\r\n");
@@ -176,21 +176,21 @@  discard block
 block discarded – undo
176 176
     die();
177 177
   }
178 178
 
179
-  foreach($languages_info as $lang_id => $lang_data) {
179
+  foreach ($languages_info as $lang_id => $lang_data) {
180 180
     $template->assign_block_vars('language', $lang_data);
181 181
     $full_filename = SN_ROOT_PHYSICAL . "language/{$lang_id}/{$domain}.mo.php";
182 182
     $languages[$lang_id] = adm_lng_load($full_filename . (file_exists($full_filename . '.new') ? '.new' : ''));
183
-    foreach($languages[$lang_id] as $locale_string_name => $cork) {
183
+    foreach ($languages[$lang_id] as $locale_string_name => $cork) {
184 184
       adm_lng_assign_string($lang_id, "[{$locale_string_name}]", $languages[$lang_id][$locale_string_name]);
185 185
     }
186 186
   }
187 187
 
188
-  foreach($locale_string_template as $locale_string_name => $locale_string_list) {
188
+  foreach ($locale_string_template as $locale_string_name => $locale_string_list) {
189 189
     $template->assign_block_vars('string', array(
190 190
       'NAME' => $locale_string_name,
191 191
     ));
192 192
 
193
-    foreach($languages_info as $lang_id => $cork2) {
193
+    foreach ($languages_info as $lang_id => $cork2) {
194 194
       $template->assign_block_vars('string.locale', array(
195 195
         'LANG' => $lang_id,
196 196
         'VALUE' => $locale_string_list["[{$lang_id}]"],
@@ -206,17 +206,17 @@  discard block
 block discarded – undo
206 206
   $dir = dir($path);
207 207
   while (false !== ($lang_id = $dir->read())) {
208 208
     $full_path = $path . $lang_id;
209
-    if($lang_id[0] != "." && is_dir($full_path)) {
209
+    if ($lang_id[0] != "." && is_dir($full_path)) {
210 210
       $lang_file_list = dir($full_path);
211 211
       while (false !== ($filename = $lang_file_list->read())) {
212 212
         $lang_domain = strtolower(substr($filename, 0, strpos($filename, '.')));
213
-        if(!$lang_domain) {
213
+        if (!$lang_domain) {
214 214
           continue;
215 215
         }
216 216
 
217 217
         $file_ext = strtolower(substr($filename, strpos($filename, '.')));
218
-        if($lang_domain != 'language') {
219
-          if($file_ext == '.mo.php.new' || ($file_ext == '.mo.php' && empty($languages[$lang_id][$lang_domain]))) {
218
+        if ($lang_domain != 'language') {
219
+          if ($file_ext == '.mo.php.new' || ($file_ext == '.mo.php' && empty($languages[$lang_id][$lang_domain]))) {
220 220
             $language_domains[$lang_domain] = $lang_domain;
221 221
             $languages[$lang_id][$lang_domain] = $lang_domain;
222 222
           }
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
   }
227 227
   $dir->close();
228 228
 
229
-  foreach($language_domains as $lang_domain) {
229
+  foreach ($language_domains as $lang_domain) {
230 230
     $template->assign_block_vars('domain', array(
231 231
       'NAME' => $lang_domain,
232 232
     ));
Please login to merge, or discard this patch.
admin/adm_metamatter.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@  discard block
 block discarded – undo
15 15
 
16 16
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
17 17
 
18
-if(!sn_module_get_active_count('payment')) {
18
+if (!sn_module_get_active_count('payment')) {
19 19
   sys_redirect(SN_ROOT_VIRTUAL . 'admin/overview.php');
20 20
 }
21 21
 
22
-if($user['authlevel'] < 3) {
22
+if ($user['authlevel'] < 3) {
23 23
   AdminMessage($lang['adm_err_denied']);
24 24
 }
25 25
 
@@ -28,19 +28,19 @@  discard block
 block discarded – undo
28 28
 $message = '';
29 29
 $message_status = ERR_ERROR;
30 30
 
31
-if($points = sys_get_param_float('points')) {
31
+if ($points = sys_get_param_float('points')) {
32 32
   try {
33 33
     $username = sys_get_param_str_unsafe('id_user');
34
-    if(empty($username)) {
34
+    if (empty($username)) {
35 35
       throw new Exception($lang['adm_mm_no_dest']);
36 36
     }
37 37
 
38 38
     $an_account = new Account(classSupernova::$auth->account->db);
39
-    if(!$an_account->db_get_by_id($username) && !$an_account->db_get_by_name($username) && !$an_account->db_get_by_email($username)) {
39
+    if (!$an_account->db_get_by_id($username) && !$an_account->db_get_by_name($username) && !$an_account->db_get_by_email($username)) {
40 40
       throw new Exception(sprintf($lang['adm_mm_user_none'], $username));
41 41
     }
42 42
 
43
-    if(!$an_account->metamatter_change(RPG_ADMIN, $points, sprintf(
43
+    if (!$an_account->metamatter_change(RPG_ADMIN, $points, sprintf(
44 44
       $lang['adm_matter_change_log_record'],
45 45
       $an_account->account_id, db_escape($an_account->account_name),
46 46
       $user['id'], db_escape($user['username']),
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 //  $message = $lang['adm_mm_no_quant'];
60 60
 }
61 61
 
62
-if($message_status == ERR_ERROR) {
62
+if ($message_status == ERR_ERROR) {
63 63
   $template->assign_vars(array(
64 64
     'ID_USER' => $username,
65 65
     'POINTS' => $points,
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
   ));
68 68
 };
69 69
 
70
-if($message) {
70
+if ($message) {
71 71
   $template->assign_block_vars('result', array('MESSAGE' => $message, 'STATUS' => $message_status ? $message_status : ERR_NONE));
72 72
 }
73 73
 
Please login to merge, or discard this patch.
admin/userlist.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
16 16
 
17 17
 global $config, $lang, $user;
18
-if($user['authlevel'] < 3) {
18
+if ($user['authlevel'] < 3) {
19 19
   AdminMessage($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 = doquery("SELECT * FROM {{banned}} WHERE `ban_user_id` = {$user_row['id']} ORDER BY ban_id DESC LIMIT 1", true);
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/admin_user.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,20 +5,20 @@  discard block
 block discarded – undo
5 5
 define('IN_ADMIN', true);
6 6
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
7 7
 
8
-if($user['authlevel'] < 3) {
8
+if ($user['authlevel'] < 3) {
9 9
   AdminMessage($lang['adm_err_denied']);
10 10
 }
11 11
 
12 12
 lng_include('admin');
13 13
 
14 14
 $user_id = sys_get_param_id('uid');
15
-if(!($user_row = db_user_by_id($user_id))) {
15
+if (!($user_row = db_user_by_id($user_id))) {
16 16
   AdminMessage(sprintf($lang['adm_dm_user_none'], $user_id));
17 17
 }
18 18
 
19 19
 $template = gettemplate('admin/admin_user', true);
20 20
 
21
-if(!empty($user_row['user_last_browser_id'])) {
21
+if (!empty($user_row['user_last_browser_id'])) {
22 22
   $temp = doquery("SELECT browser_user_agent FROM {{security_browser}} WHERE `browser_id` = {$user_row['user_last_browser_id']}", true);
23 23
   $user_row['browser_user_agent'] = $temp['browser_user_agent'];
24 24
 }
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
     'raidsloose',
56 56
     'raidswin',
57 57
     'total_rank',
58
-    'total_points',  ),
58
+    'total_points',),
59 59
 );
60
-foreach($formats as $callable => $field_list) {
61
-  foreach($field_list as $field_name) {
60
+foreach ($formats as $callable => $field_list) {
61
+  foreach ($field_list as $field_name) {
62 62
     $user_row[$field_name] = call_user_func($callable, $user_row[$field_name]);
63 63
   }
64 64
 }
Please login to merge, or discard this patch.