@@ -56,22 +56,22 @@ discard block |
||
56 | 56 | protected $php_ext; |
57 | 57 | |
58 | 58 | /** |
59 | - * Constructor |
|
60 | - * |
|
61 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
62 | - * @param \phpbb\config\config $config Config object |
|
63 | - * @param \phpbb\template\template $template Template object |
|
64 | - * @param \phpbb\user $user User object |
|
65 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
66 | - * @param \phpbb\request\request $request Request object |
|
67 | - * @param \phpbb\auth\auth $auth Auth object |
|
68 | - * @param \phpbb\pagination $pagination Pagination object |
|
69 | - * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
70 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
71 | - * @param \ernadoo\phpbbdirectory\core\comment $comment PhpBB Directory extension comment object |
|
72 | - * @param string $root_path phpBB root path |
|
73 | - * @param string $php_ext phpEx |
|
74 | - */ |
|
59 | + * Constructor |
|
60 | + * |
|
61 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
62 | + * @param \phpbb\config\config $config Config object |
|
63 | + * @param \phpbb\template\template $template Template object |
|
64 | + * @param \phpbb\user $user User object |
|
65 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
66 | + * @param \phpbb\request\request $request Request object |
|
67 | + * @param \phpbb\auth\auth $auth Auth object |
|
68 | + * @param \phpbb\pagination $pagination Pagination object |
|
69 | + * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
70 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
71 | + * @param \ernadoo\phpbbdirectory\core\comment $comment PhpBB Directory extension comment object |
|
72 | + * @param string $root_path phpBB root path |
|
73 | + * @param string $php_ext phpEx |
|
74 | + */ |
|
75 | 75 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \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) |
76 | 76 | { |
77 | 77 | $this->db = $db; |
@@ -106,13 +106,13 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
109 | - * Populate form when an error occurred |
|
110 | - * |
|
111 | - * @param int $link_id The link ID |
|
112 | - * @param int $comment_id The comment ID |
|
113 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
114 | - * @throws \phpbb\exception\http_exception |
|
115 | - */ |
|
109 | + * Populate form when an error occurred |
|
110 | + * |
|
111 | + * @param int $link_id The link ID |
|
112 | + * @param int $comment_id The comment ID |
|
113 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
114 | + * @throws \phpbb\exception\http_exception |
|
115 | + */ |
|
116 | 116 | public function delete_comment($link_id, $comment_id) |
117 | 117 | { |
118 | 118 | $this->_check_comments_enable($link_id); |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
154 | - * Edit a comment |
|
155 | - * |
|
156 | - * @param int $link_id The category ID |
|
157 | - * @param int $comment_id The comment ID |
|
158 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
159 | - * @throws \phpbb\exception\http_exception |
|
160 | - */ |
|
154 | + * Edit a comment |
|
155 | + * |
|
156 | + * @param int $link_id The category ID |
|
157 | + * @param int $comment_id The comment ID |
|
158 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
159 | + * @throws \phpbb\exception\http_exception |
|
160 | + */ |
|
161 | 161 | public function edit_comment($link_id, $comment_id) |
162 | 162 | { |
163 | 163 | $this->_check_comments_enable($link_id); |
@@ -188,12 +188,12 @@ discard block |
||
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
191 | - * Post a new comment |
|
192 | - * |
|
193 | - * @param int $link_id The category ID |
|
194 | - * @return null |
|
195 | - * @throws \phpbb\exception\http_exception |
|
196 | - */ |
|
191 | + * Post a new comment |
|
192 | + * |
|
193 | + * @param int $link_id The category ID |
|
194 | + * @return null |
|
195 | + * @throws \phpbb\exception\http_exception |
|
196 | + */ |
|
197 | 197 | public function new_comment($link_id) |
198 | 198 | { |
199 | 199 | $this->_check_comments_enable($link_id); |
@@ -219,14 +219,14 @@ discard block |
||
219 | 219 | } |
220 | 220 | |
221 | 221 | /** |
222 | - * Display popup comment |
|
223 | - * |
|
224 | - * @param int $link_id The category ID |
|
225 | - * @param int $page Page number taken from the URL |
|
226 | - * @param string $mode add|edit |
|
227 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
228 | - * @throws \phpbb\exception\http_exception |
|
229 | - */ |
|
222 | + * Display popup comment |
|
223 | + * |
|
224 | + * @param int $link_id The category ID |
|
225 | + * @param int $page Page number taken from the URL |
|
226 | + * @param string $mode add|edit |
|
227 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
228 | + * @throws \phpbb\exception\http_exception |
|
229 | + */ |
|
230 | 230 | public function view($link_id, $page, $mode = 'new') |
231 | 231 | { |
232 | 232 | $this->_check_comments_enable($link_id); |
@@ -319,13 +319,13 @@ discard block |
||
319 | 319 | } |
320 | 320 | |
321 | 321 | /** |
322 | - * Routine |
|
323 | - * |
|
324 | - * @param int $link_id The link ID |
|
325 | - * @param int $comment_id The comment ID |
|
326 | - * @param string $mode new|edit |
|
327 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
328 | - */ |
|
322 | + * Routine |
|
323 | + * |
|
324 | + * @param int $link_id The link ID |
|
325 | + * @param int $comment_id The comment ID |
|
326 | + * @param string $mode new|edit |
|
327 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
328 | + */ |
|
329 | 329 | private function _data_processing($link_id, $comment_id = 0, $mode = 'new') |
330 | 330 | { |
331 | 331 | if (!check_form_key('dir_form_comment')) |
@@ -413,12 +413,12 @@ discard block |
||
413 | 413 | } |
414 | 414 | |
415 | 415 | /** |
416 | - * Check if comments are enable in a category |
|
417 | - * |
|
418 | - * @param int $link_id The link ID |
|
419 | - * @return null Retun null if comments are allowed, http_exception if not |
|
420 | - * @throws \phpbb\exception\http_exception |
|
421 | - */ |
|
416 | + * Check if comments are enable in a category |
|
417 | + * |
|
418 | + * @param int $link_id The link ID |
|
419 | + * @return null Retun null if comments are allowed, http_exception if not |
|
420 | + * @throws \phpbb\exception\http_exception |
|
421 | + */ |
|
422 | 422 | private function _check_comments_enable($link_id) |
423 | 423 | { |
424 | 424 | $sql = 'SELECT link_cat |
@@ -444,12 +444,12 @@ discard block |
||
444 | 444 | } |
445 | 445 | |
446 | 446 | /** |
447 | - * Populate form when an error occurred |
|
448 | - * |
|
449 | - * @param int $link_id The link ID |
|
450 | - * @param string $mode add|edit |
|
451 | - * @return null |
|
452 | - */ |
|
447 | + * Populate form when an error occurred |
|
448 | + * |
|
449 | + * @param int $link_id The link ID |
|
450 | + * @param string $mode add|edit |
|
451 | + * @return null |
|
452 | + */ |
|
453 | 453 | private function _populate_form($link_id, $mode) |
454 | 454 | { |
455 | 455 | if (!$this->user->data['is_registered'] && $this->config['dir_visual_confirm'] && $mode != 'edit') |
@@ -74,15 +74,15 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \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) |
76 | 76 | { |
77 | - $this->db = $db; |
|
77 | + $this->db = $db; |
|
78 | 78 | $this->config = $config; |
79 | - $this->template = $template; |
|
79 | + $this->template = $template; |
|
80 | 80 | $this->user = $user; |
81 | 81 | $this->helper = $helper; |
82 | - $this->request = $request; |
|
82 | + $this->request = $request; |
|
83 | 83 | $this->auth = $auth; |
84 | - $this->pagination = $pagination; |
|
85 | - $this->captcha_factory = $captcha_factory; |
|
84 | + $this->pagination = $pagination; |
|
85 | + $this->captcha_factory = $captcha_factory; |
|
86 | 86 | $this->categorie = $categorie; |
87 | 87 | $this->comment = $comment; |
88 | 88 | $this->root_path = $root_path; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $comment_text = generate_text_for_edit($value['comment_text'], $value['comment_uid'], $value['comment_flags']); |
177 | 177 | $this->s_comment = $comment_text['text']; |
178 | 178 | |
179 | - $submit = $this->request->is_set_post('update_comment') ? true : false; |
|
179 | + $submit = $this->request->is_set_post('update_comment') ? true : false; |
|
180 | 180 | |
181 | 181 | // If form is done |
182 | 182 | if ($submit) |
@@ -232,8 +232,8 @@ discard block |
||
232 | 232 | $this->_check_comments_enable($link_id); |
233 | 233 | |
234 | 234 | $comment_id = $this->request->variable('c', 0); |
235 | - $view = $this->request->variable('view', ''); |
|
236 | - $start = ($page - 1) * $this->config['dir_comments_per_page']; |
|
235 | + $view = $this->request->variable('view', ''); |
|
236 | + $start = ($page - 1) * $this->config['dir_comments_per_page']; |
|
237 | 237 | |
238 | 238 | $this->s_hidden_fields = array_merge($this->s_hidden_fields, array('page' => $page)); |
239 | 239 | |
@@ -292,12 +292,12 @@ discard block |
||
292 | 292 | 'S_COMMENT' => generate_text_for_display($comments['comment_text'], $comments['comment_uid'], $comments['comment_bitfield'], $comments['comment_flags']), |
293 | 293 | 'S_ID' => $comments['comment_id'], |
294 | 294 | |
295 | - 'U_EDIT' => ($edit_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '', |
|
296 | - '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())) : '', |
|
295 | + 'U_EDIT' => ($edit_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '', |
|
296 | + '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())) : '', |
|
297 | 297 | |
298 | 298 | 'S_IGNORE_POST' => ($comments['foe'] && ($view != 'show' || $comment_id != $comments['comment_id'])) ? true : false, |
299 | - 'L_IGNORE_POST' => ($comments['foe']) ? $this->user->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>') : '', |
|
300 | - 'L_POST_DISPLAY' => ($comments['foe']) ? $this->user->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>') : '', |
|
299 | + 'L_IGNORE_POST' => ($comments['foe']) ? $this->user->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>') : '', |
|
300 | + 'L_POST_DISPLAY' => ($comments['foe']) ? $this->user->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>') : '', |
|
301 | 301 | |
302 | 302 | 'S_INFO' => $this->auth->acl_get('m_info'), |
303 | 303 | )); |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | |
399 | 399 | $meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id)); |
400 | 400 | meta_refresh(3, $meta_info); |
401 | - $message = $this->user->lang['DIR_'.strtoupper($mode).'_COMMENT_OK']; |
|
401 | + $message = $this->user->lang['DIR_' . strtoupper($mode) . '_COMMENT_OK']; |
|
402 | 402 | $message = $message . '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>'); |
403 | 403 | return $this->helper->message($message); |
404 | 404 | } |
@@ -478,11 +478,11 @@ discard block |
||
478 | 478 | $this->template->assign_vars(array( |
479 | 479 | 'S_AUTH_COMM' => $this->auth->acl_get('u_comment_dir'), |
480 | 480 | |
481 | - 'BBCODE_STATUS' => ($this->config['dir_allow_bbcode']) ? $this->user->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->user->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'), |
|
482 | - 'IMG_STATUS' => ($this->config['dir_allow_bbcode']) ? $this->user->lang['IMAGES_ARE_ON'] : $this->user->lang['IMAGES_ARE_OFF'], |
|
483 | - 'SMILIES_STATUS' => ($this->config['dir_allow_smilies']) ? $this->user->lang['SMILIES_ARE_ON'] : $this->user->lang['SMILIES_ARE_OFF'], |
|
484 | - 'URL_STATUS' => ($this->config['dir_allow_links']) ? $this->user->lang['URL_IS_ON'] : $this->user->lang['URL_IS_OFF'], |
|
485 | - 'FLASH_STATUS' => ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash']) ? $this->user->lang['FLASH_IS_ON'] : $this->user->lang['FLASH_IS_OFF'], |
|
481 | + 'BBCODE_STATUS' => ($this->config['dir_allow_bbcode']) ? $this->user->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path . "faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->user->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path . "faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'), |
|
482 | + 'IMG_STATUS' => ($this->config['dir_allow_bbcode']) ? $this->user->lang['IMAGES_ARE_ON'] : $this->user->lang['IMAGES_ARE_OFF'], |
|
483 | + 'SMILIES_STATUS' => ($this->config['dir_allow_smilies']) ? $this->user->lang['SMILIES_ARE_ON'] : $this->user->lang['SMILIES_ARE_OFF'], |
|
484 | + 'URL_STATUS' => ($this->config['dir_allow_links']) ? $this->user->lang['URL_IS_ON'] : $this->user->lang['URL_IS_OFF'], |
|
485 | + 'FLASH_STATUS' => ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash']) ? $this->user->lang['FLASH_IS_ON'] : $this->user->lang['FLASH_IS_OFF'], |
|
486 | 486 | |
487 | 487 | 'L_DIR_REPLY_EXP' => $this->user->lang('DIR_REPLY_EXP', $this->config['dir_length_comments']), |
488 | 488 |
@@ -68,22 +68,22 @@ discard block |
||
68 | 68 | protected $php_ext; |
69 | 69 | |
70 | 70 | /** |
71 | - * Constructor |
|
72 | - * |
|
73 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
74 | - * @param \phpbb\config\config $config Config object |
|
75 | - * @param \phpbb\template\template $template Template object |
|
76 | - * @param \phpbb\user $user User object |
|
77 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
78 | - * @param \phpbb\request\request $request Request object |
|
79 | - * @param \phpbb\auth\auth $auth Auth object |
|
80 | - * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
81 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
82 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
83 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
84 | - * @param string $root_path phpBB root path |
|
85 | - * @param string $php_ext phpEx |
|
86 | - */ |
|
71 | + * Constructor |
|
72 | + * |
|
73 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
74 | + * @param \phpbb\config\config $config Config object |
|
75 | + * @param \phpbb\template\template $template Template object |
|
76 | + * @param \phpbb\user $user User object |
|
77 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
78 | + * @param \phpbb\request\request $request Request object |
|
79 | + * @param \phpbb\auth\auth $auth Auth object |
|
80 | + * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
81 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
82 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
83 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
84 | + * @param string $root_path phpBB root path |
|
85 | + * @param string $php_ext phpEx |
|
86 | + */ |
|
87 | 87 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \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) |
88 | 88 | { |
89 | 89 | $this->db = $db; |
@@ -109,12 +109,12 @@ discard block |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
112 | - * Delete a link |
|
113 | - * |
|
114 | - * @param int $cat_id The category ID |
|
115 | - * @param int $link_id The link ID |
|
116 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
117 | - */ |
|
112 | + * Delete a link |
|
113 | + * |
|
114 | + * @param int $cat_id The category ID |
|
115 | + * @param int $link_id The link ID |
|
116 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
117 | + */ |
|
118 | 118 | public function delete_link($cat_id, $link_id) |
119 | 119 | { |
120 | 120 | if ($this->request->is_set_post('cancel')) |
@@ -157,13 +157,13 @@ discard block |
||
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
160 | - * Edit a link |
|
161 | - * |
|
162 | - * @param int $cat_id The category ID |
|
163 | - * @param int $link_id The link ID |
|
164 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
165 | - * @throws \phpbb\exception\http_exception |
|
166 | - */ |
|
160 | + * Edit a link |
|
161 | + * |
|
162 | + * @param int $cat_id The category ID |
|
163 | + * @param int $link_id The link ID |
|
164 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
165 | + * @throws \phpbb\exception\http_exception |
|
166 | + */ |
|
167 | 167 | public function edit_link($cat_id, $link_id) |
168 | 168 | { |
169 | 169 | $sql = 'SELECT link_user_id |
@@ -238,12 +238,12 @@ discard block |
||
238 | 238 | } |
239 | 239 | |
240 | 240 | /** |
241 | - * Display add form |
|
242 | - * |
|
243 | - * @param int $cat_id The category ID |
|
244 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
245 | - * @throws \phpbb\exception\http_exception |
|
246 | - */ |
|
241 | + * Display add form |
|
242 | + * |
|
243 | + * @param int $cat_id The category ID |
|
244 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
245 | + * @throws \phpbb\exception\http_exception |
|
246 | + */ |
|
247 | 247 | public function new_link($cat_id) |
248 | 248 | { |
249 | 249 | if (!$this->auth->acl_get('u_submit_dir')) |
@@ -285,23 +285,23 @@ discard block |
||
285 | 285 | } |
286 | 286 | |
287 | 287 | /** |
288 | - * View link controller |
|
289 | - * |
|
290 | - * @param int $link_id The link ID |
|
291 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
292 | - */ |
|
288 | + * View link controller |
|
289 | + * |
|
290 | + * @param int $link_id The link ID |
|
291 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
292 | + */ |
|
293 | 293 | public function view_link($link_id) |
294 | 294 | { |
295 | 295 | return $this->link->view($link_id); |
296 | 296 | } |
297 | 297 | |
298 | 298 | /** |
299 | - * Vote for a link |
|
300 | - * |
|
301 | - * @param int $cat_id The category ID |
|
302 | - * @param int $link_id The link ID |
|
303 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
304 | - */ |
|
299 | + * Vote for a link |
|
300 | + * |
|
301 | + * @param int $cat_id The category ID |
|
302 | + * @param int $link_id The link ID |
|
303 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
304 | + */ |
|
305 | 305 | public function vote_link($cat_id, $link_id) |
306 | 306 | { |
307 | 307 | $this->categorie->get($cat_id); |
@@ -337,14 +337,14 @@ discard block |
||
337 | 337 | } |
338 | 338 | |
339 | 339 | /** |
340 | - * Routine |
|
341 | - * |
|
342 | - * @param int $cat_id The category ID |
|
343 | - * @param int $link_id The link ID |
|
344 | - * @param string $mode add|edit |
|
345 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
346 | - * @throws \phpbb\exception\http_exception |
|
347 | - */ |
|
340 | + * Routine |
|
341 | + * |
|
342 | + * @param int $cat_id The category ID |
|
343 | + * @param int $link_id The link ID |
|
344 | + * @param string $mode add|edit |
|
345 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
346 | + * @throws \phpbb\exception\http_exception |
|
347 | + */ |
|
348 | 348 | private function _data_processing($cat_id, $link_id = 0, $mode = 'new') |
349 | 349 | { |
350 | 350 | 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'))) |
@@ -434,8 +434,8 @@ discard block |
||
434 | 434 | if (!$error) |
435 | 435 | { |
436 | 436 | /** |
437 | - * No errrors, we execute heavy tasks wich need a valid url |
|
438 | - */ |
|
437 | + * No errrors, we execute heavy tasks wich need a valid url |
|
438 | + */ |
|
439 | 439 | |
440 | 440 | // Banner |
441 | 441 | $this->link->banner_process($this->banner, $error); |
@@ -518,11 +518,11 @@ discard block |
||
518 | 518 | } |
519 | 519 | |
520 | 520 | /** |
521 | - * Display a banner |
|
522 | - * |
|
523 | - * @param string $banner_img Path to banner file |
|
524 | - * @return Response object |
|
525 | - */ |
|
521 | + * Display a banner |
|
522 | + * |
|
523 | + * @param string $banner_img Path to banner file |
|
524 | + * @return Response object |
|
525 | + */ |
|
526 | 526 | public function return_banner($banner_img) |
527 | 527 | { |
528 | 528 | if (!function_exists('file_gc')) |
@@ -555,13 +555,13 @@ discard block |
||
555 | 555 | } |
556 | 556 | |
557 | 557 | /** |
558 | - * Populate form when an error occurred |
|
559 | - * |
|
560 | - * @param int $cat_id The category ID |
|
561 | - * @param string $mode add|edit |
|
562 | - * @param string $title Page title (depends of $mode) |
|
563 | - * @return null |
|
564 | - */ |
|
558 | + * Populate form when an error occurred |
|
559 | + * |
|
560 | + * @param int $cat_id The category ID |
|
561 | + * @param string $mode add|edit |
|
562 | + * @param string $title Page title (depends of $mode) |
|
563 | + * @return null |
|
564 | + */ |
|
565 | 565 | private function _populate_form($cat_id, $mode, $title) |
566 | 566 | { |
567 | 567 | global $phpbb_extension_manager; |
@@ -86,19 +86,19 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \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) |
88 | 88 | { |
89 | - $this->db = $db; |
|
89 | + $this->db = $db; |
|
90 | 90 | $this->config = $config; |
91 | - $this->template = $template; |
|
91 | + $this->template = $template; |
|
92 | 92 | $this->user = $user; |
93 | 93 | $this->helper = $helper; |
94 | - $this->request = $request; |
|
94 | + $this->request = $request; |
|
95 | 95 | $this->auth = $auth; |
96 | - $this->captcha_factory = $captcha_factory; |
|
96 | + $this->captcha_factory = $captcha_factory; |
|
97 | 97 | $this->categorie = $categorie; |
98 | 98 | $this->link = $link; |
99 | - $this->dir_helper = $dir_helper; |
|
99 | + $this->dir_helper = $dir_helper; |
|
100 | 100 | $this->root_path = $root_path; |
101 | - $this->php_ext = $php_ext; |
|
101 | + $this->php_ext = $php_ext; |
|
102 | 102 | |
103 | 103 | $this->user->add_lang_ext('ernadoo/phpbbdirectory', 'directory'); |
104 | 104 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $cat_id = $this->request->variable('id', $cat_id); |
184 | 184 | $submit = $this->request->is_set_post('submit') ? true : false; |
185 | 185 | $refresh = $this->request->is_set_post('refresh_vc') ? true : false; |
186 | - $title = $this->user->lang['DIR_EDIT_SITE']; |
|
186 | + $title = $this->user->lang['DIR_EDIT_SITE']; |
|
187 | 187 | |
188 | 188 | $this->template->assign_block_vars('dir_navlinks', array( |
189 | 189 | 'FORUM_NAME' => $title, |
@@ -219,15 +219,15 @@ discard block |
||
219 | 219 | 'old_banner' => $site['link_banner'], |
220 | 220 | ); |
221 | 221 | |
222 | - $site_description = generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']); |
|
223 | - $site['link_banner'] = (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : ''; |
|
222 | + $site_description = generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']); |
|
223 | + $site['link_banner'] = (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : ''; |
|
224 | 224 | |
225 | - $this->url = $site['link_url']; |
|
226 | - $this->site_name = $site['link_name']; |
|
225 | + $this->url = $site['link_url']; |
|
226 | + $this->site_name = $site['link_name']; |
|
227 | 227 | $this->description = $site_description['text']; |
228 | 228 | $this->guest_email = $site['link_guest_email']; |
229 | - $this->rss = $site['link_rss']; |
|
230 | - $this->banner = $site['link_banner']; |
|
229 | + $this->rss = $site['link_rss']; |
|
230 | + $this->banner = $site['link_banner']; |
|
231 | 231 | $this->back = $site['link_back']; |
232 | 232 | $this->flag = $site['link_flag']; |
233 | 233 | } |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $cat_id = $this->request->variable('id', $cat_id); |
255 | 255 | $submit = $this->request->is_set_post('submit') ? true : false; |
256 | 256 | $refresh = $this->request->is_set_post('refresh_vc') ? true : false; |
257 | - $title = $this->user->lang['DIR_NEW_SITE']; |
|
257 | + $title = $this->user->lang['DIR_NEW_SITE']; |
|
258 | 258 | |
259 | 259 | $this->template->assign_block_vars('dir_navlinks', array( |
260 | 260 | 'FORUM_NAME' => $title, |
@@ -357,12 +357,12 @@ discard block |
||
357 | 357 | return $this->helper->message('FORM_INVALID'); |
358 | 358 | } |
359 | 359 | |
360 | - $this->url = $this->request->variable('url', ''); |
|
361 | - $this->site_name = $this->request->variable('site_name', '', true); |
|
360 | + $this->url = $this->request->variable('url', ''); |
|
361 | + $this->site_name = $this->request->variable('site_name', '', true); |
|
362 | 362 | $this->description = $this->request->variable('description', '', true); |
363 | 363 | $this->guest_email = $this->request->variable('guest_email', ''); |
364 | - $this->rss = $this->request->variable('rss', ''); |
|
365 | - $this->banner = $this->request->variable('banner', ''); |
|
364 | + $this->rss = $this->request->variable('rss', ''); |
|
365 | + $this->banner = $this->request->variable('banner', ''); |
|
366 | 366 | $this->back = $this->request->variable('back', ''); |
367 | 367 | $this->flag = $this->request->variable('flag', ''); |
368 | 368 | |
@@ -391,17 +391,17 @@ discard block |
||
391 | 391 | 'site_name' => array( |
392 | 392 | array('string', false, 1, 100)), |
393 | 393 | 'website' => array( |
394 | - array('string', false, 12, 255), |
|
395 | - array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), |
|
394 | + array('string', false, 12, 255), |
|
395 | + array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), |
|
396 | 396 | 'description' => array( |
397 | 397 | array('string', !$this->categorie->data['cat_must_describe'], 1, $this->config['dir_length_describe'])), |
398 | 398 | 'rss' => array( |
399 | 399 | array('string', true, 12, 255), |
400 | - array('match', empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), |
|
400 | + array('match', empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), |
|
401 | 401 | 'banner' => array( |
402 | 402 | array('string', true, 5, 255)), |
403 | 403 | 'back' => array( |
404 | - array('string', !$this->categorie->data['cat_link_back'], 12, 255), |
|
404 | + array('string', !$this->categorie->data['cat_link_back'], 12, 255), |
|
405 | 405 | array(array($this->link, 'link_back'), true)), |
406 | 406 | 'cat' => array( |
407 | 407 | array('num', '', 1)) |
@@ -450,8 +450,8 @@ discard block |
||
450 | 450 | // Still no errors?? So let's go! |
451 | 451 | if (!$error) |
452 | 452 | { |
453 | - $this->banner = (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner; |
|
454 | - $this->url = $this->link->clean_url($this->url); |
|
453 | + $this->banner = (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner; |
|
454 | + $this->url = $this->link->clean_url($this->url); |
|
455 | 455 | |
456 | 456 | $data_edit = array( |
457 | 457 | 'link_user_id' => $this->link_user_id, |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | |
500 | 500 | $meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)); |
501 | 501 | meta_refresh(3, $meta_info); |
502 | - $message = ($need_approval) ? $this->user->lang['DIR_'.strtoupper($mode).'_SITE_ACTIVE'] : $this->user->lang['DIR_'.strtoupper($mode).'_SITE_OK']; |
|
502 | + $message = ($need_approval) ? $this->user->lang['DIR_' . strtoupper($mode) . '_SITE_ACTIVE'] : $this->user->lang['DIR_' . strtoupper($mode) . '_SITE_OK']; |
|
503 | 503 | $message = $message . '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)) . '">', '</a>'); |
504 | 504 | return $this->helper->message($message); |
505 | 505 | } |
@@ -589,20 +589,20 @@ discard block |
||
589 | 589 | add_form_key('dir_form'); |
590 | 590 | |
591 | 591 | $ext_path = $phpbb_extension_manager->get_extension_path('ernadoo/phpbbdirectory', false); |
592 | - $flag_path = $ext_path.'images/flags/'; |
|
592 | + $flag_path = $ext_path . 'images/flags/'; |
|
593 | 593 | |
594 | 594 | $s_guest = (!$this->user->data['is_registered'] || !empty($this->guest_email)); |
595 | - $s_rss = $this->config['dir_activ_rss']; |
|
596 | - $s_banner = $this->config['dir_activ_banner']; |
|
595 | + $s_rss = $this->config['dir_activ_rss']; |
|
596 | + $s_banner = $this->config['dir_activ_banner']; |
|
597 | 597 | $s_back = $this->categorie->data['cat_link_back']; |
598 | 598 | $s_flag = $this->config['dir_activ_flag']; |
599 | 599 | |
600 | 600 | $this->template->assign_vars(array( |
601 | - 'BBCODE_STATUS' => ($this->config['allow_bbcode']) ? $this->user->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->user->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'), |
|
602 | - 'IMG_STATUS' => ($this->config['allow_bbcode']) ? $this->user->lang['IMAGES_ARE_ON'] : $this->user->lang['IMAGES_ARE_OFF'], |
|
601 | + 'BBCODE_STATUS' => ($this->config['allow_bbcode']) ? $this->user->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path . "faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->user->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path . "faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'), |
|
602 | + 'IMG_STATUS' => ($this->config['allow_bbcode']) ? $this->user->lang['IMAGES_ARE_ON'] : $this->user->lang['IMAGES_ARE_OFF'], |
|
603 | 603 | 'SMILIES_STATUS' => ($this->config['allow_smilies']) ? $this->user->lang['SMILIES_ARE_ON'] : $this->user->lang['SMILIES_ARE_OFF'], |
604 | 604 | 'URL_STATUS' => ($this->config['allow_post_links']) ? $this->user->lang['URL_IS_ON'] : $this->user->lang['URL_IS_OFF'], |
605 | - 'FLASH_STATUS' => ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->user->lang['FLASH_IS_ON'] : $this->user->lang['FLASH_IS_OFF'], |
|
605 | + 'FLASH_STATUS' => ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->user->lang['FLASH_IS_ON'] : $this->user->lang['FLASH_IS_OFF'], |
|
606 | 606 | |
607 | 607 | 'L_TITLE' => $title, |
608 | 608 | 'L_DIR_DESCRIPTION_EXP' => $this->user->lang('DIR_DESCRIPTION_EXP', $this->config['dir_length_describe']), |
@@ -47,20 +47,20 @@ discard block |
||
47 | 47 | protected $link; |
48 | 48 | |
49 | 49 | /** |
50 | - * Constructor |
|
51 | - * |
|
52 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
53 | - * @param \phpbb\config\config $config Config 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\search\fulltext_directory $search PhpBB Directory extension search object |
|
61 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
62 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
63 | - */ |
|
50 | + * Constructor |
|
51 | + * |
|
52 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
53 | + * @param \phpbb\config\config $config Config 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\search\fulltext_directory $search PhpBB Directory extension search object |
|
61 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
62 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
63 | + */ |
|
64 | 64 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\search\fulltext_directory $search, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
65 | 65 | { |
66 | 66 | $this->db = $db; |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
88 | - * Search controller |
|
89 | - * |
|
90 | - * @param int $page Page number taken from the URL |
|
91 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
92 | - * @throws \phpbb\exception\http_exception |
|
93 | - */ |
|
88 | + * Search controller |
|
89 | + * |
|
90 | + * @param int $page Page number taken from the URL |
|
91 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
92 | + * @throws \phpbb\exception\http_exception |
|
93 | + */ |
|
94 | 94 | public function main($page) |
95 | 95 | { |
96 | 96 | if (!$this->auth->acl_get('u_search_dir')) |
@@ -314,11 +314,11 @@ discard block |
||
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
317 | - * |
|
318 | - * @param array $search_category |
|
319 | - * @param bool $search_child |
|
320 | - * @return array Categories to exclude from search |
|
321 | - */ |
|
317 | + * |
|
318 | + * @param array $search_category |
|
319 | + * @param bool $search_child |
|
320 | + * @return array Categories to exclude from search |
|
321 | + */ |
|
322 | 322 | private function _get_exclude_categories(&$search_category, $search_child) |
323 | 323 | { |
324 | 324 | $sql = 'SELECT cat_id, parent_id, right_id |
@@ -63,17 +63,17 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\search\fulltext_directory $search, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
65 | 65 | { |
66 | - $this->db = $db; |
|
66 | + $this->db = $db; |
|
67 | 67 | $this->config = $config; |
68 | - $this->template = $template; |
|
68 | + $this->template = $template; |
|
69 | 69 | $this->user = $user; |
70 | 70 | $this->helper = $helper; |
71 | - $this->request = $request; |
|
71 | + $this->request = $request; |
|
72 | 72 | $this->auth = $auth; |
73 | - $this->pagination = $pagination; |
|
74 | - $this->search = $search; |
|
75 | - $this->categorie = $categorie; |
|
76 | - $this->link = $link; |
|
73 | + $this->pagination = $pagination; |
|
74 | + $this->search = $search; |
|
75 | + $this->categorie = $categorie; |
|
76 | + $this->link = $link; |
|
77 | 77 | |
78 | 78 | $this->user->add_lang_ext('ernadoo/phpbbdirectory', array('directory')); |
79 | 79 | $this->user->add_lang('search'); |
@@ -98,24 +98,24 @@ discard block |
||
98 | 98 | throw new \phpbb\exception\http_exception(403, 'DIR_ERROR_NOT_AUTH'); |
99 | 99 | } |
100 | 100 | |
101 | - $cat_id = $this->request->variable('cat_id', 0); |
|
102 | - $keywords = $this->request->variable('keywords', '', true); |
|
101 | + $cat_id = $this->request->variable('cat_id', 0); |
|
102 | + $keywords = $this->request->variable('keywords', '', true); |
|
103 | 103 | $search_terms = $this->request->variable('terms', 'all'); |
104 | - $search_category = $this->request->variable('cid', array(0)); |
|
105 | - $search_fields = $this->request->variable('sf', 'all'); |
|
104 | + $search_category = $this->request->variable('cid', array(0)); |
|
105 | + $search_fields = $this->request->variable('sf', 'all'); |
|
106 | 106 | $search_child = $this->request->variable('sc', true); |
107 | - $sort_days = $this->request->variable('st', 0); |
|
107 | + $sort_days = $this->request->variable('st', 0); |
|
108 | 108 | $sort_key = $this->request->variable('sk', 't'); |
109 | 109 | $sort_dir = $this->request->variable('sd', 'd'); |
110 | - $start = ($page - 1) * (int) $this->config['dir_show']; |
|
110 | + $start = ($page - 1) * (int) $this->config['dir_show']; |
|
111 | 111 | |
112 | - $default_sort_days = 0; |
|
112 | + $default_sort_days = 0; |
|
113 | 113 | $default_sort_key = (string) substr($this->config['dir_default_order'], 0, 1); |
114 | 114 | $default_sort_dir = (string) substr($this->config['dir_default_order'], 2); |
115 | 115 | |
116 | 116 | // Categorie ordering options |
117 | 117 | $limit_days = array(0 => $this->user->lang['ALL_RESULTS'], 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']); |
118 | - $sort_by_text = array('a' => $this->user->lang['AUTHOR'], 't' => $this->user->lang['POST_TIME'], 'r' => $this->user->lang['DIR_COMMENTS_ORDER'], 's' => $this->user->lang['DIR_NAME_ORDER'], 'v' => $this->user->lang['DIR_NB_CLICKS_ORDER']); |
|
118 | + $sort_by_text = array('a' => $this->user->lang['AUTHOR'], 't' => $this->user->lang['POST_TIME'], 'r' => $this->user->lang['DIR_COMMENTS_ORDER'], 's' => $this->user->lang['DIR_NAME_ORDER'], 'v' => $this->user->lang['DIR_NB_CLICKS_ORDER']); |
|
119 | 119 | $sort_by_sql = array('a' => 'u.username_clean', 't' => array('l.link_time', 'l.link_id'), 'r' => 'l.link_comment', 's' => 'l.link_name', 'v' => 'l.link_view'); |
120 | 120 | |
121 | 121 | if ($this->config['dir_activ_pagerank']) |
@@ -164,12 +164,12 @@ discard block |
||
164 | 164 | |
165 | 165 | $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit))); |
166 | 166 | |
167 | - ($u_hilit) ? $u_search['keywords'] = urlencode(htmlspecialchars_decode($keywords)) : ''; |
|
168 | - ($search_terms != 'all') ? $u_search['terms'] = $search_terms : ''; |
|
169 | - ($cat_id) ? $u_search['cat_id'] = $cat_id : ''; |
|
170 | - ($search_category) ? $u_search['cid'] = $search_category : ''; |
|
171 | - (!$search_child) ? $u_search['sc'] = 0 : ''; |
|
172 | - ($search_fields != 'all') ? $u_search['sf'] = $search_fields : ''; |
|
167 | + ($u_hilit) ? $u_search['keywords'] = urlencode(htmlspecialchars_decode($keywords)) : ''; |
|
168 | + ($search_terms != 'all') ? $u_search['terms'] = $search_terms : ''; |
|
169 | + ($cat_id) ? $u_search['cat_id'] = $cat_id : ''; |
|
170 | + ($search_category) ? $u_search['cid'] = $search_category : ''; |
|
171 | + (!$search_child) ? $u_search['sc'] = 0 : ''; |
|
172 | + ($search_fields != 'all') ? $u_search['sf'] = $search_fields : ''; |
|
173 | 173 | |
174 | 174 | $base_url = array( |
175 | 175 | 'routes' => 'ernadoo_phpbbdirectory_search_controller', |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | |
244 | 244 | foreach ($rowset as $data) |
245 | 245 | { |
246 | - $s_banner = $this->link->display_bann($data); |
|
246 | + $s_banner = $this->link->display_bann($data); |
|
247 | 247 | $s_thumb = $this->link->display_thumb($data); |
248 | 248 | $s_flag = $this->link->display_flag($data); |
249 | 249 | |
@@ -264,10 +264,10 @@ discard block |
||
264 | 264 | 'S_TIME' => ($data['link_time'] != 0) ? $this->user->format_date($data['link_time']) : '', |
265 | 265 | 'S_COMMENT' => $data['link_comment'], |
266 | 266 | |
267 | - 'THUMB' => '<img src="'.$s_thumb.'" alt="'.$this->user->lang['DIR_THUMB'].'" title="'.$data['link_name'].'"/>', |
|
267 | + 'THUMB' => '<img src="' . $s_thumb . '" alt="' . $this->user->lang['DIR_THUMB'] . '" title="' . $data['link_name'] . '"/>', |
|
268 | 268 | 'IMG_BANNER' => $s_banner, |
269 | 269 | 'IMG_FLAG' => $s_flag, |
270 | - 'ON_CLICK' => "onclick=\"window.open('".$this->helper->route('ernadoo_phpbbdirectory_view_controller', array('link_id' => (int) $data['link_id']))."'); return false;\"", |
|
270 | + 'ON_CLICK' => "onclick=\"window.open('" . $this->helper->route('ernadoo_phpbbdirectory_view_controller', array('link_id' => (int) $data['link_id'])) . "'); return false;\"", |
|
271 | 271 | |
272 | 272 | 'L_DIR_SEARCH_NB_CLICKS' => $this->user->lang('DIR_SEARCH_NB_CLICKS', (int) $data['link_view']), |
273 | 273 | 'L_DIR_SEARCH_NB_COMMS' => $this->user->lang('DIR_SEARCH_NB_COMMS', (int) $data['link_comment']), |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\cron\manager $cron, \ernadoo\phpbbdirectory\core\helper $dir_helper) |
60 | 60 | { |
61 | - $this->db = $db; |
|
61 | + $this->db = $db; |
|
62 | 62 | $this->config = $config; |
63 | - $this->template = $template; |
|
63 | + $this->template = $template; |
|
64 | 64 | $this->user = $user; |
65 | 65 | $this->helper = $helper; |
66 | - $this->request = $request; |
|
66 | + $this->request = $request; |
|
67 | 67 | $this->auth = $auth; |
68 | 68 | $this->cron = $cron; |
69 | - $this->dir_helper = $dir_helper; |
|
69 | + $this->dir_helper = $dir_helper; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | */ |
195 | 195 | public function display() |
196 | 196 | { |
197 | - $cat_rows = $subcats = array(); |
|
197 | + $cat_rows = $subcats = array(); |
|
198 | 198 | $parent_id = $visible_cats = 0; |
199 | 199 | |
200 | 200 | $sql_array = array( |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | { |
260 | 260 | foreach ($subcats[$dir_cat_id] as $subcat_id => $subcat_row) |
261 | 261 | { |
262 | - $row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links']+$subcat_row['links']) : $row['cat_links']; |
|
262 | + $row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links'] + $subcat_row['links']) : $row['cat_links']; |
|
263 | 263 | |
264 | 264 | if ($subcat_row['display'] && $subcat_row['parent_id'] == $dir_cat_id) |
265 | 265 | { |
@@ -505,9 +505,9 @@ discard block |
||
505 | 505 | |
506 | 506 | if ($can_watch) |
507 | 507 | { |
508 | - $s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch'))); |
|
508 | + $s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch'))); |
|
509 | 509 | $s_watching['link_toggle'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => ((!$is_watching) ? 'unwatch' : 'watch'))); |
510 | - $s_watching['title'] = $this->user->lang[(($is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT']; |
|
510 | + $s_watching['title'] = $this->user->lang[(($is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT']; |
|
511 | 511 | $s_watching['title_toggle'] = $this->user->lang[((!$is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT']; |
512 | 512 | $s_watching['is_watching'] = $is_watching; |
513 | 513 | } |
@@ -44,18 +44,18 @@ discard block |
||
44 | 44 | public $data = array(); |
45 | 45 | |
46 | 46 | /** |
47 | - * Constructor |
|
48 | - * |
|
49 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
50 | - * @param \phpbb\config\config $config Config object |
|
51 | - * @param \phpbb\template\template $template Template object |
|
52 | - * @param \phpbb\user $user User object |
|
53 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
54 | - * @param \phpbb\request\request $request Request object |
|
55 | - * @param \phpbb\auth\auth $auth Auth object |
|
56 | - * @param \phpbb\cron\manager $cron Cron object |
|
57 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
58 | - */ |
|
47 | + * Constructor |
|
48 | + * |
|
49 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
50 | + * @param \phpbb\config\config $config Config object |
|
51 | + * @param \phpbb\template\template $template Template object |
|
52 | + * @param \phpbb\user $user User object |
|
53 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
54 | + * @param \phpbb\request\request $request Request object |
|
55 | + * @param \phpbb\auth\auth $auth Auth object |
|
56 | + * @param \phpbb\cron\manager $cron Cron object |
|
57 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
58 | + */ |
|
59 | 59 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\cron\manager $cron, \ernadoo\phpbbdirectory\core\helper $dir_helper) |
60 | 60 | { |
61 | 61 | $this->db = $db; |
@@ -70,21 +70,21 @@ discard block |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
73 | - * Function for get approval setting |
|
74 | - * used in edit mode for test the setting of new category's link |
|
75 | - * |
|
76 | - * @return bool |
|
77 | - */ |
|
73 | + * Function for get approval setting |
|
74 | + * used in edit mode for test the setting of new category's link |
|
75 | + * |
|
76 | + * @return bool |
|
77 | + */ |
|
78 | 78 | public function need_approval() |
79 | 79 | { |
80 | 80 | return (bool) $this->data['cat_validate']; |
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
84 | - * Generate Jumpbox |
|
85 | - * |
|
86 | - * @return null |
|
87 | - */ |
|
84 | + * Generate Jumpbox |
|
85 | + * |
|
86 | + * @return null |
|
87 | + */ |
|
88 | 88 | public function make_cat_jumpbox() |
89 | 89 | { |
90 | 90 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
@@ -137,12 +137,12 @@ discard block |
||
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
140 | - * Generate a list of directory's categories |
|
141 | - * |
|
142 | - * @param int $select_id Selected category |
|
143 | - * @param array $ignore_id Array of ignored categories |
|
144 | - * @return string $cat_list html code |
|
145 | - */ |
|
140 | + * Generate a list of directory's categories |
|
141 | + * |
|
142 | + * @param int $select_id Selected category |
|
143 | + * @param array $ignore_id Array of ignored categories |
|
144 | + * @return string $cat_list html code |
|
145 | + */ |
|
146 | 146 | public function make_cat_select($select_id = 0, $ignore_id = array()) |
147 | 147 | { |
148 | 148 | $ignore_id = is_array($ignore_id) ? $ignore_id : array($ignore_id); |
@@ -188,10 +188,10 @@ discard block |
||
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
191 | - * Display cat or subcat |
|
192 | - * |
|
193 | - * @return null |
|
194 | - */ |
|
191 | + * Display cat or subcat |
|
192 | + * |
|
193 | + * @return null |
|
194 | + */ |
|
195 | 195 | public function display() |
196 | 196 | { |
197 | 197 | $cat_rows = $subcats = array(); |
@@ -320,11 +320,11 @@ discard block |
||
320 | 320 | } |
321 | 321 | |
322 | 322 | /** |
323 | - * Get informations about a cat or subcat |
|
324 | - * |
|
325 | - * @param int $cat_id The category ID |
|
326 | - * @return null|false |
|
327 | - */ |
|
323 | + * Get informations about a cat or subcat |
|
324 | + * |
|
325 | + * @param int $cat_id The category ID |
|
326 | + * @return null|false |
|
327 | + */ |
|
328 | 328 | public function get($cat_id = 0) |
329 | 329 | { |
330 | 330 | if ($cat_id) |
@@ -352,11 +352,11 @@ discard block |
||
352 | 352 | } |
353 | 353 | |
354 | 354 | /** |
355 | - * Create category navigation links for given category, create parent |
|
356 | - * list if currently null, assign basic category info to template |
|
357 | - * |
|
358 | - * @param array $dir_cat_data |
|
359 | - */ |
|
355 | + * Create category navigation links for given category, create parent |
|
356 | + * list if currently null, assign basic category info to template |
|
357 | + * |
|
358 | + * @param array $dir_cat_data |
|
359 | + */ |
|
360 | 360 | public function generate_dir_nav(&$dir_cat_data) |
361 | 361 | { |
362 | 362 | global $phpbb_container; |
@@ -393,12 +393,12 @@ discard block |
||
393 | 393 | } |
394 | 394 | |
395 | 395 | /** |
396 | - * Return good key language |
|
397 | - * |
|
398 | - * @param bool $validate True if approbation needed before publication |
|
399 | - * @return string Information about approval, depends on user auth level |
|
400 | - * @throws \phpbb\exception\runtime_exception |
|
401 | - */ |
|
396 | + * Return good key language |
|
397 | + * |
|
398 | + * @param bool $validate True if approbation needed before publication |
|
399 | + * @return string Information about approval, depends on user auth level |
|
400 | + * @throws \phpbb\exception\runtime_exception |
|
401 | + */ |
|
402 | 402 | public function dir_submit_type($validate) |
403 | 403 | { |
404 | 404 | if ($validate && !$this->auth->acl_get('a_')) |
@@ -422,15 +422,15 @@ discard block |
||
422 | 422 | } |
423 | 423 | |
424 | 424 | /** |
425 | - * Category watching common code |
|
426 | - * |
|
427 | - * @param string $mode Watch or unwatch a category |
|
428 | - * @param array $s_watching An empty array, passed by reference |
|
429 | - * @param int $user_id The user ID |
|
430 | - * @param int $cat_id The category ID |
|
431 | - * @param string $notify_status User is watching the category? |
|
432 | - * @return null|string |
|
433 | - */ |
|
425 | + * Category watching common code |
|
426 | + * |
|
427 | + * @param string $mode Watch or unwatch a category |
|
428 | + * @param array $s_watching An empty array, passed by reference |
|
429 | + * @param int $user_id The user ID |
|
430 | + * @param int $cat_id The category ID |
|
431 | + * @param string $notify_status User is watching the category? |
|
432 | + * @return null|string |
|
433 | + */ |
|
434 | 434 | public function watch_categorie($mode, &$s_watching, $user_id, $cat_id, $notify_status) |
435 | 435 | { |
436 | 436 | // Is user watching this thread? |
@@ -516,11 +516,11 @@ discard block |
||
516 | 516 | } |
517 | 517 | |
518 | 518 | /** |
519 | - * Return Category name |
|
520 | - * |
|
521 | - * @param int $cat_id The category ID |
|
522 | - * @return string The category name |
|
523 | - */ |
|
519 | + * Return Category name |
|
520 | + * |
|
521 | + * @param int $cat_id The category ID |
|
522 | + * @return string The category name |
|
523 | + */ |
|
524 | 524 | static public function getname($cat_id) |
525 | 525 | { |
526 | 526 | global $db; |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | protected $user; |
23 | 23 | |
24 | 24 | /** |
25 | - * Constructor |
|
26 | - * |
|
27 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
28 | - * @param \phpbb\user $user User object |
|
29 | - */ |
|
25 | + * Constructor |
|
26 | + * |
|
27 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
28 | + * @param \phpbb\user $user User object |
|
29 | + */ |
|
30 | 30 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user) |
31 | 31 | { |
32 | 32 | $this->db = $db; |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | - * Add a comment |
|
38 | - * |
|
39 | - * @param array $data Link's data from db |
|
40 | - * @return null |
|
41 | - */ |
|
37 | + * Add a comment |
|
38 | + * |
|
39 | + * @param array $data Link's data from db |
|
40 | + * @return null |
|
41 | + */ |
|
42 | 42 | public function add($data) |
43 | 43 | { |
44 | 44 | $this->db->sql_transaction('begin'); |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | - * Edit a comment |
|
59 | - * |
|
60 | - * @param array $data Data to edit |
|
61 | - * @param int $comment_id The comment ID |
|
62 | - * @return null |
|
63 | - */ |
|
58 | + * Edit a comment |
|
59 | + * |
|
60 | + * @param array $data Data to edit |
|
61 | + * @param int $comment_id The comment ID |
|
62 | + * @return null |
|
63 | + */ |
|
64 | 64 | public function edit($data, $comment_id) |
65 | 65 | { |
66 | 66 | $sql = 'UPDATE ' . DIR_COMMENT_TABLE . ' |
@@ -70,12 +70,12 @@ discard block |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
73 | - * Delete a comment |
|
74 | - * |
|
75 | - * @param string $link_id The link ID |
|
76 | - * @param string $comment_id The comment ID |
|
77 | - * @return null |
|
78 | - */ |
|
73 | + * Delete a comment |
|
74 | + * |
|
75 | + * @param string $link_id The link ID |
|
76 | + * @param string $comment_id The comment ID |
|
77 | + * @return null |
|
78 | + */ |
|
79 | 79 | public function del($link_id, $comment_id) |
80 | 80 | { |
81 | 81 | global $request; |
@@ -29,7 +29,7 @@ |
||
29 | 29 | */ |
30 | 30 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user) |
31 | 31 | { |
32 | - $this->db = $db; |
|
32 | + $this->db = $db; |
|
33 | 33 | $this->user = $user; |
34 | 34 | } |
35 | 35 |
@@ -46,20 +46,20 @@ discard block |
||
46 | 46 | protected $php_ext; |
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\template\template $template Template object |
|
54 | - * @param \phpbb\user $user User object |
|
55 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
56 | - * @param \phpbb\request\request $request Request object |
|
57 | - * @param \phpbb\auth\auth $auth Auth object |
|
58 | - * @param \phpbb\notification\manager $notification Notification object |
|
59 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
60 | - * @param string $root_path phpBB root path |
|
61 | - * @param string $php_ext phpEx |
|
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\template\template $template Template object |
|
54 | + * @param \phpbb\user $user User object |
|
55 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
56 | + * @param \phpbb\request\request $request Request object |
|
57 | + * @param \phpbb\auth\auth $auth Auth object |
|
58 | + * @param \phpbb\notification\manager $notification Notification object |
|
59 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
60 | + * @param string $root_path phpBB root path |
|
61 | + * @param string $php_ext phpEx |
|
62 | + */ |
|
63 | 63 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\notification\manager $notification, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext) |
64 | 64 | { |
65 | 65 | $this->db = $db; |
@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
79 | - * Add a link into db |
|
80 | - * |
|
81 | - * @param array $data Contains all data to insert in db |
|
82 | - * @param bool $need_approval Links needs to be approved? |
|
83 | - * @return null |
|
84 | - */ |
|
79 | + * Add a link into db |
|
80 | + * |
|
81 | + * @param array $data Contains all data to insert in db |
|
82 | + * @param bool $need_approval Links needs to be approved? |
|
83 | + * @return null |
|
84 | + */ |
|
85 | 85 | public function add($data, $need_approval) |
86 | 86 | { |
87 | 87 | $notification_data = array(); |
@@ -126,13 +126,13 @@ discard block |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
129 | - * Edit a link of the db |
|
130 | - * |
|
131 | - * @param array $data Contains all data to edit in db |
|
132 | - * @param int $link_id is link's id, for WHERE clause |
|
133 | - * @param bool $need_approval Links needs to be approved? |
|
134 | - * @return null |
|
135 | - */ |
|
129 | + * Edit a link of the db |
|
130 | + * |
|
131 | + * @param array $data Contains all data to edit in db |
|
132 | + * @param int $link_id is link's id, for WHERE clause |
|
133 | + * @param bool $need_approval Links needs to be approved? |
|
134 | + * @return null |
|
135 | + */ |
|
136 | 136 | public function edit($data, $link_id, $need_approval) |
137 | 137 | { |
138 | 138 | $notification_data = array( |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
187 | - * Delete a link of the db |
|
188 | - * |
|
189 | - * @param int $cat_id The category ID |
|
190 | - * @param mixed $link_id Link's id, for WHERE clause |
|
191 | - * @return null |
|
192 | - */ |
|
187 | + * Delete a link of the db |
|
188 | + * |
|
189 | + * @param int $cat_id The category ID |
|
190 | + * @param mixed $link_id Link's id, for WHERE clause |
|
191 | + * @return null |
|
192 | + */ |
|
193 | 193 | public function del($cat_id, $link_id) |
194 | 194 | { |
195 | 195 | $this->db->sql_transaction('begin'); |
@@ -262,12 +262,12 @@ discard block |
||
262 | 262 | } |
263 | 263 | |
264 | 264 | /** |
265 | - * Increments link view counter |
|
266 | - * |
|
267 | - * @param int $link_id Link's id, for WHERE clause |
|
268 | - * @return null |
|
269 | - * @throws \phpbb\exception\http_exception |
|
270 | - */ |
|
265 | + * Increments link view counter |
|
266 | + * |
|
267 | + * @param int $link_id Link's id, for WHERE clause |
|
268 | + * @return null |
|
269 | + * @throws \phpbb\exception\http_exception |
|
270 | + */ |
|
271 | 271 | public function view($link_id) |
272 | 272 | { |
273 | 273 | $sql = 'SELECT link_id, link_url |
@@ -291,11 +291,11 @@ discard block |
||
291 | 291 | } |
292 | 292 | |
293 | 293 | /** |
294 | - * Verify that an URL exist before add into db |
|
295 | - * |
|
296 | - * @param string $url The URL to check |
|
297 | - * @return bool True if url is reachable, else false. |
|
298 | - */ |
|
294 | + * Verify that an URL exist before add into db |
|
295 | + * |
|
296 | + * @param string $url The URL to check |
|
297 | + * @return bool True if url is reachable, else false. |
|
298 | + */ |
|
299 | 299 | public function checkurl($url) |
300 | 300 | { |
301 | 301 | $details = parse_url($url); |
@@ -332,11 +332,11 @@ discard block |
||
332 | 332 | } |
333 | 333 | |
334 | 334 | /** |
335 | - * Delete the final '/', if no path |
|
336 | - * |
|
337 | - * @param string $url URL to clean |
|
338 | - * @return string $url The correct string. |
|
339 | - */ |
|
335 | + * Delete the final '/', if no path |
|
336 | + * |
|
337 | + * @param string $url URL to clean |
|
338 | + * @return string $url The correct string. |
|
339 | + */ |
|
340 | 340 | public function clean_url($url) |
341 | 341 | { |
342 | 342 | $details = parse_url($url); |
@@ -349,11 +349,11 @@ discard block |
||
349 | 349 | } |
350 | 350 | |
351 | 351 | /** |
352 | - * Display a flag |
|
353 | - * |
|
354 | - * @param array $data Link's data from db |
|
355 | - * @return string Flag path. |
|
356 | - */ |
|
352 | + * Display a flag |
|
353 | + * |
|
354 | + * @param array $data Link's data from db |
|
355 | + * @return string Flag path. |
|
356 | + */ |
|
357 | 357 | public function display_flag($data) |
358 | 358 | { |
359 | 359 | global $phpbb_extension_manager; |
@@ -371,13 +371,13 @@ discard block |
||
371 | 371 | } |
372 | 372 | |
373 | 373 | /** |
374 | - * Calculate the link's note |
|
375 | - * |
|
376 | - * @param int $total_note Sum of all link's notes |
|
377 | - * @param int $nb_vote Number of votes |
|
378 | - * @param bool $votes_status Votes are enable in this category? |
|
379 | - * @return string $note The calculated note. |
|
380 | - */ |
|
374 | + * Calculate the link's note |
|
375 | + * |
|
376 | + * @param int $total_note Sum of all link's notes |
|
377 | + * @param int $nb_vote Number of votes |
|
378 | + * @param bool $votes_status Votes are enable in this category? |
|
379 | + * @return string $note The calculated note. |
|
380 | + */ |
|
381 | 381 | public function display_note($total_note, $nb_vote, $votes_status) |
382 | 382 | { |
383 | 383 | if (!$votes_status) |
@@ -392,11 +392,11 @@ discard block |
||
392 | 392 | } |
393 | 393 | |
394 | 394 | /** |
395 | - * Display the vote form for auth users |
|
396 | - * |
|
397 | - * @param array $data Link's data from db |
|
398 | - * @return null|string Html combo list or nothing if votes are not available. |
|
399 | - */ |
|
395 | + * Display the vote form for auth users |
|
396 | + * |
|
397 | + * @param array $data Link's data from db |
|
398 | + * @return null|string Html combo list or nothing if votes are not available. |
|
399 | + */ |
|
400 | 400 | public function display_vote($data) |
401 | 401 | { |
402 | 402 | if ($this->user->data['is_registered'] && $this->auth->acl_get('u_vote_dir') && empty($data['vote_user_id'])) |
@@ -413,11 +413,11 @@ discard block |
||
413 | 413 | } |
414 | 414 | |
415 | 415 | /** |
416 | - * Display the RSS icon |
|
417 | - * |
|
418 | - * @param array $data Link's data from db |
|
419 | - * @return null|string RSS feed URL or nothing. |
|
420 | - */ |
|
416 | + * Display the RSS icon |
|
417 | + * |
|
418 | + * @param array $data Link's data from db |
|
419 | + * @return null|string RSS feed URL or nothing. |
|
420 | + */ |
|
421 | 421 | public function display_rss($data) |
422 | 422 | { |
423 | 423 | if ($this->config['dir_activ_rss'] && !empty($data['link_rss'])) |
@@ -427,13 +427,13 @@ discard block |
||
427 | 427 | } |
428 | 428 | |
429 | 429 | /** |
430 | - * Display link's thumb if thumb service enabled. |
|
431 | - * if thumb don't exists in db or if a new service was choosen in acp |
|
432 | - * thumb is research |
|
433 | - * |
|
434 | - * @param array $data Link's data from db |
|
435 | - * @return string|null Thumb or null. |
|
436 | - */ |
|
430 | + * Display link's thumb if thumb service enabled. |
|
431 | + * if thumb don't exists in db or if a new service was choosen in acp |
|
432 | + * thumb is research |
|
433 | + * |
|
434 | + * @param array $data Link's data from db |
|
435 | + * @return string|null Thumb or null. |
|
436 | + */ |
|
437 | 437 | public function display_thumb($data) |
438 | 438 | { |
439 | 439 | if ($this->config['dir_activ_thumb']) |
@@ -454,11 +454,11 @@ discard block |
||
454 | 454 | } |
455 | 455 | |
456 | 456 | /** |
457 | - * Display and calculate PageRank if needed |
|
458 | - * |
|
459 | - * @param array $data Link's data from db |
|
460 | - * @return string Pagerank, 'n/a' or false |
|
461 | - */ |
|
457 | + * Display and calculate PageRank if needed |
|
458 | + * |
|
459 | + * @param array $data Link's data from db |
|
460 | + * @return string Pagerank, 'n/a' or false |
|
461 | + */ |
|
462 | 462 | public function display_pagerank($data) |
463 | 463 | { |
464 | 464 | if ($this->config['dir_activ_pagerank']) |
@@ -488,11 +488,11 @@ discard block |
||
488 | 488 | } |
489 | 489 | |
490 | 490 | /** |
491 | - * Display and resize a banner |
|
492 | - * |
|
493 | - * @param array $data link's data from db |
|
494 | - * @return string $s_banner html code. |
|
495 | - */ |
|
491 | + * Display and resize a banner |
|
492 | + * |
|
493 | + * @param array $data link's data from db |
|
494 | + * @return string $s_banner html code. |
|
495 | + */ |
|
496 | 496 | public function display_bann($data) |
497 | 497 | { |
498 | 498 | $s_banner = ''; |
@@ -526,11 +526,11 @@ discard block |
||
526 | 526 | } |
527 | 527 | |
528 | 528 | /** |
529 | - * Add a vote in db, for a specifi link |
|
530 | - * |
|
531 | - * @param int $link_id Link_id from db |
|
532 | - * @return null |
|
533 | - */ |
|
529 | + * Add a vote in db, for a specifi link |
|
530 | + * |
|
531 | + * @param int $link_id Link_id from db |
|
532 | + * @return null |
|
533 | + */ |
|
534 | 534 | public function add_vote($link_id) |
535 | 535 | { |
536 | 536 | $data = array( |
@@ -574,11 +574,11 @@ discard block |
||
574 | 574 | } |
575 | 575 | |
576 | 576 | /** |
577 | - * Search an appropriate thumb for url |
|
578 | - * |
|
579 | - * @param string $url Link's url |
|
580 | - * @return string The thumb url |
|
581 | - */ |
|
577 | + * Search an appropriate thumb for url |
|
578 | + * |
|
579 | + * @param string $url Link's url |
|
580 | + * @return string The thumb url |
|
581 | + */ |
|
582 | 582 | public function thumb_process($url) |
583 | 583 | { |
584 | 584 | if (!$this->config['dir_activ_thumb']) |
@@ -599,12 +599,12 @@ discard block |
||
599 | 599 | } |
600 | 600 | |
601 | 601 | /** |
602 | - * Check if ascreen thumb exists |
|
603 | - * |
|
604 | - * @param string $protocol The protocol |
|
605 | - * @param string $host The hostname |
|
606 | - * @return bool True if ascreen file exixts, else false |
|
607 | - */ |
|
602 | + * Check if ascreen thumb exists |
|
603 | + * |
|
604 | + * @param string $protocol The protocol |
|
605 | + * @param string $host The hostname |
|
606 | + * @return bool True if ascreen file exixts, else false |
|
607 | + */ |
|
608 | 608 | private function _ascreen_exist($protocol, $host) |
609 | 609 | { |
610 | 610 | if ($thumb_info = @getimagesize($protocol.'://'.$host.'/ascreen.jpg')) |
@@ -619,12 +619,12 @@ discard block |
||
619 | 619 | } |
620 | 620 | |
621 | 621 | /** |
622 | - * Primary work on banner, can edit, copy or check a banner |
|
623 | - * |
|
624 | - * @param string $banner The banner's remote url |
|
625 | - * @param array $error The array error, passed by reference |
|
626 | - * @return null |
|
627 | - */ |
|
622 | + * Primary work on banner, can edit, copy or check a banner |
|
623 | + * |
|
624 | + * @param string $banner The banner's remote url |
|
625 | + * @param array $error The array error, passed by reference |
|
626 | + * @return null |
|
627 | + */ |
|
628 | 628 | public function banner_process(&$banner, &$error) |
629 | 629 | { |
630 | 630 | $old_banner = $this->request->variable('old_banner', ''); |
@@ -660,13 +660,13 @@ discard block |
||
660 | 660 | } |
661 | 661 | |
662 | 662 | /** |
663 | - * Copy a remonte banner to server. |
|
664 | - * called by banner_process() |
|
665 | - * |
|
666 | - * @param string $banner The anner's remote url |
|
667 | - * @param array $error The array error, passed by reference |
|
668 | - * @return false|string String if no errors, else false |
|
669 | - */ |
|
663 | + * Copy a remonte banner to server. |
|
664 | + * called by banner_process() |
|
665 | + * |
|
666 | + * @param string $banner The anner's remote url |
|
667 | + * @param array $error The array error, passed by reference |
|
668 | + * @return false|string String if no errors, else false |
|
669 | + */ |
|
670 | 670 | private function _banner_upload($banner, &$error) |
671 | 671 | { |
672 | 672 | // Init upload class |
@@ -697,13 +697,13 @@ discard block |
||
697 | 697 | } |
698 | 698 | |
699 | 699 | /** |
700 | - * Check than remote banner exists |
|
701 | - * called by banner_process() |
|
702 | - * |
|
703 | - * @param string $banner The banner's remote url |
|
704 | - * @param array $error The array error, passed by reference |
|
705 | - * @return false|string String if no errors, else false |
|
706 | - */ |
|
700 | + * Check than remote banner exists |
|
701 | + * called by banner_process() |
|
702 | + * |
|
703 | + * @param string $banner The banner's remote url |
|
704 | + * @param array $error The array error, passed by reference |
|
705 | + * @return false|string String if no errors, else false |
|
706 | + */ |
|
707 | 707 | private function _banner_remote($banner, &$error) |
708 | 708 | { |
709 | 709 | if (!preg_match('#^(http|https|ftp)://#i', $banner)) |
@@ -810,11 +810,11 @@ discard block |
||
810 | 810 | } |
811 | 811 | |
812 | 812 | /** |
813 | - * Delete a banner from server |
|
814 | - * |
|
815 | - * @param string $file The file's name |
|
816 | - * @return bool True if delete success, else false |
|
817 | - */ |
|
813 | + * Delete a banner from server |
|
814 | + * |
|
815 | + * @param string $file The file's name |
|
816 | + * @return bool True if delete success, else false |
|
817 | + */ |
|
818 | 818 | private function _banner_delete($file) |
819 | 819 | { |
820 | 820 | if (file_exists($this->dir_helper->get_banner_path($file))) |
@@ -827,18 +827,18 @@ discard block |
||
827 | 827 | } |
828 | 828 | |
829 | 829 | /** |
830 | - * PageRank Lookup (Based on Google Toolbar for Mozilla Firefox) |
|
831 | - * |
|
832 | - * @copyright 2012 HM2K <[email protected]> |
|
833 | - * @link http://pagerank.phurix.net/ |
|
834 | - * @author James Wade <[email protected]> |
|
835 | - * @version $Revision: 2.1 $ |
|
836 | - * @require PHP 4.3.0 (file_get_contents) |
|
837 | - * @updated 06/10/11 |
|
838 | - * |
|
839 | - * @param string $q The website URL |
|
840 | - * @return string The calculated pagerank, or -1 |
|
841 | - */ |
|
830 | + * PageRank Lookup (Based on Google Toolbar for Mozilla Firefox) |
|
831 | + * |
|
832 | + * @copyright 2012 HM2K <[email protected]> |
|
833 | + * @link http://pagerank.phurix.net/ |
|
834 | + * @author James Wade <[email protected]> |
|
835 | + * @version $Revision: 2.1 $ |
|
836 | + * @require PHP 4.3.0 (file_get_contents) |
|
837 | + * @updated 06/10/11 |
|
838 | + * |
|
839 | + * @param string $q The website URL |
|
840 | + * @return string The calculated pagerank, or -1 |
|
841 | + */ |
|
842 | 842 | public function pagerank_process($q) |
843 | 843 | { |
844 | 844 | $googleDomains = array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch'); |
@@ -872,12 +872,12 @@ discard block |
||
872 | 872 | } |
873 | 873 | |
874 | 874 | /** |
875 | - * List flags |
|
876 | - * |
|
877 | - * @param string $flag_path The flag directory path |
|
878 | - * @param string $value Selected flag |
|
879 | - * @return string $list Html code |
|
880 | - */ |
|
875 | + * List flags |
|
876 | + * |
|
877 | + * @param string $flag_path The flag directory path |
|
878 | + * @param string $value Selected flag |
|
879 | + * @return string $list Html code |
|
880 | + */ |
|
881 | 881 | public function get_dir_flag_list($flag_path, $value) |
882 | 882 | { |
883 | 883 | $list = ''; |
@@ -912,10 +912,10 @@ discard block |
||
912 | 912 | } |
913 | 913 | |
914 | 914 | /** |
915 | - * Display recents links added |
|
916 | - * |
|
917 | - * @return null |
|
918 | - */ |
|
915 | + * Display recents links added |
|
916 | + * |
|
917 | + * @return null |
|
918 | + */ |
|
919 | 919 | public function recents() |
920 | 920 | { |
921 | 921 | if ($this->config['dir_recent_block']) |
@@ -992,13 +992,13 @@ discard block |
||
992 | 992 | } |
993 | 993 | |
994 | 994 | /** |
995 | - * Validate back link |
|
996 | - * |
|
997 | - * @param string $remote_url Page URL contains the backlink |
|
998 | - * @param bool $optional Link back is optional in this category? |
|
999 | - * @param bool $cron This methos is called by con process? |
|
1000 | - * @return false|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) |
|
1001 | - */ |
|
995 | + * Validate back link |
|
996 | + * |
|
997 | + * @param string $remote_url Page URL contains the backlink |
|
998 | + * @param bool $optional Link back is optional in this category? |
|
999 | + * @param bool $cron This methos is called by con process? |
|
1000 | + * @return false|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) |
|
1001 | + */ |
|
1002 | 1002 | public function validate_link_back($remote_url, $optional, $cron = false) |
1003 | 1003 | { |
1004 | 1004 | if (!$cron) |
@@ -1038,14 +1038,14 @@ discard block |
||
1038 | 1038 | } |
1039 | 1039 | |
1040 | 1040 | /** |
1041 | - * Check, for website with backlink specified, if backlink is always here. |
|
1042 | - * After $nb_check verification, website is deleted, otherwise, a notification is send to poster |
|
1043 | - * |
|
1044 | - * @param int $cat_id The categoryID |
|
1045 | - * @param int $nb_check Number of check before demete a website |
|
1046 | - * @param int $next_prune Date of next auto check |
|
1047 | - * @return null |
|
1048 | - */ |
|
1041 | + * Check, for website with backlink specified, if backlink is always here. |
|
1042 | + * After $nb_check verification, website is deleted, otherwise, a notification is send to poster |
|
1043 | + * |
|
1044 | + * @param int $cat_id The categoryID |
|
1045 | + * @param int $nb_check Number of check before demete a website |
|
1046 | + * @param int $next_prune Date of next auto check |
|
1047 | + * @return null |
|
1048 | + */ |
|
1049 | 1049 | private function _check($cat_id, $nb_check, $next_prune) |
1050 | 1050 | { |
1051 | 1051 | $del_array = $update_array = array(); |
@@ -1093,11 +1093,11 @@ discard block |
||
1093 | 1093 | } |
1094 | 1094 | |
1095 | 1095 | /** |
1096 | - * Method called by cron task. |
|
1097 | - * |
|
1098 | - * @param array $cat_data Information about category, from db |
|
1099 | - * @return null |
|
1100 | - */ |
|
1096 | + * Method called by cron task. |
|
1097 | + * |
|
1098 | + * @param array $cat_data Information about category, from db |
|
1099 | + * @return null |
|
1100 | + */ |
|
1101 | 1101 | public function auto_check($cat_data) |
1102 | 1102 | { |
1103 | 1103 | global $phpbb_log; |
@@ -1127,12 +1127,12 @@ discard block |
||
1127 | 1127 | } |
1128 | 1128 | |
1129 | 1129 | /** |
1130 | - * Update website verification number after a missing backlink, and send notificaton |
|
1131 | - * |
|
1132 | - * @param array $u_array Information about website |
|
1133 | - * @param int $next_prune Date of next auto check |
|
1134 | - * @return null |
|
1135 | - */ |
|
1130 | + * Update website verification number after a missing backlink, and send notificaton |
|
1131 | + * |
|
1132 | + * @param array $u_array Information about website |
|
1133 | + * @param int $next_prune Date of next auto check |
|
1134 | + * @return null |
|
1135 | + */ |
|
1136 | 1136 | private function _update_check($u_array, $next_prune) |
1137 | 1137 | { |
1138 | 1138 | if (!class_exists('messenger')) |
@@ -62,17 +62,17 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\notification\manager $notification, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext) |
64 | 64 | { |
65 | - $this->db = $db; |
|
65 | + $this->db = $db; |
|
66 | 66 | $this->config = $config; |
67 | - $this->template = $template; |
|
67 | + $this->template = $template; |
|
68 | 68 | $this->user = $user; |
69 | 69 | $this->helper = $helper; |
70 | - $this->request = $request; |
|
70 | + $this->request = $request; |
|
71 | 71 | $this->auth = $auth; |
72 | - $this->notification = $notification; |
|
73 | - $this->dir_helper = $dir_helper; |
|
74 | - $this->root_path = $root_path; |
|
75 | - $this->php_ext = $php_ext; |
|
72 | + $this->notification = $notification; |
|
73 | + $this->dir_helper = $dir_helper; |
|
74 | + $this->root_path = $root_path; |
|
75 | + $this->php_ext = $php_ext; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -223,11 +223,11 @@ discard block |
||
223 | 223 | |
224 | 224 | foreach ($link_datas_ary as $table => $field) |
225 | 225 | { |
226 | - $this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $url_array)); |
|
226 | + $this->db->sql_query("DELETE FROM $table WHERE " . $this->db->sql_in_set($field, $url_array)); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
230 | - SET cat_links = cat_links - '.sizeof($url_array).' |
|
230 | + SET cat_links = cat_links - '.sizeof($url_array) . ' |
|
231 | 231 | WHERE cat_id = ' . (int) $cat_id; |
232 | 232 | $this->db->sql_query($sql); |
233 | 233 | |
@@ -311,8 +311,8 @@ discard block |
||
311 | 311 | |
312 | 312 | if ($sock = @fsockopen($details['host'], $details['port'], $errno, $errstr, 1)) |
313 | 313 | { |
314 | - $requete = 'GET '.$details['path']." HTTP/1.1\r\n"; |
|
315 | - $requete .= 'Host: '.$details['host']."\r\n\r\n"; |
|
314 | + $requete = 'GET ' . $details['path'] . " HTTP/1.1\r\n"; |
|
315 | + $requete .= 'Host: ' . $details['host'] . "\r\n\r\n"; |
|
316 | 316 | |
317 | 317 | // Send a HTTP GET header |
318 | 318 | fputs($sock, $requete); |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | global $phpbb_extension_manager; |
360 | 360 | |
361 | 361 | $ext_path = $phpbb_extension_manager->get_extension_path('ernadoo/phpbbdirectory', false); |
362 | - $flag_path = $ext_path.'images/flags/'; |
|
362 | + $flag_path = $ext_path . 'images/flags/'; |
|
363 | 363 | $img_flag = 'no_flag.png'; |
364 | 364 | |
365 | 365 | if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path . $data['link_flag'])) |
@@ -477,12 +477,12 @@ discard block |
||
477 | 477 | $pagerank = (int) $data['link_pagerank']; |
478 | 478 | } |
479 | 479 | |
480 | - $prpos=40*$pagerank/10; |
|
481 | - $prneg=40-$prpos; |
|
482 | - $html='<img src="http://www.google.com/images/pos.gif" width="'.$prpos.'" height="4" alt="'.$pagerank.'" /><img src="http://www.google.com/images/neg.gif" width="'.$prneg.'" height="4" alt="'.$pagerank.'" /> '; |
|
480 | + $prpos = 40 * $pagerank / 10; |
|
481 | + $prneg = 40 - $prpos; |
|
482 | + $html = '<img src="http://www.google.com/images/pos.gif" width="' . $prpos . '" height="4" alt="' . $pagerank . '" /><img src="http://www.google.com/images/neg.gif" width="' . $prneg . '" height="4" alt="' . $pagerank . '" /> '; |
|
483 | 483 | |
484 | 484 | $pagerank = $pagerank == '-1' ? $this->user->lang['DIR_PAGERANK_NOT_AVAILABLE'] : $this->user->lang('DIR_FROM_TEN', $pagerank); |
485 | - return $html.$pagerank; |
|
485 | + return $html . $pagerank; |
|
486 | 486 | } |
487 | 487 | return false; |
488 | 488 | } |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | $height /= $coef_max; |
520 | 520 | } |
521 | 521 | |
522 | - $s_banner = '<img src="' . $img_src . '" width="' . $width . '" height="' . $height . '" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />'; |
|
522 | + $s_banner = '<img src="' . $img_src . '" width="' . $width . '" height="' . $height . '" alt="' . $data['link_name'] . '" title="' . $data['link_name'] . '" />'; |
|
523 | 523 | } |
524 | 524 | |
525 | 525 | return $s_banner; |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | |
555 | 555 | if ($this->request->is_ajax()) |
556 | 556 | { |
557 | - $sql= 'SELECT link_vote, link_note FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int) $link_id; |
|
557 | + $sql = 'SELECT link_vote, link_note FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int) $link_id; |
|
558 | 558 | $result = $this->db->sql_query($sql); |
559 | 559 | $data = $this->db->sql_fetchrow($result); |
560 | 560 | |
@@ -583,19 +583,19 @@ discard block |
||
583 | 583 | { |
584 | 584 | if (!$this->config['dir_activ_thumb']) |
585 | 585 | { |
586 | - return $this->root_path.'images/directory/nothumb.gif'; |
|
586 | + return $this->root_path . 'images/directory/nothumb.gif'; |
|
587 | 587 | } |
588 | 588 | |
589 | 589 | $details = parse_url($url); |
590 | 590 | |
591 | - $root_url = $details['scheme'].'://'.$details['host']; |
|
592 | - $absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url; |
|
591 | + $root_url = $details['scheme'] . '://' . $details['host']; |
|
592 | + $absolute_url = isset($details['path']) ? $root_url . $details['path'] : $root_url; |
|
593 | 593 | |
594 | 594 | if ($this->config['dir_activ_thumb_remote'] && $this->_ascreen_exist($details['scheme'], $details['host'])) |
595 | 595 | { |
596 | - return $root_url.'/ascreen.jpg'; |
|
596 | + return $root_url . '/ascreen.jpg'; |
|
597 | 597 | } |
598 | - return $this->config['dir_thumb_service'].$absolute_url; |
|
598 | + return $this->config['dir_thumb_service'] . $absolute_url; |
|
599 | 599 | } |
600 | 600 | |
601 | 601 | /** |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | */ |
608 | 608 | private function _ascreen_exist($protocol, $host) |
609 | 609 | { |
610 | - if ($thumb_info = @getimagesize($protocol.'://'.$host.'/ascreen.jpg')) |
|
610 | + if ($thumb_info = @getimagesize($protocol . '://' . $host . '/ascreen.jpg')) |
|
611 | 611 | { |
612 | 612 | // Obviously this is an image, we did some additional tests |
613 | 613 | if ($thumb_info[0] == '120' && $thumb_info[1] == '90' && $thumb_info['mime'] == 'image/jpeg') |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | return false; |
694 | 694 | } |
695 | 695 | |
696 | - return $prefix .strtolower($file->uploadname); |
|
696 | + return $prefix . strtolower($file->uploadname); |
|
697 | 697 | } |
698 | 698 | |
699 | 699 | /** |
@@ -738,8 +738,8 @@ discard block |
||
738 | 738 | include($this->root_path . 'includes/functions_upload.' . $this->php_ext); |
739 | 739 | } |
740 | 740 | |
741 | - $types = \fileupload::image_types(); |
|
742 | - $extension = strtolower(\filespec::get_extension($banner)); |
|
741 | + $types = \fileupload::image_types(); |
|
742 | + $extension = strtolower(\filespec::get_extension($banner)); |
|
743 | 743 | |
744 | 744 | // Check if this is actually an image |
745 | 745 | if ($file_stream = @fopen($banner, 'r')) |
@@ -841,14 +841,14 @@ discard block |
||
841 | 841 | */ |
842 | 842 | public function pagerank_process($q) |
843 | 843 | { |
844 | - $googleDomains = array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch'); |
|
845 | - $seed = $this->user->lang['SEED']; |
|
846 | - $result = 0x01020345; |
|
844 | + $googleDomains = array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch'); |
|
845 | + $seed = $this->user->lang['SEED']; |
|
846 | + $result = 0x01020345; |
|
847 | 847 | $len = strlen($q); |
848 | 848 | |
849 | - for ($i=0; $i<$len; $i++) |
|
849 | + for ($i = 0; $i < $len; $i++) |
|
850 | 850 | { |
851 | - $result ^= ord($seed{$i%strlen($seed)}) ^ ord($q{$i}); |
|
851 | + $result ^= ord($seed{$i % strlen($seed)}) ^ ord($q{$i}); |
|
852 | 852 | $result = (($result >> 23) & 0x1ff) | $result << 9; |
853 | 853 | } |
854 | 854 | |
@@ -859,10 +859,10 @@ discard block |
||
859 | 859 | |
860 | 860 | $ch = sprintf('8%x', $result); |
861 | 861 | $url = 'http://%s/tbr?client=navclient-auto&ch=%s&features=Rank&q=info:%s'; |
862 | - $host = 'toolbarqueries.google'.$googleDomains[mt_rand(0,count($googleDomains)-1)]; |
|
862 | + $host = 'toolbarqueries.google' . $googleDomains[mt_rand(0, count($googleDomains) - 1)]; |
|
863 | 863 | |
864 | - $url = sprintf($url,$host,$ch,$q); |
|
865 | - @$pr = trim(file_get_contents($url,false)); |
|
864 | + $url = sprintf($url, $host, $ch, $q); |
|
865 | + @$pr = trim(file_get_contents($url, false)); |
|
866 | 866 | |
867 | 867 | if (is_numeric(substr(strrchr($pr, ':'), 1))) |
868 | 868 | { |
@@ -900,9 +900,9 @@ discard block |
||
900 | 900 | |
901 | 901 | foreach ($flags as $file => $name) |
902 | 902 | { |
903 | - $img_file = strtolower(substr(strrchr($file, '_'), 1)).'.png'; |
|
903 | + $img_file = strtolower(substr(strrchr($file, '_'), 1)) . '.png'; |
|
904 | 904 | |
905 | - if (file_exists($flag_path.$img_file)) |
|
905 | + if (file_exists($flag_path . $img_file)) |
|
906 | 906 | { |
907 | 907 | $list .= '<option value="' . $img_file . '" ' . (($img_file == $value) ? 'selected="selected"' : '') . '>' . $name . '</option>'; |
908 | 908 | } |
@@ -920,8 +920,8 @@ discard block |
||
920 | 920 | { |
921 | 921 | if ($this->config['dir_recent_block']) |
922 | 922 | { |
923 | - $limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns']; |
|
924 | - $exclude_array = explode(',', str_replace(' ', '', $this->config['dir_recent_exclude'])); |
|
923 | + $limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns']; |
|
924 | + $exclude_array = explode(',', str_replace(' ', '', $this->config['dir_recent_exclude'])); |
|
925 | 925 | |
926 | 926 | $sql_array = array( |
927 | 927 | 'SELECT' => 'l.link_id, l.link_cat, l.link_url, l.link_user_id, l.link_comment, l. link_description, l.link_vote, l.link_note, l.link_view, l.link_time, l.link_name, l.link_thumb, u.user_id, u.username, u.user_colour, c.cat_name', |
@@ -937,7 +937,7 @@ discard block |
||
937 | 937 | 'ON' => 'l.link_cat = c.cat_id' |
938 | 938 | ) |
939 | 939 | ), |
940 | - 'WHERE' => $this->db->sql_in_set('l.link_cat', $exclude_array, true).' AND l.link_active = 1', |
|
940 | + 'WHERE' => $this->db->sql_in_set('l.link_cat', $exclude_array, true) . ' AND l.link_active = 1', |
|
941 | 941 | 'ORDER_BY' => 'l.link_time DESC, l.link_id DESC'); |
942 | 942 | |
943 | 943 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | } |
966 | 966 | |
967 | 967 | $this->template->assign_block_vars('block.row.col', array( |
968 | - 'UC_THUMBNAIL' => '<a href="'.$row['link_url'].'" onclick="window.open(\''.$this->helper->route('ernadoo_phpbbdirectory_view_controller', array('link_id' => (int) $row['link_id'])).'\'); return false;"><img src="'.$row['link_thumb'].'" title="'.$row['link_name'].'" alt="'.$row['link_name'].'" /></a>', |
|
968 | + 'UC_THUMBNAIL' => '<a href="' . $row['link_url'] . '" onclick="window.open(\'' . $this->helper->route('ernadoo_phpbbdirectory_view_controller', array('link_id' => (int) $row['link_id'])) . '\'); return false;"><img src="' . $row['link_thumb'] . '" title="' . $row['link_name'] . '" alt="' . $row['link_name'] . '" /></a>', |
|
969 | 969 | 'NAME' => $row['link_name'], |
970 | 970 | 'USER' => get_username_string('full', $row['link_user_id'], $row['username'], $row['user_colour']), |
971 | 971 | 'TIME' => ($row['link_time']) ? $this->user->format_date($row['link_time']) : '', |
@@ -1060,7 +1060,7 @@ discard block |
||
1060 | 1060 | 'ON' => 'l.link_user_id = u.user_id' |
1061 | 1061 | ) |
1062 | 1062 | ), |
1063 | - 'WHERE' => 'l.link_back <> "" AND l.link_active = 1 AND l.link_cat = ' . (int) $cat_id); |
|
1063 | + 'WHERE' => 'l.link_back <> "" AND l.link_active = 1 AND l.link_cat = ' . (int) $cat_id); |
|
1064 | 1064 | |
1065 | 1065 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
1066 | 1066 | $result = $this->db->sql_query($sql); |
@@ -1069,7 +1069,7 @@ discard block |
||
1069 | 1069 | { |
1070 | 1070 | if ($this->validate_link_back($row['link_back'], false, true) !== false) |
1071 | 1071 | { |
1072 | - if (!$nb_check || ($row['link_nb_check']+1) >= $nb_check) |
|
1072 | + if (!$nb_check || ($row['link_nb_check'] + 1) >= $nb_check) |
|
1073 | 1073 | { |
1074 | 1074 | $del_array[] = $row['link_id']; |
1075 | 1075 | } |
@@ -13,11 +13,11 @@ |
||
13 | 13 | class nestedset_category extends \phpbb\tree\nestedset |
14 | 14 | { |
15 | 15 | /** |
16 | - * Construct |
|
17 | - * |
|
18 | - * @param \phpbb\db\driver\driver_interface $db Database connection |
|
19 | - * @param \phpbb\lock\db $lock Lock class used to lock the table when moving forums around |
|
20 | - */ |
|
16 | + * Construct |
|
17 | + * |
|
18 | + * @param \phpbb\db\driver\driver_interface $db Database connection |
|
19 | + * @param \phpbb\lock\db $lock Lock class used to lock the table when moving forums around |
|
20 | + */ |
|
21 | 21 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\lock\db $lock) |
22 | 22 | { |
23 | 23 | parent::__construct( |
@@ -39,17 +39,17 @@ discard block |
||
39 | 39 | protected $php_ext; |
40 | 40 | |
41 | 41 | /** |
42 | - * Constructor |
|
43 | - * |
|
44 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
45 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
46 | - * @param \phpbb\template\template $template Template object |
|
47 | - * @param \phpbb\user $user User object |
|
48 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
49 | - * @param string $table_prefix prefix table |
|
50 | - * @param string $php_ext phpEx |
|
51 | - * @access public |
|
52 | - */ |
|
42 | + * Constructor |
|
43 | + * |
|
44 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
45 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
46 | + * @param \phpbb\template\template $template Template object |
|
47 | + * @param \phpbb\user $user User object |
|
48 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
49 | + * @param string $table_prefix prefix table |
|
50 | + * @param string $php_ext phpEx |
|
51 | + * @access public |
|
52 | + */ |
|
53 | 53 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\helper $dir_helper, $table_prefix, $php_ext) |
54 | 54 | { |
55 | 55 | $this->db = $db; |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
65 | - * Assign functions defined in this class to event listeners in the core |
|
66 | - * |
|
67 | - * @return array |
|
68 | - * @static |
|
69 | - * @access public |
|
70 | - */ |
|
65 | + * Assign functions defined in this class to event listeners in the core |
|
66 | + * |
|
67 | + * @return array |
|
68 | + * @static |
|
69 | + * @access public |
|
70 | + */ |
|
71 | 71 | static public function getSubscribedEvents() |
72 | 72 | { |
73 | 73 | return array( |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
84 | - * Define table constants |
|
85 | - * |
|
86 | - * @return null |
|
87 | - */ |
|
84 | + * Define table constants |
|
85 | + * |
|
86 | + * @return null |
|
87 | + */ |
|
88 | 88 | public function set_constants_tables() |
89 | 89 | { |
90 | 90 | define('DIR_CAT_TABLE', $this->table_prefix.'directory_cats'); |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
98 | - * Display links to Directory |
|
99 | - * |
|
100 | - * @return null |
|
101 | - */ |
|
98 | + * Display links to Directory |
|
99 | + * |
|
100 | + * @return null |
|
101 | + */ |
|
102 | 102 | public function add_page_header_variables() |
103 | 103 | { |
104 | 104 | $ext_theme_path = $this->dir_helper->get_ext_name() . '/styles/prosilver/theme/'; |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
121 | - * Show users as viewing Directory on Who Is Online page |
|
122 | - * |
|
123 | - * @param object $event The event object |
|
124 | - * @return null |
|
125 | - */ |
|
121 | + * Show users as viewing Directory on Who Is Online page |
|
122 | + * |
|
123 | + * @param object $event The event object |
|
124 | + * @return null |
|
125 | + */ |
|
126 | 126 | public function add_page_viewonline($event) |
127 | 127 | { |
128 | 128 | if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/directory') === 0) |
@@ -133,11 +133,11 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
136 | - * Load common language files during user setup |
|
137 | - * |
|
138 | - * @param object $event The event object |
|
139 | - * @return null |
|
140 | - */ |
|
136 | + * Load common language files during user setup |
|
137 | + * |
|
138 | + * @param object $event The event object |
|
139 | + * @return null |
|
140 | + */ |
|
141 | 141 | public function load_language_on_setup($event) |
142 | 142 | { |
143 | 143 | $lang_set_ext = $event['lang_set_ext']; |
@@ -149,11 +149,11 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
152 | - * Add administrative permissions to manage Directory |
|
153 | - * |
|
154 | - * @param object $event The event object |
|
155 | - * @return null |
|
156 | - */ |
|
152 | + * Add administrative permissions to manage Directory |
|
153 | + * |
|
154 | + * @param object $event The event object |
|
155 | + * @return null |
|
156 | + */ |
|
157 | 157 | public function permissions_add_directory($event) |
158 | 158 | { |
159 | 159 | $categories = $event['categories']; |
@@ -182,11 +182,11 @@ discard block |
||
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
185 | - * Update Directory tables if needed, after deleted an user |
|
186 | - * |
|
187 | - * @param object $event The event object |
|
188 | - * @return null |
|
189 | - */ |
|
185 | + * Update Directory tables if needed, after deleted an user |
|
186 | + * |
|
187 | + * @param object $event The event object |
|
188 | + * @return null |
|
189 | + */ |
|
190 | 190 | public function update_links_with_anonymous($event) |
191 | 191 | { |
192 | 192 | $user_ids = $event['user_ids']; |
@@ -52,13 +52,13 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\helper $dir_helper, $table_prefix, $php_ext) |
54 | 54 | { |
55 | - $this->db = $db; |
|
56 | - $this->helper = $helper; |
|
57 | - $this->template = $template; |
|
58 | - $this->user = $user; |
|
59 | - $this->dir_helper = $dir_helper; |
|
55 | + $this->db = $db; |
|
56 | + $this->helper = $helper; |
|
57 | + $this->template = $template; |
|
58 | + $this->user = $user; |
|
59 | + $this->dir_helper = $dir_helper; |
|
60 | 60 | $this->table_prefix = $table_prefix; |
61 | - $this->php_ext = $php_ext; |
|
61 | + $this->php_ext = $php_ext; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function set_constants_tables() |
89 | 89 | { |
90 | - define('DIR_CAT_TABLE', $this->table_prefix.'directory_cats'); |
|
91 | - define('DIR_COMMENT_TABLE', $this->table_prefix.'directory_comments'); |
|
92 | - define('DIR_LINK_TABLE', $this->table_prefix.'directory_links'); |
|
93 | - define('DIR_VOTE_TABLE', $this->table_prefix.'directory_votes'); |
|
94 | - define('DIR_WATCH_TABLE', $this->table_prefix.'directory_watch'); |
|
90 | + define('DIR_CAT_TABLE', $this->table_prefix . 'directory_cats'); |
|
91 | + define('DIR_COMMENT_TABLE', $this->table_prefix . 'directory_comments'); |
|
92 | + define('DIR_LINK_TABLE', $this->table_prefix . 'directory_links'); |
|
93 | + define('DIR_VOTE_TABLE', $this->table_prefix . 'directory_votes'); |
|
94 | + define('DIR_WATCH_TABLE', $this->table_prefix . 'directory_watch'); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | { |
128 | 128 | if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/directory') === 0) |
129 | 129 | { |
130 | - $event['location'] = $this->user->lang['DIRECTORY']; |
|
131 | - $event['location_url'] = $this->helper->route('ernadoo_phpbbdirectory_base_controller'); |
|
130 | + $event['location'] = $this->user->lang['DIRECTORY']; |
|
131 | + $event['location_url'] = $this->helper->route('ernadoo_phpbbdirectory_base_controller'); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | |
@@ -158,24 +158,24 @@ discard block |
||
158 | 158 | { |
159 | 159 | $categories = $event['categories']; |
160 | 160 | $categories = array_merge($categories, array('dir' => 'ACL_CAT_DIRECTORY')); |
161 | - $event['categories'] = $categories; |
|
161 | + $event['categories'] = $categories; |
|
162 | 162 | |
163 | 163 | $permissions = $event['permissions']; |
164 | 164 | |
165 | 165 | $permissions = array_merge($permissions, array( |
166 | - 'm_delete_dir' => array('lang' => 'ACL_M_DELETE_DIR', 'cat' => 'dir'), |
|
167 | - 'm_delete_comment_dir' => array('lang' => 'ACL_M_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
168 | - 'm_edit_dir' => array('lang' => 'ACL_M_EDIT_DIR', 'cat' => 'dir'), |
|
169 | - 'm_edit_comment_dir' => array('lang' => 'ACL_M_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
170 | - |
|
171 | - 'u_comment_dir' => array('lang' => 'ACL_U_COMMENT_DIR', 'cat' => 'dir'), |
|
172 | - 'u_delete_dir' => array('lang' => 'ACL_U_DELETE_DIR', 'cat' => 'dir'), |
|
173 | - 'u_delete_comment_dir' => array('lang' => 'ACL_U_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
174 | - 'u_edit_dir' => array('lang' => 'ACL_U_EDIT_DIR', 'cat' => 'dir'), |
|
175 | - 'u_edit_comment_dir' => array('lang' => 'ACL_U_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
176 | - 'u_search_dir' => array('lang' => 'ACL_U_SEARCH_DIR', 'cat' => 'dir'), |
|
177 | - 'u_submit_dir' => array('lang' => 'ACL_U_SUBMIT_DIR', 'cat' => 'dir'), |
|
178 | - 'u_vote_dir' => array('lang' => 'ACL_U_VOTE_DIR', 'cat' => 'dir'), |
|
166 | + 'm_delete_dir' => array('lang' => 'ACL_M_DELETE_DIR', 'cat' => 'dir'), |
|
167 | + 'm_delete_comment_dir' => array('lang' => 'ACL_M_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
168 | + 'm_edit_dir' => array('lang' => 'ACL_M_EDIT_DIR', 'cat' => 'dir'), |
|
169 | + 'm_edit_comment_dir' => array('lang' => 'ACL_M_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
170 | + |
|
171 | + 'u_comment_dir' => array('lang' => 'ACL_U_COMMENT_DIR', 'cat' => 'dir'), |
|
172 | + 'u_delete_dir' => array('lang' => 'ACL_U_DELETE_DIR', 'cat' => 'dir'), |
|
173 | + 'u_delete_comment_dir' => array('lang' => 'ACL_U_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
174 | + 'u_edit_dir' => array('lang' => 'ACL_U_EDIT_DIR', 'cat' => 'dir'), |
|
175 | + 'u_edit_comment_dir' => array('lang' => 'ACL_U_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
176 | + 'u_search_dir' => array('lang' => 'ACL_U_SEARCH_DIR', 'cat' => 'dir'), |
|
177 | + 'u_submit_dir' => array('lang' => 'ACL_U_SUBMIT_DIR', 'cat' => 'dir'), |
|
178 | + 'u_vote_dir' => array('lang' => 'ACL_U_VOTE_DIR', 'cat' => 'dir'), |
|
179 | 179 | )); |
180 | 180 | |
181 | 181 | $event['permissions'] = $permissions; |