@@ -292,6 +292,9 @@ |
||
292 | 292 | } |
293 | 293 | } |
294 | 294 | |
295 | + /** |
|
296 | + * @param string $u_action |
|
297 | + */ |
|
295 | 298 | private function get_tag_link($u_action, $tag_id) |
296 | 299 | { |
297 | 300 | return $u_action . (($tag_id) ? '&tag_id=' . $tag_id : ''); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $limit = $this->config['topics_per_page']; |
105 | 105 | $tags_count = $this->tags_manager->count_tags(); |
106 | 106 | $start = $this->pagination->validate_start($start, $limit, $tags_count); |
107 | - $base_url = $u_action . "&sort_key=$sort_key"; |
|
107 | + $base_url = $u_action."&sort_key=$sort_key"; |
|
108 | 108 | |
109 | 109 | $tags = $this->tags_manager->get_all_tags($start, $limit, $sort_field, $ordering); |
110 | 110 | |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | $this->template->assign_block_vars('tags', array( |
115 | 115 | 'NAME' => $tag['tag'], |
116 | 116 | 'ASSIGNMENTS' => $tag['count'], |
117 | - 'U_DELETE_TAG' => $this->get_tag_link($u_action, $tag['id']) . '&action=delete', |
|
118 | - 'U_EDIT_TAG' => $this->get_tag_link($u_action, $tag['id']) . '&action=edit_non_ajax', |
|
117 | + 'U_DELETE_TAG' => $this->get_tag_link($u_action, $tag['id']).'&action=delete', |
|
118 | + 'U_EDIT_TAG' => $this->get_tag_link($u_action, $tag['id']).'&action=edit_non_ajax', |
|
119 | 119 | )); |
120 | 120 | } |
121 | 121 | $this->template->assign_vars(array( |
122 | 122 | 'SELECT_SORT_KEY' => $this->create_sort_selects($sort_key), |
123 | - 'U_ACTION' => $u_action . "&sort_key=$sort_key&start=$start", |
|
123 | + 'U_ACTION' => $u_action."&sort_key=$sort_key&start=$start", |
|
124 | 124 | )); |
125 | 125 | break; |
126 | 126 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | { |
141 | 141 | trigger_error('TOPICTAGS_MISSING_TAG_ID', E_USER_WARNING); |
142 | 142 | } |
143 | - trigger_error($this->user->lang('TOPICTAGS_MISSING_TAG_ID') . adm_back_link($u_action), E_USER_WARNING); |
|
143 | + trigger_error($this->user->lang('TOPICTAGS_MISSING_TAG_ID').adm_back_link($u_action), E_USER_WARNING); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | $tag = $this->tags_manager->get_tag_by_id($tag_id); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | { |
154 | 154 | trigger_error('TOPICTAGS_TAG_DELETED'); |
155 | 155 | } |
156 | - trigger_error($this->user->lang('TOPICTAGS_TAG_DELETED') . adm_back_link($u_action)); |
|
156 | + trigger_error($this->user->lang('TOPICTAGS_TAG_DELETED').adm_back_link($u_action)); |
|
157 | 157 | } |
158 | 158 | else |
159 | 159 | { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $tag_id = $this->request->variable('tag_id', 0); |
182 | 182 | $old_tag_name = $this->tags_manager->get_tag_by_id($tag_id); |
183 | 183 | $this->template->assign_vars(array( |
184 | - 'U_ACTION' => $this->get_tag_link($u_action, $tag_id) . '&action=edit_non_ajax', |
|
184 | + 'U_ACTION' => $this->get_tag_link($u_action, $tag_id).'&action=edit_non_ajax', |
|
185 | 185 | 'S_EDIT_TAG_NON_AJAX' => true, |
186 | 186 | 'OLD_TAG_NAME' => $old_tag_name, |
187 | 187 | )); |
@@ -284,17 +284,17 @@ discard block |
||
284 | 284 | } |
285 | 285 | if ($success) |
286 | 286 | { |
287 | - trigger_error($msg . adm_back_link($u_action)); |
|
287 | + trigger_error($msg.adm_back_link($u_action)); |
|
288 | 288 | } |
289 | 289 | else |
290 | 290 | { |
291 | - trigger_error($msg . adm_back_link($u_action), E_USER_WARNING); |
|
291 | + trigger_error($msg.adm_back_link($u_action), E_USER_WARNING); |
|
292 | 292 | } |
293 | 293 | } |
294 | 294 | |
295 | 295 | private function get_tag_link($u_action, $tag_id) |
296 | 296 | { |
297 | - return $u_action . (($tag_id) ? '&tag_id=' . $tag_id : ''); |
|
297 | + return $u_action.(($tag_id) ? '&tag_id='.$tag_id : ''); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | private function create_sort_selects($selected_sort_key) |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | |
311 | 311 | foreach ($sort_keys as $key => $text) |
312 | 312 | { |
313 | - $sort_selects .= '<option value="' . $key . '"' . (($selected_sort_key == $key) ? ' selected="selected"' : '') . '>' . $text . '</option>'; |
|
313 | + $sort_selects .= '<option value="'.$key.'"'.(($selected_sort_key == $key) ? ' selected="selected"' : '').'>'.$text.'</option>'; |
|
314 | 314 | } |
315 | 315 | $sort_selects .= '</select>'; |
316 | 316 |
@@ -70,6 +70,8 @@ discard block |
||
70 | 70 | /** |
71 | 71 | * |
72 | 72 | * @param array $topic_row a db topic row |
73 | + * @param string $phpbb_root_path |
|
74 | + * @param string $php_ext |
|
73 | 75 | */ |
74 | 76 | public function __construct(array $topic_row, |
75 | 77 | \phpbb\user $user, |
@@ -279,11 +281,17 @@ discard block |
||
279 | 281 | return $this->topic_row['topic_views']; |
280 | 282 | } |
281 | 283 | |
284 | + /** |
|
285 | + * @param string $mode |
|
286 | + */ |
|
282 | 287 | public function author($mode) |
283 | 288 | { |
284 | 289 | return get_username_string($mode, $this->topic_row['topic_poster'], $this->topic_row['topic_first_poster_name'], $this->topic_row['topic_first_poster_colour']); |
285 | 290 | } |
286 | 291 | |
292 | + /** |
|
293 | + * @param string $mode |
|
294 | + */ |
|
287 | 295 | public function last_author($mode) |
288 | 296 | { |
289 | 297 | return get_username_string($mode, $this->topic_row['topic_last_poster_id'], $this->topic_row['topic_last_poster_name'], $this->topic_row['topic_last_poster_colour']); |
@@ -312,7 +320,7 @@ discard block |
||
312 | 320 | /** |
313 | 321 | * This will allow the style designer to output a different header |
314 | 322 | * or even separate the list of announcements from sticky and normal topics |
315 | - * @return number |
|
323 | + * @return integer |
|
316 | 324 | */ |
317 | 325 | public function topic_type_switch() |
318 | 326 | { |
@@ -93,10 +93,10 @@ discard block |
||
93 | 93 | } |
94 | 94 | $this->forum_id = (int) $this->topic_row['forum_id']; |
95 | 95 | |
96 | - $this->view_topic_url_params = 'f=' . $this->forum_id . '&t=' . $this->topic_id; |
|
97 | - $this->view_topic_url = append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", $this->view_topic_url_params); |
|
98 | - $this->newest_post_url = append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", $this->view_topic_url_params . '&view=unread') . '#unread'; |
|
99 | - $this->last_post_url = append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", $this->view_topic_url_params . '&p=' . $topic_row['topic_last_post_id']) . '#p' . $topic_row['topic_last_post_id']; |
|
96 | + $this->view_topic_url_params = 'f='.$this->forum_id.'&t='.$this->topic_id; |
|
97 | + $this->view_topic_url = append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", $this->view_topic_url_params); |
|
98 | + $this->newest_post_url = append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", $this->view_topic_url_params.'&view=unread').'#unread'; |
|
99 | + $this->last_post_url = append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", $this->view_topic_url_params.'&p='.$topic_row['topic_last_post_id']).'#p'.$topic_row['topic_last_post_id']; |
|
100 | 100 | |
101 | 101 | $this->replies = $phpbb_content_visibility->get_count('topic_posts', $topic_row, $this->forum_id) - 1; |
102 | 102 | // Get folder img, topic status/type related information |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | public function mcp_report() |
263 | 263 | { |
264 | - return append_sid("{$this->phpbb_root_path}mcp.{$this->php_ext}", 'i=reports&mode=reports&f=' . $this->forum_id . '&t=' . $this->topic_id, true, $this->user->session_id); |
|
264 | + return append_sid("{$this->phpbb_root_path}mcp.{$this->php_ext}", 'i=reports&mode=reports&f='.$this->forum_id.'&t='.$this->topic_id, true, $this->user->session_id); |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | public function forum_name() |
@@ -318,6 +318,6 @@ discard block |
||
318 | 318 | { |
319 | 319 | $s_type_switch = 0; |
320 | 320 | $s_type_switch_test = ($this->topic_row['topic_type'] == POST_ANNOUNCE || $this->topic_row['topic_type'] == POST_GLOBAL) ? 1 : 0; |
321 | - return ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test; |
|
321 | + return ($s_type_switch == $s_type_switch_test) ? - 1 : $s_type_switch_test; |
|
322 | 322 | } |
323 | 323 | } |
@@ -234,7 +234,7 @@ |
||
234 | 234 | /** |
235 | 235 | * Checks whether the mode indicates a new topic or not. |
236 | 236 | * @param string $mode the mode. |
237 | - * @return true if mode == post (indicating a new topic), false otherwise |
|
237 | + * @return boolean if mode == post (indicating a new topic), false otherwise |
|
238 | 238 | */ |
239 | 239 | private function is_new_topic($mode) |
240 | 240 | { |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $tagsJson = json_decode($tags_string, true); |
105 | 105 | $tags = array(); |
106 | 106 | |
107 | - for ($i = 0, $count = sizeof($tagsJson); $i<$count; $i++) |
|
107 | + for ($i = 0, $count = sizeof($tagsJson); $i < $count; $i ++) |
|
108 | 108 | { |
109 | 109 | $tags[] = trim($tagsJson[$i]['text']); |
110 | 110 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function index_modify_page_title($event) |
132 | 132 | { |
133 | - if ($this->config[prefixes::CONFIG . '_display_tagcloud_on_index']) |
|
133 | + if ($this->config[prefixes::CONFIG.'_display_tagcloud_on_index']) |
|
134 | 134 | { |
135 | 135 | $this->template->assign_vars(array( |
136 | 136 | 'RH_TOPICTAGS_DISPLAY_TAGCLOUD_ON_INDEX' => true, |
@@ -289,16 +289,16 @@ discard block |
||
289 | 289 | |
290 | 290 | $page_data['RH_TOPICTAGS'] = base64_encode(rawurlencode(json_encode($tags))); |
291 | 291 | |
292 | - $page_data['RH_TOPICTAGS_ALLOWED_TAGS_REGEX'] = $this->config[prefixes::CONFIG . '_allowed_tags_regex']; |
|
293 | - $page_data['RH_TOPICTAGS_CONVERT_SPACE_TO_MINUS'] = $this->config[prefixes::CONFIG . '_convert_space_to_minus'] ? 'true' : 'false'; |
|
292 | + $page_data['RH_TOPICTAGS_ALLOWED_TAGS_REGEX'] = $this->config[prefixes::CONFIG.'_allowed_tags_regex']; |
|
293 | + $page_data['RH_TOPICTAGS_CONVERT_SPACE_TO_MINUS'] = $this->config[prefixes::CONFIG.'_convert_space_to_minus'] ? 'true' : 'false'; |
|
294 | 294 | |
295 | - $page_data['S_RH_TOPICTAGS_WHITELIST_ENABLED'] = $this->config[prefixes::CONFIG . '_whitelist_enabled']; |
|
295 | + $page_data['S_RH_TOPICTAGS_WHITELIST_ENABLED'] = $this->config[prefixes::CONFIG.'_whitelist_enabled']; |
|
296 | 296 | |
297 | - if ($this->config[prefixes::CONFIG . '_whitelist_enabled']) |
|
297 | + if ($this->config[prefixes::CONFIG.'_whitelist_enabled']) |
|
298 | 298 | { |
299 | 299 | $page_data['S_RH_TOPICTAGS_WHITELIST_ENABLED'] = true; |
300 | 300 | $tags = $this->tags_manager->get_whitelist_tags(); |
301 | - for ($i = 0, $size = sizeof($tags); $i < $size; $i++) |
|
301 | + for ($i = 0, $size = sizeof($tags); $i < $size; $i ++) |
|
302 | 302 | { |
303 | 303 | $this->template->assign_block_vars('rh_topictags_whitelist', array( |
304 | 304 | 'LINK' => '#', |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | } |
309 | 309 | else |
310 | 310 | { |
311 | - $page_data['RH_TOPICTAGS_ALLOWED_TAGS_EXP'] = $this->config[prefixes::CONFIG . '_allowed_tags_exp_for_users']; |
|
311 | + $page_data['RH_TOPICTAGS_ALLOWED_TAGS_EXP'] = $this->config[prefixes::CONFIG.'_allowed_tags_exp_for_users']; |
|
312 | 312 | } |
313 | 313 | $page_data['S_RH_TOPICTAGS_INCLUDE_NG_TAGS_INPUT'] = true; |
314 | 314 | $page_data['S_RH_TOPICTAGS_INCLUDE_CSS'] = true; |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | { |
368 | 368 | foreach ($tags as $tag) |
369 | 369 | { |
370 | - $this->template->assign_block_vars($block_name, array ( |
|
370 | + $this->template->assign_block_vars($block_name, array( |
|
371 | 371 | 'NAME' => $tag, |
372 | 372 | 'LINK' => $this->helper->route('robertheim_topictags_show_tag_controller', array( |
373 | 373 | 'tags' => urlencode($tag), |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | $this->assign_tags_to_template('rh_topic_tags', $tags); |
398 | 398 | $this->template->assign_vars(array( |
399 | 399 | 'RH_TOPICTAGS_SHOW' => true, |
400 | - 'META' => '<meta name="keywords" content="' . join(', ', $tags) . '">', |
|
400 | + 'META' => '<meta name="keywords" content="'.join(', ', $tags).'">', |
|
401 | 401 | )); |
402 | 402 | // tags might want to use our extension's css. |
403 | 403 | $this->template->assign_var('S_RH_TOPICTAGS_INCLUDE_CSS', true); |
@@ -73,8 +73,7 @@ |
||
73 | 73 | \phpbb\template\template $template, |
74 | 74 | \phpbb\auth\auth $auth, |
75 | 75 | \robertheim\topictags\service\tagcloud_manager $tagcloud_manager |
76 | - ) |
|
77 | - { |
|
76 | + ) { |
|
78 | 77 | $this->config = $config; |
79 | 78 | $this->tags_manager = $tags_manager; |
80 | 79 | $this->helper = $helper; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | /** |
62 | 62 | * Remove all tags from the given topic |
63 | 63 | * |
64 | - * @param $topic_id |
|
64 | + * @param integer $topic_id |
|
65 | 65 | * @param $delete_unused_tags if set to true unused tags are removed from the db. |
66 | 66 | */ |
67 | 67 | public function remove_all_tags_from_topic($topic_id, $delete_unused_tags = true) |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | /** |
197 | 197 | * Deletes all topic-tag-assignments where the topic resides in a forum with tagging disabled. |
198 | 198 | * |
199 | - * @param $forum_ids array of forum-ids that should be checked (if null, all are checked). |
|
199 | + * @param integer[] $forum_ids array of forum-ids that should be checked (if null, all are checked). |
|
200 | 200 | * @return integer count of deleted assignments |
201 | 201 | */ |
202 | 202 | public function delete_tags_from_tagdisabled_forums($forum_ids = null) |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | /** |
248 | 248 | * Gets all assigned tags |
249 | 249 | * |
250 | - * @param $topic_id |
|
250 | + * @param integer $topic_id |
|
251 | 251 | * @return array of tag names |
252 | 252 | */ |
253 | 253 | public function get_assigned_tags($topic_id) |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | * |
269 | 269 | * @param $query prefix of tags to search |
270 | 270 | * @param $exclude array of tags that should be ignored |
271 | - * @param $count count of tags to return |
|
271 | + * @param integer $count count of tags to return |
|
272 | 272 | * @return array (array('text' => '...'), array('text' => '...')) |
273 | 273 | */ |
274 | 274 | public function get_tag_suggestions($query, $exclude, $count) |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | * Checks whether the given tag is blacklisted. |
585 | 585 | * |
586 | 586 | * @param string $tag |
587 | - * @return boolean true, if the tag is on the blacklist, false otherwise |
|
587 | + * @return boolean|null true, if the tag is on the blacklist, false otherwise |
|
588 | 588 | */ |
589 | 589 | private function is_on_blacklist($tag) |
590 | 590 | { |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | * Checks whether the given tag is whitelisted. |
604 | 604 | * |
605 | 605 | * @param string $tag |
606 | - * @return boolean true, if the tag is on the whitelist, false otherwise |
|
606 | + * @return boolean|null true, if the tag is on the whitelist, false otherwise |
|
607 | 607 | */ |
608 | 608 | private function is_on_whitelist($tag) |
609 | 609 | { |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | * |
632 | 632 | * @param $tag the tag to check |
633 | 633 | * @param $is_clean wether the tag has already been cleaned or not. |
634 | - * @return true if the tag matches, false otherwise |
|
634 | + * @return boolean if the tag matches, false otherwise |
|
635 | 635 | */ |
636 | 636 | public function is_valid_tag($tag, $is_clean = false) |
637 | 637 | { |
@@ -705,7 +705,7 @@ discard block |
||
705 | 705 | * Trims the tag to 30 characters and replaced spaces to "-" if configured. |
706 | 706 | * |
707 | 707 | * @param the tag to clean |
708 | - * @return cleaned tag |
|
708 | + * @return string tag |
|
709 | 709 | */ |
710 | 710 | public function clean_tag($tag) |
711 | 711 | { |
@@ -729,7 +729,7 @@ discard block |
||
729 | 729 | * Checks if tagging is enabled in the given forum. |
730 | 730 | * |
731 | 731 | * @param $forum_id the id of the forum |
732 | - * @return true if tagging is enabled in the given forum, false if not |
|
732 | + * @return boolean if tagging is enabled in the given forum, false if not |
|
733 | 733 | */ |
734 | 734 | public function is_tagging_enabled_in_forum($forum_id) |
735 | 735 | { |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | /** |
745 | 745 | * Enables tagging engine in all forums (not categories and links). |
746 | 746 | * |
747 | - * @return number of affected forums (should be the count of all forums (type FORUM_POST )) |
|
747 | + * @return integer of affected forums (should be the count of all forums (type FORUM_POST )) |
|
748 | 748 | */ |
749 | 749 | public function enable_tags_in_all_forums() |
750 | 750 | { |
@@ -755,7 +755,7 @@ discard block |
||
755 | 755 | * en/disables tagging engine in all forums (not categories and links). |
756 | 756 | * |
757 | 757 | * @param boolean $enable true to enable and false to disabl the engine |
758 | - * @return number of affected forums (should be the count of all forums (type FORUM_POST )) |
|
758 | + * @return integer of affected forums (should be the count of all forums (type FORUM_POST )) |
|
759 | 759 | */ |
760 | 760 | private function set_tags_enabled_in_all_forums($enable) |
761 | 761 | { |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | /** |
776 | 776 | * Disables tagging engine in all forums (not categories and links). |
777 | 777 | * |
778 | - * @return number of affected forums (should be the count of all forums (type FORUM_POST )) |
|
778 | + * @return integer of affected forums (should be the count of all forums (type FORUM_POST )) |
|
779 | 779 | */ |
780 | 780 | public function disable_tags_in_all_forums() |
781 | 781 | { |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | /** |
808 | 808 | * Checks if tagging is enabled or for all forums (not categories and links). |
809 | 809 | * |
810 | - * @return true if for all forums tagging is enabled (type FORUM_POST )) |
|
810 | + * @return boolean if for all forums tagging is enabled (type FORUM_POST )) |
|
811 | 811 | */ |
812 | 812 | public function is_enabled_in_all_forums() |
813 | 813 | { |
@@ -817,7 +817,7 @@ discard block |
||
817 | 817 | /** |
818 | 818 | * Checks if tagging is disabled or for all forums (not categories and links). |
819 | 819 | * |
820 | - * @return true if for all forums tagging is disabled (type FORUM_POST )) |
|
820 | + * @return boolean if for all forums tagging is disabled (type FORUM_POST )) |
|
821 | 821 | */ |
822 | 822 | public function is_disabled_in_all_forums() |
823 | 823 | { |
@@ -885,7 +885,7 @@ discard block |
||
885 | 885 | * @param int $tag_to_delete_id the id of the tag to delete |
886 | 886 | * @param string $tag_to_keep must be valid |
887 | 887 | * @param int $tag_to_keep_id the id of the tag to keep |
888 | - * @return the new count of assignments of the kept tag |
|
888 | + * @return integer new count of assignments of the kept tag |
|
889 | 889 | */ |
890 | 890 | public function merge($tag_to_delete_id, $tag_to_keep, $tag_to_keep_id) |
891 | 891 | { |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | db_helper $db_helper, |
51 | 51 | $table_prefix) |
52 | 52 | { |
53 | - $this->db = $db; |
|
54 | - $this->config = $config; |
|
55 | - $this->config_text = $config_text; |
|
56 | - $this->auth = $auth; |
|
57 | - $this->db_helper = $db_helper; |
|
58 | - $this->table_prefix = $table_prefix; |
|
53 | + $this->db = $db; |
|
54 | + $this->config = $config; |
|
55 | + $this->config_text = $config_text; |
|
56 | + $this->auth = $auth; |
|
57 | + $this->db_helper = $db_helper; |
|
58 | + $this->table_prefix = $table_prefix; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | public function remove_all_tags_from_topics(array $topic_ids, $delete_unused_tags = true) |
79 | 79 | { |
80 | 80 | // remove tags from topic |
81 | - $sql = 'DELETE FROM ' . $this->table_prefix . tables::TOPICTAGS. ' |
|
81 | + $sql = 'DELETE FROM '.$this->table_prefix.tables::TOPICTAGS.' |
|
82 | 82 | WHERE ' . $this->db->sql_in_set('topic_id', $topic_ids); |
83 | 83 | $this->db->sql_query($sql); |
84 | 84 | if ($delete_unused_tags) |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | private function get_unused_tag_ids() |
95 | 95 | { |
96 | 96 | $sql = 'SELECT t.id |
97 | - FROM ' . $this->table_prefix . tables::TAGS . ' t |
|
97 | + FROM ' . $this->table_prefix.tables::TAGS.' t |
|
98 | 98 | WHERE NOT EXISTS ( |
99 | 99 | SELECT 1 |
100 | - FROM ' . $this->table_prefix . tables::TOPICTAGS . ' tt |
|
100 | + FROM ' . $this->table_prefix.tables::TOPICTAGS.' tt |
|
101 | 101 | WHERE tt.tag_id = t.id |
102 | 102 | )'; |
103 | 103 | return $this->db_helper->get_ids($sql); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | // nothing to do |
117 | 117 | return 0; |
118 | 118 | } |
119 | - $sql = 'DELETE FROM ' . $this->table_prefix . tables::TAGS . ' |
|
119 | + $sql = 'DELETE FROM '.$this->table_prefix.tables::TAGS.' |
|
120 | 120 | WHERE ' . $this->db->sql_in_set('id', $ids); |
121 | 121 | $this->db->sql_query($sql); |
122 | 122 | return $this->db->sql_affectedrows(); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | // delete all tag-assignments where the tag is not valid |
150 | - $sql = 'DELETE FROM ' . $this->table_prefix . tables::TOPICTAGS . ' |
|
150 | + $sql = 'DELETE FROM '.$this->table_prefix.tables::TOPICTAGS.' |
|
151 | 151 | WHERE ' . $this->db->sql_in_set('tag_id', $ids_of_invalid_tags); |
152 | 152 | $this->db->sql_query($sql); |
153 | 153 | $removed_count = $this->db->sql_affectedrows(); |
@@ -160,10 +160,10 @@ discard block |
||
160 | 160 | private function get_assignment_ids_where_topic_does_not_exist() |
161 | 161 | { |
162 | 162 | $sql = 'SELECT tt.id |
163 | - FROM ' . $this->table_prefix . tables::TOPICTAGS . ' tt |
|
163 | + FROM ' . $this->table_prefix.tables::TOPICTAGS.' tt |
|
164 | 164 | WHERE NOT EXISTS ( |
165 | 165 | SELECT 1 |
166 | - FROM ' . TOPICS_TABLE . ' topics |
|
166 | + FROM ' . TOPICS_TABLE.' topics |
|
167 | 167 | WHERE topics.topic_id = tt.topic_id |
168 | 168 | )'; |
169 | 169 | return $this->db_helper->get_ids($sql); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | return 0; |
184 | 184 | } |
185 | 185 | // delete all tag-assignments where the topic does not exist anymore |
186 | - $sql = 'DELETE FROM ' . $this->table_prefix . tables::TOPICTAGS . ' |
|
186 | + $sql = 'DELETE FROM '.$this->table_prefix.tables::TOPICTAGS.' |
|
187 | 187 | WHERE ' . $this->db->sql_in_set('id', $ids); |
188 | 188 | $this->db->sql_query($sql); |
189 | 189 | $removed_count = $this->db->sql_affectedrows(); |
@@ -210,16 +210,16 @@ discard block |
||
210 | 210 | // performance improvement because we already know the result of querying the db. |
211 | 211 | return 0; |
212 | 212 | } |
213 | - $forums_sql_where = ' AND ' . $this->db->sql_in_set('f.forum_id', $forum_ids); |
|
213 | + $forums_sql_where = ' AND '.$this->db->sql_in_set('f.forum_id', $forum_ids); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | // get ids of all topic-assignments to topics that reside in a forum with tagging disabled. |
217 | 217 | $sql = 'SELECT tt.id |
218 | - FROM ' . $this->table_prefix . tables::TOPICTAGS . ' tt |
|
218 | + FROM ' . $this->table_prefix.tables::TOPICTAGS.' tt |
|
219 | 219 | WHERE EXISTS ( |
220 | 220 | SELECT 1 |
221 | - FROM ' . TOPICS_TABLE . ' topics, |
|
222 | - ' . FORUMS_TABLE . " f |
|
221 | + FROM ' . TOPICS_TABLE.' topics, |
|
222 | + ' . FORUMS_TABLE." f |
|
223 | 223 | WHERE topics.topic_id = tt.topic_id |
224 | 224 | AND f.forum_id = topics.forum_id |
225 | 225 | AND f.rh_topictags_enabled = 0 |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | return 0; |
234 | 234 | } |
235 | 235 | // delete these assignments |
236 | - $sql = 'DELETE FROM ' . $this->table_prefix . tables::TOPICTAGS . ' |
|
236 | + $sql = 'DELETE FROM '.$this->table_prefix.tables::TOPICTAGS.' |
|
237 | 237 | WHERE ' . $this->db->sql_in_set('id', $delete_ids); |
238 | 238 | $this->db->sql_query($sql); |
239 | 239 | $removed_count = $this->db->sql_affectedrows(); |
@@ -255,8 +255,8 @@ discard block |
||
255 | 255 | $topic_id = (int) $topic_id; |
256 | 256 | $sql = 'SELECT t.tag |
257 | 257 | FROM |
258 | - ' . $this->table_prefix . tables::TAGS . ' AS t, |
|
259 | - ' . $this->table_prefix . tables::TOPICTAGS . " AS tt |
|
258 | + ' . $this->table_prefix.tables::TAGS.' AS t, |
|
259 | + ' . $this->table_prefix.tables::TOPICTAGS." AS tt |
|
260 | 260 | WHERE tt.topic_id = $topic_id |
261 | 261 | AND t.id = tt.tag_id"; |
262 | 262 | return $this->db_helper->get_array_by_fieldname($sql, 'tag'); |
@@ -280,15 +280,15 @@ discard block |
||
280 | 280 | $exclude_sql = ''; |
281 | 281 | if (!empty($exclude)) |
282 | 282 | { |
283 | - $exclude_sql = ' AND ' . $this->db->sql_in_set('t.tag', $exclude, true, true); |
|
283 | + $exclude_sql = ' AND '.$this->db->sql_in_set('t.tag', $exclude, true, true); |
|
284 | 284 | } |
285 | 285 | $sql_array = array( |
286 | 286 | // we must fetch count, because postgres needs the context for ordering |
287 | 287 | 'SELECT' => 't.tag, t.count', |
288 | 288 | 'FROM' => array( |
289 | - $this->table_prefix . tables::TAGS => 't', |
|
289 | + $this->table_prefix.tables::TAGS => 't', |
|
290 | 290 | ), |
291 | - 'WHERE' => 't.tag ' . $this->db->sql_like_expression($query . $this->db->get_any_char()) . " |
|
291 | + 'WHERE' => 't.tag '.$this->db->sql_like_expression($query.$this->db->get_any_char())." |
|
292 | 292 | $exclude_sql", |
293 | 293 | 'ORDER_BY' => 't.count DESC', |
294 | 294 | ); |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | 'tag_id' => $id |
329 | 329 | ); |
330 | 330 | } |
331 | - $this->db->sql_multi_insert($this->table_prefix . tables::TOPICTAGS, $sql_ary); |
|
331 | + $this->db->sql_multi_insert($this->table_prefix.tables::TOPICTAGS, $sql_ary); |
|
332 | 332 | |
333 | 333 | // garbage collection |
334 | 334 | $this->delete_unused_tags(); |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | } |
367 | 367 | |
368 | 368 | // create the new tags |
369 | - $this->db->sql_multi_insert($this->table_prefix . tables::TAGS, $sql_ary_new_tags); |
|
369 | + $this->db->sql_multi_insert($this->table_prefix.tables::TAGS, $sql_ary_new_tags); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | /** |
@@ -403,10 +403,10 @@ discard block |
||
403 | 403 | // note that this case is different from $tags == null where we want to get ALL existing tags. |
404 | 404 | return array(); |
405 | 405 | } |
406 | - $where = 'WHERE ' . $this->db->sql_in_set('tag', $tags); |
|
406 | + $where = 'WHERE '.$this->db->sql_in_set('tag', $tags); |
|
407 | 407 | } |
408 | 408 | $sql = 'SELECT id, tag |
409 | - FROM ' . $this->table_prefix . tables::TAGS . " |
|
409 | + FROM ' . $this->table_prefix.tables::TAGS." |
|
410 | 410 | $where"; |
411 | 411 | if ($only_ids) |
412 | 412 | { |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | if (!$casesensitive) |
470 | 470 | { |
471 | 471 | $tag_count = sizeof($tags_copy); |
472 | - for ($i = 0; $i < $tag_count; $i++) |
|
472 | + for ($i = 0; $i < $tag_count; $i ++) |
|
473 | 473 | { |
474 | 474 | $tags_copy[$i] = utf8_strtolower($tags_copy[$i]); |
475 | 475 | } |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | { |
517 | 517 | $sql_where_topic_access = $this->db->sql_in_set('topics.forum_id', $forum_ary, false, true); |
518 | 518 | } |
519 | - $sql_where_topic_access .= ' AND topics.topic_visibility = ' . ITEM_APPROVED; |
|
519 | + $sql_where_topic_access .= ' AND topics.topic_visibility = '.ITEM_APPROVED; |
|
520 | 520 | return $sql_where_topic_access; |
521 | 521 | } |
522 | 522 | |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | { |
533 | 533 | if (empty($tags)) |
534 | 534 | { |
535 | - return 'SELECT topics.* FROM ' . TOPICS_TABLE . ' topics WHERE 0=1'; |
|
535 | + return 'SELECT topics.* FROM '.TOPICS_TABLE.' topics WHERE 0=1'; |
|
536 | 536 | } |
537 | 537 | |
538 | 538 | // validate mode |
@@ -546,10 +546,10 @@ discard block |
||
546 | 546 | $tag_count = sizeof($tags); |
547 | 547 | // http://stackoverflow.com/questions/26038114/sql-select-distinct-where-exist-row-for-each-id-in-other-table |
548 | 548 | $sql = 'SELECT topics.* |
549 | - FROM ' . TOPICS_TABLE . ' topics |
|
550 | - JOIN ' . $this->table_prefix . tables::TOPICTAGS . ' tt ON tt.topic_id = topics.topic_id |
|
551 | - JOIN ' . $this->table_prefix . tables::TAGS . ' t ON tt.tag_id = t.id |
|
552 | - JOIN ' . FORUMS_TABLE . " f ON f.forum_id = topics.forum_id |
|
549 | + FROM ' . TOPICS_TABLE.' topics |
|
550 | + JOIN ' . $this->table_prefix.tables::TOPICTAGS.' tt ON tt.topic_id = topics.topic_id |
|
551 | + JOIN ' . $this->table_prefix.tables::TAGS.' t ON tt.tag_id = t.id |
|
552 | + JOIN ' . FORUMS_TABLE." f ON f.forum_id = topics.forum_id |
|
553 | 553 | WHERE |
554 | 554 | $sql_where_tag_in |
555 | 555 | AND f.rh_topictags_enabled = 1 |
@@ -564,8 +564,8 @@ discard block |
||
564 | 564 | 'SELECT' => 'topics.*', |
565 | 565 | 'FROM' => array( |
566 | 566 | TOPICS_TABLE => 'topics', |
567 | - $this->table_prefix . tables::TOPICTAGS => 'tt', |
|
568 | - $this->table_prefix . tables::TAGS => 't', |
|
567 | + $this->table_prefix.tables::TOPICTAGS => 'tt', |
|
568 | + $this->table_prefix.tables::TAGS => 't', |
|
569 | 569 | FORUMS_TABLE => 'f', |
570 | 570 | ), |
571 | 571 | 'WHERE' => " $sql_where_tag_in |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | */ |
623 | 623 | public function get_whitelist_tags() |
624 | 624 | { |
625 | - return json_decode($this->config_text->get(prefixes::CONFIG . '_whitelist'), true); |
|
625 | + return json_decode($this->config_text->get(prefixes::CONFIG.'_whitelist'), true); |
|
626 | 626 | } |
627 | 627 | |
628 | 628 | /** |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | { |
736 | 736 | $field = 'rh_topictags_enabled'; |
737 | 737 | $sql = "SELECT $field |
738 | - FROM " . FORUMS_TABLE . ' |
|
738 | + FROM ".FORUMS_TABLE.' |
|
739 | 739 | WHERE ' . $this->db->sql_build_array('SELECT', array('forum_id' => (int) $forum_id)); |
740 | 740 | $status = (int) $this->db_helper->get_field($sql, $field); |
741 | 741 | return $status > 0; |
@@ -759,12 +759,12 @@ discard block |
||
759 | 759 | */ |
760 | 760 | private function set_tags_enabled_in_all_forums($enable) |
761 | 761 | { |
762 | - $sql_ary = array( |
|
762 | + $sql_ary = array( |
|
763 | 763 | 'rh_topictags_enabled' => $enable ? 1 : 0 |
764 | 764 | ); |
765 | - $sql = 'UPDATE ' . FORUMS_TABLE . ' |
|
766 | - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
767 | - WHERE forum_type = ' . FORUM_POST . ' |
|
765 | + $sql = 'UPDATE '.FORUMS_TABLE.' |
|
766 | + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' |
|
767 | + WHERE forum_type = ' . FORUM_POST.' |
|
768 | 768 | AND rh_topictags_enabled = ' . ($enable ? '0' : '1'); |
769 | 769 | $this->db->sql_query($sql); |
770 | 770 | $affected_rows = $this->db->sql_affectedrows(); |
@@ -796,7 +796,7 @@ discard block |
||
796 | 796 | 'FROM' => array( |
797 | 797 | FORUMS_TABLE => 'f', |
798 | 798 | ), |
799 | - 'WHERE' => 'f.rh_topictags_enabled = ' . ($status? '0' : '1') . ' |
|
799 | + 'WHERE' => 'f.rh_topictags_enabled = '.($status ? '0' : '1').' |
|
800 | 800 | AND forum_type = ' . FORUM_POST, |
801 | 801 | ); |
802 | 802 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
@@ -832,7 +832,7 @@ discard block |
||
832 | 832 | $sql_array = array( |
833 | 833 | 'SELECT' => 'id', |
834 | 834 | 'FROM' => array( |
835 | - $this->table_prefix . tables::TAGS => 't', |
|
835 | + $this->table_prefix.tables::TAGS => 't', |
|
836 | 836 | ), |
837 | 837 | ); |
838 | 838 | $sql = $this->db->sql_build_query('SELECT_DISTINCT', $sql_array); |
@@ -842,18 +842,18 @@ discard block |
||
842 | 842 | { |
843 | 843 | $tag_id = $tag['id']; |
844 | 844 | $sql = 'SELECT COUNT(tt.id) as count |
845 | - FROM ' . TOPICS_TABLE . ' topics, |
|
846 | - ' . FORUMS_TABLE . ' f, |
|
847 | - ' . $this->table_prefix . tables::TOPICTAGS . ' tt |
|
848 | - WHERE tt.tag_id = ' . $tag_id . ' |
|
845 | + FROM ' . TOPICS_TABLE.' topics, |
|
846 | + ' . FORUMS_TABLE.' f, |
|
847 | + ' . $this->table_prefix.tables::TOPICTAGS.' tt |
|
848 | + WHERE tt.tag_id = ' . $tag_id.' |
|
849 | 849 | AND topics.topic_id = tt.topic_id |
850 | 850 | AND f.forum_id = topics.forum_id |
851 | 851 | AND f.rh_topictags_enabled = 1'; |
852 | 852 | $this->db->sql_query($sql); |
853 | 853 | $count = $this->db->sql_fetchfield('count'); |
854 | 854 | |
855 | - $sql = 'UPDATE ' . $this->table_prefix . tables::TAGS . ' |
|
856 | - SET count = ' . $count . ' |
|
855 | + $sql = 'UPDATE '.$this->table_prefix.tables::TAGS.' |
|
856 | + SET count = ' . $count.' |
|
857 | 857 | WHERE id = ' . $tag_id; |
858 | 858 | $this->db->sql_query($sql); |
859 | 859 | } |
@@ -870,9 +870,9 @@ discard block |
||
870 | 870 | $sql_array = array( |
871 | 871 | 'SELECT' => 'tt.topic_id', |
872 | 872 | 'FROM' => array( |
873 | - $this->table_prefix . tables::TOPICTAGS => 'tt', |
|
873 | + $this->table_prefix.tables::TOPICTAGS => 'tt', |
|
874 | 874 | ), |
875 | - 'WHERE' => 'tt.tag_id = ' . ((int) $tag_id), |
|
875 | + 'WHERE' => 'tt.tag_id = '.((int) $tag_id), |
|
876 | 876 | ); |
877 | 877 | $sql = $this->db->sql_build_query('SELECT_DISTINCT', $sql_array); |
878 | 878 | return $this->db_helper->get_ids($sql, 'topic_id'); |
@@ -896,8 +896,8 @@ discard block |
||
896 | 896 | $topic_ids_already_assigned = $this->get_topic_ids_by_tag_id($tag_to_keep_id); |
897 | 897 | if (!empty($topic_ids_already_assigned)) |
898 | 898 | { |
899 | - $sql = 'DELETE FROM ' . $this->table_prefix . tables::TOPICTAGS. ' |
|
900 | - WHERE ' . $this->db->sql_in_set('topic_id', $topic_ids_already_assigned) . ' |
|
899 | + $sql = 'DELETE FROM '.$this->table_prefix.tables::TOPICTAGS.' |
|
900 | + WHERE ' . $this->db->sql_in_set('topic_id', $topic_ids_already_assigned).' |
|
901 | 901 | AND tag_id = ' . (int) $tag_to_delete_id; |
902 | 902 | $this->db->sql_query($sql); |
903 | 903 | } |
@@ -905,8 +905,8 @@ discard block |
||
905 | 905 | $sql_ary = array( |
906 | 906 | 'tag_id' => $tag_to_keep_id, |
907 | 907 | ); |
908 | - $sql = 'UPDATE ' . $this->table_prefix . tables::TOPICTAGS . ' |
|
909 | - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
908 | + $sql = 'UPDATE '.$this->table_prefix.tables::TOPICTAGS.' |
|
909 | + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' |
|
910 | 910 | WHERE tag_id = ' . (int) $tag_to_delete_id; |
911 | 911 | $this->db->sql_query($sql); |
912 | 912 | |
@@ -922,11 +922,11 @@ discard block |
||
922 | 922 | */ |
923 | 923 | public function delete_tag($tag_id) |
924 | 924 | { |
925 | - $sql = 'DELETE FROM ' . $this->table_prefix . tables::TOPICTAGS . ' |
|
925 | + $sql = 'DELETE FROM '.$this->table_prefix.tables::TOPICTAGS.' |
|
926 | 926 | WHERE tag_id = ' . ((int) $tag_id); |
927 | 927 | $this->db->sql_query($sql); |
928 | 928 | |
929 | - $sql = 'DELETE FROM ' . $this->table_prefix . tables::TAGS . ' |
|
929 | + $sql = 'DELETE FROM '.$this->table_prefix.tables::TAGS.' |
|
930 | 930 | WHERE id = ' . ((int) $tag_id); |
931 | 931 | $this->db->sql_query($sql); |
932 | 932 | } |
@@ -944,8 +944,8 @@ discard block |
||
944 | 944 | 'tag' => $new_name_clean, |
945 | 945 | 'tag_lowercase' => utf8_strtolower($new_name_clean), |
946 | 946 | ); |
947 | - $sql = 'UPDATE ' . $this->table_prefix . tables::TAGS . ' |
|
948 | - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
947 | + $sql = 'UPDATE '.$this->table_prefix.tables::TAGS.' |
|
948 | + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' |
|
949 | 949 | WHERE id = ' . ((int) $tag_id); |
950 | 950 | $this->db->sql_query($sql); |
951 | 951 | return $this->count_topics_by_tags(array($new_name_clean), 'AND', true); |
@@ -962,9 +962,9 @@ discard block |
||
962 | 962 | $sql_array = array( |
963 | 963 | 'SELECT' => 't.tag', |
964 | 964 | 'FROM' => array( |
965 | - $this->table_prefix . tables::TAGS => 't', |
|
965 | + $this->table_prefix.tables::TAGS => 't', |
|
966 | 966 | ), |
967 | - 'WHERE' => 't.id = ' . ((int) $tag_id), |
|
967 | + 'WHERE' => 't.id = '.((int) $tag_id), |
|
968 | 968 | ); |
969 | 969 | $sql = $this->db->sql_build_query('SELECT_DISTINCT', $sql_array); |
970 | 970 | return $this->db_helper->get_field($sql, 'tag', 1); |
@@ -992,8 +992,8 @@ discard block |
||
992 | 992 | $sort_field = 'tag'; |
993 | 993 | } |
994 | 994 | $direction = $asc ? 'ASC' : 'DESC'; |
995 | - $sql = 'SELECT * FROM ' . $this->table_prefix . tables::TAGS . ' |
|
996 | - ORDER BY ' . $sort_field . ' ' . $direction; |
|
995 | + $sql = 'SELECT * FROM '.$this->table_prefix.tables::TAGS.' |
|
996 | + ORDER BY ' . $sort_field.' '.$direction; |
|
997 | 997 | $field_names = array( |
998 | 998 | 'id', |
999 | 999 | 'tag', |
@@ -1010,7 +1010,7 @@ discard block |
||
1010 | 1010 | */ |
1011 | 1011 | public function count_tags() |
1012 | 1012 | { |
1013 | - $sql = 'SELECT COUNT(*) as count_tags FROM ' . $this->table_prefix . tables::TAGS; |
|
1013 | + $sql = 'SELECT COUNT(*) as count_tags FROM '.$this->table_prefix.tables::TAGS; |
|
1014 | 1014 | return (int) $this->db_helper->get_field($sql, 'count_tags'); |
1015 | 1015 | } |
1016 | 1016 | } |
@@ -734,7 +734,7 @@ |
||
734 | 734 | public function is_tagging_enabled_in_forum($forum_id) |
735 | 735 | { |
736 | 736 | $field = 'rh_topictags_enabled'; |
737 | - $sql = "SELECT $field |
|
737 | + $sql = "select $field |
|
738 | 738 | FROM " . FORUMS_TABLE . ' |
739 | 739 | WHERE ' . $this->db->sql_build_array('SELECT', array('forum_id' => (int) $forum_id)); |
740 | 740 | $status = (int) $this->db_helper->get_field($sql, $field); |
@@ -262,7 +262,7 @@ |
||
262 | 262 | * @var array row Array with topic data |
263 | 263 | * @var array topic_row Template array with topic data |
264 | 264 | * @since 0.0.13-b1 |
265 | - */ |
|
265 | + */ |
|
266 | 266 | $vars = array('row', 'topic_row'); |
267 | 267 | extract($this->phpbb_dispatcher->trigger_event('robertheim.topictags.viewforum_modify_topicrow', compact($vars))); |
268 | 268 |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function show() |
99 | 99 | { |
100 | - $this->tagcloud_manager->assign_tagcloud_to_template(-1); |
|
100 | + $this->tagcloud_manager->assign_tagcloud_to_template(- 1); |
|
101 | 101 | return $this->helper->render('tags.html', 'Tags'); |
102 | 102 | } |
103 | 103 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $tags = $all_tags['valid']; |
130 | 130 | $tags_string = join(', ', $tags); |
131 | 131 | $this->template->assign_var('RH_TOPICTAGS_SEARCH_HEADER', |
132 | - $this->user->lang('RH_TOPICTAGS_SEARCH_HEADER_' . $mode, $tags_string) |
|
132 | + $this->user->lang('RH_TOPICTAGS_SEARCH_HEADER_'.$mode, $tags_string) |
|
133 | 133 | ); |
134 | 134 | if (empty($tags)) |
135 | 135 | { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | return $this->helper->render('show_tag.html', $this->user->lang('RH_TOPICTAGS_TAG_SEARCH')); |
139 | 139 | } |
140 | 140 | |
141 | - $topics_count = $this->tags_manager->count_topics_by_tags($tags, $mode, $casesensitive); |
|
141 | + $topics_count = $this->tags_manager->count_topics_by_tags($tags, $mode, $casesensitive); |
|
142 | 142 | if ($topics_count <= 0) |
143 | 143 | { |
144 | 144 | $this->template->assign_var('NO_TOPICS_FOR_TAG', $this->user->lang('RH_TOPICTAGS_NO_TOPICS_FOR_TAG_'.$mode, |
@@ -146,14 +146,14 @@ discard block |
||
146 | 146 | } |
147 | 147 | else |
148 | 148 | { |
149 | - $pagination = $this->pagination; |
|
149 | + $pagination = $this->pagination; |
|
150 | 150 | |
151 | 151 | $start = $this->request->variable('start', 0); |
152 | 152 | $limit = $this->config['topics_per_page']; |
153 | 153 | |
154 | 154 | $start = $pagination->validate_start($start, $limit, $topics_count); |
155 | 155 | |
156 | - $topics = $this->tags_manager->get_topics_by_tags($tags, $start, $limit, $mode, $casesensitive); |
|
156 | + $topics = $this->tags_manager->get_topics_by_tags($tags, $start, $limit, $mode, $casesensitive); |
|
157 | 157 | |
158 | 158 | $base_url = $this->helper->route('robertheim_topictags_show_tag_controller', array( |
159 | 159 | 'tags' => urlencode($tags_string), |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | */ |
188 | 188 | private function display_topics($topics) |
189 | 189 | { |
190 | - include_once($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext); |
|
190 | + include_once($this->phpbb_root_path.'includes/functions_display.'.$this->php_ext); |
|
191 | 191 | |
192 | 192 | $pagination = $this->pagination; |
193 | 193 | |
@@ -290,6 +290,6 @@ discard block |
||
290 | 290 | $json_response->send($tags); |
291 | 291 | } |
292 | 292 | // fake a 404 |
293 | - return $this->helper->error($this->user->lang('RH_TOPICTAGS_TAG_SUGGEST_TAG_ROUTE_ERROR', $this->helper->get_current_url()) , 404); |
|
293 | + return $this->helper->error($this->user->lang('RH_TOPICTAGS_TAG_SUGGEST_TAG_ROUTE_ERROR', $this->helper->get_current_url()), 404); |
|
294 | 294 | } |
295 | 295 | } |
@@ -73,8 +73,7 @@ |
||
73 | 73 | $phpbb_root_path, |
74 | 74 | \robertheim\topictags\service\tags_manager $tags_manager, |
75 | 75 | \robertheim\topictags\service\tagcloud_manager $tagcloud_manager |
76 | - ) |
|
77 | - { |
|
76 | + ) { |
|
78 | 77 | $this->config = $config; |
79 | 78 | $this->template = $template; |
80 | 79 | $this->helper = $helper; |
@@ -114,13 +114,13 @@ |
||
114 | 114 | 'TOPICTAGS_BLACKLIST_EXP' => 'Lista de etiquetas prohibidas.<br/>NOTA: Todas las etiquetas que no están conformes con la expresión regular siempre serán rechazadas.', |
115 | 115 | |
116 | 116 | 'TOPICTAGS_ALLOWED_TAGS_REGEX' => 'Expresión regular para etiquetas permitidas', |
117 | - 'TOPICTAGS_ALLOWED_TAGS_REGEX_EXP' => 'ADVERTENCIA: No cambie esto, si no sabe lo que está haciendo. <strong>Las etiquetas pueden ser de 30 caracteres como máximo</strong>, por favor considere esto durante el diseño de expresiones regulares.<br/>Tenga en cuenta que las etiquetas no válidas, no se pueden buscar después, pero todavía se muestran en los temas.<br/>Considere la limpieza de las etiquetas no válidas (ver sección de mantenimiento).<br/>Por defecto: ' . $lang['ACP_RH_TOPICTAGS_REGEX_DEFAULT'], |
|
117 | + 'TOPICTAGS_ALLOWED_TAGS_REGEX_EXP' => 'ADVERTENCIA: No cambie esto, si no sabe lo que está haciendo. <strong>Las etiquetas pueden ser de 30 caracteres como máximo</strong>, por favor considere esto durante el diseño de expresiones regulares.<br/>Tenga en cuenta que las etiquetas no válidas, no se pueden buscar después, pero todavía se muestran en los temas.<br/>Considere la limpieza de las etiquetas no válidas (ver sección de mantenimiento).<br/>Por defecto: '.$lang['ACP_RH_TOPICTAGS_REGEX_DEFAULT'], |
|
118 | 118 | |
119 | 119 | 'TOPICTAGS_CONVERT_SPACE_TO_MINUS' => 'Convertir “ ” a “-”', |
120 | 120 | 'TOPICTAGS_CONVERT_SPACE_TO_MINUS_EXP' => 'Si se establece en sí, todos los espacios (“ ”) se convierten automáticamente a menos (“-”).<br/>NOTA 1: En la expresión regular se debe permitir “-”; de lo contrario se rechazarán las etiquetas con espacios en blanco.<br/>NOTA 2: Las etiquetas existentes con espacios NO se convertirán automáticamente.', |
121 | 121 | |
122 | 122 | 'TOPICTAGS_ALLOWED_TAGS_EXP_FOR_USERS' => 'Explicación para los usuarios', |
123 | - 'TOPICTAGS_ALLOWED_TAGS_EXP_FOR_USERS_EXP' => 'Este texto se muestra a los usuarios y debe explicar qué etiquetas se permiten, y cuáles no.<br/>Por defecto: ' . $lang['ACP_RH_TOPICTAGS_REGEX_EXP_FOR_USERS_DEFAULT'], |
|
123 | + 'TOPICTAGS_ALLOWED_TAGS_EXP_FOR_USERS_EXP' => 'Este texto se muestra a los usuarios y debe explicar qué etiquetas se permiten, y cuáles no.<br/>Por defecto: '.$lang['ACP_RH_TOPICTAGS_REGEX_EXP_FOR_USERS_DEFAULT'], |
|
124 | 124 | |
125 | 125 | 'TOPICTAGS_MANAGE_TAGS_EXP' => 'La tabla muestra todas las etiquetas existentes. Aquí puede eliminarlas (y todas sus asignaciones) o editar una etiqueta. También puede combinar etiquetas, con la edición de una etiqueta y el establecimiento de su nombre para que sea igual a otra etiqueta y así se fusionarán automáticamente.', |
126 | 126 | 'TOPICTAGS_NO_TAGS' => 'No hay etiquetas todavía.', |
@@ -114,13 +114,13 @@ |
||
114 | 114 | 'TOPICTAGS_BLACKLIST_EXP' => 'List of forbidden tags.<br/>NOTE: All tags that are not conform with the regex are always rejected.', |
115 | 115 | |
116 | 116 | 'TOPICTAGS_ALLOWED_TAGS_REGEX' => 'Regular Expression for allowed tags', |
117 | - 'TOPICTAGS_ALLOWED_TAGS_REGEX_EXP' => 'WARNING: Do not change this, if you don\'t know what you are doing. <strong>Tags can be 30 characters at maximum and delimiter must be “/”</strong>, please consider this during regex design.<br/>Note that afterwards invalid tags are not searchable, but are still displayed in the topics.<br/>Consider pruning the invalid tags (see maintenance-section).<br/>default: ' . $lang['ACP_RH_TOPICTAGS_REGEX_DEFAULT'], |
|
117 | + 'TOPICTAGS_ALLOWED_TAGS_REGEX_EXP' => 'WARNING: Do not change this, if you don\'t know what you are doing. <strong>Tags can be 30 characters at maximum and delimiter must be “/”</strong>, please consider this during regex design.<br/>Note that afterwards invalid tags are not searchable, but are still displayed in the topics.<br/>Consider pruning the invalid tags (see maintenance-section).<br/>default: '.$lang['ACP_RH_TOPICTAGS_REGEX_DEFAULT'], |
|
118 | 118 | |
119 | 119 | 'TOPICTAGS_CONVERT_SPACE_TO_MINUS' => 'Convert “ ” to “-”', |
120 | 120 | 'TOPICTAGS_CONVERT_SPACE_TO_MINUS_EXP' => 'If set to yes, all spaces (“ ”) are automatically converted to minus (“-”).<br/>NOTE 1: In the regex you must allow “-”; otherwise tags with whitespaces will be rejected.<br/>NOTE 2: Existing tags with spaces will NOT be converted automatically.', |
121 | 121 | |
122 | 122 | 'TOPICTAGS_ALLOWED_TAGS_EXP_FOR_USERS' => 'Explanation for Users', |
123 | - 'TOPICTAGS_ALLOWED_TAGS_EXP_FOR_USERS_EXP' => 'This text is shown to the users and should explain which tags are allowed and which not.<br/>default: ' . $lang['ACP_RH_TOPICTAGS_REGEX_EXP_FOR_USERS_DEFAULT'], |
|
123 | + 'TOPICTAGS_ALLOWED_TAGS_EXP_FOR_USERS_EXP' => 'This text is shown to the users and should explain which tags are allowed and which not.<br/>default: '.$lang['ACP_RH_TOPICTAGS_REGEX_EXP_FOR_USERS_DEFAULT'], |
|
124 | 124 | |
125 | 125 | 'TOPICTAGS_MANAGE_TAGS_EXP' => 'The table shows all existing tags. Here you can <ul><li>delete a tag (and all their assignments).</li><li>edit a tag (double click the tags\' names for faster workflow).</li><li>merge tags by editing a tag and setting its name so that it equals another tag - they will be merged automatically.</li></ul>', |
126 | 126 | 'TOPICTAGS_NO_TAGS' => 'There are no tags yet.', |
@@ -114,13 +114,13 @@ |
||
114 | 114 | 'TOPICTAGS_BLACKLIST_EXP' => 'Список запрещенных тегов.<br/>ПРИМЕЧАНИЕ: Все теги, которые не соответствуют регулярным выражением, всегда отклоняются.', |
115 | 115 | |
116 | 116 | 'TOPICTAGS_ALLOWED_TAGS_REGEX' => 'Регулярное выражение для разрешенных тегов', |
117 | - 'TOPICTAGS_ALLOWED_TAGS_REGEX_EXP' => 'ВНИМАНИЕ: Не изменяйте значение, если вы не уверены в своих действиях. <strong>Теги могуть состоять максимум из 30 символов</strong>, учитывайте это.<br/>Обратите внимание, что после изменения регулярных выражений недействительные теги по-прежнему будут отображаться в темах, но исключаются из поиска по тегам.<br/>Рассмотрим удаление неправильных тегов (см. секцию техобслуживания).<br/>По-умолчанию: ' . $lang['ACP_RH_TOPICTAGS_REGEX_DEFAULT'], |
|
117 | + 'TOPICTAGS_ALLOWED_TAGS_REGEX_EXP' => 'ВНИМАНИЕ: Не изменяйте значение, если вы не уверены в своих действиях. <strong>Теги могуть состоять максимум из 30 символов</strong>, учитывайте это.<br/>Обратите внимание, что после изменения регулярных выражений недействительные теги по-прежнему будут отображаться в темах, но исключаются из поиска по тегам.<br/>Рассмотрим удаление неправильных тегов (см. секцию техобслуживания).<br/>По-умолчанию: '.$lang['ACP_RH_TOPICTAGS_REGEX_DEFAULT'], |
|
118 | 118 | |
119 | 119 | 'TOPICTAGS_CONVERT_SPACE_TO_MINUS' => 'Преобразование “ ” в “-”', |
120 | 120 | 'TOPICTAGS_CONVERT_SPACE_TO_MINUS_EXP' => 'Если установлено “Да”, все пробелы (“ ”) автоматически заменяются знаком тире (“-”).<br/>ПРИМЕЧАНИЕ 1: В регулярном выражении необходимо разрешить “-”; в противном случае теги с пробелами будут отклонены.<br/>ПРИМЕЧАНИЕ 2: Существующие теги с пробелами не будут преобразованы автоматически.', |
121 | 121 | |
122 | 122 | 'TOPICTAGS_ALLOWED_TAGS_EXP_FOR_USERS' => 'Объяснение для пользователей', |
123 | - 'TOPICTAGS_ALLOWED_TAGS_EXP_FOR_USERS_EXP' => 'Этот текст отображается для пользователей и объясняет, какие теги разрешены, а какие нет.<br/>По умолчанию: ' . $lang['ACP_RH_TOPICTAGS_REGEX_EXP_FOR_USERS_DEFAULT'], |
|
123 | + 'TOPICTAGS_ALLOWED_TAGS_EXP_FOR_USERS_EXP' => 'Этот текст отображается для пользователей и объясняет, какие теги разрешены, а какие нет.<br/>По умолчанию: '.$lang['ACP_RH_TOPICTAGS_REGEX_EXP_FOR_USERS_DEFAULT'], |
|
124 | 124 | |
125 | 125 | 'TOPICTAGS_MANAGE_TAGS_EXP' => 'В таблице показаны все существующие теги. Здесь вы можете удалять их (и все их значения) или редактировать. Вы также можете объединять теги, изменив имя одного тега таким образом, что оно станет равным имени другого тега, в этом случае они будут объединены автоматически.', |
126 | 126 | 'TOPICTAGS_NO_TAGS' => 'Теги еще не были созданы.', |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | |
87 | 87 | if ($this->request->is_set_post('submit')) |
88 | 88 | { |
89 | - if (! check_form_key($form_name)) |
|
89 | + if (!check_form_key($form_name)) |
|
90 | 90 | { |
91 | 91 | trigger_error('FORM_INVALID'); |
92 | 92 | } |
93 | 93 | |
94 | - $this->config->set(prefixes::CONFIG . '_' . $list_name . '_enabled', $this->request->variable(prefixes::CONFIG . '_' . $list_name . '_enabled', 0)); |
|
95 | - $list = rawurldecode(base64_decode($this->request->variable(prefixes::CONFIG . '_' . $list_name, ''))); |
|
96 | - if (! empty($list)) |
|
94 | + $this->config->set(prefixes::CONFIG.'_'.$list_name.'_enabled', $this->request->variable(prefixes::CONFIG.'_'.$list_name.'_enabled', 0)); |
|
95 | + $list = rawurldecode(base64_decode($this->request->variable(prefixes::CONFIG.'_'.$list_name, ''))); |
|
96 | + if (!empty($list)) |
|
97 | 97 | { |
98 | 98 | $list = json_decode($list, true); |
99 | 99 | $tags = array(); |
@@ -104,21 +104,21 @@ discard block |
||
104 | 104 | $list = json_encode($tags); |
105 | 105 | } |
106 | 106 | // store the list |
107 | - $this->config_text->set(prefixes::CONFIG . '_' . $list_name, $list); |
|
108 | - trigger_error($this->user->lang('TOPICTAGS_' . $list_name_upper . '_SAVED') . adm_back_link($u_action)); |
|
107 | + $this->config_text->set(prefixes::CONFIG.'_'.$list_name, $list); |
|
108 | + trigger_error($this->user->lang('TOPICTAGS_'.$list_name_upper.'_SAVED').adm_back_link($u_action)); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | // display |
112 | - $list = $this->config_text->get(prefixes::CONFIG . '_' . $list_name); |
|
112 | + $list = $this->config_text->get(prefixes::CONFIG.'_'.$list_name); |
|
113 | 113 | $list = base64_encode(rawurlencode($list)); |
114 | 114 | $this->template->assign_vars( |
115 | 115 | array( |
116 | - 'TOPICTAGS_VERSION' => $this->user->lang('TOPICTAGS_INSTALLED', $this->config[prefixes::CONFIG . '_version']), |
|
117 | - 'TOPICTAGS_' . $list_name_upper . '_ENABLED' => $this->config[prefixes::CONFIG . '_' . $list_name . '_enabled'], |
|
118 | - 'TOPICTAGS_' . $list_name_upper => $list, |
|
116 | + 'TOPICTAGS_VERSION' => $this->user->lang('TOPICTAGS_INSTALLED', $this->config[prefixes::CONFIG.'_version']), |
|
117 | + 'TOPICTAGS_'.$list_name_upper.'_ENABLED' => $this->config[prefixes::CONFIG.'_'.$list_name.'_enabled'], |
|
118 | + 'TOPICTAGS_'.$list_name_upper => $list, |
|
119 | 119 | 'S_RH_TOPICTAGS_INCLUDE_NG_TAGS_INPUT' => true, |
120 | 120 | 'S_RH_TOPICTAGS_INCLUDE_CSS' => true, |
121 | - 'TOPICTAGS_CONVERT_SPACE_TO_MINUS' => $this->config[prefixes::CONFIG . '_convert_space_to_minus'] ? 'true' : 'false', |
|
121 | + 'TOPICTAGS_CONVERT_SPACE_TO_MINUS' => $this->config[prefixes::CONFIG.'_convert_space_to_minus'] ? 'true' : 'false', |
|
122 | 122 | 'S_ERROR' => (sizeof($errors)) ? true : false, |
123 | 123 | 'ERROR_MSG' => implode('<br />', $errors), |
124 | 124 | 'U_ACTION' => $u_action |