Completed
Push — work-fleets ( c79b12...e80c4a )
by SuperNova.WS
08:33 queued 03:23
created
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
@@ -21,13 +21,13 @@  discard block
 block discarded – undo
21 21
 
22 22
   public static function db_unit_count_by_user_and_type_and_snid($user_id, $unit_type = 0, $unit_snid = 0) {
23 23
     $query = doquery(
24
-      "SELECT unit_snid, sum(unit_level) as `qty`  FROM {{unit}} WHERE `unit_player_id` = {$user_id} " .
25
-      ($unit_type ? "AND `unit_type` = {$unit_type} " : '') .
26
-      ($unit_snid ? "AND `unit_snid` = {$unit_snid} " : '') .
24
+      "SELECT unit_snid, sum(unit_level) as `qty`  FROM {{unit}} WHERE `unit_player_id` = {$user_id} ".
25
+      ($unit_type ? "AND `unit_type` = {$unit_type} " : '').
26
+      ($unit_snid ? "AND `unit_snid` = {$unit_snid} " : '').
27 27
       'GROUP BY `unit_snid`'
28 28
     );
29 29
     $result = array();
30
-    while($row = db_fetch($query)) {
30
+    while ($row = db_fetch($query)) {
31 31
       $result[$row['unit_snid']] = $row;
32 32
     }
33 33
 
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
     WHERE
44 44
       f.fleet_owner = {$user_id} AND
45 45
       (f.fleet_start_planet_id = {$location_id} OR f.fleet_end_planet_id = {$location_id})
46
-      AND u.unit_snid = {$unit_snid} AND u.`unit_location_type` = " . LOC_FLEET . " AND " . self::db_unit_time_restrictions() .
47
-      " LIMIT 1" .
46
+      AND u.unit_snid = {$unit_snid} AND u.`unit_location_type` = ".LOC_FLEET." AND ".self::db_unit_time_restrictions().
47
+      " LIMIT 1".
48 48
       ($for_update ? ' FOR UPDATE' : '')
49 49
       , true);
50 50
   }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
   public static function db_unit_list_laboratories($user_id) {
54 54
     return doquery("SELECT DISTINCT unit_location_id AS `id`
55 55
     FROM {{unit}}
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 . ");");
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 59
   public static function db_unit_set_by_id($unit_id, $set) {
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 
72 72
   public static function db_unit_list_delete($user_id = 0, $unit_location_type, $unit_location_id, $unit_snid = 0) {
73 73
     return classSupernova::db_del_record_list(LOC_UNIT,
74
-      "`unit_location_type` = {$unit_location_type} AND `unit_location_id` = {$unit_location_id}" .
75
-      ($user_id = idval($user_id) ? " AND `unit_player_id` = {$user_id}" : '') .
74
+      "`unit_location_type` = {$unit_location_type} AND `unit_location_id` = {$unit_location_id}".
75
+      ($user_id = idval($user_id) ? " AND `unit_player_id` = {$user_id}" : '').
76 76
       ($unit_snid = idval($unit_snid) ? " AND `unit_snid` = {$unit_snid}" : ''));
77 77
   }
78 78
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     return doquery(
81 81
       "SELECT unit_player_id, unit_type, unit_snid, unit_level, count(*) AS unit_amount
82 82
     FROM `{{unit}}`
83
-    WHERE unit_level > 0 AND " . self::db_unit_time_restrictions() .
83
+    WHERE unit_level > 0 AND " . self::db_unit_time_restrictions().
84 84
       " GROUP BY unit_player_id, unit_type, unit_snid, unit_level"
85 85
     );
86 86
   }
@@ -92,15 +92,15 @@  discard block
 block discarded – undo
92 92
 
93 93
 
94 94
   public static function db_unit_list_admin_delete_mercenaries_finished() {
95
-    return doquery("DELETE FROM {{unit}} WHERE unit_time_finish IS NOT NULL AND unit_time_finish < FROM_UNIXTIME(" . SN_TIME_NOW . ") AND unit_type = " . UNIT_MERCENARIES);
95
+    return doquery("DELETE FROM {{unit}} WHERE unit_time_finish IS NOT NULL AND unit_time_finish < FROM_UNIXTIME(".SN_TIME_NOW.") AND unit_type = ".UNIT_MERCENARIES);
96 96
   }
97 97
 
98 98
   public static function db_unit_list_admin_set_mercenaries_expire_time($default_length) {
99 99
     return doquery(
100 100
       "UPDATE {{unit}}
101 101
     SET
102
-      unit_time_start = FROM_UNIXTIME(" . SN_TIME_NOW . "),
103
-      unit_time_finish = FROM_UNIXTIME(" . (SN_TIME_NOW + $default_length) . ")
102
+      unit_time_start = FROM_UNIXTIME(" . SN_TIME_NOW."),
103
+      unit_time_finish = FROM_UNIXTIME(" . (SN_TIME_NOW + $default_length).")
104 104
     WHERE unit_type = " . UNIT_MERCENARIES
105 105
     );
106 106
   }
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
   }
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
    * @param $POST_text
