Completed
Push — work-fleets ( cb2521...9eb2f3 )
by SuperNova.WS
08:26
created
includes/vars/vars_combats.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     'shield' => 10,
36 36
     'armor' => 400,
37 37
     'attack' => 5,
38
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
38
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
39 39
   ),
40 40
   SHIP_CARGO_BIG => array(
41 41
     'name' => 'big_ship_cargo',
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     'shield' => 25,
56 56
     'armor' => 1200,
57 57
     'attack' => 5,
58
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
58
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
59 59
     'engine' => array(
60 60
       array(
61 61
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     'shield' => 50,
84 84
     'armor' => 3000,
85 85
     'attack' => 10,
86
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
86
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
87 87
     'engine' => array(
88 88
       array(
89 89
         'tech' => TECH_ENGINE_ION,
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     'shield' => 200,
112 112
     'armor' => 70000,
113 113
     'attack' => 50,
114
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
114
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
115 115
     'engine' => array(
116 116
       array(
117 117
         'tech' => TECH_ENGINE_HYPER,
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     'shield' => 100,
141 141
     'armor' => 3000,
142 142
     'attack' => 50,
143
-    'amplify' => array(SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21, ),
143
+    'amplify' => array(SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21,),
144 144
     'engine' => array(
145 145
       array(
146 146
         'tech' => TECH_ENGINE_ION,
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     'shield' => 10,
169 169
     'armor' => 1600,
170 170
     'attack' => 1,
171
-    'amplify' => array(SHIP_SPY => 500.05, SHIP_SATTELITE_SOLAR => 1050, ),
171
+    'amplify' => array(SHIP_SPY => 500.05, SHIP_SATTELITE_SOLAR => 1050,),
172 172
     'engine' => array(
173 173
       array(
174 174
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     'shield' =>  0.01,
197 197
     'armor' => 100,
198 198
     'attack' =>  0.01,
199
-    'amplify' => array( SHIP_SPY => 1,),
199
+    'amplify' => array(SHIP_SPY => 1,),
200 200
     'engine' => array(
201 201
       array(
202 202
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
       'factor' => 1,
221 221
     ),
222 222
     P_UNIT_PRODUCTION => array(
223
-      RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor);},
223
+      RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor); },
224 224
     ),
225 225
     P_MINING_IS_MANAGED => true,
226 226
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     'shield' => 10,
230 230
     'armor' => 200,
231 231
     'attack' => 1,
232
-    'amplify' => array(SHIP_SPY => 1, ),
232
+    'amplify' => array(SHIP_SPY => 1,),
233 233
     'engine' => array(
234 234
       array(
235 235
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     'shield' => 10,
262 262
     'armor' => 400,
263 263
     'attack' => 50,
264
-    'amplify' => array(SHIP_CARGO_SMALL => 16.4, SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21, ),
264
+    'amplify' => array(SHIP_CARGO_SMALL => 16.4, SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21,),
265 265
     'engine' => array(
266 266
       array(
267 267
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     'shield' => 25,
291 291
     'armor' => 1000,
292 292
     'attack' => 150,
293
-    'amplify' => array(SHIP_CARGO_SMALL => 8.2, SHIP_SPY => 3.33367, SHIP_SATTELITE_SOLAR => 7, ),
293
+    'amplify' => array(SHIP_CARGO_SMALL => 8.2, SHIP_SPY => 3.33367, SHIP_SATTELITE_SOLAR => 7,),
294 294
     'engine' => array(
295 295
       array(
296 296
         'tech' => TECH_ENGINE_ION,
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
     'shield' =>  50,
350 350
     'armor' => 2700,
351 351
     'attack' => 400,
352
-    'amplify' => array(SHIP_SMALL_FIGHTER_LIGHT => 6.15, SHIP_SPY => 1.25013, SHIP_SATTELITE_SOLAR => 2.625, UNIT_DEF_TURRET_MISSILE => 5.5, ),
352
+    'amplify' => array(SHIP_SMALL_FIGHTER_LIGHT => 6.15, SHIP_SPY => 1.25013, SHIP_SATTELITE_SOLAR => 2.625, UNIT_DEF_TURRET_MISSILE => 5.5,),
353 353
     'engine' => array(
354 354
       array(
355 355
         'tech' => TECH_ENGINE_ION,
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
     'shield' =>  200,
409 409
     'armor' =>  6000,
410 410
     'attack' => 1000,
411
-    'amplify' => array(SHIP_SPY => 0.50005, SHIP_SATTELITE_SOLAR => 1.05, UNIT_DEF_TURRET_MISSILE => 1.76, ),
411
+    'amplify' => array(SHIP_SPY => 0.50005, SHIP_SATTELITE_SOLAR => 1.05, UNIT_DEF_TURRET_MISSILE => 1.76,),
412 412
     'engine' => array(
413 413
       array(
414 414
         'tech' => TECH_ENGINE_HYPER,
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
     'shield' =>  500,
505 505
     'armor' => 11000,
506 506
     'attack' => 2000,
507
-    'amplify' => array(SHIP_SPY => 0.25003, SHIP_SATTELITE_SOLAR => 0.525, SHIP_LARGE_BATTLESHIP => 7.4, UNIT_DEF_TURRET_LASER_SMALL => 1.125, ),
507
+    'amplify' => array(SHIP_SPY => 0.25003, SHIP_SATTELITE_SOLAR => 0.525, SHIP_LARGE_BATTLESHIP => 7.4, UNIT_DEF_TURRET_LASER_SMALL => 1.125,),
508 508
     'engine' => array(
509 509
       array(
510 510
         'tech' => TECH_ENGINE_HYPER,
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
     'shield' => 20,
609 609
     'armor' => 200,
610 610
     'attack' => 80,
611
-    'amplify' => array(SHIP_SPY => 7, ),
611
+    'amplify' => array(SHIP_SPY => 7,),
612 612
   ),
613 613
   UNIT_DEF_TURRET_LASER_SMALL => array(
614 614
     'name' => 'small_laser',
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
     'shield' => 25,
627 627
     'armor' => 200,
628 628
     'attack' => 100,
629
-    'amplify' => array(SHIP_SPY => 5, ),
629
+    'amplify' => array(SHIP_SPY => 5,),
630 630
   ),
631 631
   UNIT_DEF_TURRET_LASER_BIG => array(
632 632
     'name' => 'big_laser',
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
     'shield' => 100,
645 645
     'armor' => 800,
646 646
     'attack' => 250,
647
-    'amplify' => array(SHIP_SPY => 2, ),
647
+    'amplify' => array(SHIP_SPY => 2,),
648 648
   ),
649 649
   UNIT_DEF_TURRET_GAUSS => array(
650 650
     'name' => 'gauss_canyon',
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
     'armor' => 3500,
663 663
     'shield' => 200,
664 664
     'attack' => 1100,
665
-    'amplify' => array(SHIP_SPY => 0.5, ),
665
+    'amplify' => array(SHIP_SPY => 0.5,),
666 666
   ),
667 667
   UNIT_DEF_TURRET_ION => array(
668 668
     'name' => 'ionic_canyon',
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
     'shield' => 500,
681 681
     'armor' => 800,
682 682
     'attack' => 150,
683
-    'amplify' => array(SHIP_SPY => 3.3, ),
683
+    'amplify' => array(SHIP_SPY => 3.3,),
684 684
   ),
685 685
   UNIT_DEF_TURRET_PLASMA => array(
686 686
     'name' => 'buster_canyon',
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
     'shield' => 300,
699 699
     'armor' => 10000,
700 700
     'attack' => 3000,
701
-    'amplify' => array(SHIP_SPY => 0.17, ),
701
+    'amplify' => array(SHIP_SPY => 0.17,),
702 702
   ),
703 703
 
704 704
   UNIT_DEF_SHIELD_SMALL => array(
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
     'shield' => 2000,
719 719
     'armor' => 2000,
720 720
     'attack' => 1,
721
-    'amplify' => array(SHIP_SPY => 500, ),
721
+    'amplify' => array(SHIP_SPY => 500,),
722 722
   ),
723 723
   UNIT_DEF_SHIELD_BIG => array(
724 724
     'name' => 'big_protection_shield',
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
     'shield' => 2000,
738 738
     'armor' => 10000,
739 739
     'attack' => 1,
740
-    'amplify' => array(SHIP_SPY => 500, ),
740
+    'amplify' => array(SHIP_SPY => 500,),
741 741
   ),
742 742
   UNIT_DEF_SHIELD_PLANET => array(
743 743
     'name'      => 'planet_protector',
Please login to merge, or discard this patch.
includes/vars/vars_menu.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -104,21 +104,21 @@  discard block
 block discarded – undo
104 104
     'LEVEL' => 'submenu',
105 105
     'TYPE'  => 'lang',
106 106
     'ITEM'  => 'tech[UNIT_STRUCTURES]',
107
-    'LINK'  => 'buildings.php?mode=' . QUE_STRUCTURES,
107
+    'LINK'  => 'buildings.php?mode='.QUE_STRUCTURES,
108 108
     'ICON'  => true,
109 109
   ),
110 110
   'menu_planet_shipyard'   => array(
111 111
     'LEVEL' => 'submenu',
112 112
     'TYPE'  => 'lang',
113 113
     'ITEM'  => 'Shipyard',
114
-    'LINK'  => 'buildings.php?mode=' . SUBQUE_FLEET,
114
+    'LINK'  => 'buildings.php?mode='.SUBQUE_FLEET,
115 115
     'ICON'  => true,
116 116
   ),
117 117
   'menu_planet_defense'    => array(
118 118
     'LEVEL' => 'submenu',
119 119
     'TYPE'  => 'lang',
120 120
     'ITEM'  => 'Defense',
121
-    'LINK'  => 'buildings.php?mode=' . SUBQUE_DEFENSE,
121
+    'LINK'  => 'buildings.php?mode='.SUBQUE_DEFENSE,
122 122
     'ICON'  => true,
123 123
   ),
124 124
   'menu_planet_resources'  => array(
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     'LEVEL' => 'submenu',
148 148
     'TYPE'  => 'lang',
149 149
     'ITEM'  => 'Research',
150
-    'LINK'  => 'buildings.php?mode=' . QUE_RESEARCH,
150
+    'LINK'  => 'buildings.php?mode='.QUE_RESEARCH,
151 151
     'ICON'  => true,
152 152
   ),
153 153
   'menu_empire_techtree' => array(
@@ -233,14 +233,14 @@  discard block
 block discarded – undo
233 233
     'LEVEL' => 'submenu',
234 234
     'TYPE'  => 'lang',
235 235
     'ITEM'  => 'tech[UNIT_MERCENARIES]',
236
-    'LINK'  => 'officer.php?mode=' . UNIT_MERCENARIES,
236
+    'LINK'  => 'officer.php?mode='.UNIT_MERCENARIES,
237 237
     'ICON'  => true,
238 238
   ),
239 239
   'menu_empire_schematics'  => array(
240 240
     'LEVEL' => 'submenu',
241 241
     'TYPE'  => 'lang',
242 242
     'ITEM'  => 'tech[UNIT_PLANS]',
243
-    'LINK'  => 'officer.php?mode=' . UNIT_PLANS,
243
+    'LINK'  => 'officer.php?mode='.UNIT_PLANS,
244 244
     'ICON'  => true,
245 245
   ),
246 246
   'menu_empire_artifacts'   => array(
@@ -270,14 +270,14 @@  discard block
 block discarded – undo
270 270
     'LEVEL' => 'submenu',
271 271
     'TYPE'  => 'lang',
272 272
     'ITEM'  => 'Chat',
273
-    'LINK'  => 'index.php?page=chat&mode=' . CHAT_MODE_COMMON,
273
+    'LINK'  => 'index.php?page=chat&mode='.CHAT_MODE_COMMON,
274 274
     'ICON'  => true,
275 275
   ),
276 276
   'menu_ally_chat'     => array(
277 277
     'LEVEL'    => 'submenu',
278 278
     'TYPE'     => 'lang',
279 279
     'ITEM'     => 'AllyChat',
280
-    'LINK'     => 'index.php?page=chat&mode=' . CHAT_MODE_ALLY,
280
+    'LINK'     => 'index.php?page=chat&mode='.CHAT_MODE_ALLY,
281 281
     'ICON'     => true,
282 282
     'DISABLED' => classSupernova::$config->game_mode == GAME_BLITZ,
283 283
   ),
@@ -458,8 +458,8 @@  discard block
 block discarded – undo
458 458
   ),
459 459
   'menu_admin_version_info'  => array(
460 460
     'TYPE' => 'text',
461
-    'ITEM' => (classSupernova::$config->server_updater_check_last ? date(FMT_DATE, classSupernova::$config->server_updater_check_last) : '') . '<div class="' .
462
-      $sn_version_check_class[classSupernova::$config->server_updater_check_result] . '">' . classLocale::$lang['adm_opt_ver_response_short'][classSupernova::$config->server_updater_check_result] . '</div>',
461
+    'ITEM' => (classSupernova::$config->server_updater_check_last ? date(FMT_DATE, classSupernova::$config->server_updater_check_last) : '').'<div class="'.
462
+      $sn_version_check_class[classSupernova::$config->server_updater_check_result].'">'.classLocale::$lang['adm_opt_ver_response_short'][classSupernova::$config->server_updater_check_result].'</div>',
463 463
   ),
464 464
 
465 465
   'USER_AUTHLEVEL_NAME'      => array(
@@ -547,13 +547,13 @@  discard block
 block discarded – undo
547 547
   'menu_admin_planet_list_planets' => array(
548 548
     'TYPE'       => 'lang',
549 549
     'ITEM'       => 'adm_pltlst',
550
-    'LINK'       => 'admin/adm_planet_list.php?planet_type=' . PT_PLANET,
550
+    'LINK'       => 'admin/adm_planet_list.php?planet_type='.PT_PLANET,
551 551
     'AUTH_LEVEL' => 3,
552 552
   ),
553 553
   'menu_admin_planet_list_moons'   => array(
554 554
     'TYPE'       => 'lang',
555 555
     'ITEM'       => 'adm_moonlst',
556
-    'LINK'       => 'admin/adm_planet_list.php?planet_type=' . PT_MOON,
556
+    'LINK'       => 'admin/adm_planet_list.php?planet_type='.PT_MOON,
557 557
     'AUTH_LEVEL' => 3,
558 558
   ),
559 559
   'menu_admin_planet_moon_add'     => array(
Please login to merge, or discard this patch.
includes/alliance/ali_external_search.inc 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) {
3
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) {
4 4
   classSupernova::$debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
5 5
 }
6 6
 
7 7
 $template = gettemplate('ali_search', true);
8 8
 
9 9
 $ali_search_text = sys_get_param_str('searchtext');
10
-if($ali_search_text) {
10
+if ($ali_search_text) {
11 11
   $template->assign_var('SEARCH_TEXT', $ali_search_text);
12 12
 
13 13
   $search = DBStaticAlly::db_ally_search_by_name_or_tag($ali_search_text);
14
-  if(classSupernova::$db->db_num_rows($search)) {
15
-    while($ally_row = db_fetch($search)) {
14
+  if (classSupernova::$db->db_num_rows($search)) {
15
+    while ($ally_row = db_fetch($search)) {
16 16
       $template->assign_block_vars('alliances', array(
17 17
         'ID'          => $ally_row['id'],
18 18
         'TAG'         => $ally_row['ally_tag'],
Please login to merge, or discard this patch.
tests.int/FleetTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 define('SN_IN_FLEET', true);
6 6
 define('SN_RENDER_NAVBAR_PLANET', true);
7 7
 
8
-include('../common.' . substr(strrchr(__FILE__, '.'), 1));
8
+include('../common.'.substr(strrchr(__FILE__, '.'), 1));
9 9
 
10 10
 // TODO - Переместить это куда-нибудь
11 11
 $fleet_page = sys_get_param_int('fleet_page', sys_get_param_int('mode'));
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
 //  break;
193 193
     }
194 194
 
195
-    if($exceptionCode !== null) {
196
-      print('<span style="color: red; font-size: 200%;">FAILED! Expected Exception [' . $exceptionCode . ']: "' . classLocale::$lang['fl_attack_error'][$exceptionCode] . '" - FAILED!</span><br />');
195
+    if ($exceptionCode !== null) {
196
+      print('<span style="color: red; font-size: 200%;">FAILED! Expected Exception ['.$exceptionCode.']: "'.classLocale::$lang['fl_attack_error'][$exceptionCode].'" - FAILED!</span><br />');
197 197
       print('<div style="color: red; font-size: 200%;">NO EXCEPTION RAISED</div>');
198 198
       pdie();
199 199
     } else {
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
     if ($exceptionCode !== null && $e->getCode() === $exceptionCode) {
204 204
 //      print('<span style="color: darkgreen;">Exception [' . $exceptionCode . ']: "' . classLocale::$lang['fl_attack_error'][$exceptionCode] . '" - passed</span><br />');
205 205
     } else {
206
-      print('<div style="color: red; font-size: 200%;">Expected Exception [' . $exceptionCode . ']: "' . classLocale::$lang['fl_attack_error'][$exceptionCode] . '" - FAILED!</div>');
207
-      print('<div style="color: red; font-size: 200%;">Got Exception [' . $e->getCode() . ']: "' . $e->getMessage() . '"/"' . classLocale::$lang['fl_attack_error'][$e->getCode()] . '" . "</div>');
206
+      print('<div style="color: red; font-size: 200%;">Expected Exception ['.$exceptionCode.']: "'.classLocale::$lang['fl_attack_error'][$exceptionCode].'" - FAILED!</div>');
207
+      print('<div style="color: red; font-size: 200%;">Got Exception ['.$e->getCode().']: "'.$e->getMessage().'"/"'.classLocale::$lang['fl_attack_error'][$e->getCode()].'" . "</div>');
208 208
       throw $e;
209 209
     }
210 210
   }
Please login to merge, or discard this patch.
buddy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
3
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
4 4
 
5 5
 $template = gettemplate('viewreport', true);
6 6
 $template->assign_var('PAGE_HINT', classLocale::$lang['cr_view_hint']);
Please login to merge, or discard this patch.
includes/functions/qst_quest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     $template->assign_vars($quest_templatized);
180 180
     if (!empty($quest_templatized['quest_rewards_list'])) {
181 181
       foreach ($quest_templatized['quest_rewards_list'] as $quest_reward) {
182
-        $template->assign_block_vars(($block_name ? $block_name . '.' : '') . 'quest_rewards_list', $quest_reward);
182
+        $template->assign_block_vars(($block_name ? $block_name.'.' : '').'quest_rewards_list', $quest_reward);
183 183
       }
184 184
     }
185 185
   }
@@ -248,10 +248,10 @@  discard block
 block discarded – undo
248 248
 
249 249
         $comment_reward = array();
250 250
         foreach ($reward_list as $unit_id => $unit_amount) {
251
-          $comment_reward[] = $unit_amount . ' ' . classLocale::$lang['tech'][$unit_id];
251
+          $comment_reward[] = $unit_amount.' '.classLocale::$lang['tech'][$unit_id];
252 252
           $total_rewards[$user_id][$planet_id][$unit_id] += $unit_amount;
253 253
         }
254
-        $comment .= " {$classLocale['qst_msg_your_reward']} " . implode(',', $comment_reward);
254
+        $comment .= " {$classLocale['qst_msg_your_reward']} ".implode(',', $comment_reward);
255 255
 
256 256
         DBStaticMessages::msg_send_simple_message($user['id'], 0, SN_TIME_NOW, MSG_TYPE_ADMIN, classLocale::$lang['msg_from_admin'], classLocale::$lang['qst_msg_complete_subject'], $comment);
257 257
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 
290 290
         if (!empty($resourcesChange)) {
291 291
           $planet_id = $planet_id == 0 && isset($user_row['id_planet']) ? $user_row['id_planet'] : $planet_id;
292
-          if($planet_id) {
292
+          if ($planet_id) {
293 293
             // update planet
294 294
             DBStaticPlanet::db_planet_update_resources($resourcesChange, $planet_id);
295 295
           } else {
Please login to merge, or discard this patch.
admin/adm_message_list.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 define('INSTALL', false);
13 13
 define('IN_ADMIN', true);
14 14
 
15
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
15
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
16 16
 
17
-if($user['authlevel'] < 3) {
17
+if ($user['authlevel'] < 3) {
18 18
   AdminMessage(classLocale::$lang['adm_err_denied']);
19 19
 }
20 20
 
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
   ),
29 29
 );
30 30
 $template->assign_block_vars('int_type_selected', $allowed_types[-1]);
31
-foreach(DBStaticMessages::$snMessageClassList as $key => $value) {
32
-  if($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX) {
31
+foreach (DBStaticMessages::$snMessageClassList as $key => $value) {
32
+  if ($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX) {
33 33
     continue;
34 34
   }
35 35
 
@@ -41,21 +41,21 @@  discard block
 block discarded – undo
41 41
 
42 42
 
43 43
 $deletedMessages = '';
44
-if($idMessageDelete = sys_get_param_id('msg_del')) {
44
+if ($idMessageDelete = sys_get_param_id('msg_del')) {
45 45
   DBStaticMessages::db_message_delete_by_id($idMessageDelete);
46 46
   $deletedMessages = $idMessageDelete;
47
-} elseif(sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete)) {
47
+} elseif (sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete)) {
48 48
   $message_delete = implode(', ', $message_delete);
49 49
   DBStaticMessages::db_message_list_delete_set($message_delete);
50 50
   $deletedMessages = $message_delete;
51 51
 }
52 52
 
53
-if($deletedMessages) {
53
+if ($deletedMessages) {
54 54
   $template->assign_block_vars('result', array('MESSAGE' => sprintf(classLocale::$lang['mlst_messages_deleted'], $deletedMessages)));
55 55
 }
56 56
 
57 57
 
58
-if(sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year'))) {
58
+if (sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year'))) {
59 59
   $delete_date = "{$year}-{$month}-{$day}";
60 60
   DBStaticMessages::db_message_list_delete_by_date($delete_date, $int_type_selected);
61 61
   $template->assign_block_vars('result', array('MESSAGE' => sprintf(classLocale::$lang['mlst_messages_deleted_date'], $allowed_types[$int_type_selected]['TEXT'], $delete_date)));
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 
68 68
 $int_page_current = min(sys_get_param_id('int_page_current', 1), $page_max);
69 69
 
70
-if(sys_get_param('page_prev') && $int_page_current > 1) {
70
+if (sys_get_param('page_prev') && $int_page_current > 1) {
71 71
   $int_page_current--;
72
-} elseif(sys_get_param('page_next') && $int_page_current < $page_max) {
72
+} elseif (sys_get_param('page_next') && $int_page_current < $page_max) {
73 73
   $int_page_current++;
74 74
 }
75 75
 
76
-for($i = 1; $i <= $page_max; $i++) {
76
+for ($i = 1; $i <= $page_max; $i++) {
77 77
   $template->assign_block_vars('page', array('NUMBER' => $i));
78 78
 }
79 79
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 $StartRec = ($int_page_current - 1) * 25;
82 82
 
83 83
 $Messages = DBStaticMessages::db_message_list_admin_by_type($int_type_selected, $StartRec);
84
-while($row = db_fetch($Messages)) {
84
+while ($row = db_fetch($Messages)) {
85 85
   $row['FROM'] = htmlentities($row['FROM'], ENT_COMPAT, 'UTF-8');
86 86
   $row['OWNER_NAME'] = htmlentities($row['OWNER_NAME'], ENT_COMPAT, 'UTF-8');
87 87
   $row['TEXT'] = nl2br($row['TEXT']);
Please login to merge, or discard this patch.
announce.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  */
10 10
 
11 11
 $allow_anonymous = true;
12
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
12
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
13 13
 
14 14
 nws_mark_read($user);
15 15
 $template = gettemplate('announce', true);
@@ -23,42 +23,42 @@  discard block
 block discarded – undo
23 23
 $mode = sys_get_param_str('mode');
24 24
 
25 25
 $announce = array();
26
-if($user['authlevel'] >= 3) {
27
-  if(!empty($text)) {
26
+if ($user['authlevel'] >= 3) {
27
+  if (!empty($text)) {
28 28
     $announce_time = strtotime($announce_time, SN_TIME_NOW);
29 29
     $announce_time = $announce_time ? $announce_time : SN_TIME_NOW;
30 30
 
31
-    if($mode == 'edit') {
31
+    if ($mode == 'edit') {
32 32
       DBStaticNews::db_news_update_set($announce_time, $text, $detail_url, $announce_id);
33 33
       DBStaticSurvey::db_survey_delete_by_id($announce_id);
34 34
     } else {
35 35
       DBStaticNews::db_news_insert_set($announce_time, $text_unsafe, $detail_url_unsafe, $user['id'], $user['username']);
36 36
       $announce_id = classSupernova::$db->db_insert_id();
37 37
     }
38
-    if(($survey_question = sys_get_param_str('survey_question')) && ($survey_answers = sys_get_param('survey_answers'))) {
38
+    if (($survey_question = sys_get_param_str('survey_question')) && ($survey_answers = sys_get_param('survey_answers'))) {
39 39
       $survey_answers = explode("\r\n", $survey_answers);
40 40
       $survey_until = strtotime($survey_until = sys_get_param_str('survey_until'), SN_TIME_NOW);
41 41
       $survey_until = date(FMT_DATE_TIME_SQL, $survey_until ? $survey_until : SN_TIME_NOW + PERIOD_DAY * 1);
42 42
       $survey_question_unsafe = sys_get_param_str_unsafe('survey_question');
43 43
       DBStaticSurvey::db_survey_insert($announce_id, $survey_question_unsafe, $survey_until);
44 44
       $survey_id = classSupernova::$db->db_insert_id();
45
-      foreach($survey_answers as $survey_answer) {
45
+      foreach ($survey_answers as $survey_answer) {
46 46
         $survey_answer_unsafe = trim($survey_answer);
47
-        if(empty($survey_answer_unsafe)) {
47
+        if (empty($survey_answer_unsafe)) {
48 48
           continue;
49 49
         }
50 50
         DBStaticSurveyAnswer::db_survey_answer_insert($survey_id, $survey_answer_unsafe);
51 51
       }
52 52
     }
53 53
 
54
-    if($announce_time <= SN_TIME_NOW) {
55
-      if($announce_time > classSupernova::$config->var_news_last && $announce_time == SN_TIME_NOW) {
54
+    if ($announce_time <= SN_TIME_NOW) {
55
+      if ($announce_time > classSupernova::$config->var_news_last && $announce_time == SN_TIME_NOW) {
56 56
         classSupernova::$config->db_saveItem('var_news_last', $announce_time);
57 57
       }
58 58
 
59
-      if(sys_get_param_int('news_mass_mail')) {
59
+      if (sys_get_param_int('news_mass_mail')) {
60 60
         $lang_news_more = classLocale::$lang['news_more'];
61
-        $text = sys_get_param('text') . ($detail_url ? " <a href=\"{$detail_url}\"><span class=\"positive\">{$lang_news_more}</span></a>" : '');
61
+        $text = sys_get_param('text').($detail_url ? " <a href=\"{$detail_url}\"><span class=\"positive\">{$lang_news_more}</span></a>" : '');
62 62
         DBStaticMessages::msgSendFromAdmin('*', classLocale::$lang['news_title'], $text);
63 63
       }
64 64
     }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
   }
69 69
 
70 70
   $survey_answers = '';
71
-  switch($mode) {
71
+  switch ($mode) {
72 72
     case 'del':
73 73
       DBStaticNews::db_news_delete_by_id($announce_id);
74 74
       $mode = '';
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
       $template->assign_var('ID', $announce_id);
80 80
     case 'copy':
81 81
       $announce = DBStaticNews::db_news_with_survey_select_by_id($announce_id);
82
-      if($announce['survey_id']) {
82
+      if ($announce['survey_id']) {
83 83
         $query = DBStaticSurveyAnswer::db_survey_answer_text_select_by_news($announce);
84
-        while($row = db_fetch($query)) {
84
+        while ($row = db_fetch($query)) {
85 85
           $survey_answers[] = $row['survey_answer_text'];
86 86
         }
87 87
         $survey_answers = implode("\r\n", $survey_answers);
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     break;
90 90
   }
91 91
 } else {
92
-  $annQuery = 'WHERE UNIX_TIMESTAMP(`tsTimeStamp`) <= ' . SN_TIME_NOW;
92
+  $annQuery = 'WHERE UNIX_TIMESTAMP(`tsTimeStamp`) <= '.SN_TIME_NOW;
93 93
 }
94 94
 
95 95
 nws_render($template, $annQuery, 20);
Please login to merge, or discard this patch.
notes.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 use Vector\Vector;
12 12
 
13
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
13
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
14 14
 lng_include('notes');
15 15
 
16 16
 global $user;
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
 $template = gettemplate('notes', true);
19 19
 
20 20
 $result = array();
21
-if(($result_message = sys_get_param_str('MESSAGE')) && isset(classLocale::$lang[$result_message])) {
21
+if (($result_message = sys_get_param_str('MESSAGE')) && isset(classLocale::$lang[$result_message])) {
22 22
   $result[] = array('STATUS' => sys_get_param_int('STATUS'), 'MESSAGE' => classLocale::$lang[$result_message]);
23 23
 }
24 24
 
25 25
 $note_id_edit = sys_get_param_id('note_id_edit');
26 26
 $note_title_unsafe = sys_get_param_str_unsafe('note_title');
27 27
 $note_text_unsafe = sys_get_param_str_unsafe('note_text');
28
-if(sys_get_param('note_delete')) {
28
+if (sys_get_param('note_delete')) {
29 29
   try {
30 30
     DBStaticNote::processDelete($user, $note_id_edit);
31
-  } catch(Exception $e) {
31
+  } catch (Exception $e) {
32 32
     $note_id_edit = 0;
33 33
     sn_db_transaction_rollback();
34 34
     $result[] = array(
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
       'MESSAGE' => classLocale::$lang[$e->getMessage()],
37 37
     );
38 38
   }
39
-} elseif(($note_title_unsafe = sys_get_param_str_unsafe('note_title')) || ($note_text_unsafe = sys_get_param_str('note_text'))) {
39
+} elseif (($note_title_unsafe = sys_get_param_str_unsafe('note_title')) || ($note_text_unsafe = sys_get_param_str('note_text'))) {
40 40
   $note_title_unsafe == classLocale::$lang['note_new_title'] ? $note_title_unsafe = '' : false;
41 41
   $note_text_unsafe == classLocale::$lang['note_new_text'] ? $note_text_unsafe = '' : false;
42 42
   try {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     $note_system = max(0, min(sys_get_param_id('note_system'), Vector::$knownSystems));
45 45
     $note_planet = max(0, min(sys_get_param_id('note_planet'), Vector::$knownPlanets + 1));
46 46
 
47
-    if(!$note_text_unsafe && !$note_title_unsafe && !$note_galaxy && !$note_system && !$note_planet) {
47
+    if (!$note_text_unsafe && !$note_title_unsafe && !$note_galaxy && !$note_system && !$note_planet) {
48 48
       throw new Exception('note_err_note_empty', ERR_WARNING);
49 49
     }
50 50
 
@@ -53,15 +53,15 @@  discard block
 block discarded – undo
53 53
     $note_sticky = intval(sys_get_param_id('note_sticky')) ? 1 : 0;
54 54
 
55 55
     sn_db_transaction_start();
56
-    if($note_id_edit) {
56
+    if ($note_id_edit) {
57 57
       $check_note_id = DBStaticNote::db_note_get_id_and_owner($note_id_edit);
58
-      if(!$check_note_id) {
58
+      if (!$check_note_id) {
59 59
         throw new Exception('note_err_note_not_found', ERR_ERROR);
60 60
       }
61 61
     }
62 62
 
63
-    if($note_id_edit) {
64
-      if($check_note_id['owner'] != $user['id']) {
63
+    if ($note_id_edit) {
64
+      if ($check_note_id['owner'] != $user['id']) {
65 65
         throw new Exception('note_err_owner_wrong', ERR_ERROR);
66 66
       }
67 67
 
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
     }
72 72
 
73 73
     sn_db_transaction_commit();
74
-    sys_redirect('notes.php?STATUS=' . ERR_NONE . '&MESSAGE=' . ($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added'));
74
+    sys_redirect('notes.php?STATUS='.ERR_NONE.'&MESSAGE='.($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added'));
75 75
 //    throw new exception($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added', ERR_NONE);
76
-  } catch(Exception $e) {
76
+  } catch (Exception $e) {
77 77
     $note_id_edit = 0;
78 78
     sn_db_transaction_rollback();
79 79
     $result[] = array(
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
   }
84 84
 }
85 85
 
86
-if(!$note_id_edit) {
86
+if (!$note_id_edit) {
87 87
   note_assign($template, array(
88 88
     'id'          => 0,
89 89
     'time'        => SN_TIME_NOW,
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
 
97 97
 $note_exist = false;
98 98
 $notes_query = DBStaticNote::db_note_list_by_owner($user['id']);
99
-while($note_row = db_fetch($notes_query)) {
99
+while ($note_row = db_fetch($notes_query)) {
100 100
   note_assign($template, $note_row);
101 101
   $note_exist = $note_exist || $note_row['id'] == $note_id_edit;
102 102
 }
103 103
 $note_id_edit = $note_exist ? $note_id_edit : 0;
104 104
 
105
-foreach($note_priority_classes as $note_priority_id => $note_priority_class) {
105
+foreach ($note_priority_classes as $note_priority_id => $note_priority_class) {
106 106
   $template->assign_block_vars('note_priority', array(
107 107
     'ID'    => $note_priority_id,
108 108
     'CLASS' => $note_priority_classes[$note_priority_id],
@@ -110,14 +110,14 @@  discard block
 block discarded – undo
110 110
   ));
111 111
 }
112 112
 
113
-foreach(classLocale::$lang['sys_planet_type'] as $planet_type_id => $planet_type_string) {
113
+foreach (classLocale::$lang['sys_planet_type'] as $planet_type_id => $planet_type_string) {
114 114
   $template->assign_block_vars('planet_type', array(
115 115
     'ID'   => $planet_type_id,
116 116
     'TEXT' => $planet_type_string,
117 117
   ));
118 118
 }
119 119
 
120
-foreach($result as $result_data) {
120
+foreach ($result as $result_data) {
121 121
   $template->assign_block_vars('result', $result_data);
122 122
 }
123 123
 
Please login to merge, or discard this patch.