Test Failed
Branch trunk (412648)
by SuperNova.WS
03:40
created
admin/planet_compensate.php 2 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-define('INSIDE'  , true);
3
-define('INSTALL' , false);
2
+define('INSIDE', true);
3
+define('INSTALL', false);
4 4
 define('IN_ADMIN', true);
5 5
 
6 6
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 $username_unsafe = sys_get_param_str_unsafe('username');
25 25
 $username = sys_get_param_escaped('username');
26 26
 
27
-if($galaxy_src)
27
+if ($galaxy_src)
28 28
 {
29 29
   sn_db_transaction_start();
30 30
   $errors = array();
@@ -34,41 +34,41 @@  discard block
 block discarded – undo
34 34
   $planet = sys_o_get_updated($owner, array('galaxy' => $galaxy_src, 'system' => $system_src, 'planet' => $planet_src, 'planet_type' => 1), SN_TIME_NOW);
35 35
   $que    = $planet['que'];
36 36
   $planet = $planet['planet'];
37
-  if(!$planet)
37
+  if (!$planet)
38 38
   {
39 39
     $errors[] = $lang['adm_pl_comp_err_0'];
40 40
   }
41 41
 
42
-  if($planet['destruyed'])
42
+  if ($planet['destruyed'])
43 43
   {
44 44
     $errors[] = $lang['adm_pl_comp_err_1'];
45 45
   }
46 46
 
47
-  if($planet['id_owner'] != $owner['id'] || !$username)
47
+  if ($planet['id_owner'] != $owner['id'] || !$username)
48 48
   {
49 49
     $errors[] = $lang['adm_pl_comp_err_4'];
50 50
   }
51 51
 
52 52
   $destination = sys_o_get_updated($owner, array('galaxy' => $galaxy_dst, 'system' => $system_dst, 'planet' => $planet_dst, 'planet_type' => 1), SN_TIME_NOW);
53 53
   $destination = $destination['planet'];
54
-  if(!$destination)
54
+  if (!$destination)
55 55
   {
56 56
     $errors[] = $lang['adm_pl_comp_err_2'];
57 57
   }
58 58
 
59
-  if($planet['id'] == $destination['id'])
59
+  if ($planet['id'] == $destination['id'])
60 60
   {
61 61
     $errors[] = $lang['adm_pl_comp_err_5'];
62 62
   }
63 63
 
64
-  if($planet['id_owner'] != $destination['id_owner'])
64
+  if ($planet['id_owner'] != $destination['id_owner'])
65 65
   {
66 66
     $errors[] = $lang['adm_pl_comp_err_3'];
67 67
   }
68 68
 
69
-  if(!empty($errors))
69
+  if (!empty($errors))
70 70
   {
71
-    foreach($errors as $error)
71
+    foreach ($errors as $error)
72 72
     {
73 73
       $template->assign_block_vars('error', array(
74 74
         'TEXT' => $error,
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
     killer_add_planet($planet);
83 83
 
84 84
     $moon = DBStaticPlanet::db_planet_by_gspt($galaxy_src, $system_src, $planet_src, PT_MOON, true);
85
-    if($moon)
85
+    if ($moon)
86 86
     {
87 87
       $moon = sys_o_get_updated($owner, $moon, SN_TIME_NOW);
88 88
       $moon = $moon['planet'];
89 89
       killer_add_planet($moon);
90 90
     }
91 91
 
92
-    foreach(sn_get_groups('resources_loot') as $resource_id)
92
+    foreach (sn_get_groups('resources_loot') as $resource_id)
93 93
     {
94 94
       $resource_name = pname_resource_name($resource_id);
95 95
       $template->assign_var("{$resource_name}_cost", $final_cost[$resource_id]);
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
       $template->assign_var("{$resource_name}_bonus", $final_cost[$resource_id]);
98 98
     }
99 99
 
100
-    if($_GET['btn_confirm'])
100
+    if ($_GET['btn_confirm'])
101 101
     {
102 102
       $time = SN_TIME_NOW + PERIOD_DAY;
103 103
 
104 104
       DBStaticUnit::db_unit_list_delete($planet['id_owner'], LOC_PLANET, $planet['id']);
105 105
       DBStaticPlanet::db_planet_set_by_id($planet['id'], "id_owner = 0, destruyed = {$time}");
106
-      if($moon)
106
+      if ($moon)
107 107
       {
108 108
         DBStaticUnit::db_unit_list_delete($planet['id_owner'], LOC_PLANET, $moon['id']);
109 109
         DBStaticPlanet::db_planet_set_by_id($moon['id'], "id_owner = 0, destruyed = {$time}");
@@ -145,34 +145,34 @@  discard block
 block discarded – undo
145 145
   }
146 146
   */
147 147
 
148
-  foreach(sn_get_groups('structures') as $unit_id)
148
+  foreach (sn_get_groups('structures') as $unit_id)
149 149
   {
150 150
     $build_level = mrc_get_level($user, $planet, $unit_id, true, true);
151
-    if($build_level > 0)
151
+    if ($build_level > 0)
152 152
     {
153 153
       $unit_cost = get_unit_param($unit_id, 'cost');
154 154
       $build_factor = $unit_cost['factor'] != 1 ? (1 - pow($unit_cost['factor'], $build_level)) / (1 - $unit_cost['factor']) : $unit_cost['factor'];
155
-      foreach($sn_group_resources_loot as $resource_id)
155
+      foreach ($sn_group_resources_loot as $resource_id)
156 156
       {
157 157
         $final_cost[$resource_id] += isset($unit_cost[$resource_id]) && $unit_cost[$resource_id] > 0 ? floor($unit_cost[$resource_id] * $build_factor) : 0;
158 158
       }
159 159
     }
160 160
   }
161 161
 
162
-  foreach(sn_get_groups(array('defense', 'fleet')) as $unit_id)
162
+  foreach (sn_get_groups(array('defense', 'fleet')) as $unit_id)
163 163
   {
164 164
     $unit_count = mrc_get_level($user, $planet, $unit_id, true, true);
165
-    if($unit_count > 0)
165
+    if ($unit_count > 0)
166 166
     {
167 167
       $unit_cost = get_unit_param($unit_id, 'cost');
168
-      foreach($sn_group_resources_loot as $resource_id)
168
+      foreach ($sn_group_resources_loot as $resource_id)
169 169
       {
170 170
         $final_cost[$resource_id] += isset($unit_cost[$resource_id]) && $unit_cost[$resource_id] > 0 ? floor($unit_cost[$resource_id] * $unit_count) : 0;
171 171
       }
172 172
     }
173 173
   }
174 174
 
175
-  foreach($sn_group_resources_loot as $resource_id)
175
+  foreach ($sn_group_resources_loot as $resource_id)
176 176
   {
177 177
     $final_cost[$resource_id] += floor(mrc_get_level($user, $planet, $resource_id, true, true));
178 178
   }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,8 +74,7 @@  discard block
 block discarded – undo
74 74
         'TEXT' => $error,
75 75
       ));
76 76
     }
77
-  }
78
-  else
77
+  } else
79 78
   {
80 79
     $template->assign_var('CHECK', 1);
81 80
 
@@ -132,8 +131,7 @@  discard block
 block discarded – undo
132 131
 
133 132
 display($template, $lang['adm_pl_comp_title']);
134 133
 
135
-function killer_add_planet($planet)
136
-{
134
+function killer_add_planet($planet) {
137 135
   global $final_cost;
138 136
 
139 137
   $final_cost = array();
Please login to merge, or discard this patch.
admin/planet_edit.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,30 +20,30 @@
 block discarded – undo
20 20
 $planet_id = sys_get_param_id('planet_id');
21 21
 
22 22
 $unit_list = sys_get_param('unit_list');
23
-if(sys_get_param('change_data') && !empty($unit_list))
23
+if (sys_get_param('change_data') && !empty($unit_list))
24 24
 {
25 25
   $query_string = array();
26
-  foreach($unit_list as $unit_id => $unit_amount)
26
+  foreach ($unit_list as $unit_id => $unit_amount)
27 27
   {
28
-    if($unit_query_string = admin_planet_edit_query_string($unit_id, $unit_amount, $mode))
28
+    if ($unit_query_string = admin_planet_edit_query_string($unit_id, $unit_amount, $mode))
29 29
     {
30 30
       $query_string[] = $unit_query_string;
31 31
     }
32 32
   }
33 33
 
34
-  if(!empty($query_string))
34
+  if (!empty($query_string))
35 35
   {
36 36
     DBStaticPlanet::db_planet_set_by_id($planet_id, implode(', ', $query_string));
37 37
   }
38 38
 }
39 39
 
40
-if($planet_id)
40
+if ($planet_id)
41 41
 {
42 42
   $edit_planet_row = DBStaticPlanet::db_planet_by_id($planet_id);
43 43
   admin_planet_edit_template($template, $edit_planet_row, $mode);
44 44
 }
45 45
 
46
-foreach($admin_planet_edit_mode_list as $page_mode => $mode_locale)
46
+foreach ($admin_planet_edit_mode_list as $page_mode => $mode_locale)
47 47
 {
48 48
   $template->assign_block_vars('page_menu', array(
49 49
     'ID' => $page_mode,
Please login to merge, or discard this patch.
admin/add_moon.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 
20 20
 $template = gettemplate("admin/add_moon", true);
21 21
 
22
-if(sys_get_param_str('mode') == 'addit')
22
+if (sys_get_param_str('mode') == 'addit')
23 23
 {
24 24
   $PlanetID = sys_get_param_id('user');
25 25
   $MoonName = sys_get_param_str('name');
Please login to merge, or discard this patch.
admin/admin_analyze_matter.php 1 patch
Spacing   +8 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 
16 16
 $constants = get_defined_constants(true);
17 17
 $rpgConstants = array();
18
-foreach($constants['user'] as $constantName => $constantValue) {
19
-  if(substr($constantName, 0, 4) == 'RPG_') {
18
+foreach ($constants['user'] as $constantName => $constantValue) {
19
+  if (substr($constantName, 0, 4) == 'RPG_') {
20 20
     $rpgConstants[$constantValue] = $constantName;
21 21
   }
22 22
 }
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 GROUP BY log_dark_matter_reason, IF(sign((log_dark_matter_amount)) > 0, 1, -1) ORDER BY sum(log_dark_matter_amount) DESC;
34 34
 ");
35 35
 
36
-while($row = classSupernova::$db->db_fetch($result)) {
36
+while ($row = classSupernova::$db->db_fetch($result)) {
37 37
   $row['CONSTANT'] = $rpgConstants[$row['REASON']];
38 38
 
39 39
   $row['DM_AMOUNT_TEXT'] = pretty_number($row['DM_AMOUNT']);
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 GROUP BY reason, if(sign((amount)) > 0, 1, -1) ORDER BY sum(amount) DESC;
56 56
 ");
57 57
 
58
-while($row = classSupernova::$db->db_fetch($result)) {
59
-  if(empty($spent[$row['BALANCE']])) {
58
+while ($row = classSupernova::$db->db_fetch($result)) {
59
+  if (empty($spent[$row['BALANCE']])) {
60 60
     $spent[$row['BALANCE']] = array();
61 61
   }
62 62
 
@@ -66,16 +66,15 @@  discard block
 block discarded – undo
66 66
   $spent[$row['BALANCE']] = array_merge_recursive_numeric($spent[$row['BALANCE']], $row);
67 67
 }
68 68
 
69
-foreach($spent as &$row) {
69
+foreach ($spent as &$row) {
70 70
   @$row['TOTAL_COUNT'] = $row['MM_COUNT'] + $row['DM_COUNT'];
71 71
   @$row['TOTAL_AMOUNT'] = $row['MM_AMOUNT'] + $row['DM_AMOUNT'];
72 72
   @$row['TOTAL_AMOUNT_TEXT'] = pretty_number($row['TOTAL_AMOUNT']);
73 73
   @$row['TOTAL_COUNT_TEXT'] = pretty_number($row['TOTAL_COUNT']);
74 74
 }
75 75
 
76
-usort($spent, function ($a, $b) {
77
-  return $a['TOTAL_AMOUNT'] < $b['TOTAL_AMOUNT'] ? -1 :
78
-    ($a['TOTAL_AMOUNT'] > $b['TOTAL_AMOUNT'] ? 1 : 0);
76
+usort($spent, function($a, $b) {
77
+  return $a['TOTAL_AMOUNT'] < $b['TOTAL_AMOUNT'] ? -1 : ($a['TOTAL_AMOUNT'] > $b['TOTAL_AMOUNT'] ? 1 : 0);
79 78
 });
80 79
 
81 80
 
Please login to merge, or discard this patch.
admin/adm_flying_fleets.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 //while($CurrentFleet = db_fetch($FlyingFleets))
22 22
 
23 23
 $all_flying_fleets = db_fleet_list('', DB_SELECT_PLAIN);
24
-foreach($all_flying_fleets as $fleet_id => $CurrentFleet) {
24
+foreach ($all_flying_fleets as $fleet_id => $CurrentFleet) {
25 25
   $FleetOwner = db_user_by_id($CurrentFleet['fleet_owner']);
26 26
   $TargetOwner = db_user_by_id($CurrentFleet['fleet_target_owner']);
27 27
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
   $fleet_data['fleet']['STAY_TIME_INT'] = $CurrentFleet['fleet_end_stay'];
33 33
 
34 34
   $template->assign_block_vars('fleets', $fleet_data['fleet']);
35
-  foreach($fleet_data['ships'] as $ship_data) {
35
+  foreach ($fleet_data['ships'] as $ship_data) {
36 36
     $template->assign_block_vars('fleets.ships', $ship_data);
37 37
   }
38 38
 }
Please login to merge, or discard this patch.
includes/functions/qst_quest.php 2 patches
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -14,34 +14,34 @@  discard block
 block discarded – undo
14 14
 
15 15
   $in_admin = defined('IN_ADMIN') && IN_ADMIN === true;
16 16
 
17
-  if($in_admin)
17
+  if ($in_admin)
18 18
   {
19 19
     $quest_id = sys_get_param_id('id');
20 20
     $quest_name = sys_get_param_str_unsafe('QUEST_NAME');
21
-    if(!empty($quest_name))
21
+    if (!empty($quest_name))
22 22
     {
23 23
       $quest_description = sys_get_param_str_unsafe('QUEST_DESCRIPTION');
24 24
       try
25 25
       {
26 26
         $quest_rewards_list = sys_get_param('QUEST_REWARDS_LIST');
27 27
         $quest_rewards = array();
28
-        foreach($quest_rewards_list as $quest_rewards_id => $quest_rewards_amount)
28
+        foreach ($quest_rewards_list as $quest_rewards_id => $quest_rewards_amount)
29 29
         {
30
-          if(!in_array($quest_rewards_id, $quest_reward_allowed))
30
+          if (!in_array($quest_rewards_id, $quest_reward_allowed))
31 31
           {
32 32
             throw new Exception($lang['qst_adm_err_reward_type']);
33 33
           }
34 34
 
35
-          if($quest_rewards_amount < 0)
35
+          if ($quest_rewards_amount < 0)
36 36
           {
37 37
             throw new Exception($lang['qst_adm_err_reward_amount']);
38 38
           }
39
-          elseif($quest_rewards_amount > 0)
39
+          elseif ($quest_rewards_amount > 0)
40 40
           {
41 41
             $quest_rewards[] = "{$quest_rewards_id},{$quest_rewards_amount}";
42 42
           }
43 43
         }
44
-        if(empty($quest_rewards))
44
+        if (empty($quest_rewards))
45 45
         {
46 46
           throw new Exception($lang['qst_adm_err_reward_empty']);
47 47
         }
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
         $quest_rewards = implode(';', $quest_rewards);
50 50
 
51 51
         $quest_unit_id = sys_get_param_int('QUEST_UNIT_ID');
52
-        if(!in_array($quest_unit_id, $quest_units_allowed))
52
+        if (!in_array($quest_unit_id, $quest_units_allowed))
53 53
         {
54 54
           throw new Exception($lang['qst_adm_err_unit_id']);
55 55
         }
56 56
 
57 57
         $quest_unit_amount = sys_get_param_float('QUEST_UNIT_AMOUNT');
58
-        if($quest_unit_amount <= 0)
58
+        if ($quest_unit_amount <= 0)
59 59
         {
60 60
           throw new Exception($lang['qst_adm_err_unit_amount']);
61 61
         }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         // TODO: Change quest type
65 65
         $quest_type = 0;
66 66
 
67
-        if($mode == 'edit')
67
+        if ($mode == 'edit')
68 68
         {
69 69
           DbQuery::build()
70 70
             ->setTable('quest')
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
       $mode = '';
110 110
     };
111 111
 
112
-    switch($mode)
112
+    switch ($mode)
113 113
     {
114 114
       case 'del':
115 115
         doquery("DELETE FROM {{quest}} WHERE `quest_id` = {$quest_id} LIMIT 1;");
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     $query = doquery("SELECT count(*) AS count FROM `{{quest}}`;", '', true);
127 127
     $config->db_saveItem('quest_total', $query['count']);
128 128
   }
129
-  elseif(!$user_id)
129
+  elseif (!$user_id)
130 130
   {
131 131
     $user_id = $user['id'];
132 132
   }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     ));
154 154
   }
155 155
 
156
-  if($quest)
156
+  if ($quest)
157 157
   {
158 158
     $quest_templatized = qst_templatize(qst_quest_parse($quest, false));
159 159
   }
@@ -162,19 +162,19 @@  discard block
 block discarded – undo
162 162
     $quest_templatized['quest_rewards_list'] = array();
163 163
   }
164 164
 
165
-  foreach($quest_reward_allowed as $unit_id)
165
+  foreach ($quest_reward_allowed as $unit_id)
166 166
   {
167 167
     $found = false;
168
-    foreach($quest_templatized['quest_rewards_list'] as $quest_templatized_reward)
168
+    foreach ($quest_templatized['quest_rewards_list'] as $quest_templatized_reward)
169 169
     {
170
-      if($quest_templatized_reward['ID'] == $unit_id)
170
+      if ($quest_templatized_reward['ID'] == $unit_id)
171 171
       {
172 172
         $found = true;
173 173
         break;
174 174
       }
175 175
     }
176 176
 
177
-    if(!$found)
177
+    if (!$found)
178 178
     {
179 179
       $quest_templatized['quest_rewards_list'][$unit_id] = array(
180 180
         'ID'     => $unit_id,
@@ -186,12 +186,12 @@  discard block
 block discarded – undo
186 186
 
187 187
   qst_assign_to_template($template, $quest_templatized);
188 188
 
189
-  foreach($quest_list as $quest_data)
189
+  foreach ($quest_list as $quest_data)
190 190
   {
191 191
     qst_assign_to_template($template, qst_templatize($quest_data, true), 'quest');
192 192
   }
193 193
 
194
-  foreach($quest_units_allowed as $unit_id)
194
+  foreach ($quest_units_allowed as $unit_id)
195 195
   {
196 196
     $template->assign_block_vars('allowed_unit', array(
197 197
       'ID'   => $unit_id,
@@ -204,12 +204,12 @@  discard block
 block discarded – undo
204 204
 {
205 205
   $quest_list = array();
206 206
 
207
-  if($user_id)
207
+  if ($user_id)
208 208
   {
209
-    if($status !== QUEST_STATUS_ALL)
209
+    if ($status !== QUEST_STATUS_ALL)
210 210
     {
211 211
       $query_add_where = "";
212
-      if($status == null || $status == QUEST_STATUS_NOT_STARTED)
212
+      if ($status == null || $status == QUEST_STATUS_NOT_STARTED)
213 213
       {
214 214
         $query_add_where .= "AND qs.quest_status_status IS NULL";
215 215
       }
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     ;"
234 234
   );
235 235
 
236
-  while($quest = db_fetch($query))
236
+  while ($quest = db_fetch($query))
237 237
   {
238 238
     $quest_list[$quest['quest_id']] = qst_quest_parse($quest);
239 239
   }
@@ -243,16 +243,16 @@  discard block
 block discarded – undo
243 243
 
244 244
 function qst_assign_to_template(&$template, $quest_templatized, $block_name = false)
245 245
 {
246
-  if($block_name)
246
+  if ($block_name)
247 247
   {
248 248
     $template->assign_block_vars($block_name, $quest_templatized);
249 249
   }
250 250
   else
251 251
   {
252 252
     $template->assign_vars($quest_templatized);
253
-    if(!empty($quest_templatized['quest_rewards_list']))
253
+    if (!empty($quest_templatized['quest_rewards_list']))
254 254
     {
255
-      foreach($quest_templatized['quest_rewards_list'] as $quest_reward)
255
+      foreach ($quest_templatized['quest_rewards_list'] as $quest_reward)
256 256
       {
257 257
         $template->assign_block_vars(($block_name ? $block_name . '.' : '') . 'quest_rewards_list', $quest_reward);
258 258
       }
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
   global $lang;
275 275
 
276 276
   $tmp = array();
277
-  foreach($quest['quest_rewards_list'] as $quest_reward_id => $quest_reward_amount)
277
+  foreach ($quest['quest_rewards_list'] as $quest_reward_id => $quest_reward_amount)
278 278
   {
279 279
     $tmp[] = array(
280 280
       'ID'     => $quest_reward_id,
@@ -301,9 +301,9 @@  discard block
 block discarded – undo
301 301
 function qst_active_triggers($quest_list)
302 302
 {
303 303
   $quest_triggers = array();
304
-  foreach($quest_list as $quest_id => $quest)
304
+  foreach ($quest_list as $quest_id => $quest)
305 305
   {
306
-    if($quest['quest_status_status'] != QUEST_STATUS_COMPLETE)
306
+    if ($quest['quest_status_status'] != QUEST_STATUS_COMPLETE)
307 307
     {
308 308
       list($quest_unit_id, $quest_unit_amount) = explode(',', $quest['quest_conditions']);
309 309
       $quest_triggers[$quest_id] = $quest_unit_id;
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
  */
322 322
 function qst_reward(&$user, &$rewards, &$quest_list, &$quest_statuses)
323 323
 {
324
-  if(empty($quest_statuses)) return;
324
+  if (empty($quest_statuses)) return;
325 325
 
326 326
   global $lang;
327 327
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
           'quest_status_status'   => $quest_status
346 346
         ))
347 347
         ->doInsert();
348
-    } elseif($questStatus['quest_status_status'] != $quest_status) {
348
+    } elseif ($questStatus['quest_status_status'] != $quest_status) {
349 349
       DbQuery::build()
350 350
         ->setTable('quest_status')
351 351
         ->setWhereArray(array(
@@ -359,20 +359,20 @@  discard block
 block discarded – undo
359 359
     }
360 360
   }
361 361
 
362
-  if(empty($rewards)) return;
362
+  if (empty($rewards)) return;
363 363
 
364 364
   $db_changeset = array();
365 365
   $total_rewards = array();
366 366
   $comment_dm = '';
367 367
 
368
-  foreach($rewards as $quest_id => $user_data) {
369
-    foreach($user_data as $user_id => $planet_data) {
370
-      foreach($planet_data as $planet_id => $reward_list) {
368
+  foreach ($rewards as $quest_id => $user_data) {
369
+    foreach ($user_data as $user_id => $planet_data) {
370
+      foreach ($planet_data as $planet_id => $reward_list) {
371 371
         $comment = sprintf($lang['qst_msg_complete_body'], $quest_list[$quest_id]['quest_name']);
372 372
         $comment_dm .= isset($reward_list[RES_DARK_MATTER]) ? $comment : '';
373 373
 
374 374
         $comment_reward = array();
375
-        foreach($reward_list as $unit_id => $unit_amount)
375
+        foreach ($reward_list as $unit_id => $unit_amount)
376 376
         {
377 377
           $comment_reward[] = $unit_amount . ' ' . $lang['tech'][$unit_id];
378 378
           $total_rewards[$user_id][$planet_id][$unit_id] += $unit_amount;
@@ -395,23 +395,23 @@  discard block
 block discarded – undo
395 395
 
396 396
   $group_resources = sn_get_groups('resources_loot');
397 397
   $quest_rewards_allowed = sn_get_groups('quest_rewards');
398
-  if(!empty($total_rewards))
398
+  if (!empty($total_rewards))
399 399
   {
400
-    foreach($total_rewards as $user_id => $planet_data)
400
+    foreach ($total_rewards as $user_id => $planet_data)
401 401
     {
402 402
       $user_row = classSupernova::db_get_record_by_id(LOC_USER, $user_id);
403
-      foreach($planet_data as $planet_id => $unit_data)
403
+      foreach ($planet_data as $planet_id => $unit_data)
404 404
       {
405 405
         $local_changeset = array();
406
-        foreach($unit_data as $unit_id => $unit_amount)
406
+        foreach ($unit_data as $unit_id => $unit_amount)
407 407
         {
408
-          if(!isset($quest_rewards_allowed[$unit_id])) continue;
408
+          if (!isset($quest_rewards_allowed[$unit_id])) continue;
409 409
 
410
-          if($unit_id == RES_DARK_MATTER)
410
+          if ($unit_id == RES_DARK_MATTER)
411 411
           {
412 412
             rpg_points_change($user['id'], RPG_QUEST, $unit_amount, $comment_dm);
413 413
           }
414
-          elseif(isset($group_resources[$unit_id]))
414
+          elseif (isset($group_resources[$unit_id]))
415 415
           {
416 416
             $local_changeset[pname_resource_name($unit_id)] = array('delta' => $unit_amount);
417 417
           }
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
           }
422 422
         }
423 423
 
424
-        if(!empty($local_changeset))
424
+        if (!empty($local_changeset))
425 425
         {
426 426
           $planet_id = $planet_id == 0 && isset($user_row['id_planet']) ? $user_row['id_planet'] : $planet_id;
427 427
           $db_changeset[$planet_id ? 'planets' : 'users'][] = array(
Please login to merge, or discard this patch.
Braces   +28 added lines, -41 removed lines patch added patch discarded remove patch
@@ -2,8 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 use \DBAL\DbQuery;
4 4
 
5
-function qst_render_page()
6
-{
5
+function qst_render_page() {
7 6
   global $lang, $user, $template, $config;
8 7
 
9 8
   $user_id = sys_get_param_id('user_id', false);
@@ -35,8 +34,7 @@  discard block
 block discarded – undo
35 34
           if($quest_rewards_amount < 0)
36 35
           {
37 36
             throw new Exception($lang['qst_adm_err_reward_amount']);
38
-          }
39
-          elseif($quest_rewards_amount > 0)
37
+          } elseif($quest_rewards_amount > 0)
40 38
           {
41 39
             $quest_rewards[] = "{$quest_rewards_id},{$quest_rewards_amount}";
42 40
           }
@@ -78,8 +76,7 @@  discard block
 block discarded – undo
78 76
             ->setWhereArray(array('quest_id' => $quest_id))
79 77
             ->setOneRow()
80 78
             ->doUpdate();
81
-        }
82
-        else
79
+        } else
83 80
         {
84 81
           DbQuery::build()
85 82
             ->setTable('quest')
@@ -100,8 +97,7 @@  discard block
 block discarded – undo
100 97
           msg_send_simple_message('*', 0, 0, MSG_TYPE_PLAYER, $lang['sys_administration'], $lang['news_title'], $text);
101 98
         }
102 99
         */
103
-      }
104
-      catch (Exception $e)
100
+      } catch (Exception $e)
105 101
       {
106 102
         messageBox($e->getMessage(), $lang['sys_error']);
107 103
       }
@@ -125,8 +121,7 @@  discard block
 block discarded – undo
125 121
     }
126 122
     $query = doquery("SELECT count(*) AS count FROM `{{quest}}`;", '', true);
127 123
     $config->db_saveItem('quest_total', $query['count']);
128
-  }
129
-  elseif(!$user_id)
124
+  } elseif(!$user_id)
130 125
   {
131 126
     $user_id = $user['id'];
132 127
   }
@@ -156,8 +151,7 @@  discard block
 block discarded – undo
156 151
   if($quest)
157 152
   {
158 153
     $quest_templatized = qst_templatize(qst_quest_parse($quest, false));
159
-  }
160
-  else
154
+  } else
161 155
   {
162 156
     $quest_templatized['quest_rewards_list'] = array();
163 157
   }
@@ -200,8 +194,7 @@  discard block
 block discarded – undo
200 194
   }
201 195
 }
202 196
 
203
-function qst_get_quests($user_id = false, $status = QUEST_STATUS_ALL)
204
-{
197
+function qst_get_quests($user_id = false, $status = QUEST_STATUS_ALL) {
205 198
   $quest_list = array();
206 199
 
207 200
   if($user_id)
@@ -212,12 +205,10 @@  discard block
 block discarded – undo
212 205
       if($status == null || $status == QUEST_STATUS_NOT_STARTED)
213 206
       {
214 207
         $query_add_where .= "AND qs.quest_status_status IS NULL";
215
-      }
216
-      elseif ($status == QUEST_STATUS_EXCEPT_COMPLETE)
208
+      } elseif ($status == QUEST_STATUS_EXCEPT_COMPLETE)
217 209
       {
218 210
         $query_add_where .= "AND (qs.quest_status_status IS NULL OR qs.quest_status_status = " . QUEST_STATUS_STARTED . ")";
219
-      }
220
-      else
211
+      } else
221 212
       {
222 213
         $query_add_where .= "AND qs.quest_status_status = {$status}";
223 214
       }
@@ -241,13 +232,11 @@  discard block
 block discarded – undo
241 232
   return $quest_list;
242 233
 }
243 234
 
244
-function qst_assign_to_template(&$template, $quest_templatized, $block_name = false)
245
-{
235
+function qst_assign_to_template(&$template, $quest_templatized, $block_name = false) {
246 236
   if($block_name)
247 237
   {
248 238
     $template->assign_block_vars($block_name, $quest_templatized);
249
-  }
250
-  else
239
+  } else
251 240
   {
252 241
     $template->assign_vars($quest_templatized);
253 242
     if(!empty($quest_templatized['quest_rewards_list']))
@@ -260,8 +249,7 @@  discard block
 block discarded – undo
260 249
   }
261 250
 }
262 251
 
263
-function qst_quest_parse($quest)
264
-{
252
+function qst_quest_parse($quest) {
265 253
   list($quest['quest_unit_id'], $quest['quest_unit_amount']) = explode(',', $quest['quest_conditions']);
266 254
 
267 255
   $quest['quest_rewards_list'] = sys_unit_str2arr($quest['quest_rewards']);
@@ -269,8 +257,7 @@  discard block
 block discarded – undo
269 257
   return $quest;
270 258
 }
271 259
 
272
-function qst_templatize($quest, $for_display = true)
273
-{
260
+function qst_templatize($quest, $for_display = true) {
274 261
   global $lang;
275 262
 
276 263
   $tmp = array();
@@ -298,8 +285,7 @@  discard block
 block discarded – undo
298 285
   );
299 286
 }
300 287
 
301
-function qst_active_triggers($quest_list)
302
-{
288
+function qst_active_triggers($quest_list) {
303 289
   $quest_triggers = array();
304 290
   foreach($quest_list as $quest_id => $quest)
305 291
   {
@@ -319,9 +305,10 @@  discard block
 block discarded – undo
319 305
  * @param $quest_list
320 306
  * @param integer[] $quest_statuses
321 307
  */
322
-function qst_reward(&$user, &$rewards, &$quest_list, &$quest_statuses)
323
-{
324
-  if(empty($quest_statuses)) return;
308
+function qst_reward(&$user, &$rewards, &$quest_list, &$quest_statuses) {
309
+  if(empty($quest_statuses)) {
310
+    return;
311
+  }
325 312
 
326 313
   global $lang;
327 314
 
@@ -359,7 +346,9 @@  discard block
 block discarded – undo
359 346
     }
360 347
   }
361 348
 
362
-  if(empty($rewards)) return;
349
+  if(empty($rewards)) {
350
+    return;
351
+  }
363 352
 
364 353
   $db_changeset = array();
365 354
   $total_rewards = array();
@@ -405,17 +394,17 @@  discard block
 block discarded – undo
405 394
         $local_changeset = array();
406 395
         foreach($unit_data as $unit_id => $unit_amount)
407 396
         {
408
-          if(!isset($quest_rewards_allowed[$unit_id])) continue;
397
+          if(!isset($quest_rewards_allowed[$unit_id])) {
398
+            continue;
399
+          }
409 400
 
410 401
           if($unit_id == RES_DARK_MATTER)
411 402
           {
412 403
             rpg_points_change($user['id'], RPG_QUEST, $unit_amount, $comment_dm);
413
-          }
414
-          elseif(isset($group_resources[$unit_id]))
404
+          } elseif(isset($group_resources[$unit_id]))
415 405
           {
416 406
             $local_changeset[pname_resource_name($unit_id)] = array('delta' => $unit_amount);
417
-          }
418
-          else // Проверим на юниты
407
+          } else // Проверим на юниты
419 408
           {
420 409
             $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($unit_id, $unit_amount, $user_row, $planet_id);
421 410
           }
@@ -440,12 +429,10 @@  discard block
 block discarded – undo
440 429
   }
441 430
 }
442 431
 
443
-function get_quest_amount_complete($user_id)
444
-{
432
+function get_quest_amount_complete($user_id) {
445 433
   return count(qst_get_quests($user_id, QUEST_STATUS_COMPLETE));
446 434
 }
447 435
 
448
-function get_quest_amount_in_progress($user_id)
449
-{
436
+function get_quest_amount_in_progress($user_id) {
450 437
   return count(qst_get_quests($user_id, QUEST_STATUS_STARTED));
451 438
 }
Please login to merge, or discard this patch.
includes/functions/_news.php 1 patch
Spacing   +14 added lines, -15 removed lines patch added patch discarded remove patch
@@ -23,15 +23,15 @@  discard block
 block discarded – undo
23 23
   $template->assign_var('NEWS_COUNT', db_num_rows($announce_list));
24 24
 
25 25
   $users = array();
26
-  while($announce = db_fetch($announce_list)) {
27
-    if($announce['user_id'] && !isset($users[$announce['user_id']])) {
26
+  while ($announce = db_fetch($announce_list)) {
27
+    if ($announce['user_id'] && !isset($users[$announce['user_id']])) {
28 28
       $users[$announce['user_id']] = db_user_by_id($announce['user_id']);
29 29
     }
30 30
 
31 31
     $survey_vote = array('survey_vote_id' => 1);
32 32
     $survey_complete = strtotime($announce['survey_until']) < SN_TIME_NOW;
33 33
 
34
-    if($announce['survey_id'] && !empty($user['id'])) {
34
+    if ($announce['survey_id'] && !empty($user['id'])) {
35 35
       $survey_vote = !$survey_complete ? $survey_vote = doquery("SELECT `survey_vote_id` FROM `{{survey_votes}}` WHERE survey_parent_id = {$announce['survey_id']} AND survey_vote_user_id = {$user['id']} LIMIT 1;", true) : array();
36 36
     }
37 37
 
@@ -43,8 +43,7 @@  discard block
 block discarded – undo
43 43
       'ANNOUNCE'        => classSupernova::$gc->bbCodeParser->expandBbCode($announce['strAnnounce'], intval($announce['authlevel'])),
44 44
       'DETAIL_URL'      => $announce['detail_url'],
45 45
       'USER_NAME'       =>
46
-        isset($users[$announce['user_id']]) && $users[$announce['user_id']] ? player_nick_render_to_html($users[$announce['user_id']], array('color' => true)):
47
-        js_safe_string($announce['user_name']),
46
+        isset($users[$announce['user_id']]) && $users[$announce['user_id']] ? player_nick_render_to_html($users[$announce['user_id']], array('color' => true)) : js_safe_string($announce['user_name']),
48 47
       'NEW'             => $announce['unix_time'] + $config->game_news_actual >= SN_TIME_NOW,
49 48
       'FUTURE'          => $announce['unix_time'] > SN_TIME_NOW,
50 49
       'SURVEY_ID'       => $announce['survey_id'],
@@ -54,13 +53,13 @@  discard block
 block discarded – undo
54 53
       'SURVEY_UNTIL'    => $announce['survey_until'],
55 54
     ));
56 55
 
57
-    foreach($announce_exploded as $announce_paragraph) {
56
+    foreach ($announce_exploded as $announce_paragraph) {
58 57
       $template->assign_block_vars('announces.paragraph', array(
59 58
         'TEXT' => $announce_paragraph,
60 59
       ));
61 60
     }
62 61
 
63
-    if($announce['survey_id']) {
62
+    if ($announce['survey_id']) {
64 63
       $survey_query = doquery(
65 64
         "SELECT survey_answer_text AS `TEXT`, count(DISTINCT survey_vote_id) AS `VOTES`
66 65
           FROM `{{survey_answers}}` AS sa
@@ -71,15 +70,15 @@  discard block
 block discarded – undo
71 70
       );
72 71
       $survey_vote_result = array();
73 72
       $total_votes = 0;
74
-      while($row = db_fetch($survey_query)) {
73
+      while ($row = db_fetch($survey_query)) {
75 74
         $survey_vote_result[] = $row;
76 75
         $total_votes += $row['VOTES'];
77 76
       }
78 77
 
79
-      if(empty($survey_vote) && !$survey_complete) {
78
+      if (empty($survey_vote) && !$survey_complete) {
80 79
         // Can vote
81 80
         $survey_query = doquery("SELECT * FROM {{survey_answers}} WHERE survey_parent_id  = {$announce['survey_id']} ORDER BY survey_answer_id;");
82
-        while($row = db_fetch($survey_query)) {
81
+        while ($row = db_fetch($survey_query)) {
83 82
           $template->assign_block_vars('announces.survey_answers', array(
84 83
             'ID' => $row['survey_answer_id'],
85 84
             'TEXT' => $row['survey_answer_text'],
@@ -87,7 +86,7 @@  discard block
 block discarded – undo
87 86
         }
88 87
       } else {
89 88
         // Show result
90
-        foreach($survey_vote_result as &$vote_result) {
89
+        foreach ($survey_vote_result as &$vote_result) {
91 90
           $vote_percent = $total_votes ? $vote_result['VOTES'] / $total_votes * 100 : 0;
92 91
           $vote_result['PERCENT'] = $vote_percent;
93 92
           $vote_result['PERCENT_TEXT'] = round($vote_percent, 1);
@@ -104,7 +103,7 @@  discard block
 block discarded – undo
104 103
 }
105 104
 
106 105
 function nws_mark_read(&$user) {
107
-  if(isset($user['id'])) {
106
+  if (isset($user['id'])) {
108 107
     db_user_set_by_id($user['id'], '`news_lastread` = ' . SN_TIME_NOW);
109 108
     $user['news_lastread'] = SN_TIME_NOW;
110 109
   }
@@ -112,17 +111,17 @@  discard block
 block discarded – undo
112 111
 }
113 112
 
114 113
 function survey_vote(&$user) {
115
-  if(empty($user['id'])) {
114
+  if (empty($user['id'])) {
116 115
     return true;
117 116
   }
118 117
 
119 118
   sn_db_transaction_start();
120 119
   $survey_id = sys_get_param_id('survey_id');
121 120
   $is_voted = doquery("SELECT `survey_vote_id` FROM `{{survey_votes}}` WHERE survey_parent_id = {$survey_id} AND survey_vote_user_id = {$user['id']} FOR UPDATE;", true);
122
-  if(empty($is_voted)) {
121
+  if (empty($is_voted)) {
123 122
     $survey_vote_id = sys_get_param_id('survey_vote');
124 123
     $is_answer_exists = doquery("SELECT `survey_answer_id` FROM `{{survey_answers}}` WHERE survey_parent_id = {$survey_id} AND survey_answer_id = {$survey_vote_id};", true);
125
-    if(!empty($is_answer_exists)) {
124
+    if (!empty($is_answer_exists)) {
126 125
       $user_name_safe = db_escape($user['username']);
127 126
       doquery("INSERT INTO {{survey_votes}} SET `survey_parent_id` = {$survey_id}, `survey_parent_answer_id` = {$survey_vote_id}, `survey_vote_user_id` = {$user['id']}, `survey_vote_user_name` = '{$user_name_safe}';");
128 127
     }
Please login to merge, or discard this patch.
includes/pages/admin/user_view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -186,11 +186,11 @@
 block discarded – undo
186 186
   }
187 187
 
188 188
   $exclude = $user_row;
189
-  foreach($blocks as $title => $fields) {
189
+  foreach ($blocks as $title => $fields) {
190 190
     userBlockAssign($exclude, $template, $title, $fields);
191 191
   }
192 192
 
193
-  if(!empty($exclude)) {
193
+  if (!empty($exclude)) {
194 194
     userBlockAssign($exclude, $template, '!!! НЕИЗВЕСТНЫЕ ПАРАМЕТРЫ !!!', array_keys($exclude));
195 195
   }
196 196
 
Please login to merge, or discard this patch.
includes/vars.php 2 patches
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -189,62 +189,62 @@  discard block
 block discarded – undo
189 189
   );
190 190
 
191 191
 $sn_message_class_list = array(
192
-   MSG_TYPE_NEW => array(
193
-     'name' => 'new_message',
194
-     'switchable' => false,
195
-     'email' => false,
196
-   ),
197
-   MSG_TYPE_ADMIN => array(
198
-     'name' => 'msg_admin',
199
-     'switchable' => false,
200
-     'email' => true,
201
-   ),
202
-   MSG_TYPE_PLAYER => array(
203
-     'name' => 'mnl_joueur',
204
-     'switchable' => false,
205
-     'email' => true,
206
-   ),
207
-   MSG_TYPE_ALLIANCE => array(
208
-     'name' => 'mnl_alliance',
209
-     'switchable' => false,
210
-     'email' => true,
211
-   ),
212
-   MSG_TYPE_SPY => array(
213
-     'name' => 'mnl_spy',
214
-     'switchable' => true,
215
-     'email' => true,
216
-   ),
217
-   MSG_TYPE_COMBAT => array(
218
-     'name' => 'mnl_attaque',
219
-     'switchable' => true,
220
-     'email' => true,
221
-   ),
222
-   MSG_TYPE_TRANSPORT => array(
223
-     'name' => 'mnl_transport',
224
-     'switchable' => true,
225
-     'email' => true,
226
-   ),
227
-   MSG_TYPE_RECYCLE => array(
228
-     'name' => 'mnl_exploit',
229
-     'switchable' => true,
230
-     'email' => true,
231
-   ),
232
-   MSG_TYPE_EXPLORE => array(
233
-     'name' => 'mnl_expedition',
234
-     'switchable' => true,
235
-     'email' => true,
236
-   ),
237
-   //     97 => 'mnl_general',
238
-   MSG_TYPE_QUE => array(
239
-     'name' => 'mnl_buildlist',
240
-     'switchable' => true,
241
-     'email' => true,
242
-   ),
243
-   MSG_TYPE_OUTBOX => array(
244
-     'name' => 'mnl_outbox',
245
-     'switchable' => false,
246
-     'email' => false,
247
-   ),
192
+    MSG_TYPE_NEW => array(
193
+      'name' => 'new_message',
194
+      'switchable' => false,
195
+      'email' => false,
196
+    ),
197
+    MSG_TYPE_ADMIN => array(
198
+      'name' => 'msg_admin',
199
+      'switchable' => false,
200
+      'email' => true,
201
+    ),
202
+    MSG_TYPE_PLAYER => array(
203
+      'name' => 'mnl_joueur',
204
+      'switchable' => false,
205
+      'email' => true,
206
+    ),
207
+    MSG_TYPE_ALLIANCE => array(
208
+      'name' => 'mnl_alliance',
209
+      'switchable' => false,
210
+      'email' => true,
211
+    ),
212
+    MSG_TYPE_SPY => array(
213
+      'name' => 'mnl_spy',
214
+      'switchable' => true,
215
+      'email' => true,
216
+    ),
217
+    MSG_TYPE_COMBAT => array(
218
+      'name' => 'mnl_attaque',
219
+      'switchable' => true,
220
+      'email' => true,
221
+    ),
222
+    MSG_TYPE_TRANSPORT => array(
223
+      'name' => 'mnl_transport',
224
+      'switchable' => true,
225
+      'email' => true,
226
+    ),
227
+    MSG_TYPE_RECYCLE => array(
228
+      'name' => 'mnl_exploit',
229
+      'switchable' => true,
230
+      'email' => true,
231
+    ),
232
+    MSG_TYPE_EXPLORE => array(
233
+      'name' => 'mnl_expedition',
234
+      'switchable' => true,
235
+      'email' => true,
236
+    ),
237
+    //     97 => 'mnl_general',
238
+    MSG_TYPE_QUE => array(
239
+      'name' => 'mnl_buildlist',
240
+      'switchable' => true,
241
+      'email' => true,
242
+    ),
243
+    MSG_TYPE_OUTBOX => array(
244
+      'name' => 'mnl_outbox',
245
+      'switchable' => false,
246
+      'email' => false,
247
+    ),
248 248
 );
249 249
 
250 250
 $sn_message_groups = array(
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
       SHIP_HUGE_DEATH_STAR => SHIP_HUGE_DEATH_STAR, SHIP_HUGE_SUPERNOVA => SHIP_HUGE_SUPERNOVA,
1097 1097
       SHIP_CARGO_SMALL => SHIP_CARGO_SMALL, SHIP_CARGO_BIG => SHIP_CARGO_BIG, SHIP_CARGO_SUPER => SHIP_CARGO_SUPER, SHIP_CARGO_HYPER => SHIP_CARGO_HYPER,
1098 1098
       SHIP_RECYCLER => SHIP_RECYCLER, SHIP_COLONIZER => SHIP_COLONIZER, SHIP_SPY => SHIP_SPY, SHIP_SATTELITE_SOLAR => SHIP_SATTELITE_SOLAR
1099
-     ),
1099
+      ),
1100 1100
     // Defensive building list
1101 1101
     'defense'   => array (UNIT_DEF_TURRET_MISSILE => UNIT_DEF_TURRET_MISSILE, UNIT_DEF_TURRET_LASER_SMALL => UNIT_DEF_TURRET_LASER_SMALL,
1102 1102
                           UNIT_DEF_TURRET_LASER_BIG => UNIT_DEF_TURRET_LASER_BIG, UNIT_DEF_TURRET_GAUSS => UNIT_DEF_TURRET_GAUSS,
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
   SNC_VER_ERROR_MISSMATCH_KEY_ID => 'error',
167 167
 );
168 168
 
169
-$tableList = array( 'aks', 'alliance', 'alliance_requests', 'announce', 'annonce', 'banned', 'buddy', 'chat', 'config', 'counter',
169
+$tableList = array('aks', 'alliance', 'alliance_requests', 'announce', 'annonce', 'banned', 'buddy', 'chat', 'config', 'counter',
170 170
   'errors', 'fleets', 'fleet_log', 'galaxy', 'iraks', 'logs', 'log_dark_matter', 'messages', 'notes', 'planets', 'quest',
171 171
   'quest_status', 'referrals', 'rw', 'statpoints', 'users'
172 172
 );
@@ -257,14 +257,14 @@  discard block
 block discarded – undo
257 257
 $user_option_list = array();
258 258
 
259 259
 $user_option_list[OPT_MESSAGE] = array();
260
-foreach($sn_message_class_list as $message_class_id => $message_class_data)
260
+foreach ($sn_message_class_list as $message_class_id => $message_class_data)
261 261
 {
262
-  if($message_class_data['switchable'])
262
+  if ($message_class_data['switchable'])
263 263
   {
264 264
     $user_option_list[OPT_MESSAGE]["opt_{$message_class_data['name']}"] = 1;
265 265
   }
266 266
 
267
-  if($message_class_data['email'])
267
+  if ($message_class_data['email'])
268 268
   {
269 269
     $user_option_list[OPT_MESSAGE]["opt_email_{$message_class_data['name']}"] = 0;
270 270
   }
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_ICE_HYDROGEN,
848 848
         UNIT_PLANET_DENSITY_RARITY => 30, // 1, // 40.00, // * 1/121 0,82645
849 849
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_PERFECT,
850
-        UNIT_RESOURCES => array(RES_METAL => 0.20, RES_CRYSTAL => 0.60, RES_DEUTERIUM => 7.10, ),
850
+        UNIT_RESOURCES => array(RES_METAL => 0.20, RES_CRYSTAL => 0.60, RES_DEUTERIUM => 7.10,),
851 851
         UNIT_PLANET_DENSITY_MAX_SECTORS => 150,
852 852
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11,
853 853
       ),
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_ICE_METHANE,
857 857
         UNIT_PLANET_DENSITY_RARITY =>  130, // 6, // 6.67, // * 6,0	4,95868
858 858
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_GOOD,
859
-        UNIT_RESOURCES => array(RES_METAL => 0.55, RES_CRYSTAL => 0.85, RES_DEUTERIUM => 4.60, ),
859
+        UNIT_RESOURCES => array(RES_METAL => 0.55, RES_CRYSTAL => 0.85, RES_DEUTERIUM => 4.60,),
860 860
         UNIT_PLANET_DENSITY_MAX_SECTORS => 200,
861 861
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6,
862 862
       ),
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_ICE_WATER,
866 866
         UNIT_PLANET_DENSITY_RARITY =>  450, //20, // 2.00, // * 20,0	16,52893
867 867
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_AVERAGE,
868
-        UNIT_RESOURCES => array(RES_METAL => 0.86, RES_CRYSTAL => 0.95, RES_DEUTERIUM => 2.20, ),
868
+        UNIT_RESOURCES => array(RES_METAL => 0.86, RES_CRYSTAL => 0.95, RES_DEUTERIUM => 2.20,),
869 869
         UNIT_PLANET_DENSITY_MAX_SECTORS => 999,
870 870
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0,
871 871
       ),
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_CRYSTAL_RAW,
876 876
         UNIT_PLANET_DENSITY_RARITY => 20, // 1, // 40.00, // *1,0	0,82645
877 877
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_PERFECT,
878
-        UNIT_RESOURCES => array(RES_METAL => 0.40, RES_CRYSTAL => 12.37, RES_DEUTERIUM => 0.50, ),
878
+        UNIT_RESOURCES => array(RES_METAL => 0.40, RES_CRYSTAL => 12.37, RES_DEUTERIUM => 0.50,),
879 879
         UNIT_PLANET_DENSITY_MAX_SECTORS => 150,
880 880
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11,
881 881
       ),
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_CRYSTAL_SILICATE,
885 885
         UNIT_PLANET_DENSITY_RARITY => 140, // 5.71, // * 7,0	5,78512
886 886
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_GOOD,
887
-        UNIT_RESOURCES => array(RES_METAL => 0.67, RES_CRYSTAL => 4.50, RES_DEUTERIUM => 0.85, ),
887
+        UNIT_RESOURCES => array(RES_METAL => 0.67, RES_CRYSTAL => 4.50, RES_DEUTERIUM => 0.85,),
888 888
         UNIT_PLANET_DENSITY_MAX_SECTORS => 200,
889 889
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6,
890 890
       ),
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_CRYSTAL_STONE,
894 894
         UNIT_PLANET_DENSITY_RARITY => 500, // 1.90, // * 21,0	17,35537
895 895
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_AVERAGE,
896
-        UNIT_RESOURCES => array(RES_METAL => 0.80, RES_CRYSTAL => 2.00, RES_DEUTERIUM => 0.95, ),
896
+        UNIT_RESOURCES => array(RES_METAL => 0.80, RES_CRYSTAL => 2.00, RES_DEUTERIUM => 0.95,),
897 897
         UNIT_PLANET_DENSITY_MAX_SECTORS => 999,
898 898
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0,
899 899
       ),
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_STANDARD,
904 904
         UNIT_PLANET_DENSITY_RARITY => 1000, // 1.0, // * 40,0	33,05785
905 905
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_NORMAL,
906
-        UNIT_RESOURCES => array(RES_METAL => 1.00, RES_CRYSTAL => 1.00, RES_DEUTERIUM => 1.00, ),
906
+        UNIT_RESOURCES => array(RES_METAL => 1.00, RES_CRYSTAL => 1.00, RES_DEUTERIUM => 1.00,),
907 907
         UNIT_PLANET_DENSITY_MAX_SECTORS => 999,
908 908
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0,
909 909
       ),
@@ -913,7 +913,7 @@  discard block
 block discarded – undo
913 913
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_METAL_ORE,
914 914
         UNIT_PLANET_DENSITY_RARITY => 550, // 2.11, // * 19,0	15,70248
915 915
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_AVERAGE,
916
-        UNIT_RESOURCES => array(RES_METAL => 1.60, RES_CRYSTAL => 0.90, RES_DEUTERIUM => 0.80, ),
916
+        UNIT_RESOURCES => array(RES_METAL => 1.60, RES_CRYSTAL => 0.90, RES_DEUTERIUM => 0.80,),
917 917
         UNIT_PLANET_DENSITY_MAX_SECTORS => 999,
918 918
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0,
919 919
       ),
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_METAL_PERIDOT,
923 923
         UNIT_PLANET_DENSITY_RARITY => 120, // 8.00, // * 5,0	4,13223
924 924
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_GOOD,
925
-        UNIT_RESOURCES => array(RES_METAL => 4.71, RES_CRYSTAL => 0.80, RES_DEUTERIUM => 0.55, ),
925
+        UNIT_RESOURCES => array(RES_METAL => 4.71, RES_CRYSTAL => 0.80, RES_DEUTERIUM => 0.55,),
926 926
         UNIT_PLANET_DENSITY_MAX_SECTORS => 200,
927 927
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6,
928 928
       ),
@@ -931,7 +931,7 @@  discard block
 block discarded – undo
931 931
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_METAL_RAW,
932 932
         UNIT_PLANET_DENSITY_RARITY => 25, // 40.00, // * 1,0	0,82645
933 933
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_PERFECT,
934
-        UNIT_RESOURCES => array(RES_METAL => 8.00, RES_CRYSTAL => 0.40, RES_DEUTERIUM => 0.25, ),
934
+        UNIT_RESOURCES => array(RES_METAL => 8.00, RES_CRYSTAL => 0.40, RES_DEUTERIUM => 0.25,),
935 935
         UNIT_PLANET_DENSITY_MAX_SECTORS => 150,
936 936
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11,
937 937
       ),
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
     ),
1062 1062
 
1063 1063
     // Tech list
1064
-    'tech'      => array (
1064
+    'tech'      => array(
1065 1065
       TECH_ARMOR => TECH_ARMOR, TECH_WEAPON => TECH_WEAPON, TECH_SHIELD => TECH_SHIELD,
1066 1066
       TECH_SPY => TECH_SPY, TECH_COMPUTER => TECH_COMPUTER,
1067 1067
       TECH_ENERGY => TECH_ENERGY, TECH_LASER => TECH_LASER, TECH_ION => TECH_ION, TECH_PLASMA => TECH_PLASMA, TECH_HYPERSPACE => TECH_HYPERSPACE,
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
     ),
1073 1073
 
1074 1074
     // Mercenaries
1075
-    'mercenaries' => array (
1075
+    'mercenaries' => array(
1076 1076
       MRC_STOCKMAN => MRC_STOCKMAN, MRC_SPY => MRC_SPY, MRC_ACADEMIC => MRC_ACADEMIC,
1077 1077
       MRC_ADMIRAL => MRC_ADMIRAL, MRC_COORDINATOR => MRC_COORDINATOR, MRC_NAVIGATOR => MRC_NAVIGATOR,
1078 1078
     ),
@@ -1098,7 +1098,7 @@  discard block
 block discarded – undo
1098 1098
       SHIP_RECYCLER => SHIP_RECYCLER, SHIP_COLONIZER => SHIP_COLONIZER, SHIP_SPY => SHIP_SPY, SHIP_SATTELITE_SOLAR => SHIP_SATTELITE_SOLAR
1099 1099
      ),
1100 1100
     // Defensive building list
1101
-    'defense'   => array (UNIT_DEF_TURRET_MISSILE => UNIT_DEF_TURRET_MISSILE, UNIT_DEF_TURRET_LASER_SMALL => UNIT_DEF_TURRET_LASER_SMALL,
1101
+    'defense'   => array(UNIT_DEF_TURRET_MISSILE => UNIT_DEF_TURRET_MISSILE, UNIT_DEF_TURRET_LASER_SMALL => UNIT_DEF_TURRET_LASER_SMALL,
1102 1102
                           UNIT_DEF_TURRET_LASER_BIG => UNIT_DEF_TURRET_LASER_BIG, UNIT_DEF_TURRET_GAUSS => UNIT_DEF_TURRET_GAUSS,
1103 1103
                           UNIT_DEF_TURRET_ION => UNIT_DEF_TURRET_ION, UNIT_DEF_TURRET_PLASMA => UNIT_DEF_TURRET_PLASMA,
1104 1104
 
@@ -1108,7 +1108,7 @@  discard block
 block discarded – undo
1108 1108
     ),
1109 1109
 
1110 1110
     // Missiles list
1111
-    'missile'   => array (UNIT_DEF_MISSILE_INTERCEPTOR => UNIT_DEF_MISSILE_INTERCEPTOR, UNIT_DEF_MISSILE_INTERPLANET => UNIT_DEF_MISSILE_INTERPLANET, ),
1111
+    'missile'   => array(UNIT_DEF_MISSILE_INTERCEPTOR => UNIT_DEF_MISSILE_INTERCEPTOR, UNIT_DEF_MISSILE_INTERPLANET => UNIT_DEF_MISSILE_INTERPLANET,),
1112 1112
 
1113 1113
     // Combat units list
1114 1114
     'combat'    => array(
@@ -1148,9 +1148,9 @@  discard block
 block discarded – undo
1148 1148
     ),
1149 1149
 
1150 1150
     // Resource list
1151
-    'resources' => array ( 0 => 'metal', 1 => 'crystal', 2 => 'deuterium', 3 => 'dark_matter'),
1151
+    'resources' => array(0 => 'metal', 1 => 'crystal', 2 => 'deuterium', 3 => 'dark_matter'),
1152 1152
     // Resources all
1153
-    'resources_all' => array(RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_ENERGY => RES_ENERGY, RES_DARK_MATTER => RES_DARK_MATTER, RES_METAMATTER => RES_METAMATTER, ),
1153
+    'resources_all' => array(RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_ENERGY => RES_ENERGY, RES_DARK_MATTER => RES_DARK_MATTER, RES_METAMATTER => RES_METAMATTER,),
1154 1154
     // Resources can be produced on planet
1155 1155
     'resources_planet' => array(RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_ENERGY => RES_ENERGY),
1156 1156
     // Resources can be looted from planet
@@ -1169,13 +1169,13 @@  discard block
 block discarded – undo
1169 1169
     ),
1170 1170
 
1171 1171
     // Resources that can be tradeable in market trader AND be a quest_rewards
1172
-    'quest_rewards' => array(RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_DARK_MATTER => RES_DARK_MATTER, ),
1172
+    'quest_rewards' => array(RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_DARK_MATTER => RES_DARK_MATTER,),
1173 1173
 
1174 1174
 //      // Ques list
1175 1175
 //      'ques' => array(QUE_STRUCTURES, QUE_HANGAR, QUE_RESEARCH),
1176 1176
 
1177
-    'STAT_COMMON' => array(STAT_TOTAL => STAT_TOTAL, STAT_FLEET => STAT_FLEET, STAT_TECH => STAT_TECH, STAT_BUILDING => STAT_BUILDING, STAT_DEFENSE => STAT_DEFENSE, STAT_RESOURCE => STAT_RESOURCE, ),
1178
-    'STAT_PLAYER' => array(STAT_RAID_TOTAL => STAT_RAID_TOTAL, STAT_RAID_WON => STAT_RAID_WON, STAT_RAID_LOST => STAT_RAID_LOST, STAT_LVL_BUILDING => STAT_LVL_BUILDING, STAT_LVL_TECH => STAT_LVL_TECH, STAT_LVL_RAID => STAT_LVL_RAID, ),
1177
+    'STAT_COMMON' => array(STAT_TOTAL => STAT_TOTAL, STAT_FLEET => STAT_FLEET, STAT_TECH => STAT_TECH, STAT_BUILDING => STAT_BUILDING, STAT_DEFENSE => STAT_DEFENSE, STAT_RESOURCE => STAT_RESOURCE,),
1178
+    'STAT_PLAYER' => array(STAT_RAID_TOTAL => STAT_RAID_TOTAL, STAT_RAID_WON => STAT_RAID_WON, STAT_RAID_LOST => STAT_RAID_LOST, STAT_LVL_BUILDING => STAT_LVL_BUILDING, STAT_LVL_TECH => STAT_LVL_TECH, STAT_LVL_RAID => STAT_LVL_RAID,),
1179 1179
   ),
1180 1180
 );
1181 1181
 
Please login to merge, or discard this patch.