@@ -67,17 +67,17 @@ discard block |
||
67 | 67 | { |
68 | 68 | $context = new RequestContext(); |
69 | 69 | $context->fromRequest($this->symfony_request); |
70 | - $baseUrl = generate_board_url(true) . $context->getBaseUrl(); |
|
70 | + $baseUrl = generate_board_url(true).$context->getBaseUrl(); |
|
71 | 71 | |
72 | 72 | $scriptName = $this->symfony_request->getScriptName(); |
73 | 73 | $scriptName = substr($scriptName, -1, 1) == '/' ? '' : utf8_basename($scriptName); |
74 | 74 | |
75 | 75 | if ($scriptName != '') { |
76 | - $baseUrl = str_replace('/' . $scriptName, '', $baseUrl); |
|
76 | + $baseUrl = str_replace('/'.$scriptName, '', $baseUrl); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | $friends = $this->model->getFriends(); |
80 | - $friends_online = array_filter($friends, function ($friend) { |
|
80 | + $friends_online = array_filter($friends, function($friend) { |
|
81 | 81 | return $friend['user_status'] != 0; |
82 | 82 | }); |
83 | 83 | $this->template->assign_var('S_COUNT_FRIENDS', count($friends_online)); |
@@ -118,13 +118,13 @@ discard block |
||
118 | 118 | { |
119 | 119 | $context = new RequestContext(); |
120 | 120 | $context->fromRequest($this->symfony_request); |
121 | - $baseUrl = generate_board_url(true) . $context->getBaseUrl(); |
|
121 | + $baseUrl = generate_board_url(true).$context->getBaseUrl(); |
|
122 | 122 | |
123 | 123 | $scriptName = $this->symfony_request->getScriptName(); |
124 | 124 | $scriptName = substr($scriptName, -1, 1) == '/' ? '' : utf8_basename($scriptName); |
125 | 125 | |
126 | 126 | if ($scriptName != '') { |
127 | - $baseUrl = str_replace('/' . $scriptName, '', $baseUrl); |
|
127 | + $baseUrl = str_replace('/'.$scriptName, '', $baseUrl); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | $user_id = $event['member']['user_id']; |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | u.user_colour, |
74 | 74 | s.session_id, |
75 | 75 | s.session_time |
76 | - FROM " . $this->user_friends_table . " |
|
77 | - LEFT JOIN " . USERS_TABLE . " AS u ON u.user_id = " . $this->user_friends_table . ".friend_id |
|
78 | - LEFT JOIN " . SESSIONS_TABLE . " AS s ON s.session_user_id = u.user_id |
|
79 | - WHERE " . $this->user_friends_table . ".user_id = " . (int)$this->user->data['user_id'] . " |
|
76 | + FROM " . $this->user_friends_table." |
|
77 | + LEFT JOIN " . USERS_TABLE." AS u ON u.user_id = ".$this->user_friends_table.".friend_id |
|
78 | + LEFT JOIN " . SESSIONS_TABLE." AS s ON s.session_user_id = u.user_id |
|
79 | + WHERE " . $this->user_friends_table.".user_id = ".(int)$this->user->data['user_id']." |
|
80 | 80 | GROUP BY u.user_id |
81 | 81 | "; |
82 | 82 | $result = $this->phpbb_db->sql_query($sql); |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | { |
106 | 106 | $sql = " |
107 | 107 | SELECT COUNT(zebra_id) as friend_count |
108 | - FROM " . ZEBRA_TABLE . " |
|
109 | - WHERE user_id = " . (int)$friend_id . " |
|
110 | - AND zebra_id = " . (int)$this->user->data['user_id'] . " |
|
108 | + FROM " . ZEBRA_TABLE." |
|
109 | + WHERE user_id = " . (int)$friend_id." |
|
110 | + AND zebra_id = " . (int)$this->user->data['user_id']." |
|
111 | 111 | AND friend = 1 |
112 | 112 | AND foe = 0 |
113 | 113 | "; |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | |
292 | 292 | foreach ($sentFiles as $file) { |
293 | 293 | $item = array(); |
294 | - $item['id'] = 'f_' . $file['id']; |
|
294 | + $item['id'] = 'f_'.$file['id']; |
|
295 | 295 | $item['sender_id'] = $file['sender_id']; |
296 | 296 | $item['receiver_id'] = $file['receiver_id']; |
297 | 297 | $item['fileName'] = $file['fileName']; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | foreach ($getFiles as $file) { |
306 | 306 | $item = array(); |
307 | - $item['id'] = 'f_' . $file['id']; |
|
307 | + $item['id'] = 'f_'.$file['id']; |
|
308 | 308 | $item['sender_id'] = $file['sender_id']; |
309 | 309 | $item['receiver_id'] = $file['receiver_id']; |
310 | 310 | $item['fileName'] = $file['fileName']; |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | |
318 | 318 | $unsorted_messages = array_merge($sent, $inbox); |
319 | 319 | |
320 | - uasort($unsorted_messages, function ($a, $b) { |
|
320 | + uasort($unsorted_messages, function($a, $b) { |
|
321 | 321 | return ($a['sentAt'] > $b['sentAt']) ? -1 : 1; |
322 | 322 | }); |
323 | 323 |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | u.user_colour, |
40 | 40 | s.session_id, |
41 | 41 | s.session_time |
42 | - FROM " . $this->user_friends_table . " |
|
43 | - LEFT JOIN " . USERS_TABLE . " AS u ON u.user_id = " . $this->user_friends_table . ".friend_id |
|
44 | - LEFT JOIN " . SESSIONS_TABLE . " AS s ON s.session_user_id = u.user_id |
|
45 | - WHERE " . $this->user_friends_table . ".user_id = " . (int)$this->user->data['user_id'] . " |
|
42 | + FROM " . $this->user_friends_table." |
|
43 | + LEFT JOIN " . USERS_TABLE." AS u ON u.user_id = ".$this->user_friends_table.".friend_id |
|
44 | + LEFT JOIN " . SESSIONS_TABLE." AS s ON s.session_user_id = u.user_id |
|
45 | + WHERE " . $this->user_friends_table.".user_id = ".(int)$this->user->data['user_id']." |
|
46 | 46 | GROUP BY u.user_id |
47 | 47 | "; |
48 | 48 | $result = $this->db->sql_query($sql); |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | `sender_id`, |
73 | 73 | `status`, |
74 | 74 | `time` |
75 | - FROM " . $this->friends_request_table . " |
|
76 | - WHERE `user_id` = " . (int)$this->user->data['user_id'] . " |
|
75 | + FROM " . $this->friends_request_table." |
|
76 | + WHERE `user_id` = " . (int)$this->user->data['user_id']." |
|
77 | 77 | AND `status` = 0 |
78 | 78 | ORDER BY `time` DESC |
79 | 79 | "; |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | `sender_id`, |
96 | 96 | `status`, |
97 | 97 | `time` |
98 | - FROM " . $this->friends_request_table . " |
|
99 | - WHERE `request_id` = " . (int)$id . " |
|
98 | + FROM " . $this->friends_request_table." |
|
99 | + WHERE `request_id` = " . (int)$id." |
|
100 | 100 | AND `status` = 0 |
101 | 101 | ORDER BY `time` DESC |
102 | 102 | LIMIT 1 |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | `sender_id`, |
120 | 120 | `status`, |
121 | 121 | `time` |
122 | - FROM " . $this->friends_request_table . " |
|
123 | - WHERE `sender_id` = " . (int)$sender_id . " |
|
122 | + FROM " . $this->friends_request_table." |
|
123 | + WHERE `sender_id` = " . (int)$sender_id." |
|
124 | 124 | AND `status` = 0 |
125 | 125 | ORDER BY `time` DESC |
126 | 126 | LIMIT 1 |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | public function insert_friends_request(array $data) |
135 | 135 | { |
136 | 136 | $sql = " |
137 | - INSERT INTO " . $this->friends_request_table . " |
|
137 | + INSERT INTO " . $this->friends_request_table." |
|
138 | 138 | ( |
139 | 139 | `user_id`, |
140 | 140 | `sender_id`, |
@@ -143,10 +143,10 @@ discard block |
||
143 | 143 | ) |
144 | 144 | VALUES |
145 | 145 | ( |
146 | - " . ( int )$data ['user_id'] . ", |
|
147 | - " . ( int )$data ['sender_id'] . ", |
|
146 | + " . (int)$data ['user_id'].", |
|
147 | + " . (int)$data ['sender_id'].", |
|
148 | 148 | 0, |
149 | - " . time() . " |
|
149 | + " . time()." |
|
150 | 150 | ) |
151 | 151 | "; |
152 | 152 | $this->db->sql_query($sql); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | public function delete_friend_request($request_id) |
158 | 158 | { |
159 | 159 | $sql = " |
160 | - DELETE FROM " . $this->friends_request_table . " WHERE `request_id` = " . (int)$request_id . " |
|
160 | + DELETE FROM " . $this->friends_request_table." WHERE `request_id` = ".(int)$request_id." |
|
161 | 161 | "; |
162 | 162 | |
163 | 163 | return $this->db->sql_query($sql); |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | public function approve_friend_request($request_id) |
167 | 167 | { |
168 | 168 | $sql = " |
169 | - UPDATE " . $this->friends_request_table . " SET `status` = 1 WHERE `request_id` = " . (int)$request_id . " |
|
169 | + UPDATE " . $this->friends_request_table." SET `status` = 1 WHERE `request_id` = ".(int)$request_id." |
|
170 | 170 | "; |
171 | 171 | |
172 | 172 | return $this->db->sql_query($sql); |
@@ -178,15 +178,15 @@ discard block |
||
178 | 178 | $check_friend = $this->check_friend($data); |
179 | 179 | if ($check_friend == false) { |
180 | 180 | $sql = " |
181 | - INSERT INTO " . $this->user_friends_table . " |
|
181 | + INSERT INTO " . $this->user_friends_table." |
|
182 | 182 | ( |
183 | 183 | `user_id`, |
184 | 184 | `friend_id` |
185 | 185 | ) |
186 | 186 | VALUES |
187 | 187 | ( |
188 | - " . (int)$data['user_id'] . ", |
|
189 | - " . (int)$data['friend_id'] . " |
|
188 | + " . (int)$data['user_id'].", |
|
189 | + " . (int)$data['friend_id']." |
|
190 | 190 | ) |
191 | 191 | "; |
192 | 192 | if ($this->db->sql_query($sql)) { |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | { |
209 | 209 | $sql = " |
210 | 210 | SELECT COUNT(*) AS `count` |
211 | - FROM " . $this->user_friends_table . " |
|
212 | - WHERE `user_id` = " . (int)$data['user_id'] . " |
|
213 | - AND `friend_id` = " . (int)$data['friend_id'] . " |
|
211 | + FROM " . $this->user_friends_table." |
|
212 | + WHERE `user_id` = " . (int)$data['user_id']." |
|
213 | + AND `friend_id` = " . (int)$data['friend_id']." |
|
214 | 214 | "; |
215 | 215 | $this->db->sql_query($sql); |
216 | 216 | $count = $this->db->sql_fetchfield('count'); |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | { |
226 | 226 | $sql = " |
227 | 227 | SELECT COUNT(*) AS `count` |
228 | - FROM " . $this->friends_request_table . " |
|
229 | - WHERE `user_id` = " . (int)$data['user_id'] . " |
|
230 | - AND `sender_id` = " . (int)$data['sender_id'] . " |
|
228 | + FROM " . $this->friends_request_table." |
|
229 | + WHERE `user_id` = " . (int)$data['user_id']." |
|
230 | + AND `sender_id` = " . (int)$data['sender_id']." |
|
231 | 231 | AND `status` = 0 |
232 | 232 | LIMIT 1 |
233 | 233 | "; |
@@ -242,10 +242,10 @@ discard block |
||
242 | 242 | |
243 | 243 | public function remove_friend($user_id) |
244 | 244 | { |
245 | - $sql = "DELETE FROM " . $this->user_friends_table . " WHERE `user_id` = " . (int)$user_id . ""; |
|
245 | + $sql = "DELETE FROM ".$this->user_friends_table." WHERE `user_id` = ".(int)$user_id.""; |
|
246 | 246 | $this->db->sql_query($sql); |
247 | 247 | |
248 | - $sql = "DELETE FROM " . $this->user_friends_table . " WHERE `friend_id` = " . (int)$user_id . ""; |
|
248 | + $sql = "DELETE FROM ".$this->user_friends_table." WHERE `friend_id` = ".(int)$user_id.""; |
|
249 | 249 | $this->db->sql_query($sql); |
250 | 250 | } |
251 | 251 |