Completed
Push — work-fleets ( 77ad6e...489db6 )
by SuperNova.WS
06:17
created
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_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.
admin/admin_darkmatter.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -13,9 +13,9 @@  discard block
 block discarded – undo
13 13
 define('INSTALL', false);
14 14
 define('IN_ADMIN', true);
15 15
 
16
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
16
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
17 17
 
18
-if($user['authlevel'] < 3) {
18
+if ($user['authlevel'] < 3) {
19 19
   AdminMessage(classLocale::$lang['adm_err_denied']);
20 20
 }
21 21
 
@@ -24,16 +24,16 @@  discard block
 block discarded – undo
24 24
 $message = '';
25 25
 $message_status = ERR_ERROR;
26 26
 
27
-if($points = sys_get_param_float('points')) {
27
+if ($points = sys_get_param_float('points')) {
28 28
 // If points not empty...
29
-  if($username = sys_get_param_str_unsafe('id_user')) {
29
+  if ($username = sys_get_param_str_unsafe('id_user')) {
30 30
     $row = db_user_by_id($username, false, 'id, username', true, true);
31
-    if(!isset($row['id'])) {
31
+    if (!isset($row['id'])) {
32 32
       $row = db_user_by_username($username, false, 'id, username', true, true);
33 33
     }
34
-    if(is_array($row) && isset($row['id'])) {
34
+    if (is_array($row) && isset($row['id'])) {
35 35
       // Does anything post to DB?
36
-      if(rpg_points_change(
36
+      if (rpg_points_change(
37 37
         $row['id'],
38 38
         RPG_ADMIN,
39 39
         $points,
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
     // Points not empty but destination is not set - this means error
52 52
     $message = classLocale::$lang['adm_dm_no_dest'];
53 53
   }
54
-} elseif($id_user) {
54
+} elseif ($id_user) {
55 55
   // Points is empty but destination is set - this again means error
56 56
   $message = classLocale::$lang['adm_dm_no_quant'];
57 57
 }
58 58
 
59
-if(!$isNoError) {
59
+if (!$isNoError) {
60 60
   $template->assign_vars(array(
61 61
     'ID_USER' => $id_user,
62 62
     'POINTS' => $points,
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
   ));
65 65
 };
66 66
 
67
-if($message) {
67
+if ($message) {
68 68
   $template->assign_block_vars('result', array('MESSAGE' => $message, 'STATUS' => $message_status ? $message_status : ERR_NONE));
69 69
 }
70 70
 
Please login to merge, or discard this patch.
records.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
  * @copyright 2008 by Chlorel for XNova
10 10
  */
11 11
 
12
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
12
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
13 13
 
14
-if(HIDE_BUILDING_RECORDS)
14
+if (HIDE_BUILDING_RECORDS)
15 15
 {
16 16
   return;
17 17
 }
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
 $template = gettemplate('records', true);
20 20
 
21 21
 $user_skip_list_data = sys_stat_get_user_skip_list();
22
-$user_skip_list = empty($user_skip_list_data) ? '' : (' AND p.id_owner NOT IN (' . implode(',', $user_skip_list_data) . ')');
23
-$user_skip_list_un = empty($user_skip_list_data) ? '' : (' AND un.unit_player_id NOT IN (' . implode(',', $user_skip_list_data) . ')');
22
+$user_skip_list = empty($user_skip_list_data) ? '' : (' AND p.id_owner NOT IN ('.implode(',', $user_skip_list_data).')');
23
+$user_skip_list_un = empty($user_skip_list_data) ? '' : (' AND un.unit_player_id NOT IN ('.implode(',', $user_skip_list_data).')');
24 24
 
25
-$user_skip_list_unit = empty($user_skip_list_data) ? '' : (' AND unit_player_id NOT IN (' . implode(',', $user_skip_list_data) . ')');
25
+$user_skip_list_unit = empty($user_skip_list_data) ? '' : (' AND unit_player_id NOT IN ('.implode(',', $user_skip_list_data).')');
26 26
 
27 27
 $show_groups = array(
28 28
   UNIT_TECHNOLOGIES => 'tech',
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 $user_name_cache = array();
36 36
 
37
-foreach($show_groups as $unit_group_id => $mode)
37
+foreach ($show_groups as $unit_group_id => $mode)
38 38
 {
39 39
   $template->assign_block_vars('records', array(
40 40
     'UNIT' => classLocale::$lang['tech'][$unit_group_id],
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
   ));
44 44
   $unit_group = get_unit_param('techtree', $unit_group_id); // TODO - REWRITE!!!!
45 45
 
46
-  foreach($unit_group as $unit_id)
46
+  foreach ($unit_group as $unit_id)
47 47
   {
48 48
     $unit_name = &classLocale::$lang['tech'][$unit_id];
49
-    if($unit_name)
49
+    if ($unit_name)
50 50
     {
51 51
       // TODO - ISUNITSTACKABLE!
52 52
       $data_row = $unit_group_id == UNIT_SHIPS || $unit_group_id == UNIT_DEFENCE ? db_unit_records_sum($unit_id, $user_skip_list_unit) : db_unit_records_plain($unit_id, $user_skip_list_unit);
53 53
 
54
-      if($data_row)
54
+      if ($data_row)
55 55
       {
56 56
         $template->assign_block_vars('records', array(
57 57
           'UNIT' => $unit_name,
Please login to merge, or discard this patch.
phalanx.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,24 +11,24 @@  discard block
 block discarded – undo
11 11
  * @copyright 2008 by Pada for XNova.project.es
12 12
  */
13 13
 
14
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
14
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
15 15
 
16 16
 lng_include('overview');
17 17
 lng_include('universe');
18 18
 
19 19
 $sensorLevel = mrc_get_level($user, $planetrow, STRUC_MOON_PHALANX);
20 20
 if (!intval($sensorLevel)) {
21
-  message (classLocale::$lang['phalanx_nosensoravailable'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
21
+  message(classLocale::$lang['phalanx_nosensoravailable'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
22 22
 }
23 23
 
24 24
 if ($planetrow['planet_type'] != PT_MOON) {
25
-  message (classLocale::$lang['phalanx_onlyformoons'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
25
+  message(classLocale::$lang['phalanx_onlyformoons'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
26 26
 }
27 27
 
28 28
 $scan_galaxy  = sys_get_param_int('galaxy');
29 29
 $scan_system  = sys_get_param_int('system');
30 30
 $scan_planet  = sys_get_param_int('planet');
31
-$scan_planet_type  = 1; // sys_get_param_int('planettype');
31
+$scan_planet_type = 1; // sys_get_param_int('planettype');
32 32
 $id = sys_get_param_id('id');
33 33
 
34 34
 $source_galaxy = $planetrow['galaxy'];
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 $sensorRange = GetPhalanxRange($sensorLevel);
39 39
 
40 40
 $system_distance = abs($source_system - $scan_system);
41
-if($system_distance > $sensorRange || $scan_galaxy != $source_galaxy)
41
+if ($system_distance > $sensorRange || $scan_galaxy != $source_galaxy)
42 42
 {
43
-  message (classLocale::$lang['phalanx_rangeerror'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
43
+  message(classLocale::$lang['phalanx_rangeerror'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
44 44
 }
45 45
 
46 46
 $cost = $sensorLevel * 1000;
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
 }
52 52
 
53 53
 $planet_scanned = db_planet_by_gspt($scan_galaxy, $scan_system, $scan_planet, $scan_planet_type);
54
-if(!$planet_scanned['id'])
54
+if (!$planet_scanned['id'])
55 55
 {
56 56
   message(classLocale::$lang['phalanx_planet_not_exists'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
57 57
 }
58 58
 
59
-if($planet_scanned['destruyed'])
59
+if ($planet_scanned['destruyed'])
60 60
 {
61
-  message (classLocale::$lang['phalanx_planet_destroyed'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
61
+  message(classLocale::$lang['phalanx_planet_destroyed'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
62 62
 }
63 63
 
64 64
 db_planet_set_by_id($user['current_planet'], "deuterium = deuterium - {$cost}");
Please login to merge, or discard this patch.
notes.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -8,41 +8,41 @@  discard block
 block discarded – undo
8 8
  *     [!] Wrote from scratch
9 9
  */
10 10
 
11
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
11
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
12 12
 
13 13
 lng_include('notes');
14 14
 
15 15
 $template = gettemplate('notes', true);
16 16
 
17 17
 $result = array();
18
-if(($result_message = sys_get_param_str('MESSAGE')) && isset(classLocale::$lang[$result_message])) {
18
+if (($result_message = sys_get_param_str('MESSAGE')) && isset(classLocale::$lang[$result_message])) {
19 19
   $result[] = array('STATUS' => sys_get_param_int('STATUS'), 'MESSAGE' => classLocale::$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
 block discarded – undo
59 59
     db_note_list_delete($user, $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
 block discarded – undo
67 67
       'MESSAGE' => classLocale::$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 == db_escape(classLocale::$lang['note_new_title']) ? $note_title = '' : false;
72 72
   ($note_text = sys_get_param_str('note_text')) == db_escape(classLocale::$lang['note_new_text']) ? $note_text = '' : false;
73 73
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     $note_system = max(0, min(sys_get_param_id('note_system'), Vector::$knownSystems));
77 77
     $note_planet = max(0, min(sys_get_param_id('note_planet'), Vector::$knownPlanets + 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
 block discarded – undo
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 = db_note_get_id_and_owner($note_id_edit);
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
 
@@ -103,9 +103,9 @@  discard block
 block discarded – undo
103 103
     }
104 104
 
105 105
     sn_db_transaction_commit();
106
-    sys_redirect('notes.php?STATUS=' . ERR_NONE . '&MESSAGE=' . ($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added'));
106
+    sys_redirect('notes.php?STATUS='.ERR_NONE.'&MESSAGE='.($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added'));
107 107
 //    throw new exception($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added', ERR_NONE);
108
-  } catch(Exception $e) {
108
+  } catch (Exception $e) {
109 109
     $note_id_edit = 0;
110 110
     sn_db_transaction_rollback();
111 111
     $result[] = array(
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
   }
116 116
 }
117 117
 
118
-if(!$note_id_edit) {
118
+if (!$note_id_edit) {
119 119
   note_assign($template, array(
120 120
     'id'          => 0,
121 121
     'time'        => SN_TIME_NOW,
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
 
129 129
 $note_exist = false;
130 130
 $notes_query = db_note_list_by_owner($user['id']);
131
-while($note_row = db_fetch($notes_query)) {
131
+while ($note_row = db_fetch($notes_query)) {
132 132
   note_assign($template, $note_row);
133 133
   $note_exist = $note_exist || $note_row['id'] == $note_id_edit;
134 134
 }
135 135
 $note_id_edit = $note_exist ? $note_id_edit : 0;
136 136
 
137
-foreach($note_priority_classes as $note_priority_id => $note_priority_class) {
137
+foreach ($note_priority_classes as $note_priority_id => $note_priority_class) {
138 138
   $template->assign_block_vars('note_priority', array(
139 139
     'ID'    => $note_priority_id,
140 140
     'CLASS' => $note_priority_classes[$note_priority_id],
@@ -142,14 +142,14 @@  discard block
 block discarded – undo
142 142
   ));
143 143
 }
144 144
 
145
-foreach(classLocale::$lang['sys_planet_type'] as $planet_type_id => $planet_type_string) {
145
+foreach (classLocale::$lang['sys_planet_type'] as $planet_type_id => $planet_type_string) {
146 146
   $template->assign_block_vars('planet_type', array(
147 147
     'ID'   => $planet_type_id,
148 148
     'TEXT' => $planet_type_string,
149 149
   ));
150 150
 }
151 151
 
152
-foreach($result as $result_data) {
152
+foreach ($result as $result_data) {
153 153
   $template->assign_block_vars('result', $result_data);
154 154
 }
155 155
 
Please login to merge, or discard this patch.
affilates.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * v1 (c) copyright 2010 by Gorlum for http://supernova.ws
9 9
  */
10 10
 
11
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
11
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
12 12
 
13 13
 lng_include('affilates');
14 14
 
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
   $gained += $affilate_gain;
33 33
 }
34 34
 
35
-$bannerURL  = SN_ROOT_VIRTUAL_PARENT . classSupernova::$config->int_banner_URL;
35
+$bannerURL  = SN_ROOT_VIRTUAL_PARENT.classSupernova::$config->int_banner_URL;
36 36
 $bannerURL .= strpos($bannerURL, '?') ? '&' : '?';
37 37
 $bannerURL .= "id={$user['id']}";
38 38
 
39
-$userbarURL  = SN_ROOT_VIRTUAL_PARENT . classSupernova::$config->int_userbar_URL;
39
+$userbarURL  = SN_ROOT_VIRTUAL_PARENT.classSupernova::$config->int_userbar_URL;
40 40
 $userbarURL .= strpos($userbarURL, '?') ? '&' : '?';
41 41
 $userbarURL .= "id={$user['id']}";
42 42
 
Please login to merge, or discard this patch.