88 88
    */
89 89
   public static function db_ally_request_insert($user, $id_ally, $POST_text) {
90
-    doquery("INSERT INTO {{alliance_requests}} SET `id_user` = {$user['id']}, `id_ally`='{$id_ally}', request_text ='{$POST_text}', request_time=" . SN_TIME_NOW . ";");
90
+    doquery("INSERT INTO {{alliance_requests}} SET `id_user` = {$user['id']}, `id_ally`='{$id_ally}', request_text ='{$POST_text}', request_time=".SN_TIME_NOW.";");
91 91
   }
92 92
 
93 93
   /**
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
    * @param $ally
138 138
    */
139 139
   public static function db_ally_update_by_changeset($ally_changeset, $ally) {
140
-    doquery("UPDATE {{alliance}} SET " . implode(',', $ally_changeset) . " WHERE `id`='{$ally['id']}' LIMIT 1;");
140
+    doquery("UPDATE {{alliance}} SET ".implode(',', $ally_changeset)." WHERE `id`='{$ally['id']}' LIMIT 1;");
141 141
   }
142 142
 
143 143
   /**
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
    * @param $d
249 249
    */
250 250
   public static function db_ally_request_deny($d) {
251
-    doquery("UPDATE {{alliance_requests}} SET `request_denied` = 1, `request_text` = '" . classLocale::$lang['ali_req_deny_reason'] . "' WHERE `id_user`= {$d} LIMIT 1;");
251
+    doquery("UPDATE {{alliance_requests}} SET `request_denied` = 1, `request_text` = '".classLocale::$lang['ali_req_deny_reason']."' WHERE `id_user`= {$d} LIMIT 1;");
252 252
   }
253 253
 
254 254
   /**
Please login to merge, or discard this patch.
includes/classes/DBStaticChat.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
   /**
21 21
    * @param $user_id
22
-   * @param $nick
22
+   * @param string $nick
23 23
    * @param $ally_id
24
-   * @param $message
24
+   * @param string $message
25 25
    * @param $chat_message_sender_name
26 26
    * @param $chat_message_recipient_id
27 27
    * @param $chat_message_recipient_name
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
    * @param $alliance
58 58
    * @param $where_add
59 59
    * @param $start_row
60
-   * @param $page_limit
60
+   * @param integer $page_limit
61 61
    *
62 62
    * @return array|bool|mysqli_result|null
63 63
    */
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 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
   }
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
           `user` = '{$nick}',
36 36
           `ally_id` = '{$ally_id}',
37 37
           `message` = '{$message}',
38
-          `timestamp` = " . SN_TIME_NOW . ",
38
+          `timestamp` = ".SN_TIME_NOW.",
39 39
           `chat_message_sender_name` = '{$chat_message_sender_name}',
40 40
           `chat_message_recipient_id` = {$chat_message_recipient_id},
41 41
           `chat_message_recipient_name` = '{$chat_message_recipient_name}'"
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
    * @param $user
142 142
    */
143 143
   public static function db_chat_player_update($user) {
144
-    doquery("UPDATE {{chat_player}} SET `chat_player_refresh_last` = " . SN_TIME_NOW . " WHERE `chat_player_player_id` = {$user['id']} LIMIT 1;");
144
+    doquery("UPDATE {{chat_player}} SET `chat_player_refresh_last` = ".SN_TIME_NOW." WHERE `chat_player_player_id` = {$user['id']} LIMIT 1;");
145 145
   }
146 146
 
147 147
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
    * @param $user
213 213
    */
214 214
   public static function db_chat_player_update_activity($user) {
215
-    doquery("UPDATE {{chat_player}} SET `chat_player_activity` = '" . classSupernova::$db->db_escape(SN_TIME_SQL) . "' WHERE `chat_player_player_id` = {$user['id']} LIMIT 1");
215
+    doquery("UPDATE {{chat_player}} SET `chat_player_activity` = '".classSupernova::$db->db_escape(SN_TIME_SQL)."' WHERE `chat_player_player_id` = {$user['id']} LIMIT 1");
216 216
   }
217 217
 
218 218
 }
219 219
\ No newline at end of file
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
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@
 block discarded – undo
25 25
   }
26 26
 
27 27
   /**
28
-   * @param $template
29
-   * @param $query_where
30
-   * @param $query_limit
28
+   * @param template $template
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   +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.
includes/classes/DBStaticSurveyVote.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
    * @param $user
18 18
    * @param $survey_id
19 19
    * @param $survey_vote_id
20
-   * @param $user_name_safe
20
+   * @param string $user_name_safe
21 21
    */
