Completed
Push — work-fleets ( 1735a9...f6000a )
by SuperNova.WS
06:05
created
includes/alliance/ali_info.inc 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,37 +1,37 @@  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
 
7 7
 $template = gettemplate('ali_info', true);
8 8
 
9
-if($mode == 'exit') {
10
-  if($ally['ally_owner'] == $user['id']) {
9
+if ($mode == 'exit') {
10
+  if ($ally['ally_owner'] == $user['id']) {
11 11
     message(classLocale::$lang['Owner_cant_go_out'], classLocale::$lang['Alliance']);
12 12
   }
13 13
 
14
-  if(sys_get_param_int('ali_info_leave_confirm')) {
14
+  if (sys_get_param_int('ali_info_leave_confirm')) {
15 15
     sn_db_transaction_start();
16 16
     db_user_set_by_id($user['id'], "`ally_id` = null, `ally_name` = null, `ally_tag` = null, `ally_register_time` = 0, `ally_rank_id` = 0");
17 17
     db_ally_list_recalc_counts();
18 18
     sn_db_transaction_commit();
19 19
     message(sprintf(classLocale::$lang['ali_info_leave_success'], $ally['ally_name']), classLocale::$lang['sys_alliance']);
20 20
   }
21
-} elseif($mode == 'ainfo') {
21
+} elseif ($mode == 'ainfo') {
22 22
   $tag = sys_get_param_str('tag');
23 23
   $id_ally = sys_get_param_id('a');
24
-  if($tag) {
24
+  if ($tag) {
25 25
     $ally = db_ally_get_by_tag($tag);
26
-  } elseif($id_ally) {
26
+  } elseif ($id_ally) {
27 27
     $ally = db_ally_get_by_id($id_ally);
28 28
   }
29 29
 
30
-  if(!$ally) {
30
+  if (!$ally) {
31 31
     message(classLocale::$lang['ali_sys_notFound'], classLocale::$lang['Ally_info_1']);
32 32
   }
33 33
 
34
-  if(!$ally['ally_description']) {
34
+  if (!$ally['ally_description']) {
35 35
     $ally['ally_description'] = classLocale::$lang['Ally_nodescription'];
36 36
   }
37 37
 
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 } else {
44 44
   $page_header = classLocale::$lang['your_alliance'];
45 45
 
46
-  if($ally['ally_owner'] == $user['id']) {
46
+  if ($ally['ally_owner'] == $user['id']) {
47 47
     $range = $ally['ally_owner_range'] ? $ally['ally_owner_range'] : classLocale::$lang['Founder'];
48
-  } elseif($user['ally_rank_id'] != 0 && isset($ranks[$user['ally_rank_id']]['name'])) {
48
+  } elseif ($user['ally_rank_id'] != 0 && isset($ranks[$user['ally_rank_id']]['name'])) {
49 49
     $range = $ranks[$user['ally_rank_id']]['name'];
50 50
   } else {
51 51
     $range = classLocale::$lang['member'];
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 ));
87 87
 
88 88
 $relations = ali_relations($ally['id']);
89
-foreach($relations as $relation) {
90
-  if($relation['alliance_diplomacy_contr_ally_id'] && $relation['alliance_diplomacy_ally_id']) {
89
+foreach ($relations as $relation) {
90
+  if ($relation['alliance_diplomacy_contr_ally_id'] && $relation['alliance_diplomacy_ally_id']) {
91 91
     $template->assign_block_vars('relation', array(
92 92
       'NAME'     => $relation['alliance_diplomacy_contr_ally_name'],
93 93
       'RELATION' => classLocale::$lang['ali_dip_relations'][$relation['alliance_diplomacy_relation']],
@@ -106,4 +106,4 @@  discard block
 block discarded – undo
106 106
 
107 107
 ali_render();
108 108
 
109
-display($template, classLocale::$lang['your_alliance'] . ' [' . $ally['ally_name'] . ']');
109
+display($template, classLocale::$lang['your_alliance'].' ['.$ally['ally_name'].']');
Please login to merge, or discard this patch.
includes/alliance/ali_internal_admin_mail.inc 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@
 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
 
7
-if(!$user_can_send_mails) {
7
+if (!$user_can_send_mails) {
8 8
   message(classLocale::$lang['Denied_access'], classLocale::$lang['Send_circular_mail']);
9 9
 }
10 10
 
11 11
 $POST_text = sys_get_param_str('text');
12
-if($POST_text) {
13
-  message(classLocale::$lang['members_who_recived_message'] . msg_ali_send($POST_text, classLocale::$lang['ali_adm_msg_subject'], sys_get_param_int('r')), classLocale::$lang['Circular_sended'], "alliance.php", '');
12
+if ($POST_text) {
13
+  message(classLocale::$lang['members_who_recived_message'].msg_ali_send($POST_text, classLocale::$lang['ali_adm_msg_subject'], sys_get_param_int('r')), classLocale::$lang['Circular_sended'], "alliance.php", '');
14 14
 }
15 15
 
16
-$r_list = "<option value=\"-1\">" . classLocale::$lang['All_players'] . "</option>";
17
-if($ranks) {
18
-  foreach($ranks as $id => $array) {
19
-    $r_list .= "<option value=\"" . $id . "\">" . $array['name'] . "</option>";
16
+$r_list = "<option value=\"-1\">".classLocale::$lang['All_players']."</option>";
17
+if ($ranks) {
18
+  foreach ($ranks as $id => $array) {
19
+    $r_list .= "<option value=\"".$id."\">".$array['name']."</option>";
20 20
   }
21 21
 }
22 22
 
Please login to merge, or discard this patch.
includes/alliance/ali_internal_admin.inc 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  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
 
7
-if(!$user_admin) {
7
+if (!$user_admin) {
8 8
   message(classLocale::$lang['Denied_access'], classLocale::$lang['ally_admin']);
9 9
 }
10 10
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 $allyTextID = ($allyTextID < 1 || $allyTextID > 3) ? 1 : $allyTextID;
21 21
 
22 22
 
23
-if(sys_get_param_str('isSaveOptions')) {
23
+if (sys_get_param_str('isSaveOptions')) {
24 24
   require_once('includes/includes/sys_avatar.php');
25 25
 
26 26
   $new_image = $ally['ally_image'];
@@ -32,46 +32,46 @@  discard block
 block discarded – undo
32 32
 //  $template->assign_block_vars('result', $avatar_upload_result);
33 33
 
34 34
   $ally_changeset = array();
35
-  if(($new_tag = sys_get_param_str_unsafe('tag', $ally['ally_tag'])) && $new_tag != $ally['ally_tag']) {
35
+  if (($new_tag = sys_get_param_str_unsafe('tag', $ally['ally_tag'])) && $new_tag != $ally['ally_tag']) {
36 36
     $new_tag = db_escape($new_tag);
37 37
     $ally_changeset[] = "`ally_tag`='{$new_tag}'";
38 38
     db_user_set_by_id($ally['ally_user_id'], "`username`='[{$new_tag}]'");
39 39
   }
40
-  if(($new_name = sys_get_param_str_unsafe('name', $ally['ally_name'])) && $new_name != $ally['ally_name']) {
40
+  if (($new_name = sys_get_param_str_unsafe('name', $ally['ally_name'])) && $new_name != $ally['ally_name']) {
41 41
     $new_name = db_escape($new_name);
42 42
     $ally_changeset[] = "`ally_name`='{$new_name}'";
43 43
   }
44 44
 
45
-  if(($new_owner_rank = sys_get_param_str_unsafe('owner_range', $ally['ally_owner_range'])) && $new_owner_rank != $ally['ally_owner_range']) {
45
+  if (($new_owner_rank = sys_get_param_str_unsafe('owner_range', $ally['ally_owner_range'])) && $new_owner_rank != $ally['ally_owner_range']) {
46 46
     $new_owner_rank = db_escape($new_owner_rank);
47 47
     $ally_changeset[] = "`ally_owner_range` = '{$new_owner_rank}'";
48 48
   }
49
-  if(($new_web = sys_get_param_str_unsafe('web', $ally['ally_web'])) && $new_web != $ally['ally_web']) {
49
+  if (($new_web = sys_get_param_str_unsafe('web', $ally['ally_web'])) && $new_web != $ally['ally_web']) {
50 50
     $new_web = db_escape($new_web);
51 51
     $ally_changeset[] = "`ally_web` = '{$new_web}'";
52 52
   }
53 53
   $new_request = sys_get_param_int('request_notallow', $ally['ally_request_notallow']);
54 54
   $ally_changeset[] = "`ally_request_notallow` = '{$new_request}'";
55
-  if($new_image != $ally['ally_image']) {
55
+  if ($new_image != $ally['ally_image']) {
56 56
     $new_image = intval($new_image);
57 57
     $ally_changeset[] = "`ally_image` = '{$new_image}'";
58 58
   }
59 59
 
60
-  if(!empty($ally_changeset)) {
60
+  if (!empty($ally_changeset)) {
61 61
     db_ally_update_by_changeset($ally_changeset, $ally);
62 62
     sys_redirect('alliance.php?mode=admin&edit=ally');
63 63
   }
64
-} elseif(sys_get_param_str('isSaveText')) {
64
+} elseif (sys_get_param_str('isSaveText')) {
65 65
   $text = sys_get_param_str_both('text');
66 66
   db_ally_update_texts($text_list, $allyTextID, $text, $ally);
67 67
   $ally[$text_list[$allyTextID]['db_field']] = $text['unsafe'];
68
-} elseif(sys_get_param_str('isTransfer') && $idNewLeader = sys_get_param_id('idNewLeader')) {
69
-  if(!$isAllyOwner) {
68
+} elseif (sys_get_param_str('isTransfer') && $idNewLeader = sys_get_param_id('idNewLeader')) {
69
+  if (!$isAllyOwner) {
70 70
     message(classLocale::$lang['Denied_access'], classLocale::$lang['ally_admin']);
71 71
   }
72 72
 
73 73
   $newLeader = db_user_by_id($idNewLeader, false, `ally_id`);
74
-  if($newLeader['ally_id'] == $user['ally_id']) {
74
+  if ($newLeader['ally_id'] == $user['ally_id']) {
75 75
     sn_db_transaction_start();
76 76
     db_user_set_by_id($user['id'], "`ally_rank_id`='0'");
77 77
     db_ally_update_owner($idNewLeader, $user);
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
     sn_db_transaction_commit();
80 80
     sys_redirect('alliance.php');
81 81
   }
82
-} elseif(sys_get_param_str('isDisband') && sys_get_param_str('isConfirmDisband')) {
83
-  if(!$isAllyOwner) {
82
+} elseif (sys_get_param_str('isDisband') && sys_get_param_str('isConfirmDisband')) {
83
+  if (!$isAllyOwner) {
84 84
     message(classLocale::$lang['Denied_access'], classLocale::$lang['ally_admin']);
85 85
   }
86 86
   sn_db_transaction_start();
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 $request = db_ally_request_count_by_id($ally);
94 94
 
95 95
 $template->assign_vars(array(
96
-  'request_count'           => $request['request_count'] ? classLocale::$lang['ali_req_requestCount'] . ': ' . intval($request['request_count']) . '. ' . classLocale::$lang['ali_req_check'] : classLocale::$lang['ali_req_emptyList'],
96
+  'request_count'           => $request['request_count'] ? classLocale::$lang['ali_req_requestCount'].': '.intval($request['request_count']).'. '.classLocale::$lang['ali_req_check'] : classLocale::$lang['ali_req_emptyList'],
97 97
   'text'                    => $ally[$text_list[$allyTextID]['db_field']],
98 98
   'request_type'            => classLocale::$lang[$text_list[$allyTextID]['text_type']],
99 99
   't'                       => $allyTextID,
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
   $userAllyAdmins = db_user_list("`ally_id`= {$ally['id']}", false, '`id`, `username`');
127 127
   unset($tmp);
128 128
   // while ($userAllyAdmin = db_fetch($userAllyAdmins))
129
-  foreach($userAllyAdmins as $userAllyAdmin) {
129
+  foreach ($userAllyAdmins as $userAllyAdmin) {
130 130
 // pdump($userAllyAdmin);
131 131
     $tmp .= "<option value={$userAllyAdmin['id']}>{$userAllyAdmin['username']}</option>";
132 132
   }
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
   $template->assign_var('adminMembers', $tmp);
135 135
 }
136 136
 
137
-foreach($sn_ali_admin_internal as $sn_ali_admin_action => $sn_ali_admin_action_locale) {
138
-  if(!$sn_ali_admin_action_locale['title']) {
137
+foreach ($sn_ali_admin_internal as $sn_ali_admin_action => $sn_ali_admin_action_locale) {
138
+  if (!$sn_ali_admin_action_locale['title']) {
139 139
     continue;
140 140
   }
141 141
   $template->assign_block_vars('admin_actions', array(
Please login to merge, or discard this patch.
includes/alliance/ali_internal_admin_rights.inc 1 patch
Spacing   +9 added lines, -9 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
 {
5 5
   classSupernova::$debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
6 6
 }
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 $new_rank_name = sys_get_param_str('newRankName');
15 15
 if ($new_rank_name)
16 16
 {
17
-  foreach($ally_rights as $fieldName)
17
+  foreach ($ally_rights as $fieldName)
18 18
   {
19 19
     $newRank[$fieldName] = 0;
20 20
   }
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 {
29 29
   unset($ranks);
30 30
 
31
-  foreach($rankListInput as $rankID => $rank)
31
+  foreach ($rankListInput as $rankID => $rank)
32 32
   {
33
-    foreach($ally_rights as $rightName)
33
+    foreach ($ally_rights as $rightName)
34 34
     {
35 35
       $ranks[$rankID][$rightName] = $rank[$rightName] ? 1 : 0;
36 36
     }
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 $d = sys_get_param_int('d');
42 42
 if ($d && isset($ranks[$d]))
43 43
 {
44
-  if(count($ranks) == 1)
44
+  if (count($ranks) == 1)
45 45
   {
46 46
     message(classLocale::$lang['ali_adm_lastRank'], classLocale::$lang['ali_adm_rights_title']);
47 47
   }
@@ -53,17 +53,17 @@  discard block
 block discarded – undo
53 53
 
54 54
 if (count($ranks))
55 55
 {
56
-  foreach($ranks as $rankID => $rank)
56
+  foreach ($ranks as $rankID => $rank)
57 57
   {
58 58
     $rank_data = array(
59 59
       'ID'   => $rankID,
60 60
       'NAME' => $rank['name'],
61 61
     );
62 62
 
63
-    for($i = 1; $i < count($rank); $i++)
63
+    for ($i = 1; $i < count($rank); $i++)
64 64
     {
65
-      $rank_data['R' . $i] = (($rank[$ally_rights[$i]] == 1) ? ' checked' : '') ;
66
-      $rank_data['N' . $i] = $ally_rights[$i];
65
+      $rank_data['R'.$i] = (($rank[$ally_rights[$i]] == 1) ? ' checked' : '');
66
+      $rank_data['N'.$i] = $ally_rights[$i];
67 67
     }
68 68
 
69 69
     $template->assign_block_vars('rank', $rank_data);
Please login to merge, or discard this patch.
includes/db/db_queries_ally.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
     `ally_name` = '{$ally_name}',
65 65
     `ally_tag` = '{$ally_tag}',
66 66
     `ally_owner` = '{$user['id']}',
67
-    `ally_owner_range` = '" . classLocale::$lang['ali_leaderRank'] . "',
67
+    `ally_owner_range` = '".classLocale::$lang['ali_leaderRank']."',
68 68
     `ally_members` = 1,
69
-    `ranklist` = '" . classLocale::$lang['ali_defaultRankName'] . ",0,0,0,0,0',
69
+    `ranklist` = '" . classLocale::$lang['ali_defaultRankName'].",0,0,0,0,0',
70 70
     `ally_register_time`= " . SN_TIME_NOW
71 71
   );
72 72
 }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
  * @param $POST_text
86 86
  */
87 87
 function db_ally_request_insert($user, $id_ally, $POST_text) {
88
-  doquery("INSERT INTO {{alliance_requests}} SET `id_user` = {$user['id']}, `id_ally`='{$id_ally}', request_text ='{$POST_text}', request_time=" . SN_TIME_NOW . ";");
88
+  doquery("INSERT INTO {{alliance_requests}} SET `id_user` = {$user['id']}, `id_ally`='{$id_ally}', request_text ='{$POST_text}', request_time=".SN_TIME_NOW.";");
89 89
 }
90 90
 
91 91
 /**
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
  * @param $ally
136 136
  */
137 137
 function db_ally_update_by_changeset($ally_changeset, $ally) {
138
-  doquery("UPDATE {{alliance}} SET " . implode(',', $ally_changeset) . " WHERE `id`='{$ally['id']}' LIMIT 1;");
138
+  doquery("UPDATE {{alliance}} SET ".implode(',', $ally_changeset)." WHERE `id`='{$ally['id']}' LIMIT 1;");
139 139
 }
140 140
 
141 141
 /**
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
  * @param $d
247 247
  */
248 248
 function db_ally_request_deny($d) {
249
-  doquery("UPDATE {{alliance_requests}} SET `request_denied` = 1, `request_text` = '" . classLocale::$lang['ali_req_deny_reason'] . "' WHERE `id_user`= {$d} LIMIT 1;");
249
+  doquery("UPDATE {{alliance_requests}} SET `request_denied` = 1, `request_text` = '".classLocale::$lang['ali_req_deny_reason']."' WHERE `id_user`= {$d} LIMIT 1;");
250 250
 }
251 251
 
252 252
 /**
Please login to merge, or discard this patch.
includes/db/db_queries_messages.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
   return doquery(
6 6
     "SELECT * FROM {{messages}}
7 7
         WHERE
8
-          `message_type` = '" . MSG_TYPE_PLAYER . "' AND
8
+          `message_type` = '" . MSG_TYPE_PLAYER."' AND
9 9
           ((`message_owner` = '{$user['id']}' AND `message_sender` = '{$recipient_id}')
10 10
           OR
11 11
           (`message_sender` = '{$user['id']}' AND `message_owner` = '{$recipient_id}')) ORDER BY `message_time` DESC LIMIT 20;");
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 FROM
52 52
   {{messages}} AS m
53 53
   LEFT JOIN {{users}} AS u ON u.id = m.message_owner " .
54
-    ($int_type_selected >= 0 ? "WHERE `message_type` = {$int_type_selected} " : '') .
54
+    ($int_type_selected >= 0 ? "WHERE `message_type` = {$int_type_selected} " : '').
55 55
     "ORDER BY
56 56
   `message_id` DESC
57 57
 LIMIT
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 }
60 60
 
61 61
 function db_message_insert_all($message_type, $from, $subject, $text) {
62
-  return doquery($QryInsertMessage = 'INSERT INTO {{messages}} (`message_owner`, `message_sender`, `message_time`, `message_type`, `message_from`, `message_subject`, `message_text`) ' .
62
+  return doquery($QryInsertMessage = 'INSERT INTO {{messages}} (`message_owner`, `message_sender`, `message_time`, `message_type`, `message_from`, `message_subject`, `message_text`) '.
63 63
     "SELECT `id`, 0, unix_timestamp(now()), {$message_type}, '{$from}', '{$subject}', '{$text}' FROM {{users}}");
64 64
 }
65 65
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
  * @return array|bool|mysqli_result|null
70 70
  */
71 71
 function db_message_count_by_type($int_type_selected) {
72
-  $page_max = doquery('SELECT COUNT(*) AS `max` FROM {{messages}}' . ($int_type_selected >= 0 ? " WHERE `message_type` = {$int_type_selected};" : ''), true);
72
+  $page_max = doquery('SELECT COUNT(*) AS `max` FROM {{messages}}'.($int_type_selected >= 0 ? " WHERE `message_type` = {$int_type_selected};" : ''), true);
73 73
 
74 74
   return $page_max;
75 75
 }
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
  * @param $int_type_selected
87 87
  */
88 88
 function db_message_list_delete_by_date($delete_date, $int_type_selected) {
89
-  doquery("DELETE FROM {{messages}} WHERE message_time <= UNIX_TIMESTAMP('{$delete_date}')" . ($int_type_selected >= 0 ? " AND `message_type` = {$int_type_selected}" : ''));
89
+  doquery("DELETE FROM {{messages}} WHERE message_time <= UNIX_TIMESTAMP('{$delete_date}')".($int_type_selected >= 0 ? " AND `message_type` = {$int_type_selected}" : ''));
90 90
 }
91 91
 
92 92
 /**
93 93
  * @param $insert_values
94 94
  */
95 95
 function db_message_insert($insert_values) {
96
-  doquery('INSERT INTO {{messages}} (`message_owner`, `message_sender`, `message_time`, `message_type`, `message_from`, `message_subject`, `message_text`) ' .
97
-    'VALUES ' . implode(',', $insert_values));
96
+  doquery('INSERT INTO {{messages}} (`message_owner`, `message_sender`, `message_time`, `message_type`, `message_from`, `message_subject`, `message_text`) '.
97
+    'VALUES '.implode(',', $insert_values));
98 98
 }
Please login to merge, or discard this patch.
includes/db/db_queries_chat.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
       JOIN {{users}} AS u ON u.id = cp.chat_player_player_id
11 11
     WHERE
12 12
       `chat_player_refresh_last` >= '{$sql_date}'
13
-      AND (`banaday` IS NULL OR `banaday` <= " . SN_TIME_NOW . ")
13
+      AND (`banaday` IS NULL OR `banaday` <= ".SN_TIME_NOW.")
14 14
       {$ally_add}
15 15
     ORDER BY authlevel DESC, `username`");
16 16
 }
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
           `user` = '{$nick}',
34 34
           `ally_id` = '{$ally_id}',
35 35
           `message` = '{$message}',
36
-          `timestamp` = " . SN_TIME_NOW . ",
36
+          `timestamp` = ".SN_TIME_NOW.",
37 37
           `chat_message_sender_name` = '{$chat_message_sender_name}',
38 38
           `chat_message_recipient_id` = {$chat_message_recipient_id},
39 39
           `chat_message_recipient_name` = '{$chat_message_recipient_name}'"
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
  * @param $user
140 140
  */
141 141
 function db_chat_player_update($user) {
142
-  doquery("UPDATE {{chat_player}} SET `chat_player_refresh_last` = " . SN_TIME_NOW . " WHERE `chat_player_player_id` = {$user['id']} LIMIT 1;");
142
+  doquery("UPDATE {{chat_player}} SET `chat_player_refresh_last` = ".SN_TIME_NOW." WHERE `chat_player_player_id` = {$user['id']} LIMIT 1;");
143 143
 }
144 144
 
145 145
 
@@ -211,5 +211,5 @@  discard block
 block discarded – undo
211 211
  * @param $user
212 212
  */
213 213
 function db_chat_player_update_activity($user) {
214
-  doquery("UPDATE {{chat_player}} SET `chat_player_activity` = '" . classSupernova::$db->db_escape(SN_TIME_SQL) . "' WHERE `chat_player_player_id` = {$user['id']} LIMIT 1");
214
+  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 215
 }
Please login to merge, or discard this patch.
includes/db/db_helpers.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,19 +27,19 @@
 block discarded – undo
27 27
  */
28 28
 function db_set_make_safe_string($set, $delta = false) {
29 29
   $set_safe = array();
30
-  foreach($set as $field => $value) {
31
-    if(empty($field)) {
30
+  foreach ($set as $field => $value) {
31
+    if (empty($field)) {
32 32
       continue;
33 33
     }
34 34
 
35
-    $field = '`' . db_escape($field) . '`';
35
+    $field = '`'.db_escape($field).'`';
36 36
     $new_value = $value;
37
-    if($value === null) {
37
+    if ($value === null) {
38 38
       $new_value = 'NULL';
39
-    } elseif(is_string($value) && (string)($new_value = floatval($value)) != (string)$value) {
39
+    } elseif (is_string($value) && (string) ($new_value = floatval($value)) != (string) $value) {
40 40
       // non-float
41
-      $new_value = '"' . db_escape($value) . '"';
42
-    } elseif($delta) {
41
+      $new_value = '"'.db_escape($value).'"';
42
+    } elseif ($delta) {
43 43
       // float and DELTA-set
44 44
       $new_value = "{$field} + ({$new_value})";
45 45
     }
Please login to merge, or discard this patch.
includes/db/db_queries_notes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
  * @param $note_id_edit
35 35
  */
36 36
 function db_note_update_by_id($note_priority, $note_title, $note_text, $note_galaxy, $note_system, $note_planet, $note_planet_type, $note_sticky, $note_id_edit) {
37
-  doquery("UPDATE {{notes}} SET `time` = " . SN_TIME_NOW . ", `priority` = {$note_priority}, `title` = '{$note_title}', `text` = '{$note_text}',
37
+  doquery("UPDATE {{notes}} SET `time` = ".SN_TIME_NOW.", `priority` = {$note_priority}, `title` = '{$note_title}', `text` = '{$note_text}',
38 38
         `galaxy` = {$note_galaxy}, `system` = {$note_system}, `planet` = {$note_planet}, `planet_type` = {$note_planet_type}, `sticky` = {$note_sticky}
39 39
         WHERE `id` = {$note_id_edit} LIMIT 1;");
40 40
 }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
  * @param $note_sticky
52 52
  */
53 53
 function db_note_insert($user, $note_priority, $note_title, $note_text, $note_galaxy, $note_system, $note_planet, $note_planet_type, $note_sticky) {
54
-  doquery("INSERT INTO {{notes}} SET `owner` = {$user['id']}, `time` = " . SN_TIME_NOW . ", `priority` = {$note_priority}, `title` = '{$note_title}', `text` = '{$note_text}',
54
+  doquery("INSERT INTO {{notes}} SET `owner` = {$user['id']}, `time` = ".SN_TIME_NOW.", `priority` = {$note_priority}, `title` = '{$note_title}', `text` = '{$note_text}',
55 55
         `galaxy` = {$note_galaxy}, `system` = {$note_system}, `planet` = {$note_planet}, `planet_type` = {$note_planet_type}, `sticky` = {$note_sticky};");
56 56
 }
57 57
 
Please login to merge, or discard this patch.