Completed
Push — work-fleets ( 094cef...4ec5b3 )
by SuperNova.WS
06:12
created
includes/pages/imperium.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -22,17 +22,17 @@  discard block
 block discarded – undo
22 22
   $sn_group_factories = sn_get_groups('factories');
23 23
   $planet_density = sn_get_groups('planet_density');
24 24
 
25
-  if(sys_get_param('save_production')) {
25
+  if (sys_get_param('save_production')) {
26 26
     $production = sys_get_param('percent');
27
-    if(is_array($production) && !empty($production)) {
27
+    if (is_array($production) && !empty($production)) {
28 28
       // sn_db_transaction_start();
29 29
       $query = array();
30 30
       $planet_row_list = db_planet_list_sorted($user, false, '*');
31 31
       // while($planet = db_fetch($planet_row_list))
32
-      foreach($planet_row_list as $planet) {
33
-        foreach($sn_group_factories as $factory_unit_id) {
32
+      foreach ($planet_row_list as $planet) {
33
+        foreach ($sn_group_factories as $factory_unit_id) {
34 34
           $unit_db_name_porcent = pname_factory_production_field_name($factory_unit_id);
35
-          if(
35
+          if (
36 36
             get_unit_param($factory_unit_id, P_MINING_IS_MANAGED)
37 37
             && isset($production[$factory_unit_id][$planet['id']])
38 38
             && ($actual_porcent = intval($production[$factory_unit_id][$planet['id']] / 10)) >= 0
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
           }
44 44
         }
45 45
       }
46
-      foreach($query as $planet_id => $query_data) {
46
+      foreach ($query as $planet_id => $query_data) {
47 47
         db_planet_set_by_id($planet_id, implode(',', $query_data));
48 48
       }
49 49
       // sn_db_transaction_commit();
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
   $planet_row_list = db_planet_list_sorted($user);
54 54
   // while ($planet = db_fetch($planet_row_list))
55
-  foreach($planet_row_list as $planet) {
55
+  foreach ($planet_row_list as $planet) {
56 56
     sn_db_transaction_start();
57 57
     $global_data = sys_o_get_updated($user, $planet['id'], SN_TIME_NOW, false, true);
58 58
     $planets[$planet['id']] = $global_data['planet'];
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
   $template = gettemplate('imperium', $template);
65 65
   $template->assign_var('amount', count($planets) + 2);
66 66
 
67
-  for($i = 100; $i >= 0; $i -= 10) {
67
+  for ($i = 100; $i >= 0; $i -= 10) {
68 68
     $template->assign_block_vars('percent', array('PERCENT' => $i));
69 69
   }
70 70
 
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
   $total['temp_min'] = 1000;
75 75
   $total['temp_max'] = -999;
76 76
 
77
-  foreach($planets as $planet_index => &$planet) {
77
+  foreach ($planets as $planet_index => &$planet) {
78 78
     $list_planet_que = $ques[$planet_index];
79 79
     $planet_template = tpl_parse_planet($planet);
80 80
 
81 81
     $planet_fleet_id = 0;
82
-    $fleet_list = $planet_template['fleet_list'];//flt_get_fleets_to_planet($planet);
83
-    if($fleet_list['own']['count']) {
82
+    $fleet_list = $planet_template['fleet_list']; //flt_get_fleets_to_planet($planet);
83
+    if ($fleet_list['own']['count']) {
84 84
       $planet_fleet_id = "p{$fleet_id}";
85 85
       $fleets[] = tpl_parse_fleet_sn($fleet_list['own']['total'], $planet_fleet_id);
86 86
       $fleet_id++;
@@ -141,17 +141,17 @@  discard block
 block discarded – undo
141 141
     UNIT_DEFENCE            => 'defense',
142 142
   );
143 143
 
144
-  foreach($show_groups as $unit_group_id => $mode) {
144
+  foreach ($show_groups as $unit_group_id => $mode) {
145 145
     $template->assign_block_vars('prods', array(
146 146
       'NAME' => classLocale::$lang['tech'][$unit_group_id],
147 147
     ));
148 148
     $unit_group = get_unit_param('techtree', $unit_group_id);
149
-    foreach($unit_group as $unit_id) {
149
+    foreach ($unit_group as $unit_id) {
150 150
       $unit_count = $unit_count_abs = 0;
151 151
       $block_vars = array();
152 152
       $unit_is_factory = in_array($unit_id, $sn_group_factories) && get_unit_param($unit_id, P_MINING_IS_MANAGED);
153 153
       // $unit_db_name = pname_resource_name($unit_id);
154
-      foreach($planets as $planet) {
154
+      foreach ($planets as $planet) {
155 155
         $unit_level_plain = mrc_get_level($user, $planet, $unit_id, false, true);
156 156
 
157 157
         $level_plus['FACTORY'] = $unit_is_factory;
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         $level_plus['LEVEL_PLUS_GREEN'] = 0;
160 160
 
161 161
         $level_plus['PERCENT'] = $unit_is_factory ? ($unit_level_plain ? $planet[pname_factory_production_field_name($unit_id)] * 10 : -1) : -1;
162
-        switch($mode) {
162
+        switch ($mode) {
163 163
           /*
164 164
           case 'structures':
165 165
             $level_plus_build = $ques[$planet['id']]['in_que'][que_get_unit_que($unit_id)][$user['id']][$planet['id']][$unit_id];
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
           case 'structures':
180 180
           case 'defense':
181 181
             $level_plus_build = $ques[$planet['id']]['in_que'][que_get_unit_que($unit_id)][$user['id']][$planet['id']][$unit_id];
182
-            if($level_plus_build) {
182
+            if ($level_plus_build) {
183 183
               $level_plus['LEVEL_PLUS_GREEN'] = $level_plus_build < 0 ? $level_plus_build : "+{$level_plus_build}";
184 184
               // $level_plus['LEVEL_PLUS_GREEN'] = "+{$level_plus_build}";
185 185
               $total['units'][$unit_id]['LEVEL_PLUS_GREEN'] += $level_plus['LEVEL_PLUS_GREEN'];
@@ -199,15 +199,15 @@  discard block
 block discarded – undo
199 199
         $unit_count_abs += $unit_level_plain + abs($level_plus['LEVEL_PLUS_YELLOW']) + abs($level_plus['LEVEL_PLUS_GREEN']);
200 200
       }
201 201
 
202
-      if($unit_count_abs) {
202
+      if ($unit_count_abs) {
203 203
         $template->assign_block_vars('prods', array(
204 204
           'ID'    => $unit_id,
205
-          'FIELD' => 'unit_' . $unit_id, // pname_resource_name($unit_id), // TODO Делать это прямо в темплейте
205
+          'FIELD' => 'unit_'.$unit_id, // pname_resource_name($unit_id), // TODO Делать это прямо в темплейте
206 206
           'NAME'  => classLocale::$lang['tech'][$unit_id],
207 207
           'MODE'  => $mode,
208 208
         ));
209 209
 
210
-        foreach($block_vars as $block_var) {
210
+        foreach ($block_vars as $block_var) {
211 211
           $template->assign_block_vars('prods.planet', $block_var);
212 212
         }
213 213
         $unit_green = $total['units'][$unit_id]['LEVEL_PLUS_GREEN'];
Please login to merge, or discard this patch.
includes/functions/eco_planet_update.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 
15 15
   $no_data = array('user' => false, 'planet' => false, 'que' => false);
16 16
 
17
-  if(!$planet) {
17
+  if (!$planet) {
18 18
     return $no_data;
19 19
   }
20 20
 
21
-  if(!$no_user_update) {
21
+  if (!$no_user_update) {
22 22
     $user = intval(is_array($user) && $user['id'] ? $user['id'] : $user);
23
-    if(!$user) {
23
+    if (!$user) {
24 24
       // TODO - Убрать позже
25 25
       print('<h1>СООБЩИТЕ ЭТО АДМИНУ: sys_o_get_updated() - USER пустой!</h1>');
26 26
       $backtrace = debug_backtrace();
@@ -32,17 +32,17 @@  discard block
 block discarded – undo
32 32
     $user = db_user_by_id($user, !$simulation, '*', true);
33 33
   }
34 34
 
35
-  if(empty($user['id'])) {
35
+  if (empty($user['id'])) {
36 36
     return $no_data;
37 37
   }
38 38
 
39
-  if(is_array($planet) && isset($planet['galaxy']) && $planet['galaxy']) {
39
+  if (is_array($planet) && isset($planet['galaxy']) && $planet['galaxy']) {
40 40
     $planet = db_planet_by_vector($planet, '', !$simulation);
41 41
   } else {
42 42
     $planet = intval(is_array($planet) && isset($planet['id']) ? $planet['id'] : $planet);
43 43
     $planet = db_planet_by_id($planet, !$simulation);
44 44
   }
45
-  if(!is_array($planet) || !isset($planet['id'])) {
45
+  if (!is_array($planet) || !isset($planet['id'])) {
46 46
     return $no_data;
47 47
   }
48 48
 
@@ -65,19 +65,19 @@  discard block
 block discarded – undo
65 65
     RES_DEUTERIUM => 0,
66 66
   );
67 67
 
68
-  switch($planet['planet_type']) {
68
+  switch ($planet['planet_type']) {
69 69
     case PT_PLANET:
70
-      foreach($resources_increase as $resource_id => &$increment) {
70
+      foreach ($resources_increase as $resource_id => &$increment) {
71 71
         $resource_name = pname_resource_name($resource_id);
72 72
         $increment = $caps_real['total'][$resource_id] * $ProductionTime / 3600;
73 73
         $store_free = $caps_real['total_storage'][$resource_id] - $planet[$resource_name];
74 74
         $increment = min($increment, max(0, $store_free));
75 75
 
76
-        if($planet[$resource_name] + $increment < 0 && !$simulation) {
76
+        if ($planet[$resource_name] + $increment < 0 && !$simulation) {
77 77
           classSupernova::$debug->warning("Player ID {$user['id']} have negative resources on ID {$planet['id']}.{$planet['planet_type']} [{$planet['galaxy']}:{$planet['system']}:{$planet['planet']}]. Difference {$planet[$resource_name]} of {$resource_name}", 'Negative Resources', 501);
78 78
         }
79 79
         $planet[$resource_name] += $increment;
80
-        $planet[$resource_name . '_perhour'] = $caps_real['total'][$resource_id];
80
+        $planet[$resource_name.'_perhour'] = $caps_real['total'][$resource_id];
81 81
       }
82 82
     break;
83 83
 
@@ -94,13 +94,13 @@  discard block
 block discarded – undo
94 94
   // TODO пересчитывать размер планеты только при постройке чего-нибудь и при покупке сектора
95 95
   $planet['field_current'] = 0;
96 96
   $sn_group_build_allow = sn_get_groups('build_allow');
97
-  if(is_array($sn_group_build_allow[$planet['planet_type']])) {
98
-    foreach($sn_group_build_allow[$planet['planet_type']] as $building_id) {
97
+  if (is_array($sn_group_build_allow[$planet['planet_type']])) {
98
+    foreach ($sn_group_build_allow[$planet['planet_type']] as $building_id) {
99 99
       $planet['field_current'] += mrc_get_level($user, $planet, $building_id, !$simulation, true);
100 100
     }
101 101
   }
102 102
 
103
-  if($simulation) {
103
+  if ($simulation) {
104 104
     return array('user' => $user, 'planet' => $planet, 'que' => $que);
105 105
   }
106 106
 
Please login to merge, or discard this patch.
includes/functions/ali_alliances.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,10 +3,10 @@  discard block
 block discarded – undo
3 3
 function ali_rank_list_save($ranks) {
4 4
   global $user;
5 5
 
6
-  if(!empty($ranks)) {
7
-    foreach($ranks as $rank => $rights) {
6
+  if (!empty($ranks)) {
7
+    foreach ($ranks as $rank => $rights) {
8 8
       $rights = implode(',', $rights);
9
-      $ranklist .= $rights . ';';
9
+      $ranklist .= $rights.';';
10 10
     }
11 11
   }
12 12
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
   $temp_array = array();
23 23
   $query = db_ally_diplomacy_get_relations($ally_from, $ally_to);
24 24
 
25
-  while($record = db_fetch($query)) {
25
+  while ($record = db_fetch($query)) {
26 26
     $temp_array[$record['alliance_diplomacy_contr_ally_id']] = $record;
27 27
   }
28 28
 
Please login to merge, or discard this patch.
includes/functions/lng_language.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 // ----------------------------------------------------------------------------------------------------------------
4 4
 function lng_try_filepath($path, $file_path_relative)
5 5
 {
6
-  $file_path = SN_ROOT_PHYSICAL . ($path && file_exists(SN_ROOT_PHYSICAL . $path . $file_path_relative) ? $path : '') . $file_path_relative;
6
+  $file_path = SN_ROOT_PHYSICAL.($path && file_exists(SN_ROOT_PHYSICAL.$path.$file_path_relative) ? $path : '').$file_path_relative;
7 7
   return file_exists($file_path) ? $file_path : false;
8 8
 }
9 9
 
Please login to merge, or discard this patch.
includes/functions/sys_maintenance.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@  discard block
 block discarded – undo
22 22
     ),
23 23
   );
24 24
 
25
-  foreach($queries as &$query) {
26
-    if(!empty($query['query'])) {
25
+  foreach ($queries as &$query) {
26
+    if (!empty($query['query'])) {
27 27
       $query['result'] = doquery($query['query']);
28
-    } elseif(!empty($query['callable']) && is_callable($query['callable'])) {
28
+    } elseif (!empty($query['callable']) && is_callable($query['callable'])) {
29 29
       call_user_func($query['callable']);
30 30
     }
31 31
     $query['error'] = classSupernova::$db->db_error();
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
   $today_array = array($today_array['seconds'], $today_array['minutes'], $today_array['hours'], $today_array['mday'], $today_array['mon'], $today_array['year']);
70 70
 //  pdump($prev_run_array);
71 71
   $scheduleList = explode(',', $scheduleList);
72
-  array_walk($scheduleList, function (&$schedule) use ($prev_run_array, $today_array, $date_part_names_reverse, &$possible_schedules) {
72
+  array_walk($scheduleList, function(&$schedule) use ($prev_run_array, $today_array, $date_part_names_reverse, &$possible_schedules) {
73 73
     // pdump($schedule);
74 74
     $schedule = array('schedule_array' => array_reverse(explode(':', trim($schedule))));
75 75
 
@@ -81,21 +81,21 @@  discard block
 block discarded – undo
81 81
     */
82 82
     // pdump($schedule);
83 83
 
84
-    foreach($prev_run_array as $index => $date_part) {
84
+    foreach ($prev_run_array as $index => $date_part) {
85 85
       $schedule['array']['recorded'][$index] = isset($schedule['schedule_array'][$index]) ? intval($schedule['schedule_array'][$index]) : $date_part;
86 86
       $schedule['array']['now'][$index] = isset($schedule['schedule_array'][$index]) ? intval($schedule['schedule_array'][$index]) : $today_array[$index];
87 87
     }
88
-    if($schedule['array']['recorded'] == $schedule['array']['now']) {
88
+    if ($schedule['array']['recorded'] == $schedule['array']['now']) {
89 89
       unset($schedule['array']['now']);
90 90
     }
91 91
 
92
-    foreach($schedule['array'] as $name => $array) {
92
+    foreach ($schedule['array'] as $name => $array) {
93 93
       $schedule['string'][$name] = "{$array[5]}-{$array[4]}-{$array[3]} {$array[2]}:{$array[1]}:{$array[0]}";
94
-      $schedule['string'][$name . '_next'] = $schedule['string'][$name] . ' +1 ' . $interval;
95
-      $schedule['string'][$name . '_prev'] = $schedule['string'][$name] . ' -1 ' . $interval;
94
+      $schedule['string'][$name.'_next'] = $schedule['string'][$name].' +1 '.$interval;
95
+      $schedule['string'][$name.'_prev'] = $schedule['string'][$name].' -1 '.$interval;
96 96
     }
97 97
 
98
-    foreach($schedule['string'] as $string) {
98
+    foreach ($schedule['string'] as $string) {
99 99
       $timestamp = strtotime($string);
100 100
       $schedule['timestamp'][$timestamp] = $possible_schedules[$timestamp] = date(FMT_DATE_TIME_SQL, strtotime($string));
101 101
     }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
   $prev_run = 0;
129 129
   $next_run = 0;
130
-  foreach($possible_schedules as $timestamp => $string_date) {
130
+  foreach ($possible_schedules as $timestamp => $string_date) {
131 131
     $prev_run = SN_TIME_NOW >= $timestamp ? $timestamp : $prev_run;
132 132
     $next_run = SN_TIME_NOW < $timestamp && !$next_run ? $timestamp : $next_run;
133 133
 //    pdump($schedule, '$schedule ' . date(FMT_DATE_TIME_SQL, $schedule));
Please login to merge, or discard this patch.
includes/functions/scheduler_process.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -9,19 +9,19 @@  discard block
 block discarded – undo
9 9
   $ts_var_stat_update = strtotime(classSupernova::$config->db_loadItem('var_stat_update'));
10 10
   $ts_scheduled_update = sys_schedule_get_prev_run(classSupernova::$config->db_loadItem('stats_schedule'), classSupernova::$config->var_stat_update);
11 11
 
12
-  if(sys_get_param_int('admin_update')) {
12
+  if (sys_get_param_int('admin_update')) {
13 13
     define('USER_LEVEL', isset($user['authlevel']) ? $user['authlevel'] : -1);
14
-    if(USER_LEVEL > 0) {
14
+    if (USER_LEVEL > 0) {
15 15
       $is_admin_request = true;
16 16
       $ts_scheduled_update = SN_TIME_NOW;
17 17
     }
18 18
   }
19 19
 
20
-  if($ts_scheduled_update > $ts_var_stat_update) {
20
+  if ($ts_scheduled_update > $ts_var_stat_update) {
21 21
     lng_include('admin');
22 22
     sn_db_transaction_start();
23 23
     $ts_var_stat_update_end = strtotime(classSupernova::$config->db_loadItem('var_stat_update_end'));
24
-    if(SN_TIME_NOW > $ts_var_stat_update_end) {
24
+    if (SN_TIME_NOW > $ts_var_stat_update_end) {
25 25
       $old_server_status = classSupernova::$config->db_loadItem('game_disable');
26 26
       classSupernova::$config->db_saveItem('game_disable', GAME_DISABLE_STAT);
27 27
 
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
 
32 32
       $msg = $is_admin_request ? 'admin request' : 'scheduler';
33 33
       $next_run = date(FMT_DATE_TIME_SQL, sys_schedule_get_prev_run(classSupernova::$config->stats_schedule, classSupernova::$config->var_stat_update, true));
34
-      $msg = "Running stat updates: {$msg}. Config->var_stat_update = " . classSupernova::$config->var_stat_update .
35
-        ', $ts_scheduled_update = ' . date(FMT_DATE_TIME_SQL, $ts_scheduled_update) .
36
-        ', next_stat_update = ' . $next_run;
34
+      $msg = "Running stat updates: {$msg}. Config->var_stat_update = ".classSupernova::$config->var_stat_update.
35
+        ', $ts_scheduled_update = '.date(FMT_DATE_TIME_SQL, $ts_scheduled_update).
36
+        ', next_stat_update = '.$next_run;
37 37
       classSupernova::$debug->warning($msg, 'Stat update', LOG_INFO_STAT_PROCESS);
38 38
       $total_time = microtime(true);
39 39
 
40 40
       // require_once('../includes/sys_stat.php');
41
-      require_once(SN_ROOT_PHYSICAL . 'includes/includes/sys_stat.php');
41
+      require_once(SN_ROOT_PHYSICAL.'includes/includes/sys_stat.php');
42 42
       sys_stat_calculate();
43 43
 
44 44
       $total_time = microtime(true) - $total_time;
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
       classSupernova::$config->db_saveItem('var_stat_update_end', SN_TIME_SQL);
58 58
 
59 59
       classSupernova::$config->db_saveItem('game_disable', $old_server_status);
60
-    } elseif($ts_scheduled_update > $ts_var_stat_update) {
60
+    } elseif ($ts_scheduled_update > $ts_var_stat_update) {
61 61
       $timeout = strtotime(classSupernova::$config->db_loadItem('var_stat_update_end')) - SN_TIME_NOW;
62 62
       $msg = classSupernova::$config->db_loadItem('var_stat_update_msg');
63 63
       $msg = "{$msg} ETA {$timeout} seconds. Please wait...";
64 64
     }
65 65
     sn_db_transaction_rollback();
66
-  } elseif($is_admin_request) {
66
+  } elseif ($is_admin_request) {
67 67
     $msg = 'Stat is up to date';
68 68
   }
69 69
 
Please login to merge, or discard this patch.
includes/classes/UBE/UBEDebug.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
    * @version 41a6.49
12 12
    */
13 13
   public static function unit_dump_header() {
14
-    if(!defined('DEBUG_UBE')) {
14
+    if (!defined('DEBUG_UBE')) {
15 15
       return;
16 16
     }
17 17
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
    * @version 41a6.49
49 49
    */
50 50
   public static function unit_dump(UBEUnit $unit, $desc = '', UBEUnit $before = null) {
51
-    if(!defined('DEBUG_UBE')) {
51
+    if (!defined('DEBUG_UBE')) {
52 52
       return;
53 53
     }
54 54
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 //  print("<td>" . $this->units_lost . "</td>");
76 76
 //  print("<td>" . $this->units_restored . "</td>");
77 77
 //  print("<td>" . $this->capacity . "</td>");
78
-    print("<td>" . round($unit->share_of_side_armor, 4) . "</td>");
78
+    print("<td>".round($unit->share_of_side_armor, 4)."</td>");
79 79
     print('</tr>');
80 80
   }
81 81
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
    * @version 41a6.49
87 87
    */
88 88
   public static function unit_dump_footer() {
89
-    if(!defined('DEBUG_UBE')) {
89
+    if (!defined('DEBUG_UBE')) {
90 90
       return;
91 91
     }
92 92
 
@@ -101,16 +101,16 @@  discard block
 block discarded – undo
101 101
    * @return UBEUnit
102 102
    */
103 103
   public static function unit_dump_defender(UBEUnit $attacking_unit_pool, UBEUnit $defending_unit_pool, $defending_fleet_id) {
104
-    if(!defined('DEBUG_UBE')) {
104
+    if (!defined('DEBUG_UBE')) {
105 105
       return null;
106 106
     }
107 107
 
108 108
     $classLocale = classLocale::$lang;
109 109
 
110
-    print("[{$attacking_unit_pool->unitId}]{$classLocale['tech'][$attacking_unit_pool->unitId]}" .
111
-      ' attacks ' .
112
-      $defending_fleet_id . '@' . "[{$defending_unit_pool->unitId}]{$classLocale['tech'][$defending_unit_pool->unitId]}" .
113
-      ' with ' . pretty_number($defending_unit_pool->attack_income) .
110
+    print("[{$attacking_unit_pool->unitId}]{$classLocale['tech'][$attacking_unit_pool->unitId]}".
111
+      ' attacks '.
112
+      $defending_fleet_id.'@'."[{$defending_unit_pool->unitId}]{$classLocale['tech'][$defending_unit_pool->unitId]}".
113
+      ' with '.pretty_number($defending_unit_pool->attack_income).
114 114
       '<br>'
115 115
     );
116 116
     $before = clone $defending_unit_pool;
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
    * @version 41a6.49
128 128
    */
129 129
   public static function unit_dump_delta(UBEUnit $unit, $field, UBEUnit $before = null) {
130
-    if(!defined('DEBUG_UBE')) {
130
+    if (!defined('DEBUG_UBE')) {
131 131
       return;
132 132
     }
133 133
 
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
     print(pretty_number($unit->$field));
137 137
     print("</td>");
138 138
     print("<td>");
139
-    if(!empty($before)) {
140
-      print('' . pretty_number($unit->$field - $before->$field) . '');
139
+    if (!empty($before)) {
140
+      print(''.pretty_number($unit->$field - $before->$field).'');
141 141
     }
142 142
     print("</td>");
143 143
   }
Please login to merge, or discard this patch.
includes/classes/template.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
   {
62 62
     global $phpbb_root_path, $user;
63 63
 
64
-    if (file_exists($phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template'))
64
+    if (file_exists($phpbb_root_path.'styles/'.$user->theme['template_path'].'/template'))
65 65
     {
66
-      $this->root = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template';
67
-      $this->cachepath = $phpbb_root_path . 'cache/tpl_' . str_replace('_', '-', $user->theme['template_path']) . '_';
66
+      $this->root = $phpbb_root_path.'styles/'.$user->theme['template_path'].'/template';
67
+      $this->cachepath = $phpbb_root_path.'cache/tpl_'.str_replace('_', '-', $user->theme['template_path']).'_';
68 68
 
69 69
       if ($this->orig_tpl_storedb === null)
70 70
       {
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
 
82 82
       if ($user->theme['template_inherits_id'])
83 83
       {
84
-        $this->inherit_root = $phpbb_root_path . 'styles/' . $user->theme['template_inherit_path'] . '/template';
84
+        $this->inherit_root = $phpbb_root_path.'styles/'.$user->theme['template_inherit_path'].'/template';
85 85
       }
86 86
     }
87 87
     else
88 88
     {
89
-      trigger_error('Template path could not be found: styles/' . $user->theme['template_path'] . '/template', E_USER_ERROR);
89
+      trigger_error('Template path could not be found: styles/'.$user->theme['template_path'].'/template', E_USER_ERROR);
90 90
     }
91 91
 
92 92
     $this->_rootref = &$this->_tpldata['.'][0];
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     }
110 110
 
111 111
     $this->root = $template_path;
112
-    $this->cachepath = $phpbb_root_path . 'cache/ctpl_' . str_replace('_', '-', $template_name) . '_';
112
+    $this->cachepath = $phpbb_root_path.'cache/ctpl_'.str_replace('_', '-', $template_name).'_';
113 113
 
114 114
     if ($fallback_template_path !== false)
115 115
     {
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
       }
155 155
 
156 156
       $this->filename[$handle] = $filename;
157
-      $this->files[$handle] = $this->root . '/' . $filename;
157
+      $this->files[$handle] = $this->root.'/'.$filename;
158 158
 
159 159
       if ($this->inherit_root)
160 160
       {
161
-        $this->files_inherit[$handle] = $this->inherit_root . '/' . $filename;
161
+        $this->files_inherit[$handle] = $this->inherit_root.'/'.$filename;
162 162
       }
163 163
     }
164 164
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
     }
236 236
     else
237 237
     {
238
-      eval(' ?>' . $this->compiled_code[$handle] . '<?php ');
238
+      eval(' ?>'.$this->compiled_code[$handle].'<?php ');
239 239
     }
240 240
 
241 241
     return true;
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
     //$user->theme['template_storedb'] = $this->orig_tpl_storedb;
281 281
     //$user->theme['template_inherits_id'] = $this->orig_tpl_inherits_id;
282 282
 
283
-    $filename = $this->cachepath . str_replace('/', '.', $this->filename[$handle]) . DOT_PHP_EX;
283
+    $filename = $this->cachepath.str_replace('/', '.', $this->filename[$handle]).DOT_PHP_EX;
284 284
     //$this->files_template[$handle] = (isset($user->theme['template_id'])) ? $user->theme['template_id'] : 0;
285 285
 
286 286
     $recompile = false;
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 
310 310
     if (!class_exists('template_compile'))
311 311
     {
312
-      include($phpbb_root_path . 'includes/functions_template' . DOT_PHP_EX);
312
+      include($phpbb_root_path.'includes/functions_template'.DOT_PHP_EX);
313 313
     }
314 314
 
315 315
     // Inheritance - we point to another template file for this one. Equality is also used for store_db
@@ -348,10 +348,10 @@  discard block
 block discarded – undo
348 348
       foreach ($ids as $id)
349 349
       {
350 350
         $sql = 'SELECT *
351
-        FROM ' . STYLES_TEMPLATE_DATA_TABLE . '
352
-        WHERE template_id = ' . $id . "
353
-          AND (template_filename = '" . $db->sql_escape($this->filename[$handle]) . "'
354
-            OR template_included " . $db->sql_like_expression($db->any_char . $this->filename[$handle] . ':' . $db->any_char) . ')';
351
+        FROM ' . STYLES_TEMPLATE_DATA_TABLE.'
352
+        WHERE template_id = ' . $id."
353
+          AND (template_filename = '" . $db->sql_escape($this->filename[$handle])."'
354
+            OR template_included " . $db->sql_like_expression($db->any_char.$this->filename[$handle].':'.$db->any_char).')';
355 355
 
356 356
         $result = $db->sql_query($sql);
357 357
         while ($row = $db->sql_fetchrow($result))
@@ -365,14 +365,14 @@  discard block
 block discarded – undo
365 365
       {
366 366
         foreach ($rows as $row)
367 367
         {
368
-          $file = $this->root . '/' . $row['template_filename'];
368
+          $file = $this->root.'/'.$row['template_filename'];
369 369
           $force_reload = false;
370 370
           if ($row['template_id'] != $user->theme['template_id'])
371 371
           {
372 372
             // make sure that we are not overlooking a file not in the db yet
373 373
             if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'] && !file_exists($file))
374 374
             {
375
-              $file = $this->inherit_root . '/' . $row['template_filename'];
375
+              $file = $this->inherit_root.'/'.$row['template_filename'];
376 376
               $this->files[$row['template_filename']] = $file;
377 377
               $this->files_inherit[$row['template_filename']] = $file;
378 378
               $this->files_template[$row['template_filename']] = $user->theme['template_inherits_id'];
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
           else
415 415
           {
416 416
             // Only bother compiling if it doesn't already exist
417
-            if (!file_exists($this->cachepath . str_replace('/', '.', $row['template_filename']) . DOT_PHP_EX))
417
+            if (!file_exists($this->cachepath.str_replace('/', '.', $row['template_filename']).DOT_PHP_EX))
418 418
             {
419 419
               $this->filename[$row['template_filename']] = $row['template_filename'];
420 420
               $compile->compile_write($row['template_filename'], $compile->compile(trim($row['template_data'])));
@@ -425,11 +425,11 @@  discard block
 block discarded – undo
425 425
       }
426 426
       else
427 427
       {
428
-        $file = $this->root . '/' . $row['template_filename'];
428
+        $file = $this->root.'/'.$row['template_filename'];
429 429
 
430 430
         if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'] && !file_exists($file))
431 431
         {
432
-          $file = $this->inherit_root . '/' . $row['template_filename'];
432
+          $file = $this->inherit_root.'/'.$row['template_filename'];
433 433
           $this->files[$row['template_filename']] = $file;
434 434
           $this->files_inherit[$row['template_filename']] = $file;
435 435
           $this->files_template[$row['template_filename']] = $user->theme['template_inherits_id'];
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
       // Re-position template blocks
623 623
       for ($i = sizeof($this->_tpldata[$blockname]); $i > $key; $i--)
624 624
       {
625
-        $this->_tpldata[$blockname][$i] = $this->_tpldata[$blockname][$i-1];
625
+        $this->_tpldata[$blockname][$i] = $this->_tpldata[$blockname][$i - 1];
626 626
         $this->_tpldata[$blockname][$i]['S_ROW_COUNT'] = $i;
627 627
       }
628 628
 
@@ -656,10 +656,10 @@  discard block
 block discarded – undo
656 656
   {
657 657
     $handle = $filename;
658 658
     $this->filename[$handle] = $filename;
659
-    $this->files[$handle] = $this->root . '/' . $filename;
659
+    $this->files[$handle] = $this->root.'/'.$filename;
660 660
     if ($this->inherit_root)
661 661
     {
662
-      $this->files_inherit[$handle] = $this->inherit_root . '/' . $filename;
662
+      $this->files_inherit[$handle] = $this->inherit_root.'/'.$filename;
663 663
     }
664 664
 
665 665
     $filename = $this->_tpl_load($handle);
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
         include($filename);
674 674
         return;
675 675
       }
676
-      eval(' ?>' . $this->compiled_code[$handle] . '<?php ');
676
+      eval(' ?>'.$this->compiled_code[$handle].'<?php ');
677 677
     }
678 678
   }
679 679
 
@@ -685,12 +685,12 @@  discard block
 block discarded – undo
685 685
   {
686 686
     global $phpbb_root_path;
687 687
 
688
-    $file = $phpbb_root_path . $filename;
688
+    $file = $phpbb_root_path.$filename;
689 689
 
690 690
     if (!file_exists($file))
691 691
     {
692 692
       // trigger_error cannot be used here, as the output already started
693
-      echo 'template->_php_include(): File ' . htmlspecialchars($file) . ' does not exist or is empty';
693
+      echo 'template->_php_include(): File '.htmlspecialchars($file).' does not exist or is empty';
694 694
       return;
695 695
     }
696 696
     include($file);
@@ -702,13 +702,13 @@  discard block
 block discarded – undo
702 702
   */
703 703
   function assign_recursive($values, $name = '')
704 704
   {
705
-    if(isset($values['.']))
705
+    if (isset($values['.']))
706 706
     {
707 707
       $values_extra = $values['.'];
708 708
       unset($values['.']);
709 709
     }
710 710
 
711
-    if(!$name)
711
+    if (!$name)
712 712
     {
713 713
       $this->assign_vars($values);
714 714
     }
@@ -717,12 +717,12 @@  discard block
 block discarded – undo
717 717
       $this->assign_block_vars($name, $values);
718 718
     }
719 719
 
720
-    if(isset($values_extra))
720
+    if (isset($values_extra))
721 721
     {
722
-      foreach($values_extra as $sub_array_name => $sub_array)
722
+      foreach ($values_extra as $sub_array_name => $sub_array)
723 723
       {
724
-        $new_name = $name . ($name ? '.' : '') . $sub_array_name;
725
-        foreach($sub_array as $sub_element)
724
+        $new_name = $name.($name ? '.' : '').$sub_array_name;
725
+        foreach ($sub_array as $sub_element)
726 726
         {
727 727
           $this->assign_recursive($sub_element, $new_name);
728 728
         }
Please login to merge, or discard this patch.
includes/classes/db_mysql_v4.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
     !mysql_select_db($settings['name'])
53 53
       ? classSupernova::$debug->error_fatal('DB error - cannot find DB on server', $this->mysql_error())
54 54
       : false;
55
-    !$this->mysql_query('SET SESSION TRANSACTION ISOLATION LEVEL ' . self::DB_MYSQL_TRANSACTION_REPEATABLE_READ . ';')
55
+    !$this->mysql_query('SET SESSION TRANSACTION ISOLATION LEVEL '.self::DB_MYSQL_TRANSACTION_REPEATABLE_READ.';')
56 56
       ? classSupernova::$debug->error_fatal('DB error - cannot set desired isolation level', $this->mysql_error())
57 57
       : false;
58 58
 
Please login to merge, or discard this patch.