Completed
Push — work-fleets ( fff2b6...e0e753 )
by SuperNova.WS
06:54
created
records.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
  * @copyright 2008 by Chlorel for XNova
10 10
  */
11 11
 
12
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
12
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
13 13
 
14
-if(HIDE_BUILDING_RECORDS)
14
+if (HIDE_BUILDING_RECORDS)
15 15
 {
16 16
   return;
17 17
 }
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
 $template = gettemplate('records', true);
20 20
 
21 21
 $user_skip_list_data = sys_stat_get_user_skip_list();
22
-$user_skip_list = empty($user_skip_list_data) ? '' : (' AND p.id_owner NOT IN (' . implode(',', $user_skip_list_data) . ')');
23
-$user_skip_list_un = empty($user_skip_list_data) ? '' : (' AND un.unit_player_id NOT IN (' . implode(',', $user_skip_list_data) . ')');
22
+$user_skip_list = empty($user_skip_list_data) ? '' : (' AND p.id_owner NOT IN ('.implode(',', $user_skip_list_data).')');
23
+$user_skip_list_un = empty($user_skip_list_data) ? '' : (' AND un.unit_player_id NOT IN ('.implode(',', $user_skip_list_data).')');
24 24
 
25
-$user_skip_list_unit = empty($user_skip_list_data) ? '' : (' AND unit_player_id NOT IN (' . implode(',', $user_skip_list_data) . ')');
25
+$user_skip_list_unit = empty($user_skip_list_data) ? '' : (' AND unit_player_id NOT IN ('.implode(',', $user_skip_list_data).')');
26 26
 
