Completed
Push — work-fleets ( 85ab35...ea0fb4 )
by SuperNova.WS
06:12
created
includes/classes/DBStaticFleetMissile.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
    * @return array|bool|mysqli_result|null
24 24
    */
25 25
   public static function db_missile_list_by_arrival() {
26
-    $iraks = classSupernova::$db->doSelect("SELECT * FROM `{{iraks}}` WHERE `fleet_end_time` <= " . SN_TIME_NOW . " FOR UPDATE;");
26
+    $iraks = classSupernova::$db->doSelect("SELECT * FROM `{{iraks}}` WHERE `fleet_end_time` <= ".SN_TIME_NOW." FOR UPDATE;");
27 27
 
28 28
     return $iraks;
29 29
   }
Please login to merge, or discard this patch.
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -2,6 +2,10 @@
 block discarded – undo
2 2
 
3 3
 class DBStaticFleetMissile {
4 4
 
5
+  /**
6
+   * @param double $arrival
7
+   * @param integer $target_structure
8
+   */
5 9
   public static function db_missile_insert($target_coord, $user, $planetrow, $arrival, $fleet_ship_count, $target_structure) {
6 10
     classSupernova::$db->doInsert(
7 11
       "INSERT INTO `{{iraks}}` SET
Please login to merge, or discard this patch.
includes/classes/DBStaticUser.php 2 patches
Doc Comments   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,6 +104,9 @@  discard block
 block discarded – undo
104 104
     return $result;
105 105
   }
106 106
 
107
+  /**
108
+   * @param integer $config_user_birthday_range
109
+   */
107 110
   public static function db_user_list_to_celebrate($config_user_birthday_range) {
108 111
     $query = static::buildDBQ()
109 112
       ->field('id', 'username', 'user_birthday', 'user_birthday_celebrated')
@@ -178,6 +181,9 @@  discard block
 block discarded – undo
178 181
   }
179 182
 
180 183
 
184
+  /**
185
+   * @param string $username_unsafe
186
+   */
181 187
   public static function db_user_by_username($username_unsafe, $for_update = false, $fields = '*', $player = null, $like = false) {
182 188
     // TODO Проверить, кстати - а везде ли нужно выбирать юзеров или где-то все-таки ищутся Альянсы ?
183 189
     if (!($username_unsafe = trim($username_unsafe))) {
@@ -232,8 +238,8 @@  discard block
 block discarded – undo
232 238
    *    <p>array - запись пользователя с установленным полем ['id']</p>
233 239
    * @param bool      $for_update @deprecated
234 240
    * @param string    $fields @deprecated список полей или '*'/'' для всех полей
235
-   * @param null      $player
236
-   * @param bool|null $player Признак выбора записи пользователь типа "игрок"
241
+   * @param boolean      $player
242
+   * @param boolean $player Признак выбора записи пользователь типа "игрок"
237 243
    *    <p>null - Можно выбрать запись любого типа</p>
238 244
    *    <p>true - Выбирается только запись типа "игрок"</p>
239 245
    *    <p>false - Выбирается только запись типа "альянс"</p>
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         ->where('`user_as_ally` IS NULL')
24 24
         ->orderBy(array('`id` DESC'));
25 25
 
26
-    return (string)$query->selectValue();
26
+    return (string) $query->selectValue();
27 27
   }
28 28
 
29 29
   /**
@@ -48,15 +48,15 @@  discard block
 block discarded – undo
48 48
       static::buildDBQ()
49 49
         ->field('id')
50 50
         ->where("`user_as_ally` IS NULL")
51
-        ->where("`user_bot` = " . USER_BOT_PLAYER)
51
+        ->where("`user_bot` = ".USER_BOT_PLAYER)
52 52
         ->setForUpdate();
53 53
 
54 54
     return $query->selectIterator();
55 55
   }
56 56
 
57 57
   public static function db_user_lock_with_target_owner_and_acs($user, $planet = array()) {
58
-    $query = "SELECT 1 FROM `{{users}}` WHERE `id` = " . idval($user['id']) .
59
-      (!empty($planet['id_owner']) ? ' OR `id` = ' . idval($planet['id_owner']) : '')
58
+    $query = "SELECT 1 FROM `{{users}}` WHERE `id` = ".idval($user['id']).
59
+      (!empty($planet['id_owner']) ? ' OR `id` = '.idval($planet['id_owner']) : '')
60 60
       . " FOR UPDATE";
61 61
 
62 62
     static::getDb()->doSelect($query);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
       FROM `{{users}}` 
74 74
       WHERE 
75 75
         `user_as_ally` IS NULL" .
76
-        ($online ? ' AND `onlinetime` > ' . (SN_TIME_NOW - classSupernova::$config->game_users_online_timeout) : '')
76
+        ($online ? ' AND `onlinetime` > '.(SN_TIME_NOW - classSupernova::$config->game_users_online_timeout) : '')
77 77
     ));
78 78
   }
79 79
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
       ->fieldCount('r.id', 'referral_count')
96 96
       ->fieldSingleFunction('sum', 'r.dark_matter', 'referral_dm')
97 97
       ->join('LEFT JOIN {{referrals}} as r on r.id_partner = u.id')
98
-      ->where($online ? "`onlinetime` >= " . intval(SN_TIME_NOW - classSupernova::$config->game_users_online_timeout) : 'user_as_ally IS NULL')
98
+      ->where($online ? "`onlinetime` >= ".intval(SN_TIME_NOW - classSupernova::$config->game_users_online_timeout) : 'user_as_ally IS NULL')
99 99
       ->groupBy('u.id')
100 100
       ->orderBy("user_as_ally, {$sort} ASC");
101 101
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
       ->where('(`user_birthday_celebrated` IS NULL OR DATE_ADD(`user_birthday_celebrated`, INTERVAL 1 YEAR) < CURRENT_DATE)')
114 114
       ->where('`user_as_ally` IS NULL')
115 115
       ->having('`days_after_birthday` >= 0')
116
-      ->having('`days_after_birthday` < ' . intval($config_user_birthday_range))
116
+      ->having('`days_after_birthday` < '.intval($config_user_birthday_range))
117 117
       ->setForUpdate();
118 118
 
119 119
     $result = $query->selectIterator();
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
       $username_safe = db_escape($like ? strtolower($username_unsafe) : $username_unsafe); // тут на самом деле strtolower() лишняя, но пусть будет
208 208
 
209 209
       $user = classSupernova::$db->doSelectFetch(
210
-        "SELECT * FROM {{users}} WHERE `username` " . ($like ? 'LIKE' : '=') . " '{$username_safe}'"
210
+        "SELECT * FROM {{users}} WHERE `username` ".($like ? 'LIKE' : '=')." '{$username_safe}'"
211 211
         . " FOR UPDATE"
212 212
       );
213 213
       SnCache::cache_set(LOC_USER, $user); // В кэш-юзер так же заполнять индексы
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 
258 258
 
259 259
   public static function db_user_list_set_mass_mail(&$owners_list, $set) {
260
-    return classSupernova::$gc->cacheOperator->db_upd_record_list(LOC_USER, $set, !empty($owners_list) ? '`id` IN (' . implode(',', $owners_list) . ');' : '');
260
+    return classSupernova::$gc->cacheOperator->db_upd_record_list(LOC_USER, $set, !empty($owners_list) ? '`id` IN ('.implode(',', $owners_list).');' : '');
261 261
   }
262 262
 
263 263
   public static function db_user_list_set_by_ally_and_rank($ally_id, $ally_rank_id, $set) {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
    * @param array $playerArray
273 273
    */
274 274
   public static function renderNameAndCoordinates($playerArray) {
275
-    return "{$playerArray['username']} " . uni_render_coordinates($playerArray);
275
+    return "{$playerArray['username']} ".uni_render_coordinates($playerArray);
276 276
   }
277 277
 
278 278
   /**
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
       $fieldName = pname_resource_name($resourceId);
304 304
       $value = "{$fieldName} = {$fieldName} + ('{$value}')";
305 305
     }
306
-    if($query = implode(',', $playerRowFieldChanges)) {
306
+    if ($query = implode(',', $playerRowFieldChanges)) {
307 307
       classSupernova::$gc->db->doUpdate("UPDATE `{{users}}` SET {$query} WHERE id = {$userId}");
308 308
     }
309 309
   }
Please login to merge, or discard this patch.
includes/functions/qst_quest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     $template->assign_vars($quest_templatized);
180 180
     if (!empty($quest_templatized['quest_rewards_list'])) {
181 181
       foreach ($quest_templatized['quest_rewards_list'] as $quest_reward) {
182
-        $template->assign_block_vars(($block_name ? $block_name . '.' : '') . 'quest_rewards_list', $quest_reward);
182
+        $template->assign_block_vars(($block_name ? $block_name.'.' : '').'quest_rewards_list', $quest_reward);
183 183
       }
184 184
     }
185 185
   }
@@ -248,10 +248,10 @@  discard block
 block discarded – undo
248 248
 
249 249
         $comment_reward = array();
250 250
         foreach ($reward_list as $unit_id => $unit_amount) {
251
-          $comment_reward[] = $unit_amount . ' ' . classLocale::$lang['tech'][$unit_id];
251
+          $comment_reward[] = $unit_amount.' '.classLocale::$lang['tech'][$unit_id];
252 252
           $total_rewards[$user_id][$planet_id][$unit_id] += $unit_amount;
253 253
         }
254
-        $comment .= " {$classLocale['qst_msg_your_reward']} " . implode(',', $comment_reward);
254
+        $comment .= " {$classLocale['qst_msg_your_reward']} ".implode(',', $comment_reward);
255 255
 
256 256
         DBStaticMessages::msg_send_simple_message($user['id'], 0, SN_TIME_NOW, MSG_TYPE_ADMIN, classLocale::$lang['msg_from_admin'], classLocale::$lang['qst_msg_complete_subject'], $comment);
257 257
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 
290 290
         if (!empty($resourcesChange)) {
291 291
           $planet_id = $planet_id == 0 && isset($user_row['id_planet']) ? $user_row['id_planet'] : $planet_id;
292
-          if($planet_id) {
292
+          if ($planet_id) {
293 293
             // update planet
294 294
             DBStaticPlanet::db_planet_update_resources($resourcesChange, $planet_id);
295 295
           } else {
Please login to merge, or discard this patch.
includes/classes/DBStaticQue.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     if ($que_type == QUE_RESEARCH || $planet_id === null) {
39 39
       $query[] = "`que_planet_id` IS NULL";
40 40
     } elseif ($planet_id) {
41
-      $query[] = "(`que_planet_id` = {$planet_id}" . ($que_type ? '' : ' OR que_planet_id IS NULL') . ")";
41
+      $query[] = "(`que_planet_id` = {$planet_id}".($que_type ? '' : ' OR que_planet_id IS NULL').")";
42 42
     }
43 43
     if ($que_type) {
44 44
       $query[] = "`que_type` = {$que_type}";
Please login to merge, or discard this patch.
includes/classes/SnDbCachedOperator.php 3 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -314,6 +314,9 @@  discard block
 block discarded – undo
314 314
     return $result;
315 315
   }
316 316
 
317
+  /**
318
+   * @param integer $location_type
319
+   */
317 320
   public static function db_ins_field_set($location_type, $field_set, $serialize = false) {
318 321
     // TODO multiinsert
319 322
     !sn_db_field_set_is_safe($field_set) ? $field_set = sn_db_field_set_make_safe($field_set, $serialize) : false;
@@ -350,7 +353,7 @@  discard block
 block discarded – undo
350 353
   /**
351 354
    * Блокирует указанные таблицу/список таблиц
352 355
    *
353
-   * @param string|array $tables Таблица/список таблиц для блокировки. Названия таблиц - без префиксов
356
+   * @param string $tables Таблица/список таблиц для блокировки. Названия таблиц - без префиксов
354 357
    * <p>string - название таблицы для блокировки</p>
355 358
    * <p>array - массив, где ключ - имя таблицы, а значение - условия блокировки элементов</p>
356 359
    */
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -298,9 +298,11 @@
 block discarded – undo
298 298
     $set = trim($set);
299 299
     $table_name = static::$location_info[$location_type][P_TABLE_NAME];
300 300
     if ($result = $this->db->doInsert("INSERT INTO `{{{$table_name}}}` SET {$set}")) {
301
-      if ($this->db->db_affected_rows()) // Обновляем данные только если ряд был затронут
301
+      if ($this->db->db_affected_rows()) {
302
+        // Обновляем данные только если ряд был затронут
302 303
       {
303 304
         $record_id = $this->db->db_insert_id();
305
+      }
304 306
         // Вытаскиваем запись целиком, потому что в $set могли быть "данные по умолчанию"
305 307
         $result = $this->db_get_record_by_id($location_type, $record_id);
306 308
         // Очищаем второстепенные кэши - потому что вставленная запись могла повлиять на результаты запросов или локация или еще чего
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -198,10 +198,10 @@  discard block
 block discarded – undo
198 198
           $query = $this->db->doSelect(
199 199
             "SELECT
200 200
               distinct({{{$location_info[P_TABLE_NAME]}}}.{$owner_data[P_OWNER_FIELD]}) AS parent_id
201
-            FROM {{{$location_info[P_TABLE_NAME]}}}" .
202
-            ($filter ? ' WHERE ' . $filter : '') .
201
+            FROM {{{$location_info[P_TABLE_NAME]}}}".
202
+            ($filter ? ' WHERE '.$filter : '').
203 203
             ($fetch ? ' LIMIT 1' : ''));
204
-          while($row = db_fetch($query)) {
204
+          while ($row = db_fetch($query)) {
205 205
             // Исключаем из списка родительских ИД уже заблокированные записи
206 206
             if (!$this->snCache->cache_lock_get($owner_location_type, $row['parent_id'])) {
207 207
               $parent_id_list[$row['parent_id']] = $row['parent_id'];
@@ -212,17 +212,17 @@  discard block
 block discarded – undo
212 212
           if ($indexes_str = implode(',', $parent_id_list)) {
213 213
             $parent_id_field = static::$location_info[$owner_location_type][P_ID];
214 214
             classSupernova::$gc->cacheOperator->db_get_record_list($owner_location_type,
215
-              $parent_id_field . (count($parent_id_list) > 1 ? " IN ({$indexes_str})" : " = {$indexes_str}"), $fetch, true);
215
+              $parent_id_field.(count($parent_id_list) > 1 ? " IN ({$indexes_str})" : " = {$indexes_str}"), $fetch, true);
216 216
           }
217 217
         }
218 218
       }
219 219
 
220 220
       $query = $this->db->doSelect(
221
-        "SELECT * FROM {{{$location_info[P_TABLE_NAME]}}}" .
221
+        "SELECT * FROM {{{$location_info[P_TABLE_NAME]}}}".
222 222
         (($filter = trim($filter)) ? " WHERE {$filter}" : '')
223 223
         . " FOR UPDATE"
224 224
       );
225
-      while($row = db_fetch($query)) {
225
+      while ($row = db_fetch($query)) {
226 226
         // Caching record in row cache
227 227
         $this->snCache->cache_set($location_type, $row);
228 228
         // Making ref to cached record in query cache
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
     $condition = trim($condition);
293 293
     $table_name = static::$location_info[$location_type][P_TABLE_NAME];
294 294
 
295
-    if ($result = $this->db->doUpdateComplex("UPDATE {{{$table_name}}} SET " . $set . ($condition ? ' WHERE ' . $condition : ''))) {
295
+    if ($result = $this->db->doUpdateComplex("UPDATE {{{$table_name}}} SET ".$set.($condition ? ' WHERE '.$condition : ''))) {
296 296
 
297 297
       if ($this->db->db_affected_rows()) { // Обновляем данные только если ряд был затронут
298 298
         // Поскольку нам неизвестно, что и как обновилось - сбрасываем кэш этого типа полностью
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
   public function db_lock_tables($tables) {
359 359
     $tables = is_array($tables) ? $tables : array($tables => '');
360 360
     foreach ($tables as $table_name => $condition) {
361
-      $this->db->doSelect("SELECT 1 FROM {{{$table_name}}}" . ($condition ? ' WHERE ' . $condition : ''));
361
+      $this->db->doSelect("SELECT 1 FROM {{{$table_name}}}".($condition ? ' WHERE '.$condition : ''));
362 362
     }
363 363
   }
364 364
 }
Please login to merge, or discard this patch.
includes/includes/flt_page4.inc 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -2,28 +2,28 @@  discard block
 block discarded – undo
2 2
 
3 3
 $classLocale = classLocale::$lang;
4 4
 
5
-if(SN_IN_FLEET !== true) {
5
+if (SN_IN_FLEET !== true) {
6 6
   classSupernova::$debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
7 7
 }
8 8
 
9 9
 $fleetid = sys_get_param_id('fleetid');
10 10
 
11
-if(!is_numeric($fleetid) || empty($fleetid)) {
11
+if (!is_numeric($fleetid) || empty($fleetid)) {
12 12
   header("Location: fleet.php");
13 13
   exit();
14 14
 }
15 15
 
16 16
 $objFleet = new Fleet();
17 17
 $objFleet->dbLoad($fleetid);
18
-if(!$objFleet->dbId) {
18
+if (!$objFleet->dbId) {
19 19
   message(classLocale::$lang['fl_fleet_not_exists'], classLocale::$lang['fl_error']);
20 20
 }
21 21
 
22
-if($objFleet->time_arrive_to_target <= SN_TIME_NOW || $objFleet->time_return_to_source < SN_TIME_NOW || $objFleet->isReturning()) {
22
+if ($objFleet->time_arrive_to_target <= SN_TIME_NOW || $objFleet->time_return_to_source < SN_TIME_NOW || $objFleet->isReturning()) {
23 23
   message(classLocale::$lang['fl_isback'], classLocale::$lang['fl_error']);
24 24
 }
25 25
 
26
-if($objFleet->playerOwnerId != $user['id']) {
26
+if ($objFleet->playerOwnerId != $user['id']) {
27 27
   classSupernova::$debug->warning(classLocale::$lang['fl_aks_hack_wrong_fleet'], 'Wrong Fleet Owner', 301);
28 28
   message(classLocale::$lang['fl_aks_hack_wrong_fleet'], classLocale::$lang['fl_error']);
29 29
 }
@@ -34,19 +34,19 @@  discard block
 block discarded – undo
34 34
 
35 35
 !$aks && !$userToAdd_unsafe ? $userToAdd_unsafe = $user['username'] : false;
36 36
 
37
-if($userToAdd_unsafe) {
37
+if ($userToAdd_unsafe) {
38 38
   $userToAdd = db_escape($userToAdd_unsafe);
39 39
   $userToAddID = DBStaticUser::db_user_by_username($userToAdd_unsafe, false, 'id', true, true);
40 40
   $userToAddID = $userToAddID['id'];
41 41
 
42
-  if($objFleet->target_owner_id == $userToAddID) {
42
+  if ($objFleet->target_owner_id == $userToAddID) {
43 43
     message(classLocale::$lang['flt_aks_player_same'], classLocale::$lang['fl_error']);
44 44
   }
45 45
 
46
-  if($userToAddID) {
47
-    if(!$aks) {
46
+  if ($userToAddID) {
47
+    if (!$aks) {
48 48
       // No AСS exists - making one
49
-      if(!$objFleet->group_id) {
49
+      if (!$objFleet->group_id) {
50 50
         DBStaticFleetACS::db_acs_insert($fleetid, $user, $objFleet);
51 51
 
52 52
         $aks = DBStaticFleetACS::db_acs_get_by_fleet($fleetid);
@@ -61,22 +61,22 @@  discard block
 block discarded – undo
61 61
 
62 62
     $isUserExists = false;
63 63
     $invited_ar = explode(",", $aks['eingeladen']);
64
-    foreach($invited_ar as $inv) {
65
-      if($userToAddID == $inv) {
64
+    foreach ($invited_ar as $inv) {
65
+      if ($userToAddID == $inv) {
66 66
         $isUserExists = true;
67 67
       }
68 68
     }
69 69
 
70
-    if(count($invited_ar) >= 5) {
70
+    if (count($invited_ar) >= 5) {
71 71
       message(classLocale::$lang['flt_aks_error_too_much_players'], classLocale::$lang['fl_error']);
72 72
     }
73 73
 
74
-    if($isUserExists) {
74
+    if ($isUserExists) {
75 75
       $userToAdd_unsafe != $user['username'] ? $add_user_message_mr = sprintf(classLocale::$lang['fl_aks_player_invited_already'], $userToAdd) : false;
76 76
     } else {
77 77
       $add_user_message_mr = sprintf(classLocale::$lang['fl_aks_player_invited'], $userToAdd);
78 78
       !(DBStaticFleetACS::db_acs_update($userToAddID, $fleetid)) ? die(sprintf(classLocale::$lang['fl_aks_adding_error'], classSupernova::$db->db_error())) : false;
79
-      $aks['eingeladen'] .= ',' . $userToAddID;
79
+      $aks['eingeladen'] .= ','.$userToAddID;
80 80
     }
81 81
     DBStaticMessages::msg_send_simple_message($userToAddID, $user['id'], SN_TIME_NOW, MSG_TYPE_COMBAT, $user['username'],
82 82
       classLocale::$lang['fl_aks_invite_message_header'], sprintf(classLocale::$lang['fl_aks_invite_message'], $user['username']));
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
   'MISSION_NAME' => classLocale::$lang['type_mission'][MT_ACS],
94 94
 ));
95 95
 
96
-if($aks['eingeladen'] && is_array($members = classSupernova::$gc->cacheOperator->db_get_record_list(LOC_USER, "`id` in ({$aks['eingeladen']})")) && !empty($members)) {
97
-  foreach($members as $row) {
96
+if ($aks['eingeladen'] && is_array($members = classSupernova::$gc->cacheOperator->db_get_record_list(LOC_USER, "`id` in ({$aks['eingeladen']})")) && !empty($members)) {
97
+  foreach ($members as $row) {
98 98
     $template->assign_block_vars('invited', array(
99 99
       'NAME' => $row['username'],
100 100
     ));
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 $fleet_data = tplParseFleetObject($objFleet, $i, $user);
120 120
 
121 121
 $template->assign_block_vars('fleets', $fleet_data['fleet']);
122
-foreach($fleet_data['ships'] as $ship_data) {
122
+foreach ($fleet_data['ships'] as $ship_data) {
123 123
   $template->assign_block_vars('fleets.ships', $ship_data);
124 124
 }
125 125
 
Please login to merge, or discard this patch.
includes/classes/DBStaticNews.php 2 patches
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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
       LEFT JOIN {{survey}} AS s ON s.survey_announce_id = a.idAnnounce
44 44
       LEFT JOIN {{users}} AS u ON u.id = a.user_id
45 45
     {$query_where}
46
-    ORDER BY `tsTimeStamp` DESC, idAnnounce" .
46
+    ORDER BY `tsTimeStamp` DESC, idAnnounce".
47 47
       ($query_limit ? " LIMIT {$query_limit}" : ''));
48 48
 
49 49
     $template->assign_var('NEWS_COUNT', classSupernova::$db->db_num_rows($announce_list));
Please login to merge, or discard this patch.
admin/adm_message_list.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 define('INSTALL', false);
13 13
 define('IN_ADMIN', true);
14 14
 
15
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
15
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
16 16
 
17
-if($user['authlevel'] < 3) {
17
+if ($user['authlevel'] < 3) {
18 18
   AdminMessage(classLocale::$lang['adm_err_denied']);
19 19
 }
20 20
 
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
   ),
29 29
 );
30 30
 $template->assign_block_vars('int_type_selected', $allowed_types[-1]);
31
-foreach(DBStaticMessages::$snMessageClassList as $key => $value) {
32
-  if($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX) {
31
+foreach (DBStaticMessages::$snMessageClassList as $key => $value) {
32
+  if ($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX) {
33 33
     continue;
34 34
   }
35 35
 
@@ -41,21 +41,21 @@  discard block
 block discarded – undo
41 41
 
42 42
 
43 43
 $deletedMessages = '';
44
-if($idMessageDelete = sys_get_param_id('msg_del')) {
44
+if ($idMessageDelete = sys_get_param_id('msg_del')) {
45 45
   DBStaticMessages::db_message_delete_by_id($idMessageDelete);
46 46
   $deletedMessages = $idMessageDelete;
47
-} elseif(sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete)) {
47
+} elseif (sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete)) {
48 48
   $message_delete = implode(', ', $message_delete);
49 49
   DBStaticMessages::db_message_list_delete_set($message_delete);
50 50
   $deletedMessages = $message_delete;
51 51
 }
52 52
 
53
-if($deletedMessages) {
53
+if ($deletedMessages) {
54 54
   $template->assign_block_vars('result', array('MESSAGE' => sprintf(classLocale::$lang['mlst_messages_deleted'], $deletedMessages)));
55 55
 }
56 56
 
57 57
 
58
-if(sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year'))) {
58
+if (sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year'))) {
59 59
   $delete_date = "{$year}-{$month}-{$day}";
60 60
   DBStaticMessages::db_message_list_delete_by_date($delete_date, $int_type_selected);
61 61
   $template->assign_block_vars('result', array('MESSAGE' => sprintf(classLocale::$lang['mlst_messages_deleted_date'], $allowed_types[$int_type_selected]['TEXT'], $delete_date)));
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 
68 68
 $int_page_current = min(sys_get_param_id('int_page_current', 1), $page_max);
69 69
 
70
-if(sys_get_param('page_prev') && $int_page_current > 1) {
70
+if (sys_get_param('page_prev') && $int_page_current > 1) {
71 71
   $int_page_current--;
72
-} elseif(sys_get_param('page_next') && $int_page_current < $page_max) {
72
+} elseif (sys_get_param('page_next') && $int_page_current < $page_max) {
73 73
   $int_page_current++;
74 74
 }
75 75
 
76
-for($i = 1; $i <= $page_max; $i++) {
76
+for ($i = 1; $i <= $page_max; $i++) {
77 77
   $template->assign_block_vars('page', array('NUMBER' => $i));
78 78
 }
79 79
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 $StartRec = ($int_page_current - 1) * 25;
82 82
 
83 83
 $Messages = DBStaticMessages::db_message_list_admin_by_type($int_type_selected, $StartRec);
84
-while($row = db_fetch($Messages)) {
84
+while ($row = db_fetch($Messages)) {
85 85
   $row['FROM'] = htmlentities($row['FROM'], ENT_COMPAT, 'UTF-8');
86 86
   $row['OWNER_NAME'] = htmlentities($row['OWNER_NAME'], ENT_COMPAT, 'UTF-8');
87 87
   $row['TEXT'] = nl2br($row['TEXT']);
Please login to merge, or discard this patch.
includes/classes/DBStaticChat.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
   /**
21 21
    * @param $user_id
22
-   * @param $nickUnsafe
22
+   * @param string $nickUnsafe
23 23
    * @param $ally_id
24 24
    * @param $message_unsafe
25 25
    * @param $chat_message_sender_name_unsafe
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
    * @param $alliance
55 55
    * @param $where_add
56 56
    * @param $start_row
57
-   * @param $page_limit
57
+   * @param integer $page_limit
58 58
    *
59 59
    * @return array|bool|mysqli_result|null
60 60
    */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
       JOIN {{users}} AS u ON u.id = cp.chat_player_player_id
13 13
     WHERE
14 14
       `chat_player_refresh_last` >= '{$sql_date}'
15
-      AND (`banaday` IS NULL OR `banaday` <= " . SN_TIME_NOW . ")
15
+      AND (`banaday` IS NULL OR `banaday` <= ".SN_TIME_NOW.")
16 16
       {$ally_add}
17 17
     ORDER BY authlevel DESC, `username`");
18 18
   }
Please login to merge, or discard this patch.