@@ -144,7 +144,7 @@ |
||
144 | 144 | * @copyright (c) 2014 phpBB Limited <https://www.phpbb.com> |
145 | 145 | * @license GNU General Public License, version 2 (GPL-2.0) |
146 | 146 | * @param string $step The step (enable, disable, purge) |
147 | - * @param array $notification_types The notification type names |
|
147 | + * @param string[] $notification_types The notification type names |
|
148 | 148 | * @return string Return notifications as temporary state |
149 | 149 | * @access protected |
150 | 150 | */ |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | class ext extends \phpbb\extension\base |
18 | 18 | { |
19 | 19 | /** |
20 | - * Enable extension if requirements are met |
|
21 | - * |
|
22 | - * @return bool |
|
23 | - * @aceess public |
|
24 | - */ |
|
20 | + * Enable extension if requirements are met |
|
21 | + * |
|
22 | + * @return bool |
|
23 | + * @aceess public |
|
24 | + */ |
|
25 | 25 | public function is_enableable() |
26 | 26 | { |
27 | 27 | $config = $this->container->get('config'); |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
45 | - * Single enable step that installs any included migrations |
|
46 | - * |
|
47 | - * @param mixed $old_state State returned by previous call of this method |
|
48 | - * @return mixed Returns false after last step, otherwise temporary state |
|
49 | - */ |
|
45 | + * Single enable step that installs any included migrations |
|
46 | + * |
|
47 | + * @param mixed $old_state State returned by previous call of this method |
|
48 | + * @return mixed Returns false after last step, otherwise temporary state |
|
49 | + */ |
|
50 | 50 | public function enable_step($old_state) |
51 | 51 | { |
52 | 52 | switch ($old_state) |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
77 | - * Single disable step that does nothing |
|
78 | - * |
|
79 | - * @param mixed $old_state State returned by previous call of this method |
|
80 | - * @return mixed Returns false after last step, otherwise temporary state |
|
81 | - */ |
|
77 | + * Single disable step that does nothing |
|
78 | + * |
|
79 | + * @param mixed $old_state State returned by previous call of this method |
|
80 | + * @return mixed Returns false after last step, otherwise temporary state |
|
81 | + */ |
|
82 | 82 | public function disable_step($old_state) |
83 | 83 | { |
84 | 84 | switch ($old_state) |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
109 | - * Single purge step that reverts any included and installed migrations |
|
110 | - * |
|
111 | - * @param mixed $old_state State returned by previous call of this method |
|
112 | - * @return mixed Returns false after last step, otherwise temporary state |
|
113 | - */ |
|
109 | + * Single purge step that reverts any included and installed migrations |
|
110 | + * |
|
111 | + * @param mixed $old_state State returned by previous call of this method |
|
112 | + * @return mixed Returns false after last step, otherwise temporary state |
|
113 | + */ |
|
114 | 114 | public function purge_step($old_state) |
115 | 115 | { |
116 | 116 | switch ($old_state) |
@@ -138,16 +138,16 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
141 | - * Notification handler to call notification enable/disable/purge steps |
|
142 | - * |
|
143 | - * @author VSEphpbb (Matt Friedman) |
|
144 | - * @copyright (c) 2014 phpBB Limited <https://www.phpbb.com> |
|
145 | - * @license GNU General Public License, version 2 (GPL-2.0) |
|
146 | - * @param string $step The step (enable, disable, purge) |
|
147 | - * @param array $notification_types The notification type names |
|
148 | - * @return string Return notifications as temporary state |
|
149 | - * @access protected |
|
150 | - */ |
|
141 | + * Notification handler to call notification enable/disable/purge steps |
|
142 | + * |
|
143 | + * @author VSEphpbb (Matt Friedman) |
|
144 | + * @copyright (c) 2014 phpBB Limited <https://www.phpbb.com> |
|
145 | + * @license GNU General Public License, version 2 (GPL-2.0) |
|
146 | + * @param string $step The step (enable, disable, purge) |
|
147 | + * @param array $notification_types The notification type names |
|
148 | + * @return string Return notifications as temporary state |
|
149 | + * @access protected |
|
150 | + */ |
|
151 | 151 | protected function notification_handler($step, $notification_types) |
152 | 152 | { |
153 | 153 | $phpbb_notifications = $this->container->get('notification_manager'); |
@@ -155,7 +155,7 @@ |
||
155 | 155 | |
156 | 156 | foreach ($notification_types as $notification_type) |
157 | 157 | { |
158 | - call_user_func(array($phpbb_notifications, $step . '_notifications'), $notification_type); |
|
158 | + call_user_func(array($phpbb_notifications, $step.'_notifications'), $notification_type); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | return 'notifications'; |
@@ -18,11 +18,11 @@ |
||
18 | 18 | 'filename' => '\ernadoo\phpbbdirectory\acp\phpbbdirectory_module', |
19 | 19 | 'title' => 'ACP_DIRECTORY', |
20 | 20 | 'modes' => array( |
21 | - '' => array('title' => 'ACP_DIRECTORY', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('')), |
|
22 | - 'main' => array('title' => 'ACP_DIRECTORY_MAIN', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
23 | - 'settings' => array('title' => 'ACP_DIRECTORY_SETTINGS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
24 | - 'cat' => array('title' => 'ACP_DIRECTORY_CATS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
25 | - 'val' => array('title' => 'ACP_DIRECTORY_VAL', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
21 | + '' => array('title' => 'ACP_DIRECTORY', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('')), |
|
22 | + 'main' => array('title' => 'ACP_DIRECTORY_MAIN', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
23 | + 'settings' => array('title' => 'ACP_DIRECTORY_SETTINGS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
24 | + 'cat' => array('title' => 'ACP_DIRECTORY_CATS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
25 | + 'val' => array('title' => 'ACP_DIRECTORY_VAL', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
26 | 26 | ), |
27 | 27 | ); |
28 | 28 | } |
@@ -70,20 +70,20 @@ discard block |
||
70 | 70 | private $update; |
71 | 71 | |
72 | 72 | /** |
73 | - * Constructor |
|
74 | - * |
|
75 | - * @param \phpbb\cache\service $cache Cache object |
|
76 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
77 | - * @param \phpbb\controller\helper $helper Helper object |
|
78 | - * @param \phpbb\language\language $language Language object |
|
79 | - * @param \phpbb\log\log $log Log object |
|
80 | - * @param \phpbb\request\request $request Request object |
|
81 | - * @param \phpbb\template\template $template Template object |
|
82 | - * @param \phpbb\user $user User object |
|
83 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
84 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
85 | - * @param \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category PhpBB Directory extension nestedset object |
|
86 | - */ |
|
73 | + * Constructor |
|
74 | + * |
|
75 | + * @param \phpbb\cache\service $cache Cache object |
|
76 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
77 | + * @param \phpbb\controller\helper $helper Helper object |
|
78 | + * @param \phpbb\language\language $language Language object |
|
79 | + * @param \phpbb\log\log $log Log object |
|
80 | + * @param \phpbb\request\request $request Request object |
|
81 | + * @param \phpbb\template\template $template Template object |
|
82 | + * @param \phpbb\user $user User object |
|
83 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
84 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
85 | + * @param \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category PhpBB Directory extension nestedset object |
|
86 | + */ |
|
87 | 87 | public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\helper $dir_helper, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category) |
88 | 88 | { |
89 | 89 | $this->cache = $cache; |
@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
111 | - * Initialize defaults data for add page |
|
112 | - * |
|
113 | - * @return null |
|
114 | - */ |
|
111 | + * Initialize defaults data for add page |
|
112 | + * |
|
113 | + * @return null |
|
114 | + */ |
|
115 | 115 | public function action_add() |
116 | 116 | { |
117 | 117 | $this->cat_id = $this->parent_id; |
@@ -145,10 +145,10 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
148 | - * Display deleting page |
|
149 | - * |
|
150 | - * @return null |
|
151 | - */ |
|
148 | + * Display deleting page |
|
149 | + * |
|
150 | + * @return null |
|
151 | + */ |
|
152 | 152 | public function action_delete() |
153 | 153 | { |
154 | 154 | if (!$this->cat_id) |
@@ -199,10 +199,10 @@ discard block |
||
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
202 | - * Initialize data for edit page |
|
203 | - * |
|
204 | - * @return null |
|
205 | - */ |
|
202 | + * Initialize data for edit page |
|
203 | + * |
|
204 | + * @return null |
|
205 | + */ |
|
206 | 206 | public function action_edit() |
207 | 207 | { |
208 | 208 | $row = $this->_get_cat_info($this->cat_id); |
@@ -229,10 +229,10 @@ discard block |
||
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
232 | - * Move order categories |
|
233 | - * |
|
234 | - * @return null |
|
235 | - */ |
|
232 | + * Move order categories |
|
233 | + * |
|
234 | + * @return null |
|
235 | + */ |
|
236 | 236 | public function action_move() |
237 | 237 | { |
238 | 238 | if (!$this->cat_id) |
@@ -275,10 +275,10 @@ discard block |
||
275 | 275 | } |
276 | 276 | |
277 | 277 | /** |
278 | - * Display progress bar for syncinc categories |
|
279 | - * |
|
280 | - * @return null |
|
281 | - */ |
|
278 | + * Display progress bar for syncinc categories |
|
279 | + * |
|
280 | + * @return null |
|
281 | + */ |
|
282 | 282 | public function action_progress_bar() |
283 | 283 | { |
284 | 284 | $start = $this->request->variable('start', 0); |
@@ -299,10 +299,10 @@ discard block |
||
299 | 299 | } |
300 | 300 | |
301 | 301 | /** |
302 | - * Get link's ID interval for _sync_dir_links() |
|
303 | - * |
|
304 | - * @return null |
|
305 | - */ |
|
302 | + * Get link's ID interval for _sync_dir_links() |
|
303 | + * |
|
304 | + * @return null |
|
305 | + */ |
|
306 | 306 | public function action_sync() |
307 | 307 | { |
308 | 308 | if (!$this->cat_id) |
@@ -386,10 +386,10 @@ discard block |
||
386 | 386 | } |
387 | 387 | |
388 | 388 | /** |
389 | - * Sync category data |
|
390 | - * |
|
391 | - * @return null |
|
392 | - */ |
|
389 | + * Sync category data |
|
390 | + * |
|
391 | + * @return null |
|
392 | + */ |
|
393 | 393 | public function action_sync_cat() |
394 | 394 | { |
395 | 395 | $sql = 'SELECT cat_name |
@@ -413,10 +413,10 @@ discard block |
||
413 | 413 | } |
414 | 414 | |
415 | 415 | /** |
416 | - * Display categories page |
|
417 | - * |
|
418 | - * @return null |
|
419 | - */ |
|
416 | + * Display categories page |
|
417 | + * |
|
418 | + * @return null |
|
419 | + */ |
|
420 | 420 | public function display_cats() |
421 | 421 | { |
422 | 422 | // Default management page |
@@ -511,22 +511,22 @@ discard block |
||
511 | 511 | } |
512 | 512 | |
513 | 513 | /** |
514 | - * Set page url |
|
515 | - * |
|
516 | - * @param string $u_action Custom form action |
|
517 | - * @return null |
|
518 | - * @access public |
|
519 | - */ |
|
514 | + * Set page url |
|
515 | + * |
|
516 | + * @param string $u_action Custom form action |
|
517 | + * @return null |
|
518 | + * @access public |
|
519 | + */ |
|
520 | 520 | public function set_page_url($u_action) |
521 | 521 | { |
522 | 522 | $this->u_action = $u_action; |
523 | 523 | } |
524 | 524 | |
525 | 525 | /** |
526 | - * Update cat table |
|
527 | - * |
|
528 | - * @return null |
|
529 | - */ |
|
526 | + * Update cat table |
|
527 | + * |
|
528 | + * @return null |
|
529 | + */ |
|
530 | 530 | public function update() |
531 | 531 | { |
532 | 532 | if (!check_form_key($this->form_key)) |
@@ -620,11 +620,11 @@ discard block |
||
620 | 620 | } |
621 | 621 | |
622 | 622 | /** |
623 | - * Display form |
|
624 | - * |
|
625 | - * @param string $parents_list Drop-down list |
|
626 | - * @return null |
|
627 | - */ |
|
623 | + * Display form |
|
624 | + * |
|
625 | + * @param string $parents_list Drop-down list |
|
626 | + * @return null |
|
627 | + */ |
|
628 | 628 | private function _display_cat_form($parents_list) |
629 | 629 | { |
630 | 630 | $dir_cat_desc_data = array( |
@@ -694,11 +694,11 @@ discard block |
||
694 | 694 | } |
695 | 695 | |
696 | 696 | /** |
697 | - * Get category details |
|
698 | - * |
|
699 | - * @param int $cat_id The category ID |
|
700 | - * @return array |
|
701 | - */ |
|
697 | + * Get category details |
|
698 | + * |
|
699 | + * @param int $cat_id The category ID |
|
700 | + * @return array |
|
701 | + */ |
|
702 | 702 | private function _get_cat_info($cat_id) |
703 | 703 | { |
704 | 704 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next |
@@ -717,10 +717,10 @@ discard block |
||
717 | 717 | } |
718 | 718 | |
719 | 719 | /** |
720 | - * Update category data |
|
721 | - * |
|
722 | - * @return array |
|
723 | - */ |
|
720 | + * Update category data |
|
721 | + * |
|
722 | + * @return array |
|
723 | + */ |
|
724 | 724 | private function _update_cat_data() |
725 | 725 | { |
726 | 726 | if (!$this->cat_data['cat_name']) |
@@ -814,14 +814,14 @@ discard block |
||
814 | 814 | } |
815 | 815 | |
816 | 816 | /** |
817 | - * Remove complete category |
|
818 | - * |
|
819 | - * @param string $action_links Action for categories links |
|
820 | - * @param string $action_subcats Action for sub-categories |
|
821 | - * @param int $links_to_id New category ID for links |
|
822 | - * @param int $subcats_to_id New category ID for sub-categories |
|
823 | - * @return array |
|
824 | - */ |
|
817 | + * Remove complete category |
|
818 | + * |
|
819 | + * @param string $action_links Action for categories links |
|
820 | + * @param string $action_subcats Action for sub-categories |
|
821 | + * @param int $links_to_id New category ID for links |
|
822 | + * @param int $subcats_to_id New category ID for sub-categories |
|
823 | + * @return array |
|
824 | + */ |
|
825 | 825 | private function _delete_cat($action_links = 'delete', $action_subcats = 'delete', $links_to_id = 0, $subcats_to_id = 0) |
826 | 826 | { |
827 | 827 | $this->cat_data = $this->_get_cat_info($this->cat_id); |
@@ -938,12 +938,12 @@ discard block |
||
938 | 938 | } |
939 | 939 | |
940 | 940 | /** |
941 | - * Move category content from one to another forum |
|
942 | - * |
|
943 | - * @param int $from_id |
|
944 | - * @param int $to_id |
|
945 | - * @return null |
|
946 | - */ |
|
941 | + * Move category content from one to another forum |
|
942 | + * |
|
943 | + * @param int $from_id |
|
944 | + * @param int $to_id |
|
945 | + * @return null |
|
946 | + */ |
|
947 | 947 | private function _move_cat_content($from_id, $to_id) |
948 | 948 | { |
949 | 949 | $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
@@ -959,10 +959,10 @@ discard block |
||
959 | 959 | } |
960 | 960 | |
961 | 961 | /** |
962 | - * Delete category content |
|
963 | - * |
|
964 | - * @return array |
|
965 | - */ |
|
962 | + * Delete category content |
|
963 | + * |
|
964 | + * @return array |
|
965 | + */ |
|
966 | 966 | private function _delete_cat_content() |
967 | 967 | { |
968 | 968 | $this->db->sql_transaction('begin'); |
@@ -1021,11 +1021,11 @@ discard block |
||
1021 | 1021 | } |
1022 | 1022 | |
1023 | 1023 | /** |
1024 | - * Update links counter |
|
1025 | - * |
|
1026 | - * @param int $cat_id The category ID |
|
1027 | - * @return null |
|
1028 | - */ |
|
1024 | + * Update links counter |
|
1025 | + * |
|
1026 | + * @param int $cat_id The category ID |
|
1027 | + * @return null |
|
1028 | + */ |
|
1029 | 1029 | private function _sync_dir_cat($cat_id) |
1030 | 1030 | { |
1031 | 1031 | $sql = 'SELECT COUNT(link_id) AS num_links |
@@ -1043,12 +1043,12 @@ discard block |
||
1043 | 1043 | } |
1044 | 1044 | |
1045 | 1045 | /** |
1046 | - * Update link data (note, vote, comment) |
|
1047 | - * |
|
1048 | - * @param int $start |
|
1049 | - * @param int $stop |
|
1050 | - * @return null |
|
1051 | - */ |
|
1046 | + * Update link data (note, vote, comment) |
|
1047 | + * |
|
1048 | + * @param int $start |
|
1049 | + * @param int $stop |
|
1050 | + * @return null |
|
1051 | + */ |
|
1052 | 1052 | private function _sync_dir_links($start, $stop) |
1053 | 1053 | { |
1054 | 1054 | $sql_ary = array( |
@@ -1091,12 +1091,12 @@ discard block |
||
1091 | 1091 | } |
1092 | 1092 | |
1093 | 1093 | /** |
1094 | - * Display icons drop-down list |
|
1095 | - * |
|
1096 | - * @param string $icons_path |
|
1097 | - * @param string $img_selected |
|
1098 | - * @return string |
|
1099 | - */ |
|
1094 | + * Display icons drop-down list |
|
1095 | + * |
|
1096 | + * @param string $icons_path |
|
1097 | + * @param string $img_selected |
|
1098 | + * @return string |
|
1099 | + */ |
|
1100 | 1100 | private function _get_dir_icon_list($icons_path, $img_selected) |
1101 | 1101 | { |
1102 | 1102 | $imglist = filelist($icons_path, ''); |
@@ -86,24 +86,24 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\helper $dir_helper, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category) |
88 | 88 | { |
89 | - $this->cache = $cache; |
|
90 | - $this->db = $db; |
|
91 | - $this->helper = $helper; |
|
89 | + $this->cache = $cache; |
|
90 | + $this->db = $db; |
|
91 | + $this->helper = $helper; |
|
92 | 92 | $this->language = $language; |
93 | 93 | $this->phpbb_log = $log; |
94 | - $this->request = $request; |
|
94 | + $this->request = $request; |
|
95 | 95 | $this->template = $template; |
96 | - $this->user = $user; |
|
96 | + $this->user = $user; |
|
97 | 97 | $this->categorie = $categorie; |
98 | - $this->dir_helper = $dir_helper; |
|
99 | - $this->nestedset_category = $nestedset_category; |
|
98 | + $this->dir_helper = $dir_helper; |
|
99 | + $this->nestedset_category = $nestedset_category; |
|
100 | 100 | |
101 | 101 | $this->form_key = 'acp_dir_cat'; |
102 | 102 | add_form_key($this->form_key); |
103 | 103 | |
104 | 104 | $this->action = $this->request->variable('action', ''); |
105 | 105 | $this->cat_id = $request->variable('c', 0); |
106 | - $this->parent_id = $request->variable('parent_id', 0); |
|
106 | + $this->parent_id = $request->variable('parent_id', 0); |
|
107 | 107 | $this->update = ($this->request->is_set_post('update')) ? true : false; |
108 | 108 | } |
109 | 109 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | { |
154 | 154 | if (!$this->cat_id) |
155 | 155 | { |
156 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
156 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | $this->cat_data = $this->_get_cat_info($this->cat_id); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $cat_list = $this->categorie->make_cat_select((int) $this->cat_data['parent_id'], $subcats_id); |
170 | 170 | |
171 | 171 | $sql = 'SELECT cat_id |
172 | - FROM ' . DIR_CAT_TABLE . ' |
|
172 | + FROM ' . DIR_CAT_TABLE.' |
|
173 | 173 | WHERE cat_id <> ' . (int) $this->cat_id; |
174 | 174 | $result = $this->db->sql_query_limit($sql, 1); |
175 | 175 | |
@@ -185,8 +185,8 @@ discard block |
||
185 | 185 | |
186 | 186 | $this->template->assign_vars(array( |
187 | 187 | 'S_DELETE_DIR_CAT' => true, |
188 | - 'U_ACTION' => $this->u_action . "&parent_id={$parent_id}&action=delete&c=$this->cat_id", |
|
189 | - 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
188 | + 'U_ACTION' => $this->u_action."&parent_id={$parent_id}&action=delete&c=$this->cat_id", |
|
189 | + 'U_BACK' => $this->u_action.'&parent_id='.$this->parent_id, |
|
190 | 190 | |
191 | 191 | 'DIR_CAT_NAME' => $this->cat_data['cat_name'], |
192 | 192 | 'S_HAS_SUBCATS' => ($this->cat_data['right_id'] - $this->cat_data['left_id'] > 1) ? true : false, |
@@ -237,11 +237,11 @@ discard block |
||
237 | 237 | { |
238 | 238 | if (!$this->cat_id) |
239 | 239 | { |
240 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
240 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
244 | - FROM ' . DIR_CAT_TABLE . ' |
|
244 | + FROM ' . DIR_CAT_TABLE.' |
|
245 | 245 | WHERE cat_id = ' . (int) $this->cat_id; |
246 | 246 | $result = $this->db->sql_query($sql); |
247 | 247 | $row = $this->db->sql_fetchrow($result); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | if (!$row) |
251 | 251 | { |
252 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
252 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | try |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | |
264 | 264 | if ($move_cat_name !== false) |
265 | 265 | { |
266 | - $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_' . strtoupper($this->action), time(), array($row['cat_name'], $move_cat_name)); |
|
266 | + $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_'.strtoupper($this->action), time(), array($row['cat_name'], $move_cat_name)); |
|
267 | 267 | $this->cache->destroy('sql', DIR_CAT_TABLE); |
268 | 268 | } |
269 | 269 | |
@@ -307,13 +307,13 @@ discard block |
||
307 | 307 | { |
308 | 308 | if (!$this->cat_id) |
309 | 309 | { |
310 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
310 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | @set_time_limit(0); |
314 | 314 | |
315 | 315 | $sql = 'SELECT cat_name, cat_links |
316 | - FROM ' . DIR_CAT_TABLE . ' |
|
316 | + FROM ' . DIR_CAT_TABLE.' |
|
317 | 317 | WHERE cat_id = ' . (int) $this->cat_id; |
318 | 318 | $result = $this->db->sql_query($sql); |
319 | 319 | $row = $this->db->sql_fetchrow($result); |
@@ -321,12 +321,12 @@ discard block |
||
321 | 321 | |
322 | 322 | if (!$row) |
323 | 323 | { |
324 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
324 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | $sql = 'SELECT MIN(link_id) as min_link_id, MAX(link_id) as max_link_id |
328 | - FROM ' . DIR_LINK_TABLE . ' |
|
329 | - WHERE link_cat = ' . (int) $this->cat_id . ' |
|
328 | + FROM ' . DIR_LINK_TABLE.' |
|
329 | + WHERE link_cat = ' . (int) $this->cat_id.' |
|
330 | 330 | AND link_active = 1'; |
331 | 331 | $result = $this->db->sql_query($sql); |
332 | 332 | $row2 = $this->db->sql_fetchrow($result); |
@@ -348,23 +348,23 @@ discard block |
||
348 | 348 | { |
349 | 349 | // We really need to find a way of showing statistics... no progress here |
350 | 350 | $sql = 'SELECT COUNT(link_id) as num_links |
351 | - FROM ' . DIR_LINK_TABLE . ' |
|
352 | - WHERE link_cat = ' . (int) $this->cat_id . ' |
|
351 | + FROM ' . DIR_LINK_TABLE.' |
|
352 | + WHERE link_cat = ' . (int) $this->cat_id.' |
|
353 | 353 | AND link_active = 1 |
354 | - AND link_id BETWEEN ' . $start . ' AND ' . $end; |
|
354 | + AND link_id BETWEEN ' . $start.' AND '.$end; |
|
355 | 355 | $result = $this->db->sql_query($sql); |
356 | 356 | $links_done = $this->request->variable('links_done', 0) + (int) $this->db->sql_fetchfield('num_links'); |
357 | 357 | $this->db->sql_freeresult($result); |
358 | 358 | |
359 | 359 | $start += $batch_size; |
360 | 360 | |
361 | - $url = $this->u_action . "&parent_id={$this->parent_id}&c=$this->cat_id&action=sync&start=$start&links_done=$links_done&total={$row['cat_links']}"; |
|
361 | + $url = $this->u_action."&parent_id={$this->parent_id}&c=$this->cat_id&action=sync&start=$start&links_done=$links_done&total={$row['cat_links']}"; |
|
362 | 362 | |
363 | 363 | meta_refresh(0, $url); |
364 | 364 | |
365 | 365 | $this->template->assign_vars(array( |
366 | - 'U_PROGRESS_BAR' => $this->u_action . "&action=progress_bar&start=$links_done&total={$row['cat_links']}", |
|
367 | - 'UA_PROGRESS_BAR' => addslashes($this->u_action . "&action=progress_bar&start=$links_done&total={$row['cat_links']}"), |
|
366 | + 'U_PROGRESS_BAR' => $this->u_action."&action=progress_bar&start=$links_done&total={$row['cat_links']}", |
|
367 | + 'UA_PROGRESS_BAR' => addslashes($this->u_action."&action=progress_bar&start=$links_done&total={$row['cat_links']}"), |
|
368 | 368 | 'S_CONTINUE_SYNC' => true, |
369 | 369 | 'L_PROGRESS_EXPLAIN' => $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', $links_done, $row['cat_links'])) |
370 | 370 | ); |
@@ -372,12 +372,12 @@ discard block |
||
372 | 372 | return; |
373 | 373 | } |
374 | 374 | |
375 | - $url = $this->u_action . "&parent_id={$this->parent_id}&c=$this->cat_id&action=sync_cat"; |
|
375 | + $url = $this->u_action."&parent_id={$this->parent_id}&c=$this->cat_id&action=sync_cat"; |
|
376 | 376 | meta_refresh(0, $url); |
377 | 377 | |
378 | 378 | $this->template->assign_vars(array( |
379 | - 'U_PROGRESS_BAR' => $this->u_action . '&action=progress_bar', |
|
380 | - 'UA_PROGRESS_BAR' => addslashes($this->u_action . '&action=progress_bar'), |
|
379 | + 'U_PROGRESS_BAR' => $this->u_action.'&action=progress_bar', |
|
380 | + 'UA_PROGRESS_BAR' => addslashes($this->u_action.'&action=progress_bar'), |
|
381 | 381 | 'S_CONTINUE_SYNC' => true, |
382 | 382 | 'L_PROGRESS_EXPLAIN' => $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', 0, $row['cat_links'])) |
383 | 383 | ); |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | public function action_sync_cat() |
394 | 394 | { |
395 | 395 | $sql = 'SELECT cat_name |
396 | - FROM ' . DIR_CAT_TABLE . ' |
|
396 | + FROM ' . DIR_CAT_TABLE.' |
|
397 | 397 | WHERE cat_id = ' . (int) $this->cat_id; |
398 | 398 | $result = $this->db->sql_query($sql); |
399 | 399 | $row = $this->db->sql_fetchrow($result); |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | |
402 | 402 | if (!$row) |
403 | 403 | { |
404 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
404 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
405 | 405 | } |
406 | 406 | |
407 | 407 | $this->_sync_dir_cat($this->cat_id); |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | } |
427 | 427 | else |
428 | 428 | { |
429 | - $navigation = '<a href="' . $this->u_action . '">' . $this->language->lang('DIR_INDEX') . '</a>'; |
|
429 | + $navigation = '<a href="'.$this->u_action.'">'.$this->language->lang('DIR_INDEX').'</a>'; |
|
430 | 430 | |
431 | 431 | $cats_nav = $this->nestedset_category->get_path_data($this->parent_id); |
432 | 432 | |
@@ -434,11 +434,11 @@ discard block |
||
434 | 434 | { |
435 | 435 | if ($row['cat_id'] == $this->parent_id) |
436 | 436 | { |
437 | - $navigation .= ' -> ' . $row['cat_name']; |
|
437 | + $navigation .= ' -> '.$row['cat_name']; |
|
438 | 438 | } |
439 | 439 | else |
440 | 440 | { |
441 | - $navigation .= ' -> <a href="' . $this->u_action . '&parent_id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a>'; |
|
441 | + $navigation .= ' -> <a href="'.$this->u_action.'&parent_id='.$row['cat_id'].'">'.$row['cat_name'].'</a>'; |
|
442 | 442 | } |
443 | 443 | } |
444 | 444 | } |
@@ -452,8 +452,8 @@ discard block |
||
452 | 452 | } |
453 | 453 | |
454 | 454 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_name, cat_icon, cat_desc_uid, cat_desc_bitfield, cat_desc, cat_desc_options, cat_links |
455 | - FROM ' . DIR_CAT_TABLE . ' |
|
456 | - WHERE parent_id = ' . (int) $this->parent_id . ' |
|
455 | + FROM ' . DIR_CAT_TABLE.' |
|
456 | + WHERE parent_id = ' . (int) $this->parent_id.' |
|
457 | 457 | ORDER BY left_id'; |
458 | 458 | $result = $this->db->sql_query($sql); |
459 | 459 | |
@@ -461,23 +461,23 @@ discard block |
||
461 | 461 | { |
462 | 462 | do |
463 | 463 | { |
464 | - $folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="' . $this->language->lang('DIR_SUBCAT') . '" />' : '<img src="images/icon_folder.gif" alt="' . $this->language->lang('FOLDER') . '" />'; |
|
464 | + $folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="'.$this->language->lang('DIR_SUBCAT').'" />' : '<img src="images/icon_folder.gif" alt="'.$this->language->lang('FOLDER').'" />'; |
|
465 | 465 | |
466 | - $url = $this->u_action . "&parent_id=$this->parent_id&c={$row['cat_id']}"; |
|
466 | + $url = $this->u_action."&parent_id=$this->parent_id&c={$row['cat_id']}"; |
|
467 | 467 | |
468 | 468 | $this->template->assign_block_vars('cats', array( |
469 | 469 | 'FOLDER_IMAGE' => $folder_image, |
470 | - 'CAT_IMAGE' => ($row['cat_icon']) ? '<img src="' . $this->dir_helper->get_img_path('icons', $row['cat_icon']) . '" alt="" />' : '', |
|
470 | + 'CAT_IMAGE' => ($row['cat_icon']) ? '<img src="'.$this->dir_helper->get_img_path('icons', $row['cat_icon']).'" alt="" />' : '', |
|
471 | 471 | 'CAT_NAME' => $row['cat_name'], |
472 | 472 | 'CAT_DESCRIPTION' => generate_text_for_display($row['cat_desc'], $row['cat_desc_uid'], $row['cat_desc_bitfield'], $row['cat_desc_options']), |
473 | 473 | 'CAT_LINKS' => $row['cat_links'], |
474 | 474 | |
475 | - 'U_CAT' => $this->u_action . '&parent_id=' . $row['cat_id'], |
|
476 | - 'U_MOVE_UP' => $url . '&action=move_up', |
|
477 | - 'U_MOVE_DOWN' => $url . '&action=move_down', |
|
478 | - 'U_EDIT' => $url . '&action=edit', |
|
479 | - 'U_DELETE' => $url . '&action=delete', |
|
480 | - 'U_SYNC' => $url . '&action=sync') |
|
475 | + 'U_CAT' => $this->u_action.'&parent_id='.$row['cat_id'], |
|
476 | + 'U_MOVE_UP' => $url.'&action=move_up', |
|
477 | + 'U_MOVE_DOWN' => $url.'&action=move_down', |
|
478 | + 'U_EDIT' => $url.'&action=edit', |
|
479 | + 'U_DELETE' => $url.'&action=delete', |
|
480 | + 'U_SYNC' => $url.'&action=sync') |
|
481 | 481 | ); |
482 | 482 | } |
483 | 483 | while ($row = $this->db->sql_fetchrow($result)); |
@@ -486,14 +486,14 @@ discard block |
||
486 | 486 | { |
487 | 487 | $row = $this->_get_cat_info($this->parent_id); |
488 | 488 | |
489 | - $url = $this->u_action . '&parent_id=' . $this->parent_id . '&c=' . $row['cat_id']; |
|
489 | + $url = $this->u_action.'&parent_id='.$this->parent_id.'&c='.$row['cat_id']; |
|
490 | 490 | |
491 | 491 | $this->template->assign_vars(array( |
492 | 492 | 'S_NO_CATS' => true, |
493 | 493 | |
494 | - 'U_EDIT' => $url . '&action=edit', |
|
495 | - 'U_DELETE' => $url . '&action=delete', |
|
496 | - 'U_SYNC' => $url . '&action=sync') |
|
494 | + 'U_EDIT' => $url.'&action=edit', |
|
495 | + 'U_DELETE' => $url.'&action=delete', |
|
496 | + 'U_SYNC' => $url.'&action=sync') |
|
497 | 497 | ); |
498 | 498 | } |
499 | 499 | $this->db->sql_freeresult($result); |
@@ -503,10 +503,10 @@ discard block |
||
503 | 503 | 'NAVIGATION' => $navigation, |
504 | 504 | 'CAT_BOX' => $cat_box, |
505 | 505 | 'U_SEL_ACTION' => $this->u_action, |
506 | - 'U_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
506 | + 'U_ACTION' => $this->u_action.'&parent_id='.$this->parent_id, |
|
507 | 507 | |
508 | - 'U_PROGRESS_BAR' => $this->u_action . '&action=progress_bar', |
|
509 | - 'UA_PROGRESS_BAR' => addslashes($this->u_action . '&action=progress_bar'), |
|
508 | + 'U_PROGRESS_BAR' => $this->u_action.'&action=progress_bar', |
|
509 | + 'UA_PROGRESS_BAR' => addslashes($this->u_action.'&action=progress_bar'), |
|
510 | 510 | )); |
511 | 511 | } |
512 | 512 | |
@@ -538,10 +538,10 @@ discard block |
||
538 | 538 | switch ($this->action) |
539 | 539 | { |
540 | 540 | case 'delete': |
541 | - $action_subcats = $this->request->variable('action_subcats', ''); |
|
542 | - $subcats_to_id = $this->request->variable('subcats_to_id', 0); |
|
543 | - $action_links = $this->request->variable('action_links', ''); |
|
544 | - $links_to_id = $this->request->variable('links_to_id', 0); |
|
541 | + $action_subcats = $this->request->variable('action_subcats', ''); |
|
542 | + $subcats_to_id = $this->request->variable('subcats_to_id', 0); |
|
543 | + $action_links = $this->request->variable('action_links', ''); |
|
544 | + $links_to_id = $this->request->variable('links_to_id', 0); |
|
545 | 545 | |
546 | 546 | try |
547 | 547 | { |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | |
560 | 560 | $this->cache->destroy('sql', DIR_CAT_TABLE); |
561 | 561 | |
562 | - trigger_error($this->language->lang('DIR_CAT_DELETED') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); |
|
562 | + trigger_error($this->language->lang('DIR_CAT_DELETED').adm_back_link($this->u_action.'&parent_id='.$this->parent_id)); |
|
563 | 563 | |
564 | 564 | break; |
565 | 565 | |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | |
613 | 613 | $message = ($this->action == 'add') ? $this->language->lang('DIR_CAT_CREATED') : $this->language->lang('DIR_CAT_UPDATED'); |
614 | 614 | |
615 | - trigger_error($message . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); |
|
615 | + trigger_error($message.adm_back_link($this->u_action.'&parent_id='.$this->parent_id)); |
|
616 | 616 | } |
617 | 617 | |
618 | 618 | break; |
@@ -657,10 +657,10 @@ discard block |
||
657 | 657 | 'S_CAT_PARENT_ID' => $this->cat_data['parent_id'], |
658 | 658 | 'S_ADD_ACTION' => ($this->action == 'add') ? true : false, |
659 | 659 | |
660 | - 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
661 | - 'U_EDIT_ACTION' => $this->u_action . "&parent_id={$this->parent_id}&action=$this->action&c=$this->cat_id", |
|
660 | + 'U_BACK' => $this->u_action.'&parent_id='.$this->parent_id, |
|
661 | + 'U_EDIT_ACTION' => $this->u_action."&parent_id={$this->parent_id}&action=$this->action&c=$this->cat_id", |
|
662 | 662 | |
663 | - 'L_TITLE' => $this->language->lang('DIR_' . strtoupper($this->action) . '_CAT'), |
|
663 | + 'L_TITLE' => $this->language->lang('DIR_'.strtoupper($this->action).'_CAT'), |
|
664 | 664 | 'ERROR_MSG' => (sizeof($this->errors)) ? implode('<br />', $this->errors) : '', |
665 | 665 | 'ICON_IMAGE' => ($this->cat_data['cat_icon']) ? $this->dir_helper->get_img_path('icons', $this->cat_data['cat_icon']) : 'images/spacer.gif', |
666 | 666 | |
@@ -702,7 +702,7 @@ discard block |
||
702 | 702 | private function _get_cat_info($cat_id) |
703 | 703 | { |
704 | 704 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next |
705 | - FROM ' . DIR_CAT_TABLE . ' |
|
705 | + FROM ' . DIR_CAT_TABLE.' |
|
706 | 706 | WHERE cat_id = ' . (int) $cat_id; |
707 | 707 | $result = $this->db->sql_query($sql); |
708 | 708 | $row = $this->db->sql_fetchrow($result); |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | { |
766 | 766 | if ($cat_data_sql['cat_cron_enable']) |
767 | 767 | { |
768 | - $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400; |
|
768 | + $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400; |
|
769 | 769 | } |
770 | 770 | |
771 | 771 | $this->cat_data = $this->nestedset_category->insert($cat_data_sql); |
@@ -788,13 +788,13 @@ discard block |
||
788 | 788 | |
789 | 789 | if ($cat_data_sql['cat_cron_enable'] && ($row['cat_cron_freq'] != $cat_data_sql['cat_cron_freq'] || !$row['cat_cron_enable'])) |
790 | 790 | { |
791 | - $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400; |
|
791 | + $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400; |
|
792 | 792 | } |
793 | 793 | |
794 | 794 | if ($row['cat_name'] != $cat_data_sql['cat_name']) |
795 | 795 | { |
796 | 796 | // the cat name has changed, clear the parents list of all categories (for safety) |
797 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . " |
|
797 | + $sql = 'UPDATE '.DIR_CAT_TABLE." |
|
798 | 798 | SET cat_parents = ''"; |
799 | 799 | $this->db->sql_query($sql); |
800 | 800 | } |
@@ -802,8 +802,8 @@ discard block |
||
802 | 802 | // Setting the cat id to the categorie id is not really received well by some dbs. ;) |
803 | 803 | unset($cat_data_sql['cat_id']); |
804 | 804 | |
805 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
806 | - SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql) . ' |
|
805 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
806 | + SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql).' |
|
807 | 807 | WHERE cat_id = ' . (int) $this->cat_id; |
808 | 808 | $this->db->sql_query($sql); |
809 | 809 | |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | $log_action_links = 'MOVE_LINKS'; |
845 | 845 | |
846 | 846 | $sql = 'SELECT cat_name |
847 | - FROM ' . DIR_CAT_TABLE . ' |
|
847 | + FROM ' . DIR_CAT_TABLE.' |
|
848 | 848 | WHERE cat_id = ' . (int) $links_to_id; |
849 | 849 | $result = $this->db->sql_query($sql); |
850 | 850 | $row = $this->db->sql_fetchrow($result); |
@@ -946,12 +946,12 @@ discard block |
||
946 | 946 | */ |
947 | 947 | private function _move_cat_content($from_id, $to_id) |
948 | 948 | { |
949 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
950 | - SET link_cat = ' . (int) $to_id . ' |
|
949 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
950 | + SET link_cat = ' . (int) $to_id.' |
|
951 | 951 | WHERE link_cat = ' . (int) $from_id; |
952 | 952 | $this->db->sql_query($sql); |
953 | 953 | |
954 | - $sql = 'DELETE FROM ' . DIR_WATCH_TABLE . ' |
|
954 | + $sql = 'DELETE FROM '.DIR_WATCH_TABLE.' |
|
955 | 955 | WHERE cat_id = ' . (int) $from_id; |
956 | 956 | $this->db->sql_query($sql); |
957 | 957 | |
@@ -969,7 +969,7 @@ discard block |
||
969 | 969 | |
970 | 970 | // Before we remove anything we make sure we are able to adjust the post counts later. ;) |
971 | 971 | $sql = 'SELECT link_id, link_banner |
972 | - FROM ' . DIR_LINK_TABLE . ' |
|
972 | + FROM ' . DIR_LINK_TABLE.' |
|
973 | 973 | WHERE link_cat = ' . (int) $this->cat_id; |
974 | 974 | $result = $this->db->sql_query($sql); |
975 | 975 | |
@@ -1000,7 +1000,7 @@ discard block |
||
1000 | 1000 | |
1001 | 1001 | foreach ($link_datas_ary as $table => $field) |
1002 | 1002 | { |
1003 | - $this->db->sql_query("DELETE FROM $table WHERE " . $this->db->sql_in_set($field, $link_ids)); |
|
1003 | + $this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $link_ids)); |
|
1004 | 1004 | } |
1005 | 1005 | } |
1006 | 1006 | |
@@ -1012,7 +1012,7 @@ discard block |
||
1012 | 1012 | |
1013 | 1013 | foreach ($cat_datas_ary as $table => $field) |
1014 | 1014 | { |
1015 | - $this->db->sql_query("DELETE FROM $table WHERE $field = " . (int) $this->cat_id); |
|
1015 | + $this->db->sql_query("DELETE FROM $table WHERE $field = ".(int) $this->cat_id); |
|
1016 | 1016 | } |
1017 | 1017 | |
1018 | 1018 | $this->db->sql_transaction('commit'); |
@@ -1029,15 +1029,15 @@ discard block |
||
1029 | 1029 | private function _sync_dir_cat($cat_id) |
1030 | 1030 | { |
1031 | 1031 | $sql = 'SELECT COUNT(link_id) AS num_links |
1032 | - FROM ' . DIR_LINK_TABLE . ' |
|
1033 | - WHERE link_cat = ' . (int) $cat_id . ' |
|
1032 | + FROM ' . DIR_LINK_TABLE.' |
|
1033 | + WHERE link_cat = ' . (int) $cat_id.' |
|
1034 | 1034 | AND link_active = 1'; |
1035 | 1035 | $result = $this->db->sql_query($sql); |
1036 | 1036 | $total_links = (int) $this->db->sql_fetchfield('num_links'); |
1037 | 1037 | $this->db->sql_freeresult($result); |
1038 | 1038 | |
1039 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
1040 | - SET cat_links = ' . $total_links . ' |
|
1039 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
1040 | + SET cat_links = ' . $total_links.' |
|
1041 | 1041 | WHERE cat_id = ' . (int) $cat_id; |
1042 | 1042 | $this->db->sql_query($sql); |
1043 | 1043 | } |
@@ -1057,33 +1057,33 @@ discard block |
||
1057 | 1057 | 'link_vote' => 0, |
1058 | 1058 | ); |
1059 | 1059 | |
1060 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
1061 | - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
1062 | - WHERE link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop; |
|
1060 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
1061 | + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' |
|
1062 | + WHERE link_id BETWEEN ' . (int) $start.' AND '.(int) $stop; |
|
1063 | 1063 | $this->db->sql_query($sql); |
1064 | 1064 | |
1065 | - $sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM ' . DIR_VOTE_TABLE . ' |
|
1066 | - WHERE vote_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . ' |
|
1065 | + $sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM '.DIR_VOTE_TABLE.' |
|
1066 | + WHERE vote_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.' |
|
1067 | 1067 | GROUP BY vote_link_id'; |
1068 | 1068 | $result = $this->db->sql_query($sql); |
1069 | 1069 | while ($tmp = $this->db->sql_fetchrow($result)) |
1070 | 1070 | { |
1071 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
1072 | - SET link_note = ' . (int) $tmp['total'] . ', link_vote = ' . (int) $tmp['nb_vote'] . ' |
|
1071 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
1072 | + SET link_note = ' . (int) $tmp['total'].', link_vote = '.(int) $tmp['nb_vote'].' |
|
1073 | 1073 | WHERE link_id = ' . (int) $tmp['vote_link_id']; |
1074 | 1074 | $this->db->sql_query($sql); |
1075 | 1075 | } |
1076 | 1076 | $this->db->sql_freeresult($result); |
1077 | 1077 | |
1078 | 1078 | $sql = 'SELECT comment_link_id, COUNT(comment_id) AS nb_comment |
1079 | - FROM ' . DIR_COMMENT_TABLE . ' |
|
1080 | - WHERE comment_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . ' |
|
1079 | + FROM ' . DIR_COMMENT_TABLE.' |
|
1080 | + WHERE comment_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.' |
|
1081 | 1081 | GROUP BY comment_link_id'; |
1082 | 1082 | $result = $this->db->sql_query($sql); |
1083 | 1083 | while ($tmp = $this->db->sql_fetchrow($result)) |
1084 | 1084 | { |
1085 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
1086 | - SET link_comment = ' . (int) $tmp['nb_comment'] . ' |
|
1085 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
1086 | + SET link_comment = ' . (int) $tmp['nb_comment'].' |
|
1087 | 1087 | WHERE link_id = ' . (int) $tmp['comment_link_id']; |
1088 | 1088 | $this->db->sql_query($sql); |
1089 | 1089 | } |
@@ -1108,7 +1108,7 @@ discard block |
||
1108 | 1108 | |
1109 | 1109 | foreach ($img_ary as $img) |
1110 | 1110 | { |
1111 | - $img = $path . $img; |
|
1111 | + $img = $path.$img; |
|
1112 | 1112 | $selected = ''; |
1113 | 1113 | |
1114 | 1114 | if (strlen($img) > 255) |
@@ -1121,7 +1121,7 @@ discard block |
||
1121 | 1121 | $selected = ' selected="selected"'; |
1122 | 1122 | } |
1123 | 1123 | |
1124 | - $filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>'; |
|
1124 | + $filename_list .= '<option value="'.htmlspecialchars($img).'"'.$selected.'>'.$img.'</option>'; |
|
1125 | 1125 | } |
1126 | 1126 | } |
1127 | 1127 |
@@ -31,14 +31,14 @@ discard block |
||
31 | 31 | protected $u_action; |
32 | 32 | |
33 | 33 | /** |
34 | - * Constructor |
|
35 | - * |
|
36 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
37 | - * @param \phpbb\language\language $language Language object |
|
38 | - * @param \phpbb\request\request $request Request object |
|
39 | - * @param \phpbb\template\template $template Template object |
|
40 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
41 | - */ |
|
34 | + * Constructor |
|
35 | + * |
|
36 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
37 | + * @param \phpbb\language\language $language Language object |
|
38 | + * @param \phpbb\request\request $request Request object |
|
39 | + * @param \phpbb\template\template $template Template object |
|
40 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
41 | + */ |
|
42 | 42 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, \phpbb\request\request $request, \phpbb\template\template $template, \ernadoo\phpbbdirectory\core\helper $dir_helper) |
43 | 43 | { |
44 | 44 | $this->db = $db; |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | - * Display confirm box |
|
53 | - * |
|
54 | - * @param string $action Requested action |
|
55 | - * @return null |
|
56 | - */ |
|
52 | + * Display confirm box |
|
53 | + * |
|
54 | + * @param string $action Requested action |
|
55 | + * @return null |
|
56 | + */ |
|
57 | 57 | public function display_confirm($action) |
58 | 58 | { |
59 | 59 | switch ($action) |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | - * Display phpBB Directory statistics |
|
95 | - * |
|
96 | - * @return null |
|
97 | - */ |
|
94 | + * Display phpBB Directory statistics |
|
95 | + * |
|
96 | + * @return null |
|
97 | + */ |
|
98 | 98 | public function display_stats() |
99 | 99 | { |
100 | 100 | // Count number of categories |
@@ -181,11 +181,11 @@ discard block |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
184 | - * Execute action requested |
|
185 | - * |
|
186 | - * @param string $action Requested action |
|
187 | - * @return null |
|
188 | - */ |
|
184 | + * Execute action requested |
|
185 | + * |
|
186 | + * @param string $action Requested action |
|
187 | + * @return null |
|
188 | + */ |
|
189 | 189 | public function exec_action($action) |
190 | 190 | { |
191 | 191 | switch ($action) |
@@ -260,23 +260,23 @@ discard block |
||
260 | 260 | } |
261 | 261 | |
262 | 262 | /** |
263 | - * Set page url |
|
264 | - * |
|
265 | - * @param string $u_action Custom form action |
|
266 | - * @return null |
|
267 | - * @access public |
|
268 | - */ |
|
263 | + * Set page url |
|
264 | + * |
|
265 | + * @param string $u_action Custom form action |
|
266 | + * @return null |
|
267 | + * @access public |
|
268 | + */ |
|
269 | 269 | public function set_page_url($u_action) |
270 | 270 | { |
271 | 271 | $this->u_action = $u_action; |
272 | 272 | } |
273 | 273 | |
274 | 274 | /** |
275 | - * Get orphan banners |
|
276 | - * |
|
277 | - * @param bool $delete True if we want to delete banners, else false |
|
278 | - * @return null|int Number of orphan files, else null |
|
279 | - */ |
|
275 | + * Get orphan banners |
|
276 | + * |
|
277 | + * @param bool $delete True if we want to delete banners, else false |
|
278 | + * @return null|int Number of orphan files, else null |
|
279 | + */ |
|
280 | 280 | private function _orphan_files($delete = false) |
281 | 281 | { |
282 | 282 | $banner_path = $this->dir_helper->get_banner_path(); |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, \phpbb\request\request $request, \phpbb\template\template $template, \ernadoo\phpbbdirectory\core\helper $dir_helper) |
43 | 43 | { |
44 | - $this->db = $db; |
|
44 | + $this->db = $db; |
|
45 | 45 | $this->language = $language; |
46 | 46 | $this->template = $template; |
47 | - $this->request = $request; |
|
48 | - $this->dir_helper = $dir_helper; |
|
47 | + $this->request = $request; |
|
48 | + $this->dir_helper = $dir_helper; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | { |
152 | 152 | if ($file[0] != '.' && $file[0] != '..' && strpos($file, 'index.') === false && strpos($file, '.db') === false) |
153 | 153 | { |
154 | - $banners_dir_size += filesize($banners_path . $file); |
|
154 | + $banners_dir_size += filesize($banners_path.$file); |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | closedir($banners_dir); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | 'U_ACTION' => $this->u_action, |
171 | 171 | |
172 | 172 | 'TOTAL_CATS' => $total_cats, |
173 | - 'TOTAL_LINKS' => $total_links-$waiting_links, |
|
173 | + 'TOTAL_LINKS' => $total_links - $waiting_links, |
|
174 | 174 | 'WAITING_LINKS' => $waiting_links, |
175 | 175 | 'TOTAL_COMMENTS' => $total_comments, |
176 | 176 | 'TOTAL_VOTES' => $total_votes, |
@@ -195,15 +195,15 @@ discard block |
||
195 | 195 | { |
196 | 196 | case 'sqlite': |
197 | 197 | case 'firebird': |
198 | - $this->db->sql_query('DELETE FROM ' . DIR_VOTE_TABLE); |
|
198 | + $this->db->sql_query('DELETE FROM '.DIR_VOTE_TABLE); |
|
199 | 199 | break; |
200 | 200 | |
201 | 201 | default: |
202 | - $this->db->sql_query('TRUNCATE TABLE ' . DIR_VOTE_TABLE); |
|
202 | + $this->db->sql_query('TRUNCATE TABLE '.DIR_VOTE_TABLE); |
|
203 | 203 | break; |
204 | 204 | } |
205 | 205 | |
206 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
206 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
207 | 207 | SET link_vote = 0, link_note = 0'; |
208 | 208 | $this->db->sql_query($sql); |
209 | 209 | |
@@ -218,15 +218,15 @@ discard block |
||
218 | 218 | { |
219 | 219 | case 'sqlite': |
220 | 220 | case 'firebird': |
221 | - $this->db->sql_query('DELETE FROM ' . DIR_COMMENT_TABLE); |
|
221 | + $this->db->sql_query('DELETE FROM '.DIR_COMMENT_TABLE); |
|
222 | 222 | break; |
223 | 223 | |
224 | 224 | default: |
225 | - $this->db->sql_query('TRUNCATE TABLE ' . DIR_COMMENT_TABLE); |
|
225 | + $this->db->sql_query('TRUNCATE TABLE '.DIR_COMMENT_TABLE); |
|
226 | 226 | break; |
227 | 227 | } |
228 | 228 | |
229 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
229 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
230 | 230 | SET link_comment = 0'; |
231 | 231 | $this->db->sql_query($sql); |
232 | 232 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | break; |
239 | 239 | |
240 | 240 | case 'clicks': |
241 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
241 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
242 | 242 | SET link_view = 0'; |
243 | 243 | $this->db->sql_query($sql); |
244 | 244 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | { |
293 | 293 | $physical_files[] = $img; |
294 | 294 | } |
295 | - $sql = 'SELECT link_banner FROM ' . DIR_LINK_TABLE . ' |
|
295 | + $sql = 'SELECT link_banner FROM '.DIR_LINK_TABLE.' |
|
296 | 296 | WHERE link_banner <> \'\''; |
297 | 297 | $result = $this->db->sql_query($sql); |
298 | 298 |
@@ -40,15 +40,15 @@ discard block |
||
40 | 40 | private $display_vars; |
41 | 41 | |
42 | 42 | /** |
43 | - * Constructor |
|
44 | - * |
|
45 | - * @param \phpbb\config\config $config Config object |
|
46 | - * @param \phpbb\language\language $language Language object |
|
47 | - * @param \phpbb\log\log $log Log object |
|
48 | - * @param \phpbb\request\request $request Request object |
|
49 | - * @param \phpbb\template\template $template Template object |
|
50 | - * @param \phpbb\user $user User object |
|
51 | - */ |
|
43 | + * Constructor |
|
44 | + * |
|
45 | + * @param \phpbb\config\config $config Config object |
|
46 | + * @param \phpbb\language\language $language Language object |
|
47 | + * @param \phpbb\log\log $log Log object |
|
48 | + * @param \phpbb\request\request $request Request object |
|
49 | + * @param \phpbb\template\template $template Template object |
|
50 | + * @param \phpbb\user $user User object |
|
51 | + */ |
|
52 | 52 | public function __construct(\phpbb\config\config $config, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) |
53 | 53 | { |
54 | 54 | $this->config = $config; |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
65 | - * Display config page |
|
66 | - * |
|
67 | - * @return null |
|
68 | - */ |
|
65 | + * Display config page |
|
66 | + * |
|
67 | + * @return null |
|
68 | + */ |
|
69 | 69 | public function display_config() |
70 | 70 | { |
71 | 71 | // Output relevant page |
@@ -111,10 +111,10 @@ discard block |
||
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
114 | - * Validate config vars and update config table if needed |
|
115 | - * |
|
116 | - * @return null |
|
117 | - */ |
|
114 | + * Validate config vars and update config table if needed |
|
115 | + * |
|
116 | + * @return null |
|
117 | + */ |
|
118 | 118 | public function process() |
119 | 119 | { |
120 | 120 | $submit = ($this->request->is_set_post('submit')) ? true : false; |
@@ -167,22 +167,22 @@ discard block |
||
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
170 | - * Set page url |
|
171 | - * |
|
172 | - * @param string $u_action Custom form action |
|
173 | - * @return null |
|
174 | - * @access public |
|
175 | - */ |
|
170 | + * Set page url |
|
171 | + * |
|
172 | + * @param string $u_action Custom form action |
|
173 | + * @return null |
|
174 | + * @access public |
|
175 | + */ |
|
176 | 176 | public function set_page_url($u_action) |
177 | 177 | { |
178 | 178 | $this->u_action = $u_action; |
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
182 | - * Build config matrice |
|
183 | - * |
|
184 | - * @return null |
|
185 | - */ |
|
182 | + * Build config matrice |
|
183 | + * |
|
184 | + * @return null |
|
185 | + */ |
|
186 | 186 | private function _generate_config() |
187 | 187 | { |
188 | 188 | $this->display_vars = array( |
@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function __construct(\phpbb\config\config $config, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) |
53 | 53 | { |
54 | - $this->config = $config; |
|
54 | + $this->config = $config; |
|
55 | 55 | $this->language = $language; |
56 | - $this->log = $log; |
|
56 | + $this->log = $log; |
|
57 | 57 | $this->template = $template; |
58 | - $this->user = $user; |
|
59 | - $this->request = $request; |
|
58 | + $this->user = $user; |
|
59 | + $this->request = $request; |
|
60 | 60 | |
61 | 61 | $this->_generate_config(); |
62 | 62 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | else if ($vars['explain']) |
97 | 97 | { |
98 | - $l_explain = $this->language->lang($vars['lang'] . '_EXPLAIN'); |
|
98 | + $l_explain = $this->language->lang($vars['lang'].'_EXPLAIN'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | $this->template->assign_block_vars('options', array( |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function process() |
119 | 119 | { |
120 | - $submit = ($this->request->is_set_post('submit')) ? true : false; |
|
120 | + $submit = ($this->request->is_set_post('submit')) ? true : false; |
|
121 | 121 | |
122 | 122 | $this->new_config = $this->config; |
123 | 123 | $cfg_array = ($this->request->is_set('config')) ? $this->request->variable('config', array('' => ''), true) : $this->new_config; |
@@ -158,12 +158,12 @@ discard block |
||
158 | 158 | { |
159 | 159 | $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'DIR_CONFIG_SETTINGS'); |
160 | 160 | |
161 | - trigger_error($this->language->lang('CONFIG_UPDATED') . adm_back_link($this->u_action)); |
|
161 | + trigger_error($this->language->lang('CONFIG_UPDATED').adm_back_link($this->u_action)); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | $this->template->assign_vars(array( |
165 | 165 | 'L_TITLE' => $this->language->lang($this->display_vars['title']), |
166 | - 'L_TITLE_EXPLAIN' => $this->language->lang($this->display_vars['title'] . '_EXPLAIN'), |
|
166 | + 'L_TITLE_EXPLAIN' => $this->language->lang($this->display_vars['title'].'_EXPLAIN'), |
|
167 | 167 | |
168 | 168 | 'S_ERROR' => (sizeof($error)) ? true : false, |
169 | 169 | 'ERROR_MSG' => implode('<br />', $error), |
@@ -199,45 +199,45 @@ discard block |
||
199 | 199 | 'dir_banner_width' => '', |
200 | 200 | 'dir_banner_height' => '', |
201 | 201 | |
202 | - 'dir_mail' => array('lang' => 'DIR_MAIL_VALIDATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
203 | - 'dir_activ_checkurl' => array('lang' => 'DIR_ACTIVE_CHECK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
204 | - 'dir_activ_flag' => array('lang' => 'DIR_ACTIV_FLAG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
205 | - 'dir_activ_rss' => array('lang' => 'DIR_ACTIV_RSS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
206 | - 'dir_activ_pagerank' => array('lang' => 'DIR_ACTIV_PAGERANK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
207 | - 'dir_show' => array('lang' => 'DIR_SHOW', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
208 | - 'dir_length_describe' => array('lang' => 'DIR_MAX_DESC', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
209 | - 'dir_new_time' => array('lang' => 'DIR_NEW_TIME', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
210 | - 'dir_default_order' => array('lang' => 'DIR_DEFAULT_ORDER', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_order_list', 'params' => array('{CONFIG_VALUE}')), |
|
202 | + 'dir_mail' => array('lang' => 'DIR_MAIL_VALIDATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
203 | + 'dir_activ_checkurl' => array('lang' => 'DIR_ACTIVE_CHECK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
204 | + 'dir_activ_flag' => array('lang' => 'DIR_ACTIV_FLAG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
205 | + 'dir_activ_rss' => array('lang' => 'DIR_ACTIV_RSS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
206 | + 'dir_activ_pagerank' => array('lang' => 'DIR_ACTIV_PAGERANK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
207 | + 'dir_show' => array('lang' => 'DIR_SHOW', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
208 | + 'dir_length_describe' => array('lang' => 'DIR_MAX_DESC', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
209 | + 'dir_new_time' => array('lang' => 'DIR_NEW_TIME', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
210 | + 'dir_default_order' => array('lang' => 'DIR_DEFAULT_ORDER', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_order_list', 'params' => array('{CONFIG_VALUE}')), |
|
211 | 211 | |
212 | 212 | 'legend2' => 'DIR_RECENT_GUEST', |
213 | - 'dir_recent_block' => array('lang' => 'DIR_RECENT_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
214 | - 'dir_recent_rows' => array('lang' => 'DIR_RECENT_ROWS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
215 | - 'dir_recent_columns' => array('lang' => 'DIR_RECENT_COLUMNS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
216 | - 'dir_recent_exclude' => array('lang' => 'DIR_RECENT_EXCLUDE', 'validate' => 'string', 'type' => 'text:6:99', 'explain' => true), |
|
213 | + 'dir_recent_block' => array('lang' => 'DIR_RECENT_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
214 | + 'dir_recent_rows' => array('lang' => 'DIR_RECENT_ROWS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
215 | + 'dir_recent_columns' => array('lang' => 'DIR_RECENT_COLUMNS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
216 | + 'dir_recent_exclude' => array('lang' => 'DIR_RECENT_EXCLUDE', 'validate' => 'string', 'type' => 'text:6:99', 'explain' => true), |
|
217 | 217 | |
218 | 218 | 'legend3' => 'DIR_ADD_GUEST', |
219 | - 'dir_visual_confirm' => array('lang' => 'DIR_VISUAL_CONFIRM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
220 | - 'dir_visual_confirm_max_attempts' => array('lang' => 'DIR_MAX_ADD_ATTEMPTS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), |
|
219 | + 'dir_visual_confirm' => array('lang' => 'DIR_VISUAL_CONFIRM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
220 | + 'dir_visual_confirm_max_attempts' => array('lang' => 'DIR_MAX_ADD_ATTEMPTS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), |
|
221 | 221 | |
222 | 222 | 'legend4' => 'DIR_THUMB_PARAM', |
223 | - 'dir_activ_thumb' => array('lang' => 'DIR_ACTIVE_THUMB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
224 | - 'dir_activ_thumb_remote' => array('lang' => 'DIR_ACTIVE_THUMB_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
225 | - 'dir_thumb_service' => array('lang' => 'DIR_THUMB_SERVICE', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_thumb_service_list', 'params' => array('{CONFIG_VALUE}')), |
|
226 | - 'dir_thumb_service_reverse' => array('lang' => 'DIR_THUMB_SERVICE_REVERSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
223 | + 'dir_activ_thumb' => array('lang' => 'DIR_ACTIVE_THUMB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
224 | + 'dir_activ_thumb_remote' => array('lang' => 'DIR_ACTIVE_THUMB_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
225 | + 'dir_thumb_service' => array('lang' => 'DIR_THUMB_SERVICE', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_thumb_service_list', 'params' => array('{CONFIG_VALUE}')), |
|
226 | + 'dir_thumb_service_reverse' => array('lang' => 'DIR_THUMB_SERVICE_REVERSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
227 | 227 | |
228 | 228 | 'legend5' => 'DIR_COMM_PARAM', |
229 | - 'dir_allow_bbcode' => array('lang' => 'DIR_ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
230 | - 'dir_allow_flash' => array('lang' => 'DIR_ALLOW_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
231 | - 'dir_allow_links' => array('lang' => 'DIR_ALLOW_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
232 | - 'dir_allow_smilies' => array('lang' => 'DIR_ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
233 | - 'dir_length_comments' => array('lang' => 'DIR_LENGTH_COMMENTS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
234 | - 'dir_comments_per_page' => array('lang' => 'DIR_COMM_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
229 | + 'dir_allow_bbcode' => array('lang' => 'DIR_ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
230 | + 'dir_allow_flash' => array('lang' => 'DIR_ALLOW_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
231 | + 'dir_allow_links' => array('lang' => 'DIR_ALLOW_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
232 | + 'dir_allow_smilies' => array('lang' => 'DIR_ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
233 | + 'dir_length_comments' => array('lang' => 'DIR_LENGTH_COMMENTS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
234 | + 'dir_comments_per_page' => array('lang' => 'DIR_COMM_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
235 | 235 | |
236 | 236 | 'legend6' => 'DIR_BANN_PARAM', |
237 | - 'dir_activ_banner' => array('lang' => 'DIR_ACTIV_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
238 | - 'dir_banner' => array('lang' => 'DIR_MAX_BANN', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' ' . $this->user->lang['PIXEL']), |
|
239 | - 'dir_banner_filesize' => array('lang' => 'DIR_MAX_SIZE', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), |
|
240 | - 'dir_storage_banner' => array('lang' => 'DIR_STORAGE_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
237 | + 'dir_activ_banner' => array('lang' => 'DIR_ACTIV_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
238 | + 'dir_banner' => array('lang' => 'DIR_MAX_BANN', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' '.$this->user->lang['PIXEL']), |
|
239 | + 'dir_banner_filesize' => array('lang' => 'DIR_MAX_SIZE', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), |
|
240 | + 'dir_storage_banner' => array('lang' => 'DIR_STORAGE_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
241 | 241 | ) |
242 | 242 | ); |
243 | 243 | } |
@@ -67,23 +67,23 @@ discard block |
||
67 | 67 | private $links_data; |
68 | 68 | |
69 | 69 | /** |
70 | - * Constructor |
|
71 | - * |
|
72 | - * @param \phpbb\config\config $config Config object |
|
73 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
74 | - * @param \phpbb\pagination $pagination Pagination object |
|
75 | - * @param \phpbb\language\language $language Language object |
|
76 | - * @param \phpbb\log\log $log Log object |
|
77 | - * @param \phpbb\notification\manager $notification Notification object |
|
78 | - * @param \phpbb\request\request $request Request object |
|
79 | - * @param \phpbb\template\template $template Template object |
|
80 | - * @param \phpbb\user $user User object |
|
81 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
82 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
83 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
84 | - * @param string $root_path phpBB root path |
|
85 | - * @param string $php_ext phpEx |
|
86 | - */ |
|
70 | + * Constructor |
|
71 | + * |
|
72 | + * @param \phpbb\config\config $config Config object |
|
73 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
74 | + * @param \phpbb\pagination $pagination Pagination object |
|
75 | + * @param \phpbb\language\language $language Language object |
|
76 | + * @param \phpbb\log\log $log Log object |
|
77 | + * @param \phpbb\notification\manager $notification Notification object |
|
78 | + * @param \phpbb\request\request $request Request object |
|
79 | + * @param \phpbb\template\template $template Template object |
|
80 | + * @param \phpbb\user $user User object |
|
81 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
82 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
83 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
84 | + * @param string $root_path phpBB root path |
|
85 | + * @param string $php_ext phpEx |
|
86 | + */ |
|
87 | 87 | public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\notification\manager $notification, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\helper $dir_helper, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext) |
88 | 88 | { |
89 | 89 | $this->config = $config; |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
108 | - * Display confirm box |
|
109 | - * |
|
110 | - * @param array $mark Website selected for (dis)approval |
|
111 | - * @return null |
|
112 | - */ |
|
108 | + * Display confirm box |
|
109 | + * |
|
110 | + * @param array $mark Website selected for (dis)approval |
|
111 | + * @return null |
|
112 | + */ |
|
113 | 113 | public function display_confirm($mark) |
114 | 114 | { |
115 | 115 | $s_hidden_fields = array( |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
124 | - * Display website list for (dis)approval |
|
125 | - * |
|
126 | - * @return null |
|
127 | - */ |
|
124 | + * Display website list for (dis)approval |
|
125 | + * |
|
126 | + * @return null |
|
127 | + */ |
|
128 | 128 | public function display_websites() |
129 | 129 | { |
130 | 130 | global $phpbb_admin_path; |
@@ -228,11 +228,11 @@ discard block |
||
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
231 | - * Get link's information and call appropriate action |
|
232 | - * |
|
233 | - * @param array $mark Website selected for (dis)approval |
|
234 | - * @return null |
|
235 | - */ |
|
231 | + * Get link's information and call appropriate action |
|
232 | + * |
|
233 | + * @param array $mark Website selected for (dis)approval |
|
234 | + * @return null |
|
235 | + */ |
|
236 | 236 | public function exec_action($mark) |
237 | 237 | { |
238 | 238 | $this->_get_infos_links($mark); |
@@ -255,10 +255,10 @@ discard block |
||
255 | 255 | } |
256 | 256 | |
257 | 257 | /** |
258 | - * Notify users which had submitted their websites |
|
259 | - * |
|
260 | - * @return null |
|
261 | - */ |
|
258 | + * Notify users which had submitted their websites |
|
259 | + * |
|
260 | + * @return null |
|
261 | + */ |
|
262 | 262 | public function notifiy_submiters() |
263 | 263 | { |
264 | 264 | if (!class_exists('messenger')) |
@@ -302,22 +302,22 @@ discard block |
||
302 | 302 | } |
303 | 303 | |
304 | 304 | /** |
305 | - * Set page url |
|
306 | - * |
|
307 | - * @param string $u_action Custom form action |
|
308 | - * @return null |
|
309 | - * @access public |
|
310 | - */ |
|
305 | + * Set page url |
|
306 | + * |
|
307 | + * @param string $u_action Custom form action |
|
308 | + * @return null |
|
309 | + * @access public |
|
310 | + */ |
|
311 | 311 | public function set_page_url($u_action) |
312 | 312 | { |
313 | 313 | $this->u_action = $u_action; |
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
317 | - * Approve action |
|
318 | - * |
|
319 | - * @return null |
|
320 | - */ |
|
317 | + * Approve action |
|
318 | + * |
|
319 | + * @return null |
|
320 | + */ |
|
321 | 321 | private function _action_approved() |
322 | 322 | { |
323 | 323 | foreach ($this->links_data as $row) |
@@ -346,10 +346,10 @@ discard block |
||
346 | 346 | } |
347 | 347 | |
348 | 348 | /** |
349 | - * Disapprove action |
|
350 | - * |
|
351 | - * @return null |
|
352 | - */ |
|
349 | + * Disapprove action |
|
350 | + * |
|
351 | + * @return null |
|
352 | + */ |
|
353 | 353 | private function _action_disapproved() |
354 | 354 | { |
355 | 355 | foreach ($this->links_data as $row) |
@@ -370,11 +370,11 @@ discard block |
||
370 | 370 | } |
371 | 371 | |
372 | 372 | /** |
373 | - * Get informations about links selected |
|
374 | - * |
|
375 | - * @param $mark Website selected for (dis)approval |
|
376 | - * @return null |
|
377 | - */ |
|
373 | + * Get informations about links selected |
|
374 | + * |
|
375 | + * @param $mark Website selected for (dis)approval |
|
376 | + * @return null |
|
377 | + */ |
|
378 | 378 | private function _get_infos_links($mark) |
379 | 379 | { |
380 | 380 | $sql_array = array( |
@@ -409,11 +409,11 @@ discard block |
||
409 | 409 | } |
410 | 410 | |
411 | 411 | /** |
412 | - * Notify users which watch categories |
|
413 | - * |
|
414 | - * @param $row Informations about website |
|
415 | - * @return null |
|
416 | - */ |
|
412 | + * Notify users which watch categories |
|
413 | + * |
|
414 | + * @param $row Informations about website |
|
415 | + * @return null |
|
416 | + */ |
|
417 | 417 | private function _notify_suscribers($row) |
418 | 418 | { |
419 | 419 | $notification_data = array( |
@@ -85,21 +85,21 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, \phpbb\log\log $log, \phpbb\notification\manager $notification, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\helper $dir_helper, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext) |
87 | 87 | { |
88 | - $this->config = $config; |
|
89 | - $this->db = $db; |
|
90 | - $this->pagination = $pagination; |
|
88 | + $this->config = $config; |
|
89 | + $this->db = $db; |
|
90 | + $this->pagination = $pagination; |
|
91 | 91 | $this->phpbb_log = $log; |
92 | - $this->notification = $notification; |
|
93 | - $this->request = $request; |
|
92 | + $this->notification = $notification; |
|
93 | + $this->request = $request; |
|
94 | 94 | $this->template = $template; |
95 | 95 | $this->user = $user; |
96 | 96 | $this->categorie = $categorie; |
97 | - $this->dir_helper = $dir_helper; |
|
97 | + $this->dir_helper = $dir_helper; |
|
98 | 98 | $this->link = $link; |
99 | 99 | $this->root_path = $root_path; |
100 | - $this->php_ext = $php_ext; |
|
100 | + $this->php_ext = $php_ext; |
|
101 | 101 | |
102 | - $this->action = $this->request->variable('action', ''); |
|
102 | + $this->action = $this->request->variable('action', ''); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -128,14 +128,14 @@ discard block |
||
128 | 128 | global $phpbb_admin_path; |
129 | 129 | |
130 | 130 | // Sort keys |
131 | - $sort_days = $this->request->variable('st', 0); |
|
131 | + $sort_days = $this->request->variable('st', 0); |
|
132 | 132 | $sort_key = $this->request->variable('sk', 't'); |
133 | 133 | $sort_dir = $this->request->variable('sd', 'd'); |
134 | 134 | |
135 | 135 | // Number of entries to display |
136 | 136 | $per_page = $this->request->variable('links_per_page', (int) $this->config['dir_show']); |
137 | 137 | |
138 | - $start = $this->request->variable('start', 0); |
|
138 | + $start = $this->request->variable('start', 0); |
|
139 | 139 | |
140 | 140 | // Categorie ordering options |
141 | 141 | $limit_days = array(0 => $this->user->lang['SEE_ALL'], 1 => $this->user->lang['1_DAY'], 7 => $this->user->lang['7_DAYS'], 14 => $this->user->lang['2_WEEKS'], 30 => $this->user->lang['1_MONTH'], 90 => $this->user->lang['3_MONTHS'], 180 => $this->user->lang['6_MONTHS'], 365 => $this->user->lang['1_YEAR']); |
@@ -151,15 +151,15 @@ discard block |
||
151 | 151 | |
152 | 152 | if (is_array($sort_by_sql[$sort_key])) |
153 | 153 | { |
154 | - $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; |
|
154 | + $sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction; |
|
155 | 155 | } |
156 | 156 | else |
157 | 157 | { |
158 | - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; |
|
158 | + $sql_sort_order = $sort_by_sql[$sort_key].' '.$direction; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | $sql = 'SELECT COUNT(1) AS total_links |
162 | - FROM ' . DIR_LINK_TABLE . ' |
|
162 | + FROM ' . DIR_LINK_TABLE.' |
|
163 | 163 | WHERE link_active = 0' . |
164 | 164 | (($sql_where) ? " AND link_time >= $sql_where" : ''); |
165 | 165 | $result = $this->db->sql_query($sql); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | 'ON' => 'u.user_id = l.link_user_id' |
184 | 184 | ) |
185 | 185 | ), |
186 | - 'WHERE' => 'l.link_active = 0' . (($sql_where) ? " AND l.link_time >= $sql_where" : ''), |
|
186 | + 'WHERE' => 'l.link_active = 0'.(($sql_where) ? " AND l.link_time >= $sql_where" : ''), |
|
187 | 187 | 'ORDER_BY' => $sql_sort_order); |
188 | 188 | |
189 | 189 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | $option_ary = array('approved' => 'DIR_LINK_ACTIVATE', 'disapproved' => 'DIR_LINK_DELETE'); |
212 | 212 | |
213 | - $base_url = $this->u_action . "&$u_sort_param&links_per_page=$per_page"; |
|
213 | + $base_url = $this->u_action."&$u_sort_param&links_per_page=$per_page"; |
|
214 | 214 | $this->pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_links, $per_page, $start); |
215 | 215 | |
216 | 216 | $this->template->assign_vars(array( |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | 'S_SORT_DIR' => $s_sort_dir, |
222 | 222 | 'LINKS_PER_PAGE' => $per_page, |
223 | 223 | |
224 | - 'U_ACTION' => $this->u_action . "&$u_sort_param&links_per_page=$per_page&start=$start", |
|
224 | + 'U_ACTION' => $this->u_action."&$u_sort_param&links_per_page=$per_page&start=$start", |
|
225 | 225 | )); |
226 | 226 | } |
227 | 227 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | return; |
250 | 250 | } |
251 | 251 | |
252 | - $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_LINK_' . strtoupper($this->action), time(), array(implode(', ', $this->affected_link_name))); |
|
252 | + $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_LINK_'.strtoupper($this->action), time(), array(implode(', ', $this->affected_link_name))); |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | /** |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | { |
262 | 262 | if (!class_exists('messenger')) |
263 | 263 | { |
264 | - include($this->root_path . 'includes/functions_messenger.' . $this->php_ext); |
|
264 | + include($this->root_path.'includes/functions_messenger.'.$this->php_ext); |
|
265 | 265 | } |
266 | 266 | $messenger = new \messenger(false); |
267 | 267 | |
@@ -328,15 +328,15 @@ discard block |
||
328 | 328 | 'link_cat' => (int) $row['link_cat'], |
329 | 329 | ); |
330 | 330 | |
331 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
332 | - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
331 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
332 | + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' |
|
333 | 333 | WHERE link_id = ' . (int) $row['link_id']; |
334 | 334 | $this->db->sql_query($sql); |
335 | 335 | } |
336 | 336 | |
337 | 337 | foreach ($this->cat_data as $cat_id => $count) |
338 | 338 | { |
339 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
339 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
340 | 340 | SET cat_links = cat_links + '.$count.' |
341 | 341 | WHERE cat_id = ' . (int) $cat_id; |
342 | 342 | $this->db->sql_query($sql); |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | } |
363 | 363 | } |
364 | 364 | |
365 | - $sql = 'DELETE FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int) $row['link_id']; |
|
365 | + $sql = 'DELETE FROM '.DIR_LINK_TABLE.' WHERE link_id = '.(int) $row['link_id']; |
|
366 | 366 | $this->db->sql_query($sql); |
367 | 367 | } |
368 | 368 | } |
@@ -46,20 +46,20 @@ discard block |
||
46 | 46 | protected $link; |
47 | 47 | |
48 | 48 | /** |
49 | - * Constructor |
|
50 | - * |
|
51 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
52 | - * @param \phpbb\config\config $config Config object |
|
53 | - * @param \phpbb\language\language $language Language object |
|
54 | - * @param \phpbb\template\template $template Template object |
|
55 | - * @param \phpbb\user $user User object |
|
56 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
57 | - * @param \phpbb\request\request $request Request object |
|
58 | - * @param \phpbb\auth\auth $auth Auth object |
|
59 | - * @param \phpbb\pagination $pagination Pagination object |
|
60 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
61 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
62 | - */ |
|
49 | + * Constructor |
|
50 | + * |
|
51 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
52 | + * @param \phpbb\config\config $config Config object |
|
53 | + * @param \phpbb\language\language $language Language object |
|
54 | + * @param \phpbb\template\template $template Template object |
|
55 | + * @param \phpbb\user $user User object |
|
56 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
57 | + * @param \phpbb\request\request $request Request object |
|
58 | + * @param \phpbb\auth\auth $auth Auth object |
|
59 | + * @param \phpbb\pagination $pagination Pagination object |
|
60 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
61 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
62 | + */ |
|
63 | 63 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
64 | 64 | { |
65 | 65 | $this->db = $db; |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
86 | - * Base controller to be accessed with the URL /directory |
|
87 | - * |
|
88 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
89 | - */ |
|
86 | + * Base controller to be accessed with the URL /directory |
|
87 | + * |
|
88 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
89 | + */ |
|
90 | 90 | public function base() |
91 | 91 | { |
92 | 92 | $this->categorie->display(); |
@@ -96,17 +96,17 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
99 | - * View controller for display a category |
|
100 | - * |
|
101 | - * @param int $cat_id The category ID |
|
102 | - * @param int $page Page number taken from the URL |
|
103 | - * @param int $sort_days Specifies the maximum amount of days a link may be old |
|
104 | - * @param string $sort_key is the key of $sort_by_sql for the selected sorting: a|t|r|s|v|p |
|
105 | - * @param string $sort_dir is either a or d representing ASC and DESC (ascending|descending) |
|
106 | - * @param string $mode watch|unwatch |
|
107 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
108 | - * @throws \phpbb\exception\http_exception |
|
109 | - */ |
|
99 | + * View controller for display a category |
|
100 | + * |
|
101 | + * @param int $cat_id The category ID |
|
102 | + * @param int $page Page number taken from the URL |
|
103 | + * @param int $sort_days Specifies the maximum amount of days a link may be old |
|
104 | + * @param string $sort_key is the key of $sort_by_sql for the selected sorting: a|t|r|s|v|p |
|
105 | + * @param string $sort_dir is either a or d representing ASC and DESC (ascending|descending) |
|
106 | + * @param string $mode watch|unwatch |
|
107 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
108 | + * @throws \phpbb\exception\http_exception |
|
109 | + */ |
|
110 | 110 | public function view($cat_id, $page, $sort_days, $sort_key, $sort_dir, $mode = '') |
111 | 111 | { |
112 | 112 | if (false === $this->categorie->get($cat_id)) |
@@ -366,11 +366,11 @@ discard block |
||
366 | 366 | } |
367 | 367 | |
368 | 368 | /** |
369 | - * date controller for return a date |
|
370 | - * |
|
371 | - * @return \phpbb\json_response A Json Response |
|
372 | - * @throws \phpbb\exception\http_exception |
|
373 | - */ |
|
369 | + * date controller for return a date |
|
370 | + * |
|
371 | + * @return \phpbb\json_response A Json Response |
|
372 | + * @throws \phpbb\exception\http_exception |
|
373 | + */ |
|
374 | 374 | public function return_date() |
375 | 375 | { |
376 | 376 | if (!$this->request->is_ajax()) |
@@ -62,16 +62,16 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
64 | 64 | { |
65 | - $this->db = $db; |
|
66 | - $this->config = $config; |
|
65 | + $this->db = $db; |
|
66 | + $this->config = $config; |
|
67 | 67 | $this->language = $language; |
68 | 68 | $this->template = $template; |
69 | 69 | $this->user = $user; |
70 | - $this->helper = $helper; |
|
71 | - $this->request = $request; |
|
70 | + $this->helper = $helper; |
|
71 | + $this->request = $request; |
|
72 | 72 | $this->auth = $auth; |
73 | - $this->pagination = $pagination; |
|
74 | - $this->categorie = $categorie; |
|
73 | + $this->pagination = $pagination; |
|
74 | + $this->categorie = $categorie; |
|
75 | 75 | $this->link = $link; |
76 | 76 | |
77 | 77 | $language->add_lang('directory', 'ernadoo/phpbbdirectory'); |
@@ -115,18 +115,18 @@ discard block |
||
115 | 115 | |
116 | 116 | $start = ($page - 1) * $this->config['dir_show']; |
117 | 117 | |
118 | - $default_sort_days = 0; |
|
118 | + $default_sort_days = 0; |
|
119 | 119 | $default_sort_key = (string) substr($this->config['dir_default_order'], 0, 1); |
120 | 120 | $default_sort_dir = (string) substr($this->config['dir_default_order'], 2); |
121 | 121 | |
122 | 122 | $sort_days = (!$sort_days) ? $this->request->variable('st', $default_sort_days) : $sort_days; |
123 | 123 | $sort_key = (!$sort_key) ? $this->request->variable('sk', $default_sort_key) : $sort_key; |
124 | - $sort_dir = (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir; |
|
124 | + $sort_dir = (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir; |
|
125 | 125 | $link_list = $rowset = array(); |
126 | 126 | |
127 | 127 | // Categorie ordering options |
128 | 128 | $limit_days = array(0 => $this->language->lang('SEE_ALL'), 1 => $this->language->lang('1_DAY'), 7 => $this->language->lang('7_DAYS'), 14 => $this->language->lang('2_WEEKS'), 30 => $this->language->lang('1_MONTH'), 90 => $this->language->lang('3_MONTHS'), 180 => $this->language->lang('6_MONTHS'), 365 => $this->language->lang('1_YEAR')); |
129 | - $sort_by_text = array('a' => $this->language->lang('AUTHOR'), 't' => $this->language->lang('POST_TIME'), 'r' => $this->language->lang('DIR_COMMENTS_ORDER'), 's' => $this->language->lang('DIR_NAME_ORDER'), 'v' => $this->language->lang('DIR_NB_CLICKS_ORDER')); |
|
129 | + $sort_by_text = array('a' => $this->language->lang('AUTHOR'), 't' => $this->language->lang('POST_TIME'), 'r' => $this->language->lang('DIR_COMMENTS_ORDER'), 's' => $this->language->lang('DIR_NAME_ORDER'), 'v' => $this->language->lang('DIR_NB_CLICKS_ORDER')); |
|
130 | 130 | $sort_by_sql = array('a' => 'u.username_clean', 't' => array('l.link_time', 'l.link_id'), 'r' => 'l.link_comment', 's' => 'LOWER(l.link_name)', 'v' => 'l.link_view'); |
131 | 131 | |
132 | 132 | if ($this->config['dir_activ_pagerank']) |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | $min_post_time = time() - ($sort_days * 86400); |
166 | 166 | |
167 | 167 | $sql = 'SELECT COUNT(link_id) AS nb_links |
168 | - FROM ' . DIR_LINK_TABLE . ' |
|
169 | - WHERE link_cat = ' . (int) $cat_id . ' |
|
168 | + FROM ' . DIR_LINK_TABLE.' |
|
169 | + WHERE link_cat = ' . (int) $cat_id.' |
|
170 | 170 | AND link_time >= ' . $min_post_time; |
171 | 171 | $result = $this->db->sql_query($sql); |
172 | 172 | $nb_links = (int) $this->db->sql_fetchfield('nb_links'); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | else |
182 | 182 | { |
183 | 183 | $sql_limit_time = ''; |
184 | - $nb_links = (int) $this->categorie->data['cat_links']; |
|
184 | + $nb_links = (int) $this->categorie->data['cat_links']; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | // Make sure $start is set to the last page if it exceeds the amount |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | |
242 | 242 | if (is_array($sort_by_sql[$sort_key])) |
243 | 243 | { |
244 | - $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; |
|
244 | + $sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction; |
|
245 | 245 | } |
246 | 246 | else |
247 | 247 | { |
248 | - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; |
|
248 | + $sql_sort_order = $sort_by_sql[$sort_key].' '.$direction; |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | // Grab just the sorted link ids |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | ), |
289 | 289 | array( |
290 | 290 | 'FROM' => array(DIR_VOTE_TABLE => 'v'), |
291 | - 'ON' => 'l.link_id = v.vote_link_id AND v.vote_user_id = ' . $this->user->data['user_id'] |
|
291 | + 'ON' => 'l.link_id = v.vote_link_id AND v.vote_user_id = '.$this->user->data['user_id'] |
|
292 | 292 | ) |
293 | 293 | ), |
294 | 294 | 'WHERE' => $this->db->sql_in_set('l.link_id', $link_list) |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | |
306 | 306 | $link_list = ($store_reverse) ? array_reverse($link_list) : $link_list; |
307 | 307 | |
308 | - $votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false; |
|
309 | - $comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false; |
|
308 | + $votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false; |
|
309 | + $comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false; |
|
310 | 310 | |
311 | 311 | foreach ($link_list as $link_id) |
312 | 312 | { |
@@ -316,11 +316,11 @@ discard block |
||
316 | 316 | $s_note = $this->link->display_note($site['link_note'], $site['link_vote'], $votes_status); |
317 | 317 | $s_thumb = $this->link->display_thumb($site); |
318 | 318 | $s_vote = $this->link->display_vote($site); |
319 | - $s_banner = $this->link->display_bann($site); |
|
320 | - $s_pr = $this->link->display_pagerank($site); |
|
321 | - $s_rss = $this->link->display_rss($site); |
|
319 | + $s_banner = $this->link->display_bann($site); |
|
320 | + $s_pr = $this->link->display_pagerank($site); |
|
321 | + $s_rss = $this->link->display_rss($site); |
|
322 | 322 | |
323 | - $edit_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_edit_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_edit_dir')))); |
|
323 | + $edit_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_edit_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_edit_dir')))); |
|
324 | 324 | $delete_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_delete_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_delete_dir')))); |
325 | 325 | |
326 | 326 | $this->template->assign_block_vars('site', array( |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | $this->template->assign_block_vars('no_draw_link', array()); |
358 | 358 | } |
359 | 359 | |
360 | - $page_title = $this->language->lang('DIRECTORY') . ' - ' . $this->categorie->data['cat_name']; |
|
360 | + $page_title = $this->language->lang('DIRECTORY').' - '.$this->categorie->data['cat_name']; |
|
361 | 361 | |
362 | 362 | $this->categorie->display(); |
363 | 363 |
@@ -59,23 +59,23 @@ discard block |
||
59 | 59 | protected $php_ext; |
60 | 60 | |
61 | 61 | /** |
62 | - * Constructor |
|
63 | - * |
|
64 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
65 | - * @param \phpbb\config\config $config Config object |
|
66 | - * @param \phpbb\language\language $language Language object |
|
67 | - * @param \phpbb\template\template $template Template object |
|
68 | - * @param \phpbb\user $user User object |
|
69 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
70 | - * @param \phpbb\request\request $request Request object |
|
71 | - * @param \phpbb\auth\auth $auth Auth object |
|
72 | - * @param \phpbb\pagination $pagination Pagination object |
|
73 | - * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
74 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
75 | - * @param \ernadoo\phpbbdirectory\core\comment $comment PhpBB Directory extension comment object |
|
76 | - * @param string $root_path phpBB root path |
|
77 | - * @param string $php_ext phpEx |
|
78 | - */ |
|
62 | + * Constructor |
|
63 | + * |
|
64 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
65 | + * @param \phpbb\config\config $config Config object |
|
66 | + * @param \phpbb\language\language $language Language object |
|
67 | + * @param \phpbb\template\template $template Template object |
|
68 | + * @param \phpbb\user $user User object |
|
69 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
70 | + * @param \phpbb\request\request $request Request object |
|
71 | + * @param \phpbb\auth\auth $auth Auth object |
|
72 | + * @param \phpbb\pagination $pagination Pagination object |
|
73 | + * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
74 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
75 | + * @param \ernadoo\phpbbdirectory\core\comment $comment PhpBB Directory extension comment object |
|
76 | + * @param string $root_path phpBB root path |
|
77 | + * @param string $php_ext phpEx |
|
78 | + */ |
|
79 | 79 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\comment $comment, $root_path, $php_ext) |
80 | 80 | { |
81 | 81 | $this->db = $db; |
@@ -111,13 +111,13 @@ discard block |
||
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
114 | - * Populate form when an error occurred |
|
115 | - * |
|
116 | - * @param int $link_id The link ID |
|
117 | - * @param int $comment_id The comment ID |
|
118 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
119 | - * @throws \phpbb\exception\http_exception |
|
120 | - */ |
|
114 | + * Populate form when an error occurred |
|
115 | + * |
|
116 | + * @param int $link_id The link ID |
|
117 | + * @param int $comment_id The comment ID |
|
118 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
119 | + * @throws \phpbb\exception\http_exception |
|
120 | + */ |
|
121 | 121 | public function delete_comment($link_id, $comment_id) |
122 | 122 | { |
123 | 123 | $this->_check_comments_enable($link_id); |
@@ -156,13 +156,13 @@ discard block |
||
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
159 | - * Edit a comment |
|
160 | - * |
|
161 | - * @param int $link_id The category ID |
|
162 | - * @param int $comment_id The comment ID |
|
163 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
164 | - * @throws \phpbb\exception\http_exception |
|
165 | - */ |
|
159 | + * Edit a comment |
|
160 | + * |
|
161 | + * @param int $link_id The category ID |
|
162 | + * @param int $comment_id The comment ID |
|
163 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
164 | + * @throws \phpbb\exception\http_exception |
|
165 | + */ |
|
166 | 166 | public function edit_comment($link_id, $comment_id) |
167 | 167 | { |
168 | 168 | $this->_check_comments_enable($link_id); |
@@ -193,12 +193,12 @@ discard block |
||
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
196 | - * Post a new comment |
|
197 | - * |
|
198 | - * @param int $link_id The category ID |
|
199 | - * @return null |
|
200 | - * @throws \phpbb\exception\http_exception |
|
201 | - */ |
|
196 | + * Post a new comment |
|
197 | + * |
|
198 | + * @param int $link_id The category ID |
|
199 | + * @return null |
|
200 | + * @throws \phpbb\exception\http_exception |
|
201 | + */ |
|
202 | 202 | public function new_comment($link_id) |
203 | 203 | { |
204 | 204 | $this->_check_comments_enable($link_id); |
@@ -224,14 +224,14 @@ discard block |
||
224 | 224 | } |
225 | 225 | |
226 | 226 | /** |
227 | - * Display popup comment |
|
228 | - * |
|
229 | - * @param int $link_id The category ID |
|
230 | - * @param int $page Page number taken from the URL |
|
231 | - * @param string $mode add|edit |
|
232 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
233 | - * @throws \phpbb\exception\http_exception |
|
234 | - */ |
|
227 | + * Display popup comment |
|
228 | + * |
|
229 | + * @param int $link_id The category ID |
|
230 | + * @param int $page Page number taken from the URL |
|
231 | + * @param string $mode add|edit |
|
232 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
233 | + * @throws \phpbb\exception\http_exception |
|
234 | + */ |
|
235 | 235 | public function view($link_id, $page, $mode = 'new') |
236 | 236 | { |
237 | 237 | $this->_check_comments_enable($link_id); |
@@ -324,13 +324,13 @@ discard block |
||
324 | 324 | } |
325 | 325 | |
326 | 326 | /** |
327 | - * Routine |
|
328 | - * |
|
329 | - * @param int $link_id The link ID |
|
330 | - * @param int $comment_id The comment ID |
|
331 | - * @param string $mode new|edit |
|
332 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
333 | - */ |
|
327 | + * Routine |
|
328 | + * |
|
329 | + * @param int $link_id The link ID |
|
330 | + * @param int $comment_id The comment ID |
|
331 | + * @param string $mode new|edit |
|
332 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
333 | + */ |
|
334 | 334 | private function _data_processing($link_id, $comment_id = 0, $mode = 'new') |
335 | 335 | { |
336 | 336 | if (!check_form_key('dir_form_comment')) |
@@ -418,12 +418,12 @@ discard block |
||
418 | 418 | } |
419 | 419 | |
420 | 420 | /** |
421 | - * Check if comments are enable in a category |
|
422 | - * |
|
423 | - * @param int $link_id The link ID |
|
424 | - * @return null Retun null if comments are allowed, http_exception if not |
|
425 | - * @throws \phpbb\exception\http_exception |
|
426 | - */ |
|
421 | + * Check if comments are enable in a category |
|
422 | + * |
|
423 | + * @param int $link_id The link ID |
|
424 | + * @return null Retun null if comments are allowed, http_exception if not |
|
425 | + * @throws \phpbb\exception\http_exception |
|
426 | + */ |
|
427 | 427 | private function _check_comments_enable($link_id) |
428 | 428 | { |
429 | 429 | $sql = 'SELECT link_cat |
@@ -449,12 +449,12 @@ discard block |
||
449 | 449 | } |
450 | 450 | |
451 | 451 | /** |
452 | - * Populate form when an error occurred |
|
453 | - * |
|
454 | - * @param int $link_id The link ID |
|
455 | - * @param string $mode add|edit |
|
456 | - * @return null |
|
457 | - */ |
|
452 | + * Populate form when an error occurred |
|
453 | + * |
|
454 | + * @param int $link_id The link ID |
|
455 | + * @param string $mode add|edit |
|
456 | + * @return null |
|
457 | + */ |
|
458 | 458 | private function _populate_form($link_id, $mode) |
459 | 459 | { |
460 | 460 | if (!$this->user->data['is_registered'] && $this->config['dir_visual_confirm'] && $mode != 'edit') |
@@ -191,7 +191,7 @@ |
||
191 | 191 | * Post a new comment |
192 | 192 | * |
193 | 193 | * @param int $link_id The category ID |
194 | - * @return null |
|
194 | + * @return \Symfony\Component\HttpFoundation\Response|null |
|
195 | 195 | * @throws \phpbb\exception\http_exception |
196 | 196 | */ |
197 | 197 | public function new_comment($link_id) |
@@ -78,16 +78,16 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\comment $comment, $root_path, $php_ext) |
80 | 80 | { |
81 | - $this->db = $db; |
|
82 | - $this->config = $config; |
|
81 | + $this->db = $db; |
|
82 | + $this->config = $config; |
|
83 | 83 | $this->language = $language; |
84 | 84 | $this->template = $template; |
85 | 85 | $this->user = $user; |
86 | - $this->helper = $helper; |
|
87 | - $this->request = $request; |
|
86 | + $this->helper = $helper; |
|
87 | + $this->request = $request; |
|
88 | 88 | $this->auth = $auth; |
89 | - $this->pagination = $pagination; |
|
90 | - $this->captcha_factory = $captcha_factory; |
|
89 | + $this->pagination = $pagination; |
|
90 | + $this->captcha_factory = $captcha_factory; |
|
91 | 91 | $this->categorie = $categorie; |
92 | 92 | $this->comment = $comment; |
93 | 93 | $this->root_path = $root_path; |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | $sql = 'SELECT * |
131 | - FROM ' . DIR_COMMENT_TABLE . ' |
|
131 | + FROM ' . DIR_COMMENT_TABLE.' |
|
132 | 132 | WHERE comment_id = ' . (int) $comment_id; |
133 | 133 | $result = $this->db->sql_query($sql); |
134 | 134 | $value = $this->db->sql_fetchrow($result); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id)); |
146 | 146 | meta_refresh(3, $meta_info); |
147 | 147 | $message = $this->language->lang('DIR_COMMENT_DELETE_OK'); |
148 | - $message = $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>'); |
|
148 | + $message = $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="'.$meta_info.'">', '</a>'); |
|
149 | 149 | return $this->helper->message($message); |
150 | 150 | } |
151 | 151 | else |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $this->_check_comments_enable($link_id); |
168 | 168 | |
169 | 169 | $sql = 'SELECT * |
170 | - FROM ' . DIR_COMMENT_TABLE . ' |
|
170 | + FROM ' . DIR_COMMENT_TABLE.' |
|
171 | 171 | WHERE comment_id = ' . (int) $comment_id; |
172 | 172 | $result = $this->db->sql_query($sql); |
173 | 173 | $value = $this->db->sql_fetchrow($result); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $comment_text = generate_text_for_edit($value['comment_text'], $value['comment_uid'], $value['comment_flags']); |
181 | 181 | $this->s_comment = $comment_text['text']; |
182 | 182 | |
183 | - $submit = $this->request->is_set_post('update_comment') ? true : false; |
|
183 | + $submit = $this->request->is_set_post('update_comment') ? true : false; |
|
184 | 184 | |
185 | 185 | // If form is done |
186 | 186 | if ($submit) |
@@ -236,15 +236,15 @@ discard block |
||
236 | 236 | $this->_check_comments_enable($link_id); |
237 | 237 | |
238 | 238 | $comment_id = $this->request->variable('c', 0); |
239 | - $view = $this->request->variable('view', ''); |
|
240 | - $start = ($page - 1) * $this->config['dir_comments_per_page']; |
|
239 | + $view = $this->request->variable('view', ''); |
|
240 | + $start = ($page - 1) * $this->config['dir_comments_per_page']; |
|
241 | 241 | |
242 | 242 | $this->s_hidden_fields = array_merge($this->s_hidden_fields, array('page' => $page)); |
243 | 243 | |
244 | 244 | $this->_populate_form($link_id, $mode); |
245 | 245 | |
246 | 246 | $sql = 'SELECT COUNT(comment_id) AS nb_comments |
247 | - FROM ' . DIR_COMMENT_TABLE . ' |
|
247 | + FROM ' . DIR_COMMENT_TABLE.' |
|
248 | 248 | WHERE comment_link_id = ' . (int) $link_id; |
249 | 249 | $result = $this->db->sql_query($sql); |
250 | 250 | $nb_comments = (int) $this->db->sql_fetchfield('nb_comments'); |
@@ -264,10 +264,10 @@ discard block |
||
264 | 264 | ), |
265 | 265 | array( |
266 | 266 | 'FROM' => array(ZEBRA_TABLE => 'z'), |
267 | - 'ON' => 'z.user_id = ' . $this->user->data['user_id'] . ' AND z.zebra_id = a.comment_user_id' |
|
267 | + 'ON' => 'z.user_id = '.$this->user->data['user_id'].' AND z.zebra_id = a.comment_user_id' |
|
268 | 268 | ) |
269 | 269 | ), |
270 | - 'WHERE' => 'a.comment_link_id = ' . (int) $link_id, |
|
270 | + 'WHERE' => 'a.comment_link_id = '.(int) $link_id, |
|
271 | 271 | 'ORDER_BY' => 'a.comment_date DESC'); |
272 | 272 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
273 | 273 | $result = $this->db->sql_query_limit($sql, $this->config['dir_comments_per_page'], $start); |
@@ -296,12 +296,12 @@ discard block |
||
296 | 296 | 'S_COMMENT' => generate_text_for_display($comments['comment_text'], $comments['comment_uid'], $comments['comment_bitfield'], $comments['comment_flags']), |
297 | 297 | 'S_ID' => $comments['comment_id'], |
298 | 298 | |
299 | - 'U_EDIT' => ($edit_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '', |
|
300 | - 'U_DELETE' => ($delete_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_delete_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'], '_referer' => $this->helper->get_current_url())) : '', |
|
299 | + 'U_EDIT' => ($edit_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '', |
|
300 | + 'U_DELETE' => ($delete_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_delete_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'], '_referer' => $this->helper->get_current_url())) : '', |
|
301 | 301 | |
302 | 302 | 'S_IGNORE_POST' => ($comments['foe'] && ($view != 'show' || $comment_id != $comments['comment_id'])) ? true : false, |
303 | 303 | 'L_IGNORE_POST' => ($comments['foe']) ? $this->language->lang('POST_BY_FOE', get_username_string('full', $comments['comment_user_id'], $comments['username'], $comments['user_colour']), '<a href="'.$this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '', |
304 | - 'L_POST_DISPLAY' => ($comments['foe']) ? $this->language->lang('POST_DISPLAY', '<a class="display_post" data-post-id="' . $comments['comment_id'] . '" href="' . $this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?c='.(int) $comments['comment_id'] . '&view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '', |
|
304 | + 'L_POST_DISPLAY' => ($comments['foe']) ? $this->language->lang('POST_DISPLAY', '<a class="display_post" data-post-id="'.$comments['comment_id'].'" href="'.$this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?c='.(int) $comments['comment_id'].'&view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '', |
|
305 | 305 | |
306 | 306 | 'S_INFO' => $this->auth->acl_get('m_info'), |
307 | 307 | )); |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | |
342 | 342 | if (!function_exists('validate_data')) |
343 | 343 | { |
344 | - include($this->root_path . 'includes/functions_user.' . $this->php_ext); |
|
344 | + include($this->root_path.'includes/functions_user.'.$this->php_ext); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | $error = validate_data( |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id)); |
404 | 404 | meta_refresh(3, $meta_info); |
405 | 405 | $message = $this->language->lang('DIR_'.strtoupper($mode).'_COMMENT_OK'); |
406 | - $message = $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>'); |
|
406 | + $message = $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="'.$meta_info.'">', '</a>'); |
|
407 | 407 | return $this->helper->message($message); |
408 | 408 | } |
409 | 409 | else |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | private function _check_comments_enable($link_id) |
427 | 427 | { |
428 | 428 | $sql = 'SELECT link_cat |
429 | - FROM ' . DIR_LINK_TABLE . ' |
|
429 | + FROM ' . DIR_LINK_TABLE.' |
|
430 | 430 | WHERE link_id = ' . (int) $link_id; |
431 | 431 | $result = $this->db->sql_query($sql); |
432 | 432 | $cat_id = (int) $this->db->sql_fetchfield('link_cat'); |
@@ -468,11 +468,11 @@ discard block |
||
468 | 468 | |
469 | 469 | if (!function_exists('generate_smilies')) |
470 | 470 | { |
471 | - include($this->root_path . 'includes/functions_posting.' . $this->php_ext); |
|
471 | + include($this->root_path.'includes/functions_posting.'.$this->php_ext); |
|
472 | 472 | } |
473 | 473 | if (!function_exists('display_custom_bbcodes')) |
474 | 474 | { |
475 | - include($this->root_path . 'includes/functions_display.' . $this->php_ext); |
|
475 | + include($this->root_path.'includes/functions_display.'.$this->php_ext); |
|
476 | 476 | } |
477 | 477 | |
478 | 478 | generate_smilies('inline', 0); |
@@ -482,11 +482,11 @@ discard block |
||
482 | 482 | $this->template->assign_vars(array( |
483 | 483 | 'S_AUTH_COMM' => $this->auth->acl_get('u_comment_dir'), |
484 | 484 | |
485 | - 'BBCODE_STATUS' => ($this->config['dir_allow_bbcode']) ? $this->language->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'), |
|
486 | - 'IMG_STATUS' => ($this->config['dir_allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'), |
|
487 | - 'SMILIES_STATUS' => ($this->config['dir_allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'), |
|
488 | - 'URL_STATUS' => ($this->config['dir_allow_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'), |
|
489 | - 'FLASH_STATUS' => ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'), |
|
485 | + 'BBCODE_STATUS' => ($this->config['dir_allow_bbcode']) ? $this->language->lang('BBCODE_IS_ON', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>'), |
|
486 | + 'IMG_STATUS' => ($this->config['dir_allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'), |
|
487 | + 'SMILIES_STATUS' => ($this->config['dir_allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'), |
|
488 | + 'URL_STATUS' => ($this->config['dir_allow_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'), |
|
489 | + 'FLASH_STATUS' => ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'), |
|
490 | 490 | |
491 | 491 | 'L_DIR_REPLY_EXP' => $this->language->lang('DIR_REPLY_EXP', $this->config['dir_length_comments']), |
492 | 492 |
@@ -71,23 +71,23 @@ discard block |
||
71 | 71 | protected $php_ext; |
72 | 72 | |
73 | 73 | /** |
74 | - * Constructor |
|
75 | - * |
|
76 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
77 | - * @param \phpbb\config\config $config Config object |
|
78 | - * @param \phpbb\language\language $language Language object |
|
79 | - * @param \phpbb\template\template $template Template object |
|
80 | - * @param \phpbb\user $user User object |
|
81 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
82 | - * @param \phpbb\request\request $request Request object |
|
83 | - * @param \phpbb\auth\auth $auth Auth object |
|
84 | - * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
85 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
86 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
87 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
88 | - * @param string $root_path phpBB root path |
|
89 | - * @param string $php_ext phpEx |
|
90 | - */ |
|
74 | + * Constructor |
|
75 | + * |
|
76 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
77 | + * @param \phpbb\config\config $config Config object |
|
78 | + * @param \phpbb\language\language $language Language object |
|
79 | + * @param \phpbb\template\template $template Template object |
|
80 | + * @param \phpbb\user $user User object |
|
81 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
82 | + * @param \phpbb\request\request $request Request object |
|
83 | + * @param \phpbb\auth\auth $auth Auth object |
|
84 | + * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
85 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
86 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
87 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
88 | + * @param string $root_path phpBB root path |
|
89 | + * @param string $php_ext phpEx |
|
90 | + */ |
|
91 | 91 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext) |
92 | 92 | { |
93 | 93 | $this->db = $db; |
@@ -114,12 +114,12 @@ discard block |
||
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
117 | - * Delete a link |
|
118 | - * |
|
119 | - * @param int $cat_id The category ID |
|
120 | - * @param int $link_id The link ID |
|
121 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
122 | - */ |
|
117 | + * Delete a link |
|
118 | + * |
|
119 | + * @param int $cat_id The category ID |
|
120 | + * @param int $link_id The link ID |
|
121 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
122 | + */ |
|
123 | 123 | public function delete_link($cat_id, $link_id) |
124 | 124 | { |
125 | 125 | if ($this->request->is_set_post('cancel')) |
@@ -162,13 +162,13 @@ discard block |
||
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
165 | - * Edit a link |
|
166 | - * |
|
167 | - * @param int $cat_id The category ID |
|
168 | - * @param int $link_id The link ID |
|
169 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
170 | - * @throws \phpbb\exception\http_exception |
|
171 | - */ |
|
165 | + * Edit a link |
|
166 | + * |
|
167 | + * @param int $cat_id The category ID |
|
168 | + * @param int $link_id The link ID |
|
169 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
170 | + * @throws \phpbb\exception\http_exception |
|
171 | + */ |
|
172 | 172 | public function edit_link($cat_id, $link_id) |
173 | 173 | { |
174 | 174 | $sql = 'SELECT link_user_id |
@@ -243,12 +243,12 @@ discard block |
||
243 | 243 | } |
244 | 244 | |
245 | 245 | /** |
246 | - * Display add form |
|
247 | - * |
|
248 | - * @param int $cat_id The category ID |
|
249 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
250 | - * @throws \phpbb\exception\http_exception |
|
251 | - */ |
|
246 | + * Display add form |
|
247 | + * |
|
248 | + * @param int $cat_id The category ID |
|
249 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
250 | + * @throws \phpbb\exception\http_exception |
|
251 | + */ |
|
252 | 252 | public function new_link($cat_id) |
253 | 253 | { |
254 | 254 | if (!$this->auth->acl_get('u_submit_dir')) |
@@ -290,23 +290,23 @@ discard block |
||
290 | 290 | } |
291 | 291 | |
292 | 292 | /** |
293 | - * View link controller |
|
294 | - * |
|
295 | - * @param int $link_id The link ID |
|
296 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
297 | - */ |
|
293 | + * View link controller |
|
294 | + * |
|
295 | + * @param int $link_id The link ID |
|
296 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
297 | + */ |
|
298 | 298 | public function view_link($link_id) |
299 | 299 | { |
300 | 300 | return $this->link->view($link_id); |
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
304 | - * Vote for a link |
|
305 | - * |
|
306 | - * @param int $cat_id The category ID |
|
307 | - * @param int $link_id The link ID |
|
308 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
309 | - */ |
|
304 | + * Vote for a link |
|
305 | + * |
|
306 | + * @param int $cat_id The category ID |
|
307 | + * @param int $link_id The link ID |
|
308 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
309 | + */ |
|
310 | 310 | public function vote_link($cat_id, $link_id) |
311 | 311 | { |
312 | 312 | $this->categorie->get($cat_id); |
@@ -342,14 +342,14 @@ discard block |
||
342 | 342 | } |
343 | 343 | |
344 | 344 | /** |
345 | - * Routine |
|
346 | - * |
|
347 | - * @param int $cat_id The category ID |
|
348 | - * @param int $link_id The link ID |
|
349 | - * @param string $mode add|edit |
|
350 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
351 | - * @throws \phpbb\exception\http_exception |
|
352 | - */ |
|
345 | + * Routine |
|
346 | + * |
|
347 | + * @param int $cat_id The category ID |
|
348 | + * @param int $link_id The link ID |
|
349 | + * @param string $mode add|edit |
|
350 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
351 | + * @throws \phpbb\exception\http_exception |
|
352 | + */ |
|
353 | 353 | private function _data_processing($cat_id, $link_id = 0, $mode = 'new') |
354 | 354 | { |
355 | 355 | if (($mode == 'edit' && !$this->auth->acl_get('m_edit_dir') && !$this->auth->acl_get('u_edit_dir')) || ($mode == 'new' && !$this->auth->acl_get('u_submit_dir'))) |
@@ -439,8 +439,8 @@ discard block |
||
439 | 439 | if (!$error) |
440 | 440 | { |
441 | 441 | /** |
442 | - * No errrors, we execute heavy tasks wich need a valid url |
|
443 | - */ |
|
442 | + * No errrors, we execute heavy tasks wich need a valid url |
|
443 | + */ |
|
444 | 444 | |
445 | 445 | // Banner |
446 | 446 | $this->link->banner_process($this->banner, $error); |
@@ -523,11 +523,11 @@ discard block |
||
523 | 523 | } |
524 | 524 | |
525 | 525 | /** |
526 | - * Display a banner |
|
527 | - * |
|
528 | - * @param string $banner_img Path to banner file |
|
529 | - * @return Response object |
|
530 | - */ |
|
526 | + * Display a banner |
|
527 | + * |
|
528 | + * @param string $banner_img Path to banner file |
|
529 | + * @return Response object |
|
530 | + */ |
|
531 | 531 | public function return_banner($banner_img) |
532 | 532 | { |
533 | 533 | if (!function_exists('file_gc')) |
@@ -561,13 +561,13 @@ discard block |
||
561 | 561 | } |
562 | 562 | |
563 | 563 | /** |
564 | - * Populate form when an error occurred |
|
565 | - * |
|
566 | - * @param int $cat_id The category ID |
|
567 | - * @param string $mode add|edit |
|
568 | - * @param string $title Page title (depends of $mode) |
|
569 | - * @return null |
|
570 | - */ |
|
564 | + * Populate form when an error occurred |
|
565 | + * |
|
566 | + * @param int $cat_id The category ID |
|
567 | + * @param string $mode add|edit |
|
568 | + * @param string $title Page title (depends of $mode) |
|
569 | + * @return null |
|
570 | + */ |
|
571 | 571 | private function _populate_form($cat_id, $mode, $title) |
572 | 572 | { |
573 | 573 | global $phpbb_extension_manager; |
@@ -90,20 +90,20 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext) |
92 | 92 | { |
93 | - $this->db = $db; |
|
94 | - $this->config = $config; |
|
93 | + $this->db = $db; |
|
94 | + $this->config = $config; |
|
95 | 95 | $this->language = $language; |
96 | 96 | $this->template = $template; |
97 | 97 | $this->user = $user; |
98 | - $this->helper = $helper; |
|
99 | - $this->request = $request; |
|
98 | + $this->helper = $helper; |
|
99 | + $this->request = $request; |
|
100 | 100 | $this->auth = $auth; |
101 | - $this->captcha_factory = $captcha_factory; |
|
101 | + $this->captcha_factory = $captcha_factory; |
|
102 | 102 | $this->categorie = $categorie; |
103 | 103 | $this->link = $link; |
104 | - $this->dir_helper = $dir_helper; |
|
104 | + $this->dir_helper = $dir_helper; |
|
105 | 105 | $this->root_path = $root_path; |
106 | - $this->php_ext = $php_ext; |
|
106 | + $this->php_ext = $php_ext; |
|
107 | 107 | |
108 | 108 | $language->add_lang('directory', 'ernadoo/phpbbdirectory'); |
109 | 109 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | $sql = 'SELECT link_user_id |
131 | - FROM ' . DIR_LINK_TABLE . ' |
|
131 | + FROM ' . DIR_LINK_TABLE.' |
|
132 | 132 | WHERE link_id = ' . (int) $link_id; |
133 | 133 | $result = $this->db->sql_query($sql); |
134 | 134 | $link_data = $this->db->sql_fetchrow($result); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | $meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)); |
153 | 153 | meta_refresh(3, $meta_info); |
154 | - $message = $this->language->lang('DIR_DELETE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)) . '">', '</a>'); |
|
154 | + $message = $this->language->lang('DIR_DELETE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)).'">', '</a>'); |
|
155 | 155 | return $this->helper->message($message); |
156 | 156 | } |
157 | 157 | else |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | public function edit_link($cat_id, $link_id) |
172 | 172 | { |
173 | 173 | $sql = 'SELECT link_user_id |
174 | - FROM ' . DIR_LINK_TABLE . ' |
|
174 | + FROM ' . DIR_LINK_TABLE.' |
|
175 | 175 | WHERE link_id = ' . (int) $link_id; |
176 | 176 | $result = $this->db->sql_query($sql); |
177 | 177 | $link_data = $this->db->sql_fetchrow($result); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $cat_id = $this->request->variable('id', $cat_id); |
188 | 188 | $submit = $this->request->is_set_post('submit') ? true : false; |
189 | 189 | $refresh = $this->request->is_set_post('refresh_vc') ? true : false; |
190 | - $title = $this->language->lang('DIR_EDIT_SITE'); |
|
190 | + $title = $this->language->lang('DIR_EDIT_SITE'); |
|
191 | 191 | |
192 | 192 | $this->template->assign_block_vars('dir_navlinks', array( |
193 | 193 | 'FORUM_NAME' => $title, |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | else |
208 | 208 | { |
209 | 209 | $sql = 'SELECT link_id, link_uid, link_flags, link_bitfield, link_cat, link_url, link_description, link_guest_email, link_name, link_rss, link_back, link_banner, link_flag, link_cat, link_time |
210 | - FROM ' . DIR_LINK_TABLE . ' |
|
210 | + FROM ' . DIR_LINK_TABLE.' |
|
211 | 211 | WHERE link_id = ' . (int) $link_id; |
212 | 212 | $result = $this->db->sql_query($sql); |
213 | 213 | |
@@ -223,15 +223,15 @@ discard block |
||
223 | 223 | 'old_banner' => $site['link_banner'], |
224 | 224 | ); |
225 | 225 | |
226 | - $site_description = generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']); |
|
227 | - $site['link_banner'] = (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : ''; |
|
226 | + $site_description = generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']); |
|
227 | + $site['link_banner'] = (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : ''; |
|
228 | 228 | |
229 | - $this->url = $site['link_url']; |
|
230 | - $this->site_name = $site['link_name']; |
|
229 | + $this->url = $site['link_url']; |
|
230 | + $this->site_name = $site['link_name']; |
|
231 | 231 | $this->description = $site_description['text']; |
232 | 232 | $this->guest_email = $site['link_guest_email']; |
233 | - $this->rss = $site['link_rss']; |
|
234 | - $this->banner = $site['link_banner']; |
|
233 | + $this->rss = $site['link_rss']; |
|
234 | + $this->banner = $site['link_banner']; |
|
235 | 235 | $this->back = $site['link_back']; |
236 | 236 | $this->flag = $site['link_flag']; |
237 | 237 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | $cat_id = $this->request->variable('id', $cat_id); |
259 | 259 | $submit = $this->request->is_set_post('submit') ? true : false; |
260 | 260 | $refresh = $this->request->is_set_post('refresh_vc') ? true : false; |
261 | - $title = $this->language->lang('DIR_NEW_SITE'); |
|
261 | + $title = $this->language->lang('DIR_NEW_SITE'); |
|
262 | 262 | |
263 | 263 | $this->template->assign_block_vars('dir_navlinks', array( |
264 | 264 | 'FORUM_NAME' => $title, |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | |
323 | 323 | // We check if user had already vot for this website. |
324 | 324 | $sql = 'SELECT vote_link_id |
325 | - FROM ' . DIR_VOTE_TABLE . ' |
|
325 | + FROM ' . DIR_VOTE_TABLE.' |
|
326 | 326 | WHERE ' . $this->db->sql_build_array('SELECT', $data); |
327 | 327 | $result = $this->db->sql_query($sql); |
328 | 328 | $data = $this->db->sql_fetchrow($result); |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | |
337 | 337 | $meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)); |
338 | 338 | meta_refresh(3, $meta_info); |
339 | - $message = $this->language->lang('DIR_VOTE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $meta_info . '">', '</a>'); |
|
339 | + $message = $this->language->lang('DIR_VOTE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$meta_info.'">', '</a>'); |
|
340 | 340 | return $this->helper->message($message); |
341 | 341 | } |
342 | 342 | |
@@ -361,18 +361,18 @@ discard block |
||
361 | 361 | return $this->helper->message('FORM_INVALID'); |
362 | 362 | } |
363 | 363 | |
364 | - $this->url = $this->request->variable('url', ''); |
|
365 | - $this->site_name = $this->request->variable('site_name', '', true); |
|
364 | + $this->url = $this->request->variable('url', ''); |
|
365 | + $this->site_name = $this->request->variable('site_name', '', true); |
|
366 | 366 | $this->description = $this->request->variable('description', '', true); |
367 | 367 | $this->guest_email = $this->request->variable('guest_email', ''); |
368 | - $this->rss = $this->request->variable('rss', ''); |
|
369 | - $this->banner = $this->request->variable('banner', ''); |
|
368 | + $this->rss = $this->request->variable('rss', ''); |
|
369 | + $this->banner = $this->request->variable('banner', ''); |
|
370 | 370 | $this->back = $this->request->variable('back', ''); |
371 | 371 | $this->flag = $this->request->variable('flag', ''); |
372 | 372 | |
373 | 373 | if (!function_exists('validate_data')) |
374 | 374 | { |
375 | - include($this->root_path . 'includes/functions_user.' . $this->php_ext); |
|
375 | + include($this->root_path.'includes/functions_user.'.$this->php_ext); |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | // We define variables to check |
@@ -395,17 +395,17 @@ discard block |
||
395 | 395 | 'site_name' => array( |
396 | 396 | array('string', false, 1, 100)), |
397 | 397 | 'website' => array( |
398 | - array('string', false, 12, 255), |
|
399 | - array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), |
|
398 | + array('string', false, 12, 255), |
|
399 | + array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), |
|
400 | 400 | 'description' => array( |
401 | 401 | array('string', !$this->categorie->data['cat_must_describe'], 1, $this->config['dir_length_describe'])), |
402 | 402 | 'rss' => array( |
403 | 403 | array('string', true, 12, 255), |
404 | - array('match', empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), |
|
404 | + array('match', empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), |
|
405 | 405 | 'banner' => array( |
406 | 406 | array('string', true, 5, 255)), |
407 | 407 | 'back' => array( |
408 | - array('string', !$this->categorie->data['cat_link_back'], 12, 255), |
|
408 | + array('string', !$this->categorie->data['cat_link_back'], 12, 255), |
|
409 | 409 | array(array($this->link, 'link_back'), true)), |
410 | 410 | 'cat' => array( |
411 | 411 | array('num', '', 1)) |
@@ -454,8 +454,8 @@ discard block |
||
454 | 454 | // Still no errors?? So let's go! |
455 | 455 | if (!$error) |
456 | 456 | { |
457 | - $this->banner = (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner; |
|
458 | - $this->url = $this->link->clean_url($this->url); |
|
457 | + $this->banner = (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner; |
|
458 | + $this->url = $this->link->clean_url($this->url); |
|
459 | 459 | |
460 | 460 | $data_edit = array( |
461 | 461 | 'link_user_id' => $this->link_user_id, |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)); |
505 | 505 | meta_refresh(3, $meta_info); |
506 | 506 | $message = ($need_approval) ? $this->language->lang('DIR_'.strtoupper($mode).'_SITE_ACTIVE') : $this->language->lang('DIR_'.strtoupper($mode).'_SITE_OK'); |
507 | - $message = $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)) . '">', '</a>'); |
|
507 | + $message = $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)).'">', '</a>'); |
|
508 | 508 | return $this->helper->message($message); |
509 | 509 | } |
510 | 510 | else |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | { |
534 | 534 | if (!function_exists('file_gc')) |
535 | 535 | { |
536 | - include($this->root_path . 'includes/functions_download.' . $this->php_ext); |
|
536 | + include($this->root_path.'includes/functions_download.'.$this->php_ext); |
|
537 | 537 | } |
538 | 538 | |
539 | 539 | $file_path = $this->dir_helper->get_banner_path($banner_img); |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | |
589 | 589 | if (!function_exists('display_custom_bbcodes')) |
590 | 590 | { |
591 | - include($this->root_path . 'includes/functions_display.' . $this->php_ext); |
|
591 | + include($this->root_path.'includes/functions_display.'.$this->php_ext); |
|
592 | 592 | } |
593 | 593 | display_custom_bbcodes(); |
594 | 594 | add_form_key('dir_form'); |
@@ -597,17 +597,17 @@ discard block |
||
597 | 597 | $flag_path = $ext_path.'images/flags/'; |
598 | 598 | |
599 | 599 | $s_guest = (!$this->user->data['is_registered'] || !empty($this->guest_email)); |
600 | - $s_rss = $this->config['dir_activ_rss']; |
|
601 | - $s_banner = $this->config['dir_activ_banner']; |
|
600 | + $s_rss = $this->config['dir_activ_rss']; |
|
601 | + $s_banner = $this->config['dir_activ_banner']; |
|
602 | 602 | $s_back = $this->categorie->data['cat_link_back']; |
603 | 603 | $s_flag = $this->config['dir_activ_flag']; |
604 | 604 | |
605 | 605 | $this->template->assign_vars(array( |
606 | - 'BBCODE_STATUS' => ($this->config['allow_bbcode']) ? $this->language->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'), |
|
607 | - 'IMG_STATUS' => ($this->config['allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'), |
|
606 | + 'BBCODE_STATUS' => ($this->config['allow_bbcode']) ? $this->language->lang('BBCODE_IS_ON', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>'), |
|
607 | + 'IMG_STATUS' => ($this->config['allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'), |
|
608 | 608 | 'SMILIES_STATUS' => ($this->config['allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'), |
609 | 609 | 'URL_STATUS' => ($this->config['allow_post_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'), |
610 | - 'FLASH_STATUS' => ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'), |
|
610 | + 'FLASH_STATUS' => ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'), |
|
611 | 611 | |
612 | 612 | 'L_TITLE' => $title, |
613 | 613 | 'L_DIR_DESCRIPTION_EXP' => $this->language->lang('DIR_DESCRIPTION_EXP', $this->config['dir_length_describe']), |