Completed
Push — work-fleets ( 7f5906...04acf9 )
by SuperNova.WS
06:14
created
includes/alliance/ali_internal_members.inc 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -2,31 +2,31 @@  discard block
 block discarded – undo
2 2
 
3 3
 $classLocale = classLocale::$lang;
4 4
 
5
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) {
5
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) {
6 6
   classSupernova::$debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
7 7
 }
8 8
 
9 9
 // Changing rank for single user
10 10
 $id_user = sys_get_param_id('id_user');
11
-if(isset($_GET['id_rank'])) {
11
+if (isset($_GET['id_rank'])) {
12 12
   $id_rank = sys_get_param_int('id_rank');
13 13
 }
14
-if($id_user && isset($id_rank) && $user_admin) {
14
+if ($id_user && isset($id_rank) && $user_admin) {
15 15
   DBStaticUser::db_user_set_by_id($id_user, "`ally_rank_id` = {$id_rank}");
16 16
 }
17 17
 
18 18
 $id_kick = sys_get_param_id('kick');
19 19
 
20
-if($id_kick && $user_can_kick) {
20
+if ($id_kick && $user_can_kick) {
21 21
   $u = DBStaticUser::db_user_by_id($id_kick, true);
22
-  if($u['ally_id'] == $ally['id'] && $u['id'] != $ally['ally_owner']) {
22
+  if ($u['ally_id'] == $ally['id'] && $u['id'] != $ally['ally_owner']) {
23 23
     DBStaticUser::db_user_set_by_id($id_kick, '`ally_id`= null, `ally_name` = null, `ally_tag` = null, ally_register_time = 0, ally_rank_id = 0');
24 24
     db_ally_update_member_decrease($ally);
25 25
   }
26 26
 }
27 27
 
28 28
 $sort2 = sys_get_param_int('sort2');
29
-if($sort2) {
29
+if ($sort2) {
30 30
   $sort2s = "DESC";
31 31
   $sort2 = 0;
32 32
 } else {
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 }
36 36
 
37 37
 $sort1 = sys_get_param_int('sort1');
38
-if($sort1 > 5 || $sort1 < 0) {
38
+if ($sort1 > 5 || $sort1 < 0) {
39 39
   $sort1 = 0;
40 40
 }
41 41
 $sort1s = array(
@@ -49,28 +49,28 @@  discard block
 block discarded – undo
49 49
 
50 50
 $template = gettemplate('ali_members', true);
51 51
 
52
-$userList = DBStaticUser::db_user_list("`ally_id`= {$user['ally_id']} ORDER BY " . sprintf($sort1s[$sort1], $sort2s), false,
52
+$userList = DBStaticUser::db_user_list("`ally_id`= {$user['ally_id']} ORDER BY ".sprintf($sort1s[$sort1], $sort2s), false,
53 53
   'id, username, galaxy, system, planet, onlinetime, ally_rank_id, ally_register_time, total_points');
54 54
 
55 55
 // while ($userRow = db_fetch($userList))
56
-foreach($userList as $userRow) {
56
+foreach ($userList as $userRow) {
57 57
   $i++;
58
-  if(!isset($ranks[$userRow['ally_rank_id']])) {
58
+  if (!isset($ranks[$userRow['ally_rank_id']])) {
59 59
     $userRow['ally_rank_id'] = 0;
60 60
   }
61 61
 
62
-  if($ally['ally_owner'] == $userRow['id']) {
62
+  if ($ally['ally_owner'] == $userRow['id']) {
63 63
     $ally_range = ($ally['ally_owner_range']) ? $ally['ally_owner_range'] : classLocale::$lang['Founder'];
64 64
   } else {
65
-    if($user_admin) {
66
-      $ally_range = '<select onchange="window.location=\'alliance.php?mode=admin&edit=members&id_user=' . $userRow['id'] . '&id_rank=\' + this.value">';
65
+    if ($user_admin) {
66
+      $ally_range = '<select onchange="window.location=\'alliance.php?mode=admin&edit=members&id_user='.$userRow['id'].'&id_rank=\' + this.value">';
67 67
 
68
-      foreach($ranks as $rankID => $rankArray) {
69
-        $ally_range .= '<option value="' . $rankID . '"';
70
-        if($rankID == $userRow['ally_rank_id']) {
68
+      foreach ($ranks as $rankID => $rankArray) {
69
+        $ally_range .= '<option value="'.$rankID.'"';
70
+        if ($rankID == $userRow['ally_rank_id']) {
71 71
           $ally_range .= " selected";
72 72
         }
73
-        $ally_range .= '>' . $rankArray['name'];
73
+        $ally_range .= '>'.$rankArray['name'];
74 74
         $ally_range .= '</option>';
75 75
       }
76 76
       $ally_range .= '</select>';
@@ -80,20 +80,20 @@  discard block
 block discarded – undo
80 80
   }
81 81
 
82 82
   $last_active = time() - $userRow["onlinetime"];
83
-  if($user_admin) {
84
-    if($last_active < 60) {
83
+  if ($user_admin) {
84
+    if ($last_active < 60) {
85 85
       $tmp = "lime>{$classLocale['On']}";
86
-    } elseif($last_active < 60 * 60) {
86
+    } elseif ($last_active < 60 * 60) {
87 87
       $last_active = round($last_active / 60);
88 88
       $tmp = "lime>{$last_active} {$classLocale['sys_min_short']}";
89
-    } elseif($last_active < 60 * 60 * 24) {
89
+    } elseif ($last_active < 60 * 60 * 24) {
90 90
       $last_active = round($last_active / (60 * 60));
91 91
       $tmp = "green>{$last_active} {$classLocale['sys_hrs_short']}";
92 92
     } else {
93 93
       $last_active = round($last_active / (60 * 60 * 24));
94
-      if($last_active < 7) {
94
+      if ($last_active < 7) {
95 95
         $tmp = "yellow";
96
-      } elseif($last_active < 30) {
96
+      } elseif ($last_active < 30) {
97 97
         $tmp = "orange";
98 98
       } else {
99 99
         $tmp = "red";
@@ -101,10 +101,10 @@  discard block
 block discarded – undo
101 101
       $tmp .= ">{$last_active} {$classLocale['sys_day_short']}";
102 102
     }
103 103
   } else {
104
-    if($user_onlinestatus) {
105
-      if($last_active < 60 * 5) {
104
+    if ($user_onlinestatus) {
105
+      if ($last_active < 60 * 5) {
106 106
         $tmp = "lime>{$classLocale['On']}";
107
-      } elseif($last_active < 60 * 15) {
107
+      } elseif ($last_active < 60 * 15) {
108 108
         $tmp = "yellow>{$classLocale['ali_lessThen15min']}";
109 109
       } else {
110 110
         $tmp = "red>{$classLocale['Off']}";
@@ -124,21 +124,21 @@  discard block
 block discarded – undo
124 124
     'SYSTEM'        => $userRow['system'],
125 125
     'PLANET'        => $userRow['planet'],
126 126
     'POINTS'        => pretty_number($userRow['total_points']),
127
-    'ONLINE'        => '<font color=' . $tmp . '</font>',
127
+    'ONLINE'        => '<font color='.$tmp.'</font>',
128 128
     'RANK'          => $ally_range,
129 129
     'REGISTER_TIME' => date(FMT_DATE_TIME, $userRow['ally_register_time']),
130 130
     'SHOW_KICK'     => $user['id'] != $userRow['id'] && $ally['ally_owner'] != $userRow['id'],
131 131
   ));
132 132
 }
133 133
 
134
-if($i != $ally['ally_members']) {
134
+if ($i != $ally['ally_members']) {
135 135
   db_ally_update_member_set($i, $ally);
136 136
 }
137 137
 
138 138
 $template->assign_vars(array(
139
-  'mode'          => $mode . ($edit ? "&edit=" . $edit : ''),
139
+  'mode'          => $mode.($edit ? "&edit=".$edit : ''),
140 140
   'ADMIN_MODE'    => $user_can_kick,
141
-  'dpath'         => SN_ROOT_VIRTUAL . $dpath,
141
+  'dpath'         => SN_ROOT_VIRTUAL.$dpath,
142 142
   'onlineMessage' => $user_admin ? classLocale::$lang['ali_sys_lastActive'] : classLocale::$lang['Online'],
143 143
   'memberCount'   => count($userList),
144 144
   'memberslist'   => $page_list,
Please login to merge, or discard this patch.
includes/alliance/ali_internal_admin_request.inc 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 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
 
@@ -10,16 +10,16 @@  discard block
 block discarded – undo
10 10
 
11 11
 $d = sys_get_param_id('d');
12 12
 
13
-if($d) {
13
+if ($d) {
14 14
   db_ally_request_deny($d);
15 15
 }
16 16
 
17 17
 $id_user = sys_get_param_id('id_user');
18 18
 
19
-if($id_user) {
19
+if ($id_user) {
20 20
   $ally_name_safe = db_escape($ally['ally_name']);
21 21
   $ally_tag_safe = db_escape($ally['ally_tag']);
22
-  DBStaticUser::db_user_set_by_id($id_user, "`ally_id` = '{$ally['id']}', `ally_name` = '{$ally_name_safe}', `ally_tag` = '{$ally_tag_safe}', `ally_register_time` = " . SN_TIME_NOW . ", `ally_rank_id` = 0");
22
+  DBStaticUser::db_user_set_by_id($id_user, "`ally_id` = '{$ally['id']}', `ally_name` = '{$ally_name_safe}', `ally_tag` = '{$ally_tag_safe}', `ally_register_time` = ".SN_TIME_NOW.", `ally_rank_id` = 0");
23 23
   db_ally_update_member_increase($ally);
24 24
   db_ally_request_delete_by_user_id($id_user);
25 25
 }
Please login to merge, or discard this patch.
includes/classes/UBE/UBEMoonCalculator.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
     $debris_for_moon = $debris->debris_total();
72 72
 
73
-    if(!$debris_for_moon) {
73
+    if (!$debris_for_moon) {
74 74
       return;
75 75
     }
76 76
 
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
     $moon_chance = min($debris_for_moon / UBE_MOON_DEBRIS_PER_PERCENT, UBE_MOON_PERCENT_MAX); // TODO Configure
79 79
     $moon_chance = $moon_chance >= UBE_MOON_PERCENT_MIN ? $moon_chance : 0;
80 80
     $this->create_chance = $moon_chance;
81
-    if($moon_chance) {
82
-      if($is_simulator || mt_rand(1, 100) <= $moon_chance) {
81
+    if ($moon_chance) {
82
+      if ($is_simulator || mt_rand(1, 100) <= $moon_chance) {
83 83
         $this->status = UBE_MOON_CREATE_SUCCESS;
84 84
         $this->moon_diameter = round($is_simulator ? $moon_chance * 150 + 1999 : mt_rand($moon_chance * 100 + 1000, $moon_chance * 200 + 2999));
85 85
 
86
-        if($debris_for_moon <= UBE_MOON_DEBRIS_MAX_SPENT) {
86
+        if ($debris_for_moon <= UBE_MOON_DEBRIS_MAX_SPENT) {
87 87
           $debris->_reset();
88 88
         } else {
89 89
           $moon_debris_left_percent = ($debris_for_moon - UBE_MOON_DEBRIS_MAX_SPENT) / $debris_for_moon;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
    */
103 103
   protected function moon_destroy_try($reapers) {
104 104
     // TODO: $is_simulator
105
-    if($reapers <= 0) {
105
+    if ($reapers <= 0) {
106 106
       return;
107 107
     }
108 108
 
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
120 120
    * @version 2016-02-25 23:42:45 41a4.68
121 121
    */
122 122
   public function calculate_moon(UBE $ube) {
123
-    if(UBE_MOON_EXISTS == $this->status) {
124
-      if($ube->mission_type_id == MT_DESTROY && $ube->combat_result == UBE_COMBAT_RESULT_WIN) {
123
+    if (UBE_MOON_EXISTS == $this->status) {
124
+      if ($ube->mission_type_id == MT_DESTROY && $ube->combat_result == UBE_COMBAT_RESULT_WIN) {
125 125
         $reapers = $ube->fleet_list->ube_calculate_attack_reapers();
126 126
         $this->moon_destroy_try($reapers);
127 127
       }
@@ -131,12 +131,12 @@  discard block
 block discarded – undo
131 131
   }
132 132
 
133 133
   public function report_generate_sql() {
134
-    return "`ube_report_moon` = " . (int)$this->status . ",
135
-      `ube_report_moon_chance` = " . (int)$this->create_chance . ",
136
-      `ube_report_moon_size` = " . (float)$this->moon_diameter . ",
137
-      `ube_report_moon_reapers` = " . (int)$this->reapers_status . ",
138
-      `ube_report_moon_destroy_chance` = " . (int)$this->destroy_chance . ",
139
-      `ube_report_moon_reapers_die_chance` = " . (int)$this->reaper_die_chance;
134
+    return "`ube_report_moon` = ".(int) $this->status.",
135
+      `ube_report_moon_chance` = " . (int) $this->create_chance.",
136
+      `ube_report_moon_size` = " . (float) $this->moon_diameter.",
137
+      `ube_report_moon_reapers` = " . (int) $this->reapers_status.",
138
+      `ube_report_moon_destroy_chance` = " . (int) $this->destroy_chance.",
139
+      `ube_report_moon_reapers_die_chance` = " . (int) $this->reaper_die_chance;
140 140
   }
141 141
 
142 142
   public function report_render_moon() {
@@ -166,11 +166,11 @@  discard block
 block discarded – undo
166 166
    * @param $planet_id
167 167
    */
168 168
   public function db_apply_result($planet_info, $destination_user_id) {
169
-    if($this->status == UBE_MOON_CREATE_SUCCESS) {
169
+    if ($this->status == UBE_MOON_CREATE_SUCCESS) {
170 170
       $moon_row = uni_create_moon($planet_info[PLANET_GALAXY], $planet_info[PLANET_SYSTEM], $planet_info[PLANET_PLANET], $destination_user_id, $this->moon_diameter, '', false);
171 171
       $this->moon_name = $moon_row['name'];
172 172
       unset($moon_row);
173
-    } elseif($this->status == UBE_MOON_DESTROY_SUCCESS) {
173
+    } elseif ($this->status == UBE_MOON_DESTROY_SUCCESS) {
174 174
       DBStaticPlanet::db_planet_delete_by_id($planet_info[PLANET_ID]);
175 175
     }
176 176
   }
@@ -179,18 +179,18 @@  discard block
 block discarded – undo
179 179
     $classLocale = classLocale::$lang;
180 180
 
181 181
     $text_defender = '';
182
-    if($this->status == UBE_MOON_CREATE_SUCCESS) {
182
+    if ($this->status == UBE_MOON_CREATE_SUCCESS) {
183 183
       $text_defender .= "{$classLocale['ube_report_moon_created']} {$this->moon_diameter} {$classLocale['sys_kilometers_short']}<br /><br />";
184
-    } elseif($this->status == UBE_MOON_CREATE_FAILED) {
184
+    } elseif ($this->status == UBE_MOON_CREATE_FAILED) {
185 185
       $text_defender .= "{$classLocale['ube_report_moon_chance']} {$this->create_chance}%<br /><br />";
186 186
     }
187 187
 
188
-    if($ube->mission_type_id == MT_DESTROY) {
189
-      if($this->reapers_status == UBE_MOON_REAPERS_NONE) {
188
+    if ($ube->mission_type_id == MT_DESTROY) {
189
+      if ($this->reapers_status == UBE_MOON_REAPERS_NONE) {
190 190
         $text_defender .= classLocale::$lang['ube_report_moon_reapers_none'];
191 191
       } else {
192 192
         $text_defender .= "{$classLocale['ube_report_moon_reapers_wave']}. {$classLocale['ube_report_moon_reapers_chance']} {$this->destroy_chance}%. ";
193
-        $text_defender .= classLocale::$lang[$this->status == UBE_MOON_DESTROY_SUCCESS ? 'ube_report_moon_reapers_success' : 'ube_report_moon_reapers_failure'] . "<br />";
193
+        $text_defender .= classLocale::$lang[$this->status == UBE_MOON_DESTROY_SUCCESS ? 'ube_report_moon_reapers_success' : 'ube_report_moon_reapers_failure']."<br />";
194 194
 
195 195
         $text_defender .= "{$classLocale['ube_report_moon_reapers_outcome']} {$this->reaper_die_chance}%. ";
196 196
         $text_defender .= classLocale::$lang[$this->reapers_status == UBE_MOON_REAPERS_RETURNED ? 'ube_report_moon_reapers_survive' : 'ube_report_moon_reapers_died'];
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
    * @version 2016-02-25 23:42:45 41a4.68
216 216
    */
217 217
   public function ubeInitLoadStatis($destination_planet) {
218
-    if($destination_planet['planet_type'] == PT_MOON || is_array($moon = DBStaticPlanet::db_planet_by_parent($destination_planet['id'], true, '`id`'))) {
218
+    if ($destination_planet['planet_type'] == PT_MOON || is_array($moon = DBStaticPlanet::db_planet_by_parent($destination_planet['id'], true, '`id`'))) {
219 219
       $this->status = UBE_MOON_EXISTS;
220 220
       $this->moon_diameter = !empty($moon['planet_type']) && $moon['planet_type'] == PT_MOON ? $moon['diameter'] : $destination_planet['diameter'];
221 221
       $this->reapers_status = UBE_MOON_REAPERS_NONE;
Please login to merge, or discard this patch.
includes/includes/art_artifact.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
   $unit_level = $artifact_level_old = mrc_get_level($user, null, $unit_id, true);
14 14
   if ($unit_level > 0) {
15 15
     $db_changeset = array();
16
-    switch($unit_id) {
16
+    switch ($unit_id) {
17 17
       case ART_LHC:
18 18
       case ART_HOOK_SMALL:
19 19
       case ART_HOOK_MEDIUM:
@@ -133,6 +133,6 @@  discard block
 block discarded – undo
133 133
 
134 134
   sn_db_transaction_commit();
135 135
   message($message, "{$classLocale['tech'][UNIT_ARTIFACTS]} - {$classLocale['tech'][$unit_id]}",
136
-    ($request_uri = sys_get_param_str_unsafe('REQUEST_URI')) ? $request_uri : ('artifacts' . DOT_PHP_EX . '#' . $unit_id),
136
+    ($request_uri = sys_get_param_str_unsafe('REQUEST_URI')) ? $request_uri : ('artifacts'.DOT_PHP_EX.'#'.$unit_id),
137 137
     5);
138 138
 }
Please login to merge, or discard this patch.
includes/classes/DBStaticPlanet.php 2 patches
Doc Comments   +14 added lines patch added patch discarded remove patch
@@ -21,11 +21,19 @@  discard block
 block discarded – undo
21 21
     return empty($result) ? null : $result;
22 22
   }
23 23
 
24
+  /**
25
+   * @param integer $galaxy
26
+   * @param integer $system
27
+   * @param integer $planet
28
+   */
24 29
   public static function db_planet_by_gspt_safe($galaxy, $system, $planet, $planet_type, $for_update = false, $fields = '*') {
25 30
     return classSupernova::db_get_record_list(LOC_PLANET,
26 31
       "{{planets}}.`galaxy` = {$galaxy} AND {{planets}}.`system` = {$system} AND {{planets}}.`planet` = {$planet} AND {{planets}}.`planet_type` = {$planet_type}", true);
27 32
   }
28 33
 
34
+  /**
35
+   * @param integer $planet_type
36
+   */
29 37
   public static function db_planet_by_gspt($galaxy, $system, $planet, $planet_type, $for_update = false, $fields = '*') {
30 38
     $galaxy = intval($galaxy);
31 39
     $system = intval($system);
@@ -120,6 +128,9 @@  discard block
 block discarded – undo
120 128
       "`id_owner` = '{$user_row['id']}' {$conditions} ORDER BY {$order_by}");
121 129
   }
122 130
 
131
+  /**
132
+   * @param integer $planet_id
133
+   */
123 134
   public static function db_planet_list_by_user_or_planet($user_id, $planet_id) {
124 135
     if(!($user_id = idval($user_id)) && !($planet_id = idval($planet_id))) {
125 136
       return false;
@@ -138,6 +149,9 @@  discard block
 block discarded – undo
138 149
     return classSupernova::db_upd_record_by_id(LOC_PLANET, $planet_id, $set);
139 150
   }
140 151
 
152
+  /**
153
+   * @param integer $ui_planet_type
154
+   */
141 155
   public static function db_planet_set_by_gspt($ui_galaxy, $ui_system, $ui_planet, $ui_planet_type = PT_ALL, $set) {
142 156
     if(!($set = trim($set))) {
143 157
       return false;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -55,11 +55,10 @@  discard block
 block discarded – undo
55 55
   }
56 56
 
57 57
   public static function db_planet_by_vector($vector, $prefix = '', $for_update = false, $fields = '*') {
58
-    $galaxy = isset($vector[$prefix . 'galaxy']) ? intval($vector[$prefix . 'galaxy']) : 0;
59
-    $system = isset($vector[$prefix . 'system']) ? intval($vector[$prefix . 'system']) : 0;
60
-    $planet = isset($vector[$prefix . 'planet']) ? intval($vector[$prefix . 'planet']) : 0;
61
-    $planet_type = isset($vector[$prefix . 'planet_type']) ? intval($vector[$prefix . 'planet_type']) :
62
-      (isset($vector[$prefix . 'type']) ? intval($vector[$prefix . 'type']) : 0);
58
+    $galaxy = isset($vector[$prefix.'galaxy']) ? intval($vector[$prefix.'galaxy']) : 0;
59
+    $system = isset($vector[$prefix.'system']) ? intval($vector[$prefix.'system']) : 0;
60
+    $planet = isset($vector[$prefix.'planet']) ? intval($vector[$prefix.'planet']) : 0;
61
+    $planet_type = isset($vector[$prefix.'planet_type']) ? intval($vector[$prefix.'planet_type']) : (isset($vector[$prefix.'type']) ? intval($vector[$prefix.'type']) : 0);
63 62
     $planet_type = $planet_type == PT_DEBRIS ? PT_PLANET : $planet_type;
64 63
 
65 64
     return DBStaticPlanet::db_planet_by_gspt_safe($galaxy, $system, $planet, $planet_type, $for_update, $fields);
@@ -85,7 +84,7 @@  discard block
 block discarded – undo
85 84
     }
86 85
 
87 86
     return classSupernova::$gc->cacheOperator->db_get_record_list(LOC_PLANET,
88
-      "`parent_planet` = {$parent_id} AND `planet_type` = " . PT_MOON, true);
87
+      "`parent_planet` = {$parent_id} AND `planet_type` = ".PT_MOON, true);
89 88
   }
90 89
 
91 90
   public static function db_planet_by_id_and_owner($planet_id, $owner_id, $for_update = false, $fields = '*') {
@@ -106,7 +105,7 @@  discard block
 block discarded – undo
106 105
     }
107 106
 
108 107
     return classSupernova::$gc->cacheOperator->db_get_record_list(LOC_PLANET,
109
-      "`planet_type` = " . PT_MOON . " AND `id_owner` = {$user_id} AND `id` != {$this_moon_id}");
108
+      "`planet_type` = ".PT_MOON." AND `id_owner` = {$user_id} AND `id` != {$this_moon_id}");
110 109
   }
111 110
 
112 111
   public static function db_planet_list_in_system($galaxy, $system) {
@@ -132,7 +131,7 @@  discard block
 block discarded – undo
132 131
     );
133 132
     $order_by = classSupernova::$user_options[PLAYER_OPTION_PLANET_SORT];
134 133
     empty($sort_orders[$order_by]) ? $order_by = SORT_ID : false;
135
-    $order_by = $sort_orders[$order_by] . ' ' . (classSupernova::$user_options[PLAYER_OPTION_PLANET_SORT_INVERSE] == SORT_ASCENDING ? 'ASC' : 'DESC');
134
+    $order_by = $sort_orders[$order_by].' '.(classSupernova::$user_options[PLAYER_OPTION_PLANET_SORT_INVERSE] == SORT_ASCENDING ? 'ASC' : 'DESC');
136 135
 
137 136
     // Compilating query
138 137
     return classSupernova::$gc->cacheOperator->db_get_record_list(LOC_PLANET,
Please login to merge, or discard this patch.
includes/classes/DBStaticUnit.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -56,6 +56,9 @@  discard block
 block discarded – undo
56 56
     WHERE unit_player_id = {$user_id} AND unit_location_type = " . LOC_PLANET . " AND unit_level > 0 AND unit_snid IN (" . STRUC_LABORATORY . ", " . STRUC_LABORATORY_NANO . ");");
57 57
   }
58 58
 
59
+  /**
60
+   * @param string $set
61
+   */
59 62
   public static function db_unit_set_by_id($unit_id, $set) {
60 63
     return classSupernova::db_upd_record_by_id(LOC_UNIT, $unit_id, $set);
61 64
   }
@@ -69,6 +72,9 @@  discard block
 block discarded – undo
69 72
     return classSupernova::db_ins_record(LOC_UNIT, $set);
70 73
   }
71 74
 
75
+  /**
76
+   * @param integer $unit_location_type
77
+   */
72 78
   public static function db_unit_list_delete($user_id = 0, $unit_location_type, $unit_location_id, $unit_snid = 0) {
73 79
     return classSupernova::db_del_record_list(LOC_UNIT,
74 80
       "`unit_location_type` = {$unit_location_type} AND `unit_location_id` = {$unit_location_id}" .
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     }
25 25
 
26 26
     if (classSupernova::$gc->snCache->isUnitLocatorNotSet($location_type, $location_id)) {
27
-      $got_data = classSupernova::$gc->cacheOperator->db_get_record_list(LOC_UNIT, "unit_location_type = {$location_type} AND unit_location_id = {$location_id} AND " . DBStaticUnit::db_unit_time_restrictions());
27
+      $got_data = classSupernova::$gc->cacheOperator->db_get_record_list(LOC_UNIT, "unit_location_type = {$location_type} AND unit_location_id = {$location_id} AND ".DBStaticUnit::db_unit_time_restrictions());
28 28
       if (!empty($got_data) && is_array($got_data)) {
29 29
         foreach ($got_data as $unit_id => $unit_data) {
30 30
           classSupernova::$gc->snCache->setUnitLocatorByLocationAndIDs($location_type, $location_id, $unit_data);
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
 
60 60
   public static function db_unit_count_by_user_and_type_and_snid($user_id, $unit_type = 0, $unit_snid = 0) {
61 61
     $query = classSupernova::$db->doSelect(
62
-      "SELECT unit_snid, sum(unit_level) as `qty`  FROM {{unit}} WHERE `unit_player_id` = {$user_id} " .
63
-      ($unit_type ? "AND `unit_type` = {$unit_type} " : '') .
64
-      ($unit_snid ? "AND `unit_snid` = {$unit_snid} " : '') .
62
+      "SELECT unit_snid, sum(unit_level) as `qty`  FROM {{unit}} WHERE `unit_player_id` = {$user_id} ".
63
+      ($unit_type ? "AND `unit_type` = {$unit_type} " : '').
64
+      ($unit_snid ? "AND `unit_snid` = {$unit_snid} " : '').
65 65
       'GROUP BY `unit_snid`'
66 66
     );
67 67
     $result = array();
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
     WHERE
82 82
       f.fleet_owner = {$user_id} AND
83 83
       (f.fleet_start_planet_id = {$location_id} OR f.fleet_end_planet_id = {$location_id})
84
-      AND u.unit_snid = {$unit_snid} AND u.`unit_location_type` = " . LOC_FLEET . " AND " . self::db_unit_time_restrictions() .
85
-      " LIMIT 1" .
84
+      AND u.unit_snid = {$unit_snid} AND u.`unit_location_type` = ".LOC_FLEET." AND ".self::db_unit_time_restrictions().
85
+      " LIMIT 1".
86 86
       ($for_update ? ' FOR UPDATE' : ''));
87 87
   }
88 88
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
   public static function db_unit_list_laboratories($user_id) {
91 91
     return classSupernova::$db->doSelect("SELECT DISTINCT unit_location_id AS `id`
92 92
     FROM {{unit}}
93
-    WHERE unit_player_id = {$user_id} AND unit_location_type = " . LOC_PLANET . " AND unit_level > 0 AND unit_snid IN (" . STRUC_LABORATORY . ", " . STRUC_LABORATORY_NANO . ");");
93
+    WHERE unit_player_id = {$user_id} AND unit_location_type = ".LOC_PLANET." AND unit_level > 0 AND unit_snid IN (".STRUC_LABORATORY.", ".STRUC_LABORATORY_NANO.");");
94 94
   }
95 95
 
96 96
   public static function db_unit_set_by_id($unit_id, $set) {
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     return classSupernova::$db->doSelect(
125 125
       "SELECT unit_player_id, unit_type, unit_snid, unit_level, count(*) AS unit_amount
126 126
     FROM `{{unit}}`
127
-    WHERE unit_level > 0 AND " . self::db_unit_time_restrictions() .
127
+    WHERE unit_level > 0 AND " . self::db_unit_time_restrictions().
128 128
       " GROUP BY unit_player_id, unit_type, unit_snid, unit_level"
129 129
     );
130 130
   }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
   public static function db_unit_list_admin_delete_mercenaries_finished() {
139 139
     return classSupernova::$db->doDeleteDeprecated(TABLE_UNIT, array(
140 140
       'unit_time_finish IS NOT NULL',
141
-      "unit_time_finish < FROM_UNIXTIME(" . SN_TIME_NOW . ")",
141
+      "unit_time_finish < FROM_UNIXTIME(".SN_TIME_NOW.")",
142 142
       'unit_type' => UNIT_MERCENARIES,
143 143
     ));
144 144
   }
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
     return classSupernova::$db->doUpdate(
148 148
       "UPDATE `{{unit}}`
149 149
     SET
150
-      unit_time_start = FROM_UNIXTIME(" . SN_TIME_NOW . "),
151
-      unit_time_finish = FROM_UNIXTIME(" . (SN_TIME_NOW + $default_length) . ")
150
+      unit_time_start = FROM_UNIXTIME(" . SN_TIME_NOW."),
151
+      unit_time_finish = FROM_UNIXTIME(" . (SN_TIME_NOW + $default_length).")
152 152
     WHERE unit_type = " . UNIT_MERCENARIES
153 153
     );
154 154
   }
@@ -173,13 +173,13 @@  discard block
 block discarded – undo
173 173
 
174 174
     $temp = DBStaticUnit::db_get_unit_by_location($user['id'], $unit_location, $location_id, $unit_id, true, 'unit_id');
175 175
     if (!empty($temp['unit_id'])) {
176
-      $result = (bool)classSupernova::$gc->cacheOperator->db_upd_record_list(
176
+      $result = (bool) classSupernova::$gc->cacheOperator->db_upd_record_list(
177 177
         LOC_UNIT, "`unit_level` = `unit_level` + ($unit_value)", "`unit_id` = {$temp['unit_id']}"
178 178
       );
179 179
     } else {
180 180
       $locationIdRendered = $unit_location == LOC_USER ? $user['id'] : $planet_id;
181 181
       $unitType = get_unit_param($unit_id, P_UNIT_TYPE);
182
-      $result = (bool)classSupernova::$gc->cacheOperator->db_ins_record(
182
+      $result = (bool) classSupernova::$gc->cacheOperator->db_ins_record(
183 183
         LOC_UNIT,
184 184
         "unit_player_id = {$user['id']}, 
185 185
         unit_location_type = {$unit_location}, 
Please login to merge, or discard this patch.
includes/classes/DBStaticAlly.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -293,7 +293,7 @@
 block discarded – undo
293 293
   }
294 294
 
295 295
   /**
296
-   * @param $ranklist
296
+   * @param string $ranklist
297 297
    * @param $user
298 298
    */
299 299
   public static function db_ally_update_ranklist($ranklist, $user) {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
     `ally_name` = '{$ally_name}',
67 67
     `ally_tag` = '{$ally_tag}',
68 68
     `ally_owner` = '{$user['id']}',
69
-    `ally_owner_range` = '" . classLocale::$lang['ali_leaderRank'] . "',
69
+    `ally_owner_range` = '".classLocale::$lang['ali_leaderRank']."',
70 70
     `ally_members` = 1,
71
-    `ranklist` = '" . classLocale::$lang['ali_defaultRankName'] . ",0,0,0,0,0',
71
+    `ranklist` = '" . classLocale::$lang['ali_defaultRankName'].",0,0,0,0,0',
72 72
     `ally_register_time`= " . SN_TIME_NOW
73 73
     );
74 74
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
    * @param $POST_text
90 90
    */
91 91
   public static function db_ally_request_insert($user, $id_ally, $POST_text) {
92
-    classSupernova::$db->doInsert("INSERT INTO {{alliance_requests}} SET `id_user` = {$user['id']}, `id_ally`='{$id_ally}', request_text ='{$POST_text}', request_time=" . SN_TIME_NOW . ";");
92
+    classSupernova::$db->doInsert("INSERT INTO {{alliance_requests}} SET `id_user` = {$user['id']}, `id_ally`='{$id_ally}', request_text ='{$POST_text}', request_time=".SN_TIME_NOW.";");
93 93
   }
94 94
 
95 95
   /**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
    * @param $ally
140 140
    */
141 141
   public static function db_ally_update_by_changeset($ally_changeset, $ally) {
142
-    classSupernova::$db->doUpdate("UPDATE {{alliance}} SET " . implode(',', $ally_changeset) . " WHERE `id`='{$ally['id']}' LIMIT 1;");
142
+    classSupernova::$db->doUpdate("UPDATE {{alliance}} SET ".implode(',', $ally_changeset)." WHERE `id`='{$ally['id']}' LIMIT 1;");
143 143
   }
144 144
 
145 145
   /**
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
    * @param $d
251 251
    */
252 252
   public static function db_ally_request_deny($d) {
253
-    classSupernova::$db->doUpdate("UPDATE {{alliance_requests}} SET `request_denied` = 1, `request_text` = '" . classLocale::$lang['ali_req_deny_reason'] . "' WHERE `id_user`= {$d} LIMIT 1;");
253
+    classSupernova::$db->doUpdate("UPDATE {{alliance_requests}} SET `request_denied` = 1, `request_text` = '".classLocale::$lang['ali_req_deny_reason']."' WHERE `id_user`= {$d} LIMIT 1;");
254 254
   }
255 255
 
256 256
   /**
Please login to merge, or discard this patch.
includes/classes/DBStaticFleetACS.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
 
76 76
 
77 77
   /**
78
-   * @param $fleet_group_id_list
78
+   * @param string $fleet_group_id_list
79 79
    */
80 80
   public static function db_acs_delete_by_list($fleet_group_id_list) {
81 81
     doquery("DELETE FROM {{aks}} WHERE `id` IN ({$fleet_group_id_list})");
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -51,16 +51,16 @@
 block discarded – undo
51 51
    */
52 52
   public static function db_acs_insert($fleetid, $user, $objFleet) {
53 53
     doquery("INSERT INTO {{aks}} SET
54
-          `name` = '" . db_escape(classLocale::$lang['flt_acs_prefix'] . $fleetid) . "',
55
-          `teilnehmer` = '" . $user['id'] . "',
56
-          `flotten` = '" . $fleetid . "',
57
-          `ankunft` = '" . $objFleet->time_arrive_to_target . "',
58
-          `galaxy` = '" . $objFleet->fleet_end_galaxy . "',
59
-          `system` = '" . $objFleet->fleet_end_system . "',
60
-          `planet` = '" . $objFleet->fleet_end_planet . "',
61
-          `planet_type` = '" . $objFleet->fleet_end_type . "',
62
-          `eingeladen` = '" . $user['id'] . "',
63
-          `fleet_end_time` = '" . $objFleet->time_return_to_source . "'");
54
+          `name` = '" . db_escape(classLocale::$lang['flt_acs_prefix'].$fleetid)."',
55
+          `teilnehmer` = '" . $user['id']."',
56
+          `flotten` = '" . $fleetid."',
57
+          `ankunft` = '" . $objFleet->time_arrive_to_target."',
58
+          `galaxy` = '" . $objFleet->fleet_end_galaxy."',
59
+          `system` = '" . $objFleet->fleet_end_system."',
60
+          `planet` = '" . $objFleet->fleet_end_planet."',
61
+          `planet_type` = '" . $objFleet->fleet_end_type."',
62
+          `eingeladen` = '" . $user['id']."',
63
+          `fleet_end_time` = '" . $objFleet->time_return_to_source."'");
64 64
   }
65 65
 
66 66
   /**
Please login to merge, or discard this patch.
includes/classes/DBStaticNews.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 function db_news_insert_set($announce_time, $text, $detail_url, $user) {
13 13
   doquery("INSERT INTO {{announce}}
14 14
         SET `tsTimeStamp` = FROM_UNIXTIME({$announce_time}), `strAnnounce`='{$text}', detail_url = '{$detail_url}',
15
-        `user_id` = {$user['id']}, `user_name` = '" . db_escape($user['username']) . "'");
15
+        `user_id` = {$user['id']}, `user_name` = '".db_escape($user['username'])."'");
16 16
 }
17 17
 
18 18
 function db_survey_insert($announce_id, $survey_question, $survey_until) {
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
       LEFT JOIN {{survey}} AS s ON s.survey_announce_id = a.idAnnounce
94 94
       LEFT JOIN {{users}} AS u ON u.id = a.user_id
95 95
     {$query_where}
96
-    ORDER BY `tsTimeStamp` DESC, idAnnounce" .
96
+    ORDER BY `tsTimeStamp` DESC, idAnnounce".
97 97
     ($query_limit ? " LIMIT {$query_limit}" : ''));
98 98
 
99 99
   $template->assign_var('NEWS_COUNT', db_num_rows($announce_list));
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@
 block discarded – undo
26 26
 
27 27
   /**
28 28
    * @param template $template
29
-   * @param $query_where
30
-   * @param $query_limit
29
+   * @param string $query_where
30
+   * @param integer $query_limit
31 31
    *
32 32
    * @return array|bool|mysqli_result|null
33 33
    */
Please login to merge, or discard this patch.