@@ -22,7 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @param \blitze\sitemaker\services\poll $poll Poll Object |
24 | 24 | * @param \blitze\sitemaker\services\template $ptemplate Sitemaker Template Object |
25 | - */ |
|
25 | + */ |
|
26 | 26 | public function __construct(\blitze\sitemaker\services\poll $poll, \blitze\sitemaker\services\template $ptemplate) |
27 | 27 | { |
28 | 28 | $this->poll = $poll; |
@@ -42,7 +42,7 @@ |
||
42 | 42 | * @param \phpbb\user $user User object |
43 | 43 | * @param string $root_path Path to the phpbb includes directory. |
44 | 44 | * @param string $php_ext php file extension |
45 | - */ |
|
45 | + */ |
|
46 | 46 | public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, $root_path, $php_ext) |
47 | 47 | { |
48 | 48 | $this->auth = $auth; |
@@ -81,7 +81,7 @@ |
||
81 | 81 | 'L_QUICKREPLY' => $this->language->lang('NEW_COMMENT'), |
82 | 82 | 'U_QR_ACTION' => append_sid("{$this->phpbb_root_path}posting.{$this->php_ext}", "mode=reply&f={$topic_data['forum_id']}&t={$topic_data['topic_id']}"), |
83 | 83 | 'QR_HIDDEN_FIELDS' => build_hidden_fields($qr_hidden_fields), |
84 | - 'SUBJECT' => 'Re: ' . censor_text($topic_data['topic_title']), |
|
84 | + 'SUBJECT' => 'Re: '.censor_text($topic_data['topic_title']), |
|
85 | 85 | )); |
86 | 86 | } |
87 | 87 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | * @param \blitze\content\services\topic $topic Topic object |
59 | 59 | * @param string $root_path Path to the phpbb directory. |
60 | 60 | * @param string $php_ext php file extension |
61 | - */ |
|
61 | + */ |
|
62 | 62 | public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\content_visibility $content_visibility, \phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, \phpbb\pagination $pagination, \phpbb\request\request_interface $request, \phpbb\template\template $template, \phpbb\template\context $template_context, \phpbb\user $user, \blitze\sitemaker\services\forum\data $forum, \blitze\content\services\topic $topic, $root_path, $php_ext) |
63 | 63 | { |
64 | 64 | parent::__construct($auth, $config, $language, $template, $user, $root_path, $php_ext); |
@@ -258,8 +258,7 @@ discard block |
||
258 | 258 | $prev_posts_count = $this->content_visibility->get_count('topic_posts', $topic_data, $topic_data['forum_id']) - 1; |
259 | 259 | } |
260 | 260 | return $prev_posts_count; |
261 | - } |
|
262 | - else |
|
261 | + } else |
|
263 | 262 | { |
264 | 263 | return $this->get_prev_posts_count($topic_data['forum_id'], $topic_data['topic_id'], $post_id, $sort_dir) - 1; |
265 | 264 | } |
@@ -290,8 +289,7 @@ discard block |
||
290 | 289 | if ($sort_dir == 'd') |
291 | 290 | { |
292 | 291 | $sql .= " AND (p.post_time > {$row['post_time']} OR (p.post_time = {$row['post_time']} AND p.post_id >= {$row['post_id']}))"; |
293 | - } |
|
294 | - else |
|
292 | + } else |
|
295 | 293 | { |
296 | 294 | $sql .= " AND (p.post_time < {$row['post_time']} OR (p.post_time = {$row['post_time']} AND p.post_id <= {$row['post_id']}))"; |
297 | 295 | } |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | { |
88 | 88 | if ($topic_data['total_comments']) |
89 | 89 | { |
90 | - $view = $this->request->variable('view', ''); |
|
91 | - $start = $this->request->variable('start', 0); |
|
92 | - $post_id = $this->request->variable('p', 0); |
|
90 | + $view = $this->request->variable('view', ''); |
|
91 | + $start = $this->request->variable('start', 0); |
|
92 | + $post_id = $this->request->variable('p', 0); |
|
93 | 93 | |
94 | 94 | $this->find_unread($view, $topic_data); |
95 | 95 | |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | ->build(); |
105 | 105 | $posts_data = $this->forum->get_post_data(false, array(), $this->config['posts_per_page'], $start, array( |
106 | 106 | 'WHERE' => array( |
107 | - 'p.topic_id = ' . (int) $topic_data['topic_id'], |
|
108 | - 'p.post_id <> ' . (int) $topic_data['topic_first_post_id'], |
|
107 | + 'p.topic_id = '.(int) $topic_data['topic_id'], |
|
108 | + 'p.post_id <> '.(int) $topic_data['topic_first_post_id'], |
|
109 | 109 | ), |
110 | - 'ORDER_BY' => $this->sort_by_sql[$sort_key] . ' ' . $this->sort_dir_sql[$sort_dir], |
|
110 | + 'ORDER_BY' => $this->sort_by_sql[$sort_key].' '.$this->sort_dir_sql[$sort_dir], |
|
111 | 111 | )); |
112 | 112 | |
113 | 113 | $topic_tracking_info = $this->forum->get_topic_tracking_info(); |
@@ -172,9 +172,9 @@ discard block |
||
172 | 172 | $topic_last_read = (isset($topic_tracking_info[$topic_id])) ? $topic_tracking_info[$topic_id] : 0; |
173 | 173 | |
174 | 174 | $sql = 'SELECT post_id, topic_id, forum_id |
175 | - FROM ' . POSTS_TABLE . " |
|
175 | + FROM ' . POSTS_TABLE." |
|
176 | 176 | WHERE topic_id = $topic_id |
177 | - AND " . $this->content_visibility->get_visibility_sql('post', $forum_id) . " |
|
177 | + AND ".$this->content_visibility->get_visibility_sql('post', $forum_id)." |
|
178 | 178 | AND post_time > $topic_last_read |
179 | 179 | AND forum_id = $forum_id |
180 | 180 | ORDER BY post_time ASC, post_id ASC"; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | if ($row) |
186 | 186 | { |
187 | - redirect(append_sid($topic_data['topic_url'], 'p=' . $row['post_id']) . '#p' . $row['post_id']); |
|
187 | + redirect(append_sid($topic_data['topic_url'], 'p='.$row['post_id']).'#p'.$row['post_id']); |
|
188 | 188 | } |
189 | 189 | } |
190 | 190 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $start = $this->pagination->validate_start($start, $this->config['posts_per_page'], $topic_data['total_comments']); |
212 | 212 | $this->pagination->generate_template_pagination($base_url, 'pagination', 'start', $topic_data['total_comments'], $this->config['posts_per_page'], $start); |
213 | 213 | |
214 | - $data =& $this->template_context->get_data_ref()['pagination']; |
|
214 | + $data = & $this->template_context->get_data_ref()['pagination']; |
|
215 | 215 | foreach ($data as &$row) |
216 | 216 | { |
217 | 217 | $row['PAGE_URL'] .= '#comments'; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | protected function get_prev_posts_count($forum_id, $topic_id, $post_id, $sort_dir) |
274 | 274 | { |
275 | 275 | $sql = 'SELECT post_id, post_time, post_visibility |
276 | - FROM ' . POSTS_TABLE . " p |
|
276 | + FROM ' . POSTS_TABLE." p |
|
277 | 277 | WHERE p.topic_id = $topic_id |
278 | 278 | AND p.post_id = $post_id"; |
279 | 279 | $result = $this->db->sql_query($sql); |
@@ -281,9 +281,9 @@ discard block |
||
281 | 281 | $this->db->sql_freeresult($result); |
282 | 282 | |
283 | 283 | $sql = 'SELECT COUNT(p.post_id) AS prev_posts |
284 | - FROM ' . POSTS_TABLE . " p |
|
284 | + FROM ' . POSTS_TABLE." p |
|
285 | 285 | WHERE p.topic_id = $topic_id |
286 | - AND " . $this->content_visibility->get_visibility_sql('post', $forum_id, 'p.'); |
|
286 | + AND ".$this->content_visibility->get_visibility_sql('post', $forum_id, 'p.'); |
|
287 | 287 | |
288 | 288 | if ($sort_dir == 'd') |
289 | 289 | { |
@@ -310,11 +310,11 @@ discard block |
||
310 | 310 | */ |
311 | 311 | protected function set_sorting_options(&$sort_days, &$sort_key, &$sort_dir, &$u_sort_param) |
312 | 312 | { |
313 | - $default_sort_days = (!empty($this->user->data['user_post_show_days'])) ? $this->user->data['user_post_show_days'] : 0; |
|
313 | + $default_sort_days = (!empty($this->user->data['user_post_show_days'])) ? $this->user->data['user_post_show_days'] : 0; |
|
314 | 314 | $default_sort_key = (!empty($this->user->data['user_post_sortby_type'])) ? $this->user->data['user_post_sortby_type'] : 't'; |
315 | 315 | $default_sort_dir = (!empty($this->user->data['user_post_sortby_dir'])) ? $this->user->data['user_post_sortby_dir'] : 'a'; |
316 | 316 | |
317 | - $sort_days = $this->request->variable('st', $default_sort_days); |
|
317 | + $sort_days = $this->request->variable('st', $default_sort_days); |
|
318 | 318 | $sort_key = $this->request->variable('sk', $default_sort_key); |
319 | 319 | $sort_dir = $this->request->variable('sd', $default_sort_dir); |
320 | 320 | |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | */ |
377 | 377 | protected function get_post_display_lang(array $row, $topic_url) |
378 | 378 | { |
379 | - return ($row['hide_post']) ? $this->language->lang('POST_DISPLAY', '<a class="display_post" data-post-id="' . $row['post_id'] . '" href="' . append_sid($topic_url, "p={$row['post_id']}&view=show") . "#p{$row['post_id']}" . '">', '</a>') : ''; |
|
379 | + return ($row['hide_post']) ? $this->language->lang('POST_DISPLAY', '<a class="display_post" data-post-id="'.$row['post_id'].'" href="'.append_sid($topic_url, "p={$row['post_id']}&view=show")."#p{$row['post_id']}".'">', '</a>') : ''; |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | /** |
@@ -386,6 +386,6 @@ discard block |
||
386 | 386 | */ |
387 | 387 | protected function set_form_action($topic_url, $start) |
388 | 388 | { |
389 | - $this->template->assign_var('S_TOPIC_ACTION', append_sid($topic_url, (($start == 0) ? '' : "start=$start")) . '#comments'); |
|
389 | + $this->template->assign_var('S_TOPIC_ACTION', append_sid($topic_url, (($start == 0) ? '' : "start=$start")).'#comments'); |
|
390 | 390 | } |
391 | 391 | } |
@@ -34,10 +34,10 @@ |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | - * Get the url to this item |
|
38 | - * |
|
39 | - * @return string URL |
|
40 | - */ |
|
37 | + * Get the url to this item |
|
38 | + * |
|
39 | + * @return string URL |
|
40 | + */ |
|
41 | 41 | public function get_url() |
42 | 42 | { |
43 | 43 | if ($type = $this->types->get_forum_type($this->item_parent_id)) |
@@ -42,7 +42,7 @@ |
||
42 | 42 | { |
43 | 43 | if ($type = $this->types->get_forum_type($this->item_parent_id)) |
44 | 44 | { |
45 | - return append_sid($this->phpbb_root_path . 'mcp.' . $this->php_ext, "i=-blitze-content-mcp-content_module&mode=content&type=$type&t={$this->item_id}&do=view"); |
|
45 | + return append_sid($this->phpbb_root_path.'mcp.'.$this->php_ext, "i=-blitze-content-mcp-content_module&mode=content&type=$type&t={$this->item_id}&do=view"); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | return parent::get_url(); |
@@ -301,8 +301,7 @@ |
||
301 | 301 | if ($row['post_delete_reason']) |
302 | 302 | { |
303 | 303 | return $this->language->lang('POST_DELETED_BY_REASON', $display_postername, $display_username, $this->user->format_date($row['post_delete_time'], false, true), $row['post_delete_reason']); |
304 | - } |
|
305 | - else |
|
304 | + } else |
|
306 | 305 | { |
307 | 306 | return $this->language->lang('POST_DELETED_BY', $display_postername, $display_username, $this->user->format_date($row['post_delete_time'], false, true)); |
308 | 307 | } |
@@ -250,10 +250,10 @@ discard block |
||
250 | 250 | { |
251 | 251 | if ($topic_data['topic_first_post_id'] === $post_data['post_id']) |
252 | 252 | { |
253 | - return append_sid($topic_data['topic_url'], 'view=unread') . '#unread'; |
|
253 | + return append_sid($topic_data['topic_url'], 'view=unread').'#unread'; |
|
254 | 254 | } |
255 | 255 | |
256 | - return append_sid($topic_data['topic_url'], 'p=' . $post_data['post_id']) . '#p' . $post_data['post_id']; |
|
256 | + return append_sid($topic_data['topic_url'], 'p='.$post_data['post_id']).'#p'.$post_data['post_id']; |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $l_edited_by = $edit_reason = ''; |
267 | 267 | if (($row['post_edit_count'] && $this->config['display_last_edited']) || $row['post_edit_reason']) |
268 | 268 | { |
269 | - $display_username = $users_cache[$row['poster_id']]['username_full']; |
|
269 | + $display_username = $users_cache[$row['poster_id']]['username_full']; |
|
270 | 270 | $l_edited_by = $this->language->lang('EDITED_TIMES_TOTAL', (int) $row['post_edit_count'], $display_username, $this->user->format_date($row['post_edit_time'], false, true)); |
271 | 271 | $edit_reason = $row['post_edit_reason']; |
272 | 272 | } |
@@ -289,8 +289,8 @@ discard block |
||
289 | 289 | |
290 | 290 | if ($s_post_deleted && $row['post_delete_user']) |
291 | 291 | { |
292 | - $display_postername = $users_cache[$row['poster_id']]['username_full']; |
|
293 | - $display_username = $users_cache[$row['post_delete_user']]['username_full']; |
|
292 | + $display_postername = $users_cache[$row['poster_id']]['username_full']; |
|
293 | + $display_username = $users_cache[$row['post_delete_user']]['username_full']; |
|
294 | 294 | |
295 | 295 | $l_deleted_message = $this->get_delete_message($row, $display_postername, $display_username); |
296 | 296 | $l_deleted_by = $this->language->lang('DELETED_INFORMATION', $display_username, $this->user->format_date($row['post_delete_time'], false, true)); |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | ); |
367 | 367 | |
368 | 368 | return array( |
369 | - 'U_BOOKMARK_TOPIC' => ($this->user->data['is_registered'] && $this->config['allow_bookmarks']) ? $this->helper->get_viewtopic_url($topic_data) . '&bookmark=1&hash=' . generate_link_hash("topic_{$topic_data['topic_id']}") : '', |
|
369 | + 'U_BOOKMARK_TOPIC' => ($this->user->data['is_registered'] && $this->config['allow_bookmarks']) ? $this->helper->get_viewtopic_url($topic_data).'&bookmark=1&hash='.generate_link_hash("topic_{$topic_data['topic_id']}") : '', |
|
370 | 370 | 'S_BOOKMARK_TOPIC' => $this->language->lang($lang_keys['bookmark'][$state_key]), |
371 | 371 | 'S_BOOKMARK_TOGGLE' => $this->language->lang($lang_keys['toggle'][$state_key]), |
372 | 372 | 'S_BOOKMARKED_TOPIC' => $bookmarked, |
@@ -36,7 +36,7 @@ |
||
36 | 36 | * @param \blitze\content\services\fields $fields Content fields object |
37 | 37 | * @param string $phpbb_root_path Path to the phpbb includes directory. |
38 | 38 | * @param string $php_ext php file extension |
39 | - */ |
|
39 | + */ |
|
40 | 40 | public function __construct(\phpbb\db\driver\driver_interface $db, \blitze\content\services\types $content_types, \blitze\content\services\fields $fields, $phpbb_root_path, $php_ext) |
41 | 41 | { |
42 | 42 | $this->db = $db; |
@@ -115,9 +115,9 @@ |
||
115 | 115 | $forum_list = is_array($forum_list) ? $forum_list : array($forum_list); |
116 | 116 | |
117 | 117 | $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_title AS post_subject, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_attachment AS post_attachment, t.topic_first_poster_name AS username, t.topic_first_poster_colour AS user_colour |
118 | - FROM ' . TOPICS_TABLE . ' t |
|
119 | - WHERE ' . $this->db->sql_in_set('forum_id', $this->get_forum_list($forum_list)) . ' |
|
120 | - AND ' . $this->db->sql_in_set('topic_visibility', $event['visibility_const']) . " |
|
118 | + FROM ' . TOPICS_TABLE.' t |
|
119 | + WHERE ' . $this->db->sql_in_set('forum_id', $this->get_forum_list($forum_list)).' |
|
120 | + AND ' . $this->db->sql_in_set('topic_visibility', $event['visibility_const'])." |
|
121 | 121 | AND topic_delete_user <> 0 |
122 | 122 | {$event['limit_time_sql']} |
123 | 123 | ORDER BY {$event['sort_order_sql']}"; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * @param \phpbb\db\driver\driver_interface $db Database object |
29 | 29 | * @param \phpbb\controller\helper $helper Helper object |
30 | 30 | * @param \blitze\content\services\types $content_types Content types object |
31 | - */ |
|
31 | + */ |
|
32 | 32 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \blitze\content\services\types $content_types) |
33 | 33 | { |
34 | 34 | $this->db = $db; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | public function modify_posts_data(\phpbb\event\data $event) |
59 | 59 | { |
60 | 60 | $sql_array = $event['sql_array']; |
61 | - $sql_array['WHERE'] .= ' AND t.topic_time <= ' . time(); |
|
61 | + $sql_array['WHERE'] .= ' AND t.topic_time <= '.time(); |
|
62 | 62 | |
63 | 63 | $sql_count = $sql_array; |
64 | 64 | $sql_count['SELECT'] = 'COUNT(p.post_id) AS total_results'; |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | public function modify_topic_data(\phpbb\event\data $event) |
83 | 83 | { |
84 | 84 | $sql_where = $event['sql_where']; |
85 | - $sql_where .= ' AND t.topic_time <= ' . time(); |
|
85 | + $sql_where .= ' AND t.topic_time <= '.time(); |
|
86 | 86 | |
87 | - $sql = 'SELECT COUNT(t.topic_id) AS total_results FROM ' . $event['sql_from'] . ' WHERE ' . $sql_where; |
|
87 | + $sql = 'SELECT COUNT(t.topic_id) AS total_results FROM '.$event['sql_from'].' WHERE '.$sql_where; |
|
88 | 88 | $result = $this->db->sql_query($sql); |
89 | 89 | $total_results = $this->db->sql_fetchfield('total_results'); |
90 | 90 | $this->db->sql_freeresult($result); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @param \phpbb\controller\helper $helper Helper object |
26 | 26 | * @param \blitze\content\services\types $content_types Content types object |
27 | - */ |
|
27 | + */ |
|
28 | 28 | public function __construct(\phpbb\controller\helper $helper, \blitze\content\services\types $content_types) |
29 | 29 | { |
30 | 30 | $this->helper = $helper; |
@@ -160,8 +160,7 @@ |
||
160 | 160 | if ($this->build_content) |
161 | 161 | { |
162 | 162 | $event['redirect_url'] = $this->builder->get_cp_url(); |
163 | - } |
|
164 | - else |
|
163 | + } else |
|
165 | 164 | { |
166 | 165 | $topic_url = $this->builder->get_post_url($this->content_type, $event['post_data']); |
167 | 166 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | * @param \phpbb\controller\helper $helper Controller helper class |
41 | 41 | * @param \phpbb\template\template $template Template object |
42 | 42 | * @param \blitze\content\services\form\builder $builder Form builder object |
43 | - */ |
|
43 | + */ |
|
44 | 44 | public function __construct(\phpbb\controller\helper $helper, \phpbb\template\template $template, \blitze\content\services\form\builder $builder) |
45 | 45 | { |
46 | 46 | $this->helper = $helper; |