22 22
   public static function db_survey_vote_insert(&$user, $survey_id, $survey_vote_id, $user_name_safe) {
23 23
     doquery("INSERT INTO {{survey_votes}} SET `survey_parent_id` = {$survey_id}, `survey_parent_answer_id` = {$survey_vote_id}, `survey_vote_user_id` = {$user['id']}, `survey_vote_user_name` = '{$user_name_safe}';");
Please login to merge, or discard this patch.
includes/classes/DBStaticMessages.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
     return doquery(
8 8
       "SELECT * FROM {{messages}}
9 9
         WHERE
10
-          `message_type` = '" . MSG_TYPE_PLAYER . "' AND
10
+          `message_type` = '" . MSG_TYPE_PLAYER."' AND
11 11
           ((`message_owner` = '{$user['id']}' AND `message_sender` = '{$recipient_id}')
12 12
           OR
13 13
           (`message_sender` = '{$user['id']}' AND `message_owner` = '{$recipient_id}')) ORDER BY `message_time` DESC LIMIT 20;");
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 FROM
54 54
   {{messages}} AS m
55 55
   LEFT JOIN {{users}} AS u ON u.id = m.message_owner " .
56
-      ($int_type_selected >= 0 ? "WHERE `message_type` = {$int_type_selected} " : '') .
56
+      ($int_type_selected >= 0 ? "WHERE `message_type` = {$int_type_selected} " : '').
57 57
       "ORDER BY
58 58
   `message_id` DESC
59 59
 LIMIT
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
   }
62 62
 
63 63
   public static function db_message_insert_all($message_type, $from, $subject, $text) {
64
-    return doquery($QryInsertMessage = 'INSERT INTO {{messages}} (`message_owner`, `message_sender`, `message_time`, `message_type`, `message_from`, `message_subject`, `message_text`) ' .
64
+    return doquery($QryInsertMessage = 'INSERT INTO {{messages}} (`message_owner`, `message_sender`, `message_time`, `message_type`, `message_from`, `message_subject`, `message_text`) '.
65 65
       "SELECT `id`, 0, unix_timestamp(now()), {$message_type}, '{$from}', '{$subject}', '{$text}' FROM {{users}}");
66 66
   }
67 67
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
    * @return array|bool|mysqli_result|null
72 72
    */
73 73
   public static function db_message_count_by_type($int_type_selected) {
74
-    $page_max = doquery('SELECT COUNT(*) AS `max` FROM {{messages}}' . ($int_type_selected >= 0 ? " WHERE `message_type` = {$int_type_selected};" : ''), true);
74
+    $page_max = doquery('SELECT COUNT(*) AS `max` FROM {{messages}}'.($int_type_selected >= 0 ? " WHERE `message_type` = {$int_type_selected};" : ''), true);
75 75
 
76 76
     return $page_max;
77 77
   }
@@ -88,15 +88,15 @@  discard block
 block discarded – undo
88 88
    * @param $int_type_selected
89 89
    */
90 90
   public static function db_message_list_delete_by_date($delete_date, $int_type_selected) {
91
-    doquery("DELETE FROM {{messages}} WHERE message_time <= UNIX_TIMESTAMP('{$delete_date}')" . ($int_type_selected >= 0 ? " AND `message_type` = {$int_type_selected}" : ''));
91
+    doquery("DELETE FROM {{messages}} WHERE message_time <= UNIX_TIMESTAMP('{$delete_date}')".($int_type_selected >= 0 ? " AND `message_type` = {$int_type_selected}" : ''));
92 92
   }
93 93
 
94 94
   /**
95 95
    * @param $insert_values
96 96
    */
97 97
   public static function db_message_insert($insert_values) {
98
-    doquery('INSERT INTO {{messages}} (`message_owner`, `message_sender`, `message_time`, `message_type`, `message_from`, `message_subject`, `message_text`) ' .
99
-      'VALUES ' . implode(',', $insert_values));
98
+    doquery('INSERT INTO {{messages}} (`message_owner`, `message_sender`, `message_time`, `message_type`, `message_from`, `message_subject`, `message_text`) '.
99
+      'VALUES '.implode(',', $insert_values));
100 100
   }
101 101
 
102 102
 
Please login to merge, or discard this patch.
includes/classes/DBStaticFleetMissile.php 1 patch
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 = doquery("SELECT * FROM {{iraks}} WHERE `fleet_end_time` <= " . SN_TIME_NOW . " FOR UPDATE;");
26
+    $iraks = doquery("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.
announce.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  */
10 10
 
11 11
 $allow_anonymous = true;
12
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
12
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
13 13
 
14 14
 global $config;
15 15
 
@@ -23,40 +23,40 @@  discard block
 block discarded – undo
23 23
 $mode = sys_get_param_str('mode');
24 24
 
25 25
 $announce = array();
26
-if($user['authlevel'] >= 3) {
27
-  if(!empty($text)) {
26
+if ($user['authlevel'] >= 3) {
27
+  if (!empty($text)) {
28 28
     $announce_time = strtotime($announce_time, SN_TIME_NOW);
29 29
     $announce_time = $announce_time ? $announce_time : SN_TIME_NOW;
30 30
 
31
-    if($mode == 'edit') {
31
+    if ($mode == 'edit') {
32 32
       DBStaticNews::db_news_update_set($announce_time, $text, $detail_url, $announce_id);
33 33
       DBStaticSurvey::db_survey_delete_by_id($announce_id);
34 34
     } else {
35 35
       DBStaticNews::db_news_insert_set($announce_time, $text, $detail_url, $user);
36 36
       $announce_id = db_insert_id();
37 37
     }
38
-    if(($survey_question = sys_get_param_str('survey_question')) && ($survey_answers = sys_get_param('survey_answers'))) {
38
+    if (($survey_question = sys_get_param_str('survey_question')) && ($survey_answers = sys_get_param('survey_answers'))) {
39 39
       $survey_answers = explode("\r\n", $survey_answers);
40 40
       $survey_until = strtotime($survey_until = sys_get_param_str('survey_until'), SN_TIME_NOW);
41 41
       $survey_until = date(FMT_DATE_TIME_SQL, $survey_until ? $survey_until : SN_TIME_NOW + PERIOD_DAY * 1);
42 42
       DBStaticSurvey::db_survey_insert($announce_id, $survey_question, $survey_until);
43 43
       $survey_id = db_insert_id();
44
-      foreach($survey_answers as $survey_answer) {
44
+      foreach ($survey_answers as $survey_answer) {
45 45
         $survey_answer = db_escape(trim($survey_answer));
46
-        if(empty($survey_answer)) {
46
+        if (empty($survey_answer)) {
47 47
           continue;
48 48
         }
49 49
         DBStaticSurveyAnswer::db_survey_answer_insert($survey_id, $survey_answer);
50 50
       }
51 51
     }
52 52
 
53
-    if($announce_time <= SN_TIME_NOW) {
54
-      if($announce_time > $config->var_news_last && $announce_time == SN_TIME_NOW) {
53
+    if ($announce_time <= SN_TIME_NOW) {
54
+      if ($announce_time > $config->var_news_last && $announce_time == SN_TIME_NOW) {
55 55
         $config->db_saveItem('var_news_last', $announce_time);
56 56
       }
57 57
 
58
-      if(sys_get_param_int('news_mass_mail')) {
59
-        $text = sys_get_param('text') . ($detail_url ? " <a href=\"{$detail_url}\"><span class=\"positive\">{$lang['news_more']}</span></a>" : '');
58
+      if (sys_get_param_int('news_mass_mail')) {
59
+        $text = sys_get_param('text').($detail_url ? " <a href=\"{$detail_url}\"><span class=\"positive\">{$lang['news_more']}</span></a>" : '');
60 60
         msg_send_simple_message('*', 0, 0, MSG_TYPE_ADMIN, $lang['sys_administration'], $lang['news_title'], $text);
61 61
       }
62 62
     }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
   }
67 67
 
68 68
   $survey_answers = '';
69
-  switch($mode) {
69
+  switch ($mode) {
70 70
     case 'del':
71 71
       DBStaticNews::db_news_delete_by_id($announce_id);
72 72
       $mode = '';
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
       $template->assign_var('ID', $announce_id);
77 77
     case 'copy':
78 78
       $announce = DBStaticNews::db_news_with_survey_select_by_id($announce_id);
79
-      if($announce['survey_id']) {
79
+      if ($announce['survey_id']) {
80 80
         $query = DBStaticSurveyAnswer::db_survey_answer_text_select_by_news($announce);
81
-        while($row = db_fetch($query)) {
81
+        while ($row = db_fetch($query)) {
82 82
           $survey_answers[] = $row['survey_answer_text'];
83 83
         }
84 84
         $survey_answers = implode("\r\n", $survey_answers);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     break;
87 87
   }
88 88
 } else {
89
-  $annQuery = 'WHERE UNIX_TIMESTAMP(`tsTimeStamp`) <= ' . SN_TIME_NOW;
89
+  $annQuery = 'WHERE UNIX_TIMESTAMP(`tsTimeStamp`) <= '.SN_TIME_NOW;
90 90
 }
91 91
 
92 92
 nws_render($template, $annQuery, 20);
Please login to merge, or discard this patch.