27 27
 $show_groups = array(
28 28
   UNIT_TECHNOLOGIES => 'tech',
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 $user_name_cache = array();
36 36
 
37
-foreach($show_groups as $unit_group_id => $mode)
37
+foreach ($show_groups as $unit_group_id => $mode)
38 38
 {
39 39
   $template->assign_block_vars('records', array(
40 40
     'UNIT' => classLocale::$lang['tech'][$unit_group_id],
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
   ));
44 44
   $unit_group = get_unit_param('techtree', $unit_group_id); // TODO - REWRITE!!!!
45 45
 
46
-  foreach($unit_group as $unit_id)
46
+  foreach ($unit_group as $unit_id)
47 47
   {
48 48
     $unit_name = &classLocale::$lang['tech'][$unit_id];
49
-    if($unit_name)
49
+    if ($unit_name)
50 50
     {
51 51
       // TODO - ISUNITSTACKABLE!
52 52
       $data_row = $unit_group_id == UNIT_SHIPS || $unit_group_id == UNIT_DEFENCE ? db_unit_records_sum($unit_id, $user_skip_list_unit) : db_unit_records_plain($unit_id, $user_skip_list_unit);
53 53
 
54
-      if($data_row)
54
+      if ($data_row)
55 55
       {
56 56
         $template->assign_block_vars('records', array(
57 57
           'UNIT' => $unit_name,
Please login to merge, or discard this patch.
phalanx.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,24 +11,24 @@  discard block
 block discarded – undo
11 11
  * @copyright 2008 by Pada for XNova.project.es
12 12
  */
13 13
 
14
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
14
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
15 15
 
16 16
 lng_include('overview');
17 17
 lng_include('universe');
18 18
 
19 19
 $sensorLevel = mrc_get_level($user, $planetrow, STRUC_MOON_PHALANX);
20 20
 if (!intval($sensorLevel)) {
21
-  message (classLocale::$lang['phalanx_nosensoravailable'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
21
+  message(classLocale::$lang['phalanx_nosensoravailable'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
22 22
 }
23 23
 
24 24
 if ($planetrow['planet_type'] != PT_MOON) {
25
-  message (classLocale::$lang['phalanx_onlyformoons'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
25
+  message(classLocale::$lang['phalanx_onlyformoons'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
26 26
 }
27 27
 
28 28
 $scan_galaxy  = sys_get_param_int('galaxy');
29 29
 $scan_system  = sys_get_param_int('system');
30 30
 $scan_planet  = sys_get_param_int('planet');
31
-$scan_planet_type  = 1; // sys_get_param_int('planettype');
31
+$scan_planet_type = 1; // sys_get_param_int('planettype');
32 32
 $id = sys_get_param_id('id');
33 33
 
34 34
 $source_galaxy = $planetrow['galaxy'];
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 $sensorRange = GetPhalanxRange($sensorLevel);
39 39
 
40 40
 $system_distance = abs($source_system - $scan_system);
41
-if($system_distance > $sensorRange || $scan_galaxy != $source_galaxy)
41
+if ($system_distance > $sensorRange || $scan_galaxy != $source_galaxy)
42 42
 {
43
-  message (classLocale::$lang['phalanx_rangeerror'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
43
+  message(classLocale::$lang['phalanx_rangeerror'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
44 44
 }
45 45
 
46 46
 $cost = $sensorLevel * 1000;
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
 }
52 52
 
53 53
 $planet_scanned = db_planet_by_gspt($scan_galaxy, $scan_system, $scan_planet, $scan_planet_type);
54
-if(!$planet_scanned['id'])
54
+if (!$planet_scanned['id'])
55 55
 {
56 56
   message(classLocale::$lang['phalanx_planet_not_exists'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
57 57
 }
58 58
 
59
-if($planet_scanned['destruyed'])
59
+if ($planet_scanned['destruyed'])
60 60
 {
61
-  message (classLocale::$lang['phalanx_planet_destroyed'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
61
+  message(classLocale::$lang['phalanx_planet_destroyed'], classLocale::$lang['tech'][STRUC_MOON_PHALANX], '', 3);
62 62
 }
63 63
 
64 64
 db_planet_set_by_id($user['current_planet'], "deuterium = deuterium - {$cost}");
Please login to merge, or discard this patch.
notes.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -8,41 +8,41 @@  discard block
 block discarded – undo
8 8
  *     [!] Wrote from scratch
9 9
  */
10 10
 
11
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
11
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
12 12
 
13 13
 lng_include('notes');
14 14
 
15 15
 $template = gettemplate('notes', true);
16 16
 
17 17
 $result = array();
18
-if(($result_message = sys_get_param_str('MESSAGE')) && isset(classLocale::$lang[$result_message])) {
18
+if (($result_message = sys_get_param_str('MESSAGE')) && isset(classLocale::$lang[$result_message])) {
19 19
   $result[] = array('STATUS' => sys_get_param_int('STATUS'), 'MESSAGE' => classLocale::$lang[$result_message]);
20 20
 }
21 21
 
22 22
 $note_id_edit = sys_get_param_id('note_id_edit');
23
-if(sys_get_param('note_delete')) {
23
+if (sys_get_param('note_delete')) {
24 24
   try {
25 25
     $not = '';
26 26
     $query_where = '';
27
-    switch(sys_get_param_str('note_delete_range')) {
27
+    switch (sys_get_param_str('note_delete_range')) {
28 28
       case 'all':
29 29
       break;
30 30
 
31 31
       case 'marked_not':
32 32
         $not = 'NOT';
33 33
       case 'marked':
34
-        if(!is_array($notes_marked = sys_get_param('note'))) {
34
+        if (!is_array($notes_marked = sys_get_param('note'))) {
35 35
           throw new Exception('note_err_none_selected', ERR_WARNING);
36 36
         }
37 37
 
38 38
         $notes_marked_filtered = array();
39
-        foreach($notes_marked as $note_id => $note_select) {
40
-          if($note_select == 'on' && $note_id = idval($note_id)) {
39
+        foreach ($notes_marked as $note_id => $note_select) {
40
+          if ($note_select == 'on' && $note_id = idval($note_id)) {
41 41
             $notes_marked_filtered[] = $note_id;
42 42
           }
43 43
         }
44 44
 
45
-        if(empty($notes_marked_filtered)) {
45
+        if (empty($notes_marked_filtered)) {
46 46
           throw new Exception('note_err_none_selected', ERR_WARNING);
47 47
         }
48 48
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     db_note_list_delete($user, $query_where);
60 60
     sn_db_transaction_commit();
61 61
     throw new Exception($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added', ERR_NONE);
62
-  } catch(Exception $e) {
62
+  } catch (Exception $e) {
63 63
     $note_id_edit = 0;
64 64
     sn_db_transaction_rollback();
65 65
     $result[] = array(
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
       'MESSAGE' => classLocale::$lang[$e->getMessage()],
68 68
     );
69 69
   }
70
-} elseif(($note_title = sys_get_param_str('note_title')) || ($note_text = sys_get_param_str('note_text'))) {
70
+} elseif (($note_title = sys_get_param_str('note_title')) || ($note_text = sys_get_param_str('note_text'))) {
71 71
   $note_title == db_escape(classLocale::$lang['note_new_title']) ? $note_title = '' : false;
72 72
   ($note_text = sys_get_param_str('note_text')) == db_escape(classLocale::$lang['note_new_text']) ? $note_text = '' : false;
73 73
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     $note_system = max(0, min(sys_get_param_id('note_system'), Vector::$knownSystems));
77 77
     $note_planet = max(0, min(sys_get_param_id('note_planet'), Vector::$knownPlanets + 1));
78 78
 
79
-    if(!$note_text && !$note_title && !$note_galaxy && !$note_system && !$note_planet) {
79
+    if (!$note_text && !$note_title && !$note_galaxy && !$note_system && !$note_planet) {
80 80
       throw new exception('note_err_note_empty', ERR_WARNING);
81 81
     }
82 82
 
@@ -85,15 +85,15 @@  discard block
 block discarded – undo
85 85
     $note_sticky = intval(sys_get_param_id('note_sticky')) ? 1 : 0;
86 86
 
87 87
     sn_db_transaction_start();
88
-    if($note_id_edit) {
88
+    if ($note_id_edit) {
89 89
       $check_note_id = db_note_get_id_and_owner($note_id_edit);
90
-      if(!$check_note_id) {
90
+      if (!$check_note_id) {
91 91
         throw new Exception('note_err_note_not_found', ERR_ERROR);
92 92
       }
93 93
     }
94 94
 
95
-    if($note_id_edit) {
96
-      if($check_note_id['owner'] != $user['id']) {
95
+    if ($note_id_edit) {
96
+      if ($check_note_id['owner'] != $user['id']) {
97 97
         throw new Exception('note_err_owner_wrong', ERR_ERROR);
98 98
       }
99 99
 
@@ -103,9 +103,9 @@  discard block
 block discarded – undo
103 103
     }
104 104
 
105 105
     sn_db_transaction_commit();
106
-    sys_redirect('notes.php?STATUS=' . ERR_NONE . '&MESSAGE=' . ($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added'));
106
+    sys_redirect('notes.php?STATUS='.ERR_NONE.'&MESSAGE='.($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added'));
107 107
 //    throw new exception($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added', ERR_NONE);
108
-  } catch(Exception $e) {
108
+  } catch (Exception $e) {
109 109
     $note_id_edit = 0;
110 110
     sn_db_transaction_rollback();
111 111
     $result[] = array(
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
   }
116 116
 }
117 117
 
118
-if(!$note_id_edit) {
118
+if (!$note_id_edit) {
119 119
   note_assign($template, array(
120 120
     'id'          => 0,
121 121
     'time'        => SN_TIME_NOW,
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
 
129 129
 $note_exist = false;
130 130
 $notes_query = db_note_list_by_owner($user['id']);
131
-while($note_row = db_fetch($notes_query)) {
131
+while ($note_row = db_fetch($notes_query)) {
132 132
   note_assign($template, $note_row);
133 133
   $note_exist = $note_exist || $note_row['id'] == $note_id_edit;
134 134
 }
135 135
 $note_id_edit = $note_exist ? $note_id_edit : 0;
136 136
 
137
-foreach($note_priority_classes as $note_priority_id => $note_priority_class) {
137
+foreach ($note_priority_classes as $note_priority_id => $note_priority_class) {
138 138
   $template->assign_block_vars('note_priority', array(
139 139
     'ID'    => $note_priority_id,
140 140
     'CLASS' => $note_priority_classes[$note_priority_id],
@@ -142,14 +142,14 @@  discard block
 block discarded – undo
142 142
   ));
143 143
 }
144 144
 
145
-foreach(classLocale::$lang['sys_planet_type'] as $planet_type_id => $planet_type_string) {
145
+foreach (classLocale::$lang['sys_planet_type'] as $planet_type_id => $planet_type_string) {
146 146
   $template->assign_block_vars('planet_type', array(
147 147
     'ID'   => $planet_type_id,
148 148
     'TEXT' => $planet_type_string,
149 149
   ));
150 150
 }
151 151
 
152
-foreach($result as $result_data) {
152
+foreach ($result as $result_data) {
153 153
   $template->assign_block_vars('result', $result_data);
154 154
 }
155 155
 
Please login to merge, or discard this patch.
common.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,24 +12,24 @@  discard block
 block discarded – undo
12 12
 global $template_result, $user;
13 13
 
14 14
 // Напоминание для Администрации, что игра отключена
15
-if($template_result[F_GAME_DISABLE]) {
15
+if ($template_result[F_GAME_DISABLE]) {
16 16
   echo '<div class="global_admin_warning">', $template_result[F_GAME_DISABLE_REASON], '</div>';
17 17
 }
18 18
 unset($disable_reason);
19 19
 
20 20
 
21
-if(defined('IN_ADMIN') && IN_ADMIN === true) {
21
+if (defined('IN_ADMIN') && IN_ADMIN === true) {
22 22
   lng_include('admin');
23
-} elseif($sys_user_logged_in) {
23
+} elseif ($sys_user_logged_in) {
24 24
   sys_user_vacation($user);
25 25
 
26 26
   $planet_id = SetSelectedPlanet($user);
27 27
 
28 28
   // TODO НЕ НУЖНО АЛЬЯНС КАЖДЫЙ РАЗ ОБНОВЛЯТЬ!!!
29
-  if($user['ally_id']) {
29
+  if ($user['ally_id']) {
30 30
     sn_db_transaction_start();
31 31
     sn_ali_fill_user_ally($user);
32
-    if(!$user['ally']['player']['id']) {
32
+    if (!$user['ally']['player']['id']) {
33 33
       // sn_sys_logout(false, true);
34 34
       // core_auth::logout(false);
35 35
       classSupernova::$auth->logout(false);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     }
38 38
     // TODO UNCOMMENT
39 39
     que_process($user['ally']['player']);
40
-    db_user_set_by_id($user['ally']['player']['id'], '`onlinetime` = ' . SN_TIME_NOW);
40
+    db_user_set_by_id($user['ally']['player']['id'], '`onlinetime` = '.SN_TIME_NOW);
41 41
     sn_db_transaction_commit();
42 42
   }
43 43
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
   sn_db_transaction_commit();
49 49
 
50 50
   $planetrow = $global_data['planet'];
51
-  if(!($planetrow && isset($planetrow['id']) && $planetrow['id'])) {
51
+  if (!($planetrow && isset($planetrow['id']) && $planetrow['id'])) {
52 52
     // sn_sys_logout(false, true);
53 53
     // core_auth::logout(false);
54 54
     classSupernova::$auth->logout(false);
Please login to merge, or discard this patch.
affilates.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * v1 (c) copyright 2010 by Gorlum for http://supernova.ws
9 9
  */
10 10
 
11
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
11
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
12 12
 
13 13
 lng_include('affilates');
14 14
 
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
   $gained += $affilate_gain;
33 33
 }
34 34
 
35
-$bannerURL  = SN_ROOT_VIRTUAL_PARENT . classSupernova::$config->int_banner_URL;
35
+$bannerURL  = SN_ROOT_VIRTUAL_PARENT.classSupernova::$config->int_banner_URL;
36 36
 $bannerURL .= strpos($bannerURL, '?') ? '&' : '?';
37 37
 $bannerURL .= "id={$user['id']}";
38 38
 
39
-$userbarURL  = SN_ROOT_VIRTUAL_PARENT . classSupernova::$config->int_userbar_URL;
39
+$userbarURL  = SN_ROOT_VIRTUAL_PARENT.classSupernova::$config->int_userbar_URL;
40 40
 $userbarURL .= strpos($userbarURL, '?') ? '&' : '?';
41 41
 $userbarURL .= "id={$user['id']}";
42 42
 
Please login to merge, or discard this patch.
search.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
10 10
  * @copyright 2008 by ??????? for XNova
11 11
  */
12 12
 
13
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
13
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
14 14
 
15
-if(classSupernova::$config->game_mode == GAME_BLITZ) {
15
+if (classSupernova::$config->game_mode == GAME_BLITZ) {
16 16
   message(classLocale::$lang['sys_blitz_page_disabled'], classLocale::$lang['sys_error'], 'overview.php', 10);
17 17
   die();
18 18
 }
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 
26 26
 $template = gettemplate('search', true);
27 27
 
28
-if($searchtext && $type) {
29
-  switch($type) {
28
+if ($searchtext && $type) {
29
+  switch ($type) {
30 30
     case "planetname":
31 31
       // $search = db_planet_list_search($searchtext);
32 32
     break;
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
     break;
42 42
   }
43 43
 
44
-  while($row = db_fetch($search)) {
45
-    if($type == 'playername' || $type == 'planetname') {
44
+  while ($row = db_fetch($search)) {
45
+    if ($type == 'playername' || $type == 'planetname') {
46 46
       $template->assign_block_vars('search_result', array(
47 47
         'PLAYER_ID'       => $row['uid'],
48 48
         'PLAYER_NAME'     => htmlentities($row['username'], ENT_COMPAT, 'UTF-8'),
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         'ALLY_NAME'       => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'),
58 58
         'ALLY_TAG'        => htmlentities($row['ally_tag'], ENT_COMPAT, 'UTF-8'),
59 59
       ));
60
-    } elseif($type == 'ally') {
60
+    } elseif ($type == 'ally') {
61 61
       $template->assign_block_vars('search_result', array(
62 62
         'ALLY_NAME'     => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'),
63 63
         'ALLY_TAG'      => htmlentities($row['ally_tag'], ENT_COMPAT, 'UTF-8'),
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
   'ally'       => 'sys_alliance',
76 76
 );
77 77
 
78
-foreach($search_type as $type_id => $type_lang) {
78
+foreach ($search_type as $type_id => $type_lang) {
79 79
   $template->assign_block_vars('type', array(
80 80
     'ID'       => $type_id,
81 81
     'TEXT'     => classLocale::$lang[$type_lang],
Please login to merge, or discard this patch.
dark_matter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once('common.' . substr(strrchr(__FILE__, '.'), 1));
3
+include_once('common.'.substr(strrchr(__FILE__, '.'), 1));
4 4
 
5
-if(sn_module_get_active_count('payment') && !defined('SN_GOOGLE')) {
5
+if (sn_module_get_active_count('payment') && !defined('SN_GOOGLE')) {
6 6
   sys_redirect('metamatter.php');
7 7
 }
8 8
 
Please login to merge, or discard this patch.
quest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-define('INSIDE'  , true);
11
-define('INSTALL' , false);
10
+define('INSIDE', true);
11
+define('INSTALL', false);
12 12
 
13
-require('common.' . substr(strrchr(__FILE__, '.'), 1));
13
+require('common.'.substr(strrchr(__FILE__, '.'), 1));
14 14
 
15 15
 lng_include('quest');
16 16
 $template = gettemplate('quest', true);
Please login to merge, or discard this patch.
jumpgate.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -10,76 +10,76 @@  discard block
 block discarded – undo
10 10
  * @copyright 2008 By Chlorel for XNova
11 11
  */
12 12
 
13
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
13
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
14 14
 
15 15
 lng_include('fleet');
16 16
 
17
-if($TargetPlanet = sys_get_param_id('jmpto'))
17
+if ($TargetPlanet = sys_get_param_id('jmpto'))
18 18
 {
19 19
   sn_db_transaction_start();
20 20
   db_user_by_id($user['id'], true, 'id');
21 21
   $planetrow = db_planet_by_id($planetrow['id'], true);
22
-  if(!($NextJumpTime = uni_get_time_to_jump($planetrow)))
22
+  if (!($NextJumpTime = uni_get_time_to_jump($planetrow)))
23 23
   {
24 24
     $TargetGate = db_planet_by_id($TargetPlanet, true, '`id`, `last_jump_time`');
25
-    if(mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0)
25
+    if (mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0)
26 26
     {
27
-      $NextDestTime = uni_get_time_to_jump ( $TargetGate );
28
-      if(!$NextDestTime)
27
+      $NextDestTime = uni_get_time_to_jump($TargetGate);
28
+      if (!$NextDestTime)
29 29
       {
30 30
         // $SubQueryOri = "";
31 31
         // $SubQueryDes = "";
32 32
         $ship_list = sys_get_param('ships');
33 33
         $db_changeset = array();
34
-        foreach($ship_list as $ship_id => $ship_count)
34
+        foreach ($ship_list as $ship_id => $ship_count)
35 35
         {
36
-          if(!in_array($ship_id, sn_get_groups('fleet')))
36
+          if (!in_array($ship_id, sn_get_groups('fleet')))
37 37
           {
38 38
             continue;
39 39
           }
40 40
 
41 41
           $ship_count = max(0, min(floor($ship_count), mrc_get_level($user, $planetrow, $ship_id)));
42
-          if($ship_count)
42
+          if ($ship_count)
43 43
           {
44 44
             $db_changeset['unit'][] = sn_db_unit_changeset_prepare($ship_id, -$ship_count, $user, $planetrow['id']);
45 45
             $db_changeset['unit'][] = sn_db_unit_changeset_prepare($ship_id, $ship_count, $user, $TargetGate['id']);
46 46
           }
47 47
         }
48 48
         // Dit monsieur, y avait quelque chose a envoyer ???
49
-        if(!empty($db_changeset))
49
+        if (!empty($db_changeset))
50 50
         {
51
-          db_planet_set_by_id($TargetGate['id'], "`last_jump_time` = " . SN_TIME_NOW . "");
52
-          db_planet_set_by_id($planetrow['id'], "`last_jump_time` = " . SN_TIME_NOW . "");
51
+          db_planet_set_by_id($TargetGate['id'], "`last_jump_time` = ".SN_TIME_NOW."");
52
+          db_planet_set_by_id($planetrow['id'], "`last_jump_time` = ".SN_TIME_NOW."");
53 53
           db_changeset_apply($db_changeset);
54 54
 
55 55
           db_user_set_by_id($user['id'], "`current_planet` = '{$TargetGate['id']}'");
56 56
 
57 57
           $planetrow['last_jump_time'] = SN_TIME_NOW;
58
-          $RetMessage = classLocale::$lang['gate_jump_done'] ." - ". pretty_time(uni_get_time_to_jump($planetrow));
58
+          $RetMessage = classLocale::$lang['gate_jump_done']." - ".pretty_time(uni_get_time_to_jump($planetrow));
59 59
         } else {
60 60
           $RetMessage = classLocale::$lang['gate_wait_data'];
61 61
         }
62 62
       } else {
63
-        $RetMessage = classLocale::$lang['gate_wait_dest'] ." - ". pretty_time($NextDestTime);
63
+        $RetMessage = classLocale::$lang['gate_wait_dest']." - ".pretty_time($NextDestTime);
64 64
       }
65 65
     } else {
66 66
       $RetMessage = classLocale::$lang['gate_no_dest_g'];
67 67
     }
68 68
   } else {
69
-    $RetMessage = classLocale::$lang['gate_wait_star'] ." - ". pretty_time($NextJumpTime);
69
+    $RetMessage = classLocale::$lang['gate_wait_star']." - ".pretty_time($NextJumpTime);
70 70
   }
71 71
   sn_db_transaction_commit();
72 72
   message($RetMessage, classLocale::$lang['tech'][STRUC_MOON_GATE], "jumpgate.php", 10);
73 73
 } else {
74 74
   $template = gettemplate('jumpgate', true);
75
-  if(mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0)
75
+  if (mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0)
76 76
   {
77 77
     $Combo = '';
78 78
     $MoonList = db_planet_list_moon_other($user['id'], $planetrow['id']);
79 79
     // while($CurMoon = db_fetch($MoonList))
80
-    foreach($MoonList as $CurMoon)
80
+    foreach ($MoonList as $CurMoon)
81 81
     {
82
-      if(mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1)
82
+      if (mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1)
83 83
       {
84 84
         $NextJumpTime = uni_get_time_to_jump($CurMoon);
85 85
         $template->assign_block_vars('moon', array(
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
       }
94 94
     }
95 95
 
96
-    foreach(sn_get_groups('fleet') as $Ship)
96
+    foreach (sn_get_groups('fleet') as $Ship)
97 97
     {
98
-      if(($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0)
98
+      if (($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0)
99 99
       {
100 100
         continue;
101 101
       }
Please login to merge, or discard this patch.