@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | protected $language; |
23 | 23 | |
24 | 24 | /** |
25 | - * Constructor |
|
26 | - * |
|
27 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
28 | - * @param \phpbb\language\language $language Language object |
|
29 | - */ |
|
25 | + * Constructor |
|
26 | + * |
|
27 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
28 | + * @param \phpbb\language\language $language Language object |
|
29 | + */ |
|
30 | 30 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language) |
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,8 +29,8 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language) |
31 | 31 | { |
32 | - $this->db = $db; |
|
33 | - $this->language = $language; |
|
32 | + $this->db = $db; |
|
33 | + $this->language = $language; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | { |
44 | 44 | $this->db->sql_transaction('begin'); |
45 | 45 | |
46 | - $sql = 'INSERT INTO ' . DIR_COMMENT_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
46 | + $sql = 'INSERT INTO '.DIR_COMMENT_TABLE.' '.$this->db->sql_build_array('INSERT', $data); |
|
47 | 47 | $this->db->sql_query($sql); |
48 | 48 | |
49 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
49 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
50 | 50 | SET link_comment = link_comment + 1 |
51 | 51 | WHERE link_id = ' . (int) $data['comment_link_id']; |
52 | 52 | $this->db->sql_query($sql); |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function edit($data, $comment_id) |
65 | 65 | { |
66 | - $sql = 'UPDATE ' . DIR_COMMENT_TABLE . ' |
|
67 | - SET ' . $this->db->sql_build_array('UPDATE', $data) . ' |
|
66 | + $sql = 'UPDATE '.DIR_COMMENT_TABLE.' |
|
67 | + SET ' . $this->db->sql_build_array('UPDATE', $data).' |
|
68 | 68 | WHERE comment_id = ' . (int) $comment_id; |
69 | 69 | $this->db->sql_query($sql); |
70 | 70 | } |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | |
83 | 83 | $this->db->sql_transaction('begin'); |
84 | 84 | |
85 | - $sql = 'DELETE FROM ' . DIR_COMMENT_TABLE . ' WHERE comment_id = ' . (int) $comment_id; |
|
85 | + $sql = 'DELETE FROM '.DIR_COMMENT_TABLE.' WHERE comment_id = '.(int) $comment_id; |
|
86 | 86 | $this->db->sql_query($sql); |
87 | 87 | |
88 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
88 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
89 | 89 | SET link_comment = link_comment - 1 |
90 | 90 | WHERE link_id = ' . (int) $link_id; |
91 | 91 | $this->db->sql_query($sql); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | if ($request->is_ajax()) |
96 | 96 | { |
97 | 97 | $sql = 'SELECT COUNT(comment_id) AS nb_comments |
98 | - FROM ' . DIR_COMMENT_TABLE . ' |
|
98 | + FROM ' . DIR_COMMENT_TABLE.' |
|
99 | 99 | WHERE comment_link_id = ' . (int) $link_id; |
100 | 100 | $result = $this->db->sql_query($sql); |
101 | 101 | $nb_comments = (int) $this->db->sql_fetchfield('nb_comments'); |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | private $ext_name = 'ernadoo/phpbbdirectory'; |
23 | 23 | |
24 | 24 | /** |
25 | - * Constructor |
|
26 | - * |
|
27 | - * @param \phpbb\extension\manager $phpbb_extension_manager Extension manager helper |
|
28 | - * @param \phpbb\path_helper $path_helper Controller path helper object |
|
29 | - */ |
|
25 | + * Constructor |
|
26 | + * |
|
27 | + * @param \phpbb\extension\manager $phpbb_extension_manager Extension manager helper |
|
28 | + * @param \phpbb\path_helper $path_helper Controller path helper object |
|
29 | + */ |
|
30 | 30 | public function __construct(\phpbb\extension\manager $phpbb_extension_manager, \phpbb\path_helper $path_helper) |
31 | 31 | { |
32 | 32 | $this->extension_manager = $phpbb_extension_manager; |
@@ -34,48 +34,48 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | - * Return ext name |
|
38 | - * |
|
39 | - * @param bool $web_root_path Whether the path should be relative to web root |
|
40 | - * @return string Path to an extension |
|
41 | - */ |
|
37 | + * Return ext name |
|
38 | + * |
|
39 | + * @param bool $web_root_path Whether the path should be relative to web root |
|
40 | + * @return string Path to an extension |
|
41 | + */ |
|
42 | 42 | public function get_ext_name($web_root_path = false) |
43 | 43 | { |
44 | 44 | return (($web_root_path) ? $this->path_helper->get_web_root_path() : '') . $this->extension_manager->get_extension_path($this->ext_name); |
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
48 | - * Return path to resource image |
|
49 | - * |
|
50 | - * @param string $type is ressource type (flags|icons) |
|
51 | - * @param string $image is the resource to display |
|
52 | - * @return string The relative path to ressource |
|
53 | - */ |
|
48 | + * Return path to resource image |
|
49 | + * |
|
50 | + * @param string $type is ressource type (flags|icons) |
|
51 | + * @param string $image is the resource to display |
|
52 | + * @return string The relative path to ressource |
|
53 | + */ |
|
54 | 54 | public function get_img_path($type, $image = '') |
55 | 55 | { |
56 | 56 | return $this->get_ext_name(true) . 'images/' . $type . '/' . $image; |
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | - * Return path to banner |
|
61 | - * |
|
62 | - * @param string $banner is the physical name |
|
63 | - * @return string The relative path to banner |
|
64 | - */ |
|
60 | + * Return path to banner |
|
61 | + * |
|
62 | + * @param string $banner is the physical name |
|
63 | + * @return string The relative path to banner |
|
64 | + */ |
|
65 | 65 | public function get_banner_path($banner = '') |
66 | 66 | { |
67 | 67 | return 'files/' . $this->get_ext_name() . 'banners/' . $banner; |
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * Return array entries that match the pattern |
|
72 | - * |
|
73 | - * @link http://php.net/manual/fr/function.preg-grep.php#95787 |
|
74 | - * |
|
75 | - * @param string $pattern The pattern to search for |
|
76 | - * @param array $input The input array |
|
77 | - * @return array $vals Returns an array indexed using the keys from the input array |
|
78 | - */ |
|
71 | + * Return array entries that match the pattern |
|
72 | + * |
|
73 | + * @link http://php.net/manual/fr/function.preg-grep.php#95787 |
|
74 | + * |
|
75 | + * @param string $pattern The pattern to search for |
|
76 | + * @param array $input The input array |
|
77 | + * @return array $vals Returns an array indexed using the keys from the input array |
|
78 | + */ |
|
79 | 79 | public function preg_grep_keys($pattern, $input) |
80 | 80 | { |
81 | 81 | $keys = preg_grep($pattern, array_keys($input)); |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function __construct(\phpbb\extension\manager $phpbb_extension_manager, \phpbb\path_helper $path_helper) |
31 | 31 | { |
32 | - $this->extension_manager = $phpbb_extension_manager; |
|
33 | - $this->path_helper = $path_helper; |
|
32 | + $this->extension_manager = $phpbb_extension_manager; |
|
33 | + $this->path_helper = $path_helper; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function get_ext_name($web_root_path = false) |
43 | 43 | { |
44 | - return (($web_root_path) ? $this->path_helper->get_web_root_path() : '') . $this->extension_manager->get_extension_path($this->ext_name); |
|
44 | + return (($web_root_path) ? $this->path_helper->get_web_root_path() : '').$this->extension_manager->get_extension_path($this->ext_name); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function get_img_path($type, $image = '') |
55 | 55 | { |
56 | - return $this->get_ext_name(true) . 'images/' . $type . '/' . $image; |
|
56 | + return $this->get_ext_name(true).'images/'.$type.'/'.$image; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function get_banner_path($banner = '') |
66 | 66 | { |
67 | - return 'files/' . $this->get_ext_name() . 'banners/' . $banner; |
|
67 | + return 'files/'.$this->get_ext_name().'banners/'.$banner; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -58,24 +58,24 @@ discard block |
||
58 | 58 | protected $php_ext; |
59 | 59 | |
60 | 60 | /** |
61 | - * Constructor |
|
62 | - * |
|
63 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
64 | - * @param \phpbb\config\config $config Config object |
|
65 | - * @param \phpbb\language\language $language Language object |
|
66 | - * @param \phpbb\template\template $template Template object |
|
67 | - * @param \phpbb\user $user User object |
|
68 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
69 | - * @param \phpbb\request\request $request Request object |
|
70 | - * @param \phpbb\auth\auth $auth Auth object |
|
71 | - * @param \phpbb\notification\manager $notification Notification object |
|
72 | - * @param \phpbb\filesystem\filesystem_interface $filesystem phpBB filesystem helper |
|
73 | - * @param \FastImageSize\FastImageSize $imagesize FastImageSize class |
|
74 | - * @param \phpbb\files\factory $files_factory File classes factory |
|
75 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
76 | - * @param string $root_path phpBB root path |
|
77 | - * @param string $php_ext phpEx |
|
78 | - */ |
|
61 | + * Constructor |
|
62 | + * |
|
63 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
64 | + * @param \phpbb\config\config $config Config object |
|
65 | + * @param \phpbb\language\language $language Language object |
|
66 | + * @param \phpbb\template\template $template Template object |
|
67 | + * @param \phpbb\user $user User object |
|
68 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
69 | + * @param \phpbb\request\request $request Request object |
|
70 | + * @param \phpbb\auth\auth $auth Auth object |
|
71 | + * @param \phpbb\notification\manager $notification Notification object |
|
72 | + * @param \phpbb\filesystem\filesystem_interface $filesystem phpBB filesystem helper |
|
73 | + * @param \FastImageSize\FastImageSize $imagesize FastImageSize class |
|
74 | + * @param \phpbb\files\factory $files_factory File classes factory |
|
75 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
76 | + * @param string $root_path phpBB root path |
|
77 | + * @param string $php_ext phpEx |
|
78 | + */ |
|
79 | 79 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\notification\manager $notification, \phpbb\filesystem\filesystem_interface $filesystem, \FastImageSize\FastImageSize $imagesize, \phpbb\files\factory $files_factory, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext) |
80 | 80 | { |
81 | 81 | $this->db = $db; |
@@ -96,12 +96,12 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
99 | - * Add a link into db |
|
100 | - * |
|
101 | - * @param array $data Contains all data to insert in db |
|
102 | - * @param bool $need_approval Links needs to be approved? |
|
103 | - * @return null |
|
104 | - */ |
|
99 | + * Add a link into db |
|
100 | + * |
|
101 | + * @param array $data Contains all data to insert in db |
|
102 | + * @param bool $need_approval Links needs to be approved? |
|
103 | + * @return null |
|
104 | + */ |
|
105 | 105 | public function add($data, $need_approval) |
106 | 106 | { |
107 | 107 | $notification_data = array(); |
@@ -146,13 +146,13 @@ discard block |
||
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
149 | - * Edit a link of the db |
|
150 | - * |
|
151 | - * @param array $data Contains all data to edit in db |
|
152 | - * @param int $link_id is link's id, for WHERE clause |
|
153 | - * @param bool $need_approval Links needs to be approved? |
|
154 | - * @return null |
|
155 | - */ |
|
149 | + * Edit a link of the db |
|
150 | + * |
|
151 | + * @param array $data Contains all data to edit in db |
|
152 | + * @param int $link_id is link's id, for WHERE clause |
|
153 | + * @param bool $need_approval Links needs to be approved? |
|
154 | + * @return null |
|
155 | + */ |
|
156 | 156 | public function edit($data, $link_id, $need_approval) |
157 | 157 | { |
158 | 158 | $notification_data = array( |
@@ -204,12 +204,12 @@ discard block |
||
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
207 | - * Delete a link of the db |
|
208 | - * |
|
209 | - * @param int $cat_id The category ID |
|
210 | - * @param mixed $link_id Link's id, for WHERE clause |
|
211 | - * @return null |
|
212 | - */ |
|
207 | + * Delete a link of the db |
|
208 | + * |
|
209 | + * @param int $cat_id The category ID |
|
210 | + * @param mixed $link_id Link's id, for WHERE clause |
|
211 | + * @return null |
|
212 | + */ |
|
213 | 213 | public function del($cat_id, $link_id) |
214 | 214 | { |
215 | 215 | $this->db->sql_transaction('begin'); |
@@ -282,12 +282,12 @@ discard block |
||
282 | 282 | } |
283 | 283 | |
284 | 284 | /** |
285 | - * Increments link view counter |
|
286 | - * |
|
287 | - * @param int $link_id Link's id, for WHERE clause |
|
288 | - * @return null |
|
289 | - * @throws \phpbb\exception\http_exception |
|
290 | - */ |
|
285 | + * Increments link view counter |
|
286 | + * |
|
287 | + * @param int $link_id Link's id, for WHERE clause |
|
288 | + * @return null |
|
289 | + * @throws \phpbb\exception\http_exception |
|
290 | + */ |
|
291 | 291 | public function view($link_id) |
292 | 292 | { |
293 | 293 | $sql = 'SELECT link_id, link_url |
@@ -311,11 +311,11 @@ discard block |
||
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
314 | - * Verify that an URL exist before add into db |
|
315 | - * |
|
316 | - * @param string $url The URL to check |
|
317 | - * @return bool True if url is reachable, else false. |
|
318 | - */ |
|
314 | + * Verify that an URL exist before add into db |
|
315 | + * |
|
316 | + * @param string $url The URL to check |
|
317 | + * @return bool True if url is reachable, else false. |
|
318 | + */ |
|
319 | 319 | public function checkurl($url) |
320 | 320 | { |
321 | 321 | $details = parse_url($url); |
@@ -352,11 +352,11 @@ discard block |
||
352 | 352 | } |
353 | 353 | |
354 | 354 | /** |
355 | - * Delete the final '/', if no path |
|
356 | - * |
|
357 | - * @param string $url URL to clean |
|
358 | - * @return string $url The correct string. |
|
359 | - */ |
|
355 | + * Delete the final '/', if no path |
|
356 | + * |
|
357 | + * @param string $url URL to clean |
|
358 | + * @return string $url The correct string. |
|
359 | + */ |
|
360 | 360 | public function clean_url($url) |
361 | 361 | { |
362 | 362 | $details = parse_url($url); |
@@ -369,11 +369,11 @@ discard block |
||
369 | 369 | } |
370 | 370 | |
371 | 371 | /** |
372 | - * Display a flag |
|
373 | - * |
|
374 | - * @param array $data Link's data from db |
|
375 | - * @return string Flag path. |
|
376 | - */ |
|
372 | + * Display a flag |
|
373 | + * |
|
374 | + * @param array $data Link's data from db |
|
375 | + * @return string Flag path. |
|
376 | + */ |
|
377 | 377 | public function display_flag($data) |
378 | 378 | { |
379 | 379 | global $phpbb_extension_manager; |
@@ -391,13 +391,13 @@ discard block |
||
391 | 391 | } |
392 | 392 | |
393 | 393 | /** |
394 | - * Calculate the link's note |
|
395 | - * |
|
396 | - * @param int $total_note Sum of all link's notes |
|
397 | - * @param int $nb_vote Number of votes |
|
398 | - * @param bool $votes_status Votes are enable in this category? |
|
399 | - * @return string $note The calculated note. |
|
400 | - */ |
|
394 | + * Calculate the link's note |
|
395 | + * |
|
396 | + * @param int $total_note Sum of all link's notes |
|
397 | + * @param int $nb_vote Number of votes |
|
398 | + * @param bool $votes_status Votes are enable in this category? |
|
399 | + * @return string $note The calculated note. |
|
400 | + */ |
|
401 | 401 | public function display_note($total_note, $nb_vote, $votes_status) |
402 | 402 | { |
403 | 403 | if (!$votes_status) |
@@ -412,11 +412,11 @@ discard block |
||
412 | 412 | } |
413 | 413 | |
414 | 414 | /** |
415 | - * Display the vote form for auth users |
|
416 | - * |
|
417 | - * @param array $data Link's data from db |
|
418 | - * @return null|string Html combo list or nothing if votes are not available. |
|
419 | - */ |
|
415 | + * Display the vote form for auth users |
|
416 | + * |
|
417 | + * @param array $data Link's data from db |
|
418 | + * @return null|string Html combo list or nothing if votes are not available. |
|
419 | + */ |
|
420 | 420 | public function display_vote($data) |
421 | 421 | { |
422 | 422 | if ($this->user->data['is_registered'] && $this->auth->acl_get('u_vote_dir') && empty($data['vote_user_id'])) |
@@ -433,11 +433,11 @@ discard block |
||
433 | 433 | } |
434 | 434 | |
435 | 435 | /** |
436 | - * Display the RSS icon |
|
437 | - * |
|
438 | - * @param array $data Link's data from db |
|
439 | - * @return null|string RSS feed URL or nothing. |
|
440 | - */ |
|
436 | + * Display the RSS icon |
|
437 | + * |
|
438 | + * @param array $data Link's data from db |
|
439 | + * @return null|string RSS feed URL or nothing. |
|
440 | + */ |
|
441 | 441 | public function display_rss($data) |
442 | 442 | { |
443 | 443 | if ($this->config['dir_activ_rss'] && !empty($data['link_rss'])) |
@@ -447,13 +447,13 @@ discard block |
||
447 | 447 | } |
448 | 448 | |
449 | 449 | /** |
450 | - * Display link's thumb if thumb service enabled. |
|
451 | - * if thumb don't exists in db or if a new service was choosen in acp |
|
452 | - * thumb is research |
|
453 | - * |
|
454 | - * @param array $data Link's data from db |
|
455 | - * @return string|null Thumb or null. |
|
456 | - */ |
|
450 | + * Display link's thumb if thumb service enabled. |
|
451 | + * if thumb don't exists in db or if a new service was choosen in acp |
|
452 | + * thumb is research |
|
453 | + * |
|
454 | + * @param array $data Link's data from db |
|
455 | + * @return string|null Thumb or null. |
|
456 | + */ |
|
457 | 457 | public function display_thumb($data) |
458 | 458 | { |
459 | 459 | if ($this->config['dir_activ_thumb']) |
@@ -474,11 +474,11 @@ discard block |
||
474 | 474 | } |
475 | 475 | |
476 | 476 | /** |
477 | - * Display and calculate PageRank if needed |
|
478 | - * |
|
479 | - * @param array $data Link's data from db |
|
480 | - * @return string Pagerank, 'n/a' or false |
|
481 | - */ |
|
477 | + * Display and calculate PageRank if needed |
|
478 | + * |
|
479 | + * @param array $data Link's data from db |
|
480 | + * @return string Pagerank, 'n/a' or false |
|
481 | + */ |
|
482 | 482 | public function display_pagerank($data) |
483 | 483 | { |
484 | 484 | if ($this->config['dir_activ_pagerank']) |
@@ -508,11 +508,11 @@ discard block |
||
508 | 508 | } |
509 | 509 | |
510 | 510 | /** |
511 | - * Display and resize a banner |
|
512 | - * |
|
513 | - * @param array $data link's data from db |
|
514 | - * @return string $s_banner html code. |
|
515 | - */ |
|
511 | + * Display and resize a banner |
|
512 | + * |
|
513 | + * @param array $data link's data from db |
|
514 | + * @return string $s_banner html code. |
|
515 | + */ |
|
516 | 516 | public function display_bann($data) |
517 | 517 | { |
518 | 518 | if (!empty($data['link_banner'])) |
@@ -550,11 +550,11 @@ discard block |
||
550 | 550 | } |
551 | 551 | |
552 | 552 | /** |
553 | - * Add a vote in db, for a specifi link |
|
554 | - * |
|
555 | - * @param int $link_id Link_id from db |
|
556 | - * @return null |
|
557 | - */ |
|
553 | + * Add a vote in db, for a specifi link |
|
554 | + * |
|
555 | + * @param int $link_id Link_id from db |
|
556 | + * @return null |
|
557 | + */ |
|
558 | 558 | public function add_vote($link_id) |
559 | 559 | { |
560 | 560 | $data = array( |
@@ -598,11 +598,11 @@ discard block |
||
598 | 598 | } |
599 | 599 | |
600 | 600 | /** |
601 | - * Search an appropriate thumb for url |
|
602 | - * |
|
603 | - * @param string $url Link's url |
|
604 | - * @return string The thumb url |
|
605 | - */ |
|
601 | + * Search an appropriate thumb for url |
|
602 | + * |
|
603 | + * @param string $url Link's url |
|
604 | + * @return string The thumb url |
|
605 | + */ |
|
606 | 606 | public function thumb_process($url) |
607 | 607 | { |
608 | 608 | if (!$this->config['dir_activ_thumb']) |
@@ -623,12 +623,12 @@ discard block |
||
623 | 623 | } |
624 | 624 | |
625 | 625 | /** |
626 | - * Check if ascreen thumb exists |
|
627 | - * |
|
628 | - * @param string $protocol The protocol |
|
629 | - * @param string $host The hostname |
|
630 | - * @return bool True if ascreen file exixts, else false |
|
631 | - */ |
|
626 | + * Check if ascreen thumb exists |
|
627 | + * |
|
628 | + * @param string $protocol The protocol |
|
629 | + * @param string $host The hostname |
|
630 | + * @return bool True if ascreen file exixts, else false |
|
631 | + */ |
|
632 | 632 | private function _ascreen_exist($protocol, $host) |
633 | 633 | { |
634 | 634 | if (($thumb_info = $this->imagesize->getImageSize($protocol.'://'.$host.'/ascreen.jpg')) !== false) |
@@ -643,12 +643,12 @@ discard block |
||
643 | 643 | } |
644 | 644 | |
645 | 645 | /** |
646 | - * Primary work on banner, can edit, copy or check a banner |
|
647 | - * |
|
648 | - * @param string $banner The banner's remote url |
|
649 | - * @param array $error The array error, passed by reference |
|
650 | - * @return null |
|
651 | - */ |
|
646 | + * Primary work on banner, can edit, copy or check a banner |
|
647 | + * |
|
648 | + * @param string $banner The banner's remote url |
|
649 | + * @param array $error The array error, passed by reference |
|
650 | + * @return null |
|
651 | + */ |
|
652 | 652 | public function banner_process(&$banner, &$error) |
653 | 653 | { |
654 | 654 | $old_banner = $this->request->variable('old_banner', ''); |
@@ -684,13 +684,13 @@ discard block |
||
684 | 684 | } |
685 | 685 | |
686 | 686 | /** |
687 | - * Copy a remonte banner to server. |
|
688 | - * called by banner_process() |
|
689 | - * |
|
690 | - * @param string $banner The banner's remote url |
|
691 | - * @param array $error The array error, passed by reference |
|
692 | - * @return false|string String if no errors, else false |
|
693 | - */ |
|
687 | + * Copy a remonte banner to server. |
|
688 | + * called by banner_process() |
|
689 | + * |
|
690 | + * @param string $banner The banner's remote url |
|
691 | + * @param array $error The array error, passed by reference |
|
692 | + * @return false|string String if no errors, else false |
|
693 | + */ |
|
694 | 694 | private function _banner_upload($banner, &$error) |
695 | 695 | { |
696 | 696 | /** @var \phpbb\files\upload $upload */ |
@@ -721,13 +721,13 @@ discard block |
||
721 | 721 | } |
722 | 722 | |
723 | 723 | /** |
724 | - * Check than remote banner exists |
|
725 | - * called by banner_process() |
|
726 | - * |
|
727 | - * @param string $banner The banner's remote url |
|
728 | - * @param array $error The array error, passed by reference |
|
729 | - * @return false|string String if no errors, else false |
|
730 | - */ |
|
724 | + * Check than remote banner exists |
|
725 | + * called by banner_process() |
|
726 | + * |
|
727 | + * @param string $banner The banner's remote url |
|
728 | + * @param array $error The array error, passed by reference |
|
729 | + * @return false|string String if no errors, else false |
|
730 | + */ |
|
731 | 731 | private function _banner_remote($banner, &$error) |
732 | 732 | { |
733 | 733 | if (!preg_match('#^(http|https|ftp)://#i', $banner)) |
@@ -835,11 +835,11 @@ discard block |
||
835 | 835 | } |
836 | 836 | |
837 | 837 | /** |
838 | - * Delete a banner from server |
|
839 | - * |
|
840 | - * @param string $file The file's name |
|
841 | - * @return bool True if delete success, else false |
|
842 | - */ |
|
838 | + * Delete a banner from server |
|
839 | + * |
|
840 | + * @param string $file The file's name |
|
841 | + * @return bool True if delete success, else false |
|
842 | + */ |
|
843 | 843 | private function _banner_delete($file) |
844 | 844 | { |
845 | 845 | if (file_exists($this->dir_helper->get_banner_path($file))) |
@@ -852,18 +852,18 @@ discard block |
||
852 | 852 | } |
853 | 853 | |
854 | 854 | /** |
855 | - * PageRank Lookup (Based on Google Toolbar for Mozilla Firefox) |
|
856 | - * |
|
857 | - * @copyright 2012 HM2K <[email protected]> |
|
858 | - * @link http://pagerank.phurix.net/ |
|
859 | - * @author James Wade <[email protected]> |
|
860 | - * @version $Revision: 2.1 $ |
|
861 | - * @require PHP 4.3.0 (file_get_contents) |
|
862 | - * @updated 06/10/11 |
|
863 | - * |
|
864 | - * @param string $q The website URL |
|
865 | - * @return string The calculated pagerank, or -1 |
|
866 | - */ |
|
855 | + * PageRank Lookup (Based on Google Toolbar for Mozilla Firefox) |
|
856 | + * |
|
857 | + * @copyright 2012 HM2K <[email protected]> |
|
858 | + * @link http://pagerank.phurix.net/ |
|
859 | + * @author James Wade <[email protected]> |
|
860 | + * @version $Revision: 2.1 $ |
|
861 | + * @require PHP 4.3.0 (file_get_contents) |
|
862 | + * @updated 06/10/11 |
|
863 | + * |
|
864 | + * @param string $q The website URL |
|
865 | + * @return string The calculated pagerank, or -1 |
|
866 | + */ |
|
867 | 867 | public function pagerank_process($q) |
868 | 868 | { |
869 | 869 | $googleDomains = array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch'); |
@@ -897,12 +897,12 @@ discard block |
||
897 | 897 | } |
898 | 898 | |
899 | 899 | /** |
900 | - * List flags |
|
901 | - * |
|
902 | - * @param string $flag_path The flag directory path |
|
903 | - * @param string $value Selected flag |
|
904 | - * @return string $list Html code |
|
905 | - */ |
|
900 | + * List flags |
|
901 | + * |
|
902 | + * @param string $flag_path The flag directory path |
|
903 | + * @param string $value Selected flag |
|
904 | + * @return string $list Html code |
|
905 | + */ |
|
906 | 906 | public function get_dir_flag_list($flag_path, $value) |
907 | 907 | { |
908 | 908 | $list = ''; |
@@ -937,10 +937,10 @@ discard block |
||
937 | 937 | } |
938 | 938 | |
939 | 939 | /** |
940 | - * Display recents links added |
|
941 | - * |
|
942 | - * @return null |
|
943 | - */ |
|
940 | + * Display recents links added |
|
941 | + * |
|
942 | + * @return null |
|
943 | + */ |
|
944 | 944 | public function recents() |
945 | 945 | { |
946 | 946 | if ($this->config['dir_recent_block']) |
@@ -1017,13 +1017,13 @@ discard block |
||
1017 | 1017 | } |
1018 | 1018 | |
1019 | 1019 | /** |
1020 | - * Validate back link |
|
1021 | - * |
|
1022 | - * @param string $remote_url Page URL contains the backlink |
|
1023 | - * @param bool $optional Link back is optional in this category? |
|
1024 | - * @param bool $cron This methos is called by con process? |
|
1025 | - * @return false|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) |
|
1026 | - */ |
|
1020 | + * Validate back link |
|
1021 | + * |
|
1022 | + * @param string $remote_url Page URL contains the backlink |
|
1023 | + * @param bool $optional Link back is optional in this category? |
|
1024 | + * @param bool $cron This methos is called by con process? |
|
1025 | + * @return false|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) |
|
1026 | + */ |
|
1027 | 1027 | public function validate_link_back($remote_url, $optional, $cron = false) |
1028 | 1028 | { |
1029 | 1029 | if (!$cron) |
@@ -1063,14 +1063,14 @@ discard block |
||
1063 | 1063 | } |
1064 | 1064 | |
1065 | 1065 | /** |
1066 | - * Check, for website with backlink specified, if backlink is always here. |
|
1067 | - * After $nb_check verification, website is deleted, otherwise, a notification is send to poster |
|
1068 | - * |
|
1069 | - * @param int $cat_id The categoryID |
|
1070 | - * @param int $nb_check Number of check before demete a website |
|
1071 | - * @param int $next_prune Date of next auto check |
|
1072 | - * @return null |
|
1073 | - */ |
|
1066 | + * Check, for website with backlink specified, if backlink is always here. |
|
1067 | + * After $nb_check verification, website is deleted, otherwise, a notification is send to poster |
|
1068 | + * |
|
1069 | + * @param int $cat_id The categoryID |
|
1070 | + * @param int $nb_check Number of check before demete a website |
|
1071 | + * @param int $next_prune Date of next auto check |
|
1072 | + * @return null |
|
1073 | + */ |
|
1074 | 1074 | private function _check($cat_id, $nb_check, $next_prune) |
1075 | 1075 | { |
1076 | 1076 | $del_array = $update_array = array(); |
@@ -1118,11 +1118,11 @@ discard block |
||
1118 | 1118 | } |
1119 | 1119 | |
1120 | 1120 | /** |
1121 | - * Method called by cron task. |
|
1122 | - * |
|
1123 | - * @param array $cat_data Information about category, from db |
|
1124 | - * @return null |
|
1125 | - */ |
|
1121 | + * Method called by cron task. |
|
1122 | + * |
|
1123 | + * @param array $cat_data Information about category, from db |
|
1124 | + * @return null |
|
1125 | + */ |
|
1126 | 1126 | public function auto_check($cat_data) |
1127 | 1127 | { |
1128 | 1128 | global $phpbb_log; |
@@ -1152,12 +1152,12 @@ discard block |
||
1152 | 1152 | } |
1153 | 1153 | |
1154 | 1154 | /** |
1155 | - * Update website verification number after a missing backlink, and send notificaton |
|
1156 | - * |
|
1157 | - * @param array $u_array Information about website |
|
1158 | - * @param int $next_prune Date of next auto check |
|
1159 | - * @return null |
|
1160 | - */ |
|
1155 | + * Update website verification number after a missing backlink, and send notificaton |
|
1156 | + * |
|
1157 | + * @param array $u_array Information about website |
|
1158 | + * @param int $next_prune Date of next auto check |
|
1159 | + * @return null |
|
1160 | + */ |
|
1161 | 1161 | private function _update_check($u_array, $next_prune) |
1162 | 1162 | { |
1163 | 1163 | if (!class_exists('messenger')) |
@@ -78,21 +78,21 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\notification\manager $notification, \phpbb\filesystem\filesystem_interface $filesystem, \FastImageSize\FastImageSize $imagesize, \phpbb\files\factory $files_factory, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext) |
80 | 80 | { |
81 | - $this->db = $db; |
|
82 | - $this->config = $config; |
|
81 | + $this->db = $db; |
|
82 | + $this->config = $config; |
|
83 | 83 | $this->language = $language; |
84 | 84 | $this->template = $template; |
85 | 85 | $this->user = $user; |
86 | - $this->helper = $helper; |
|
87 | - $this->request = $request; |
|
86 | + $this->helper = $helper; |
|
87 | + $this->request = $request; |
|
88 | 88 | $this->auth = $auth; |
89 | - $this->notification = $notification; |
|
89 | + $this->notification = $notification; |
|
90 | 90 | $this->filesystem = $filesystem; |
91 | 91 | $this->imagesize = $imagesize; |
92 | - $this->files_factory = $files_factory; |
|
92 | + $this->files_factory = $files_factory; |
|
93 | 93 | $this->dir_helper = $dir_helper; |
94 | 94 | $this->root_path = $root_path; |
95 | - $this->php_ext = $php_ext; |
|
95 | + $this->php_ext = $php_ext; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | |
109 | 109 | $this->db->sql_transaction('begin'); |
110 | 110 | |
111 | - $sql = 'INSERT INTO ' . DIR_LINK_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
111 | + $sql = 'INSERT INTO '.DIR_LINK_TABLE.' '.$this->db->sql_build_array('INSERT', $data); |
|
112 | 112 | $this->db->sql_query($sql); |
113 | 113 | $notification_data['link_id'] = $this->db->sql_nextid(); |
114 | 114 | |
115 | 115 | if (!$need_approval || $this->auth->acl_get('a_') || $this->auth->acl_get('m_')) |
116 | 116 | { |
117 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
117 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
118 | 118 | SET cat_links = cat_links + 1 |
119 | 119 | WHERE cat_id = ' . (int) $data['link_cat']; |
120 | 120 | $this->db->sql_query($sql); |
@@ -172,14 +172,14 @@ discard block |
||
172 | 172 | |
173 | 173 | $this->db->sql_transaction('begin'); |
174 | 174 | |
175 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
175 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
176 | 176 | SET cat_links = cat_links - 1 |
177 | 177 | WHERE cat_id = ' . (int) $old_cat; |
178 | 178 | $this->db->sql_query($sql); |
179 | 179 | |
180 | 180 | if (!$need_approval) |
181 | 181 | { |
182 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
182 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
183 | 183 | SET cat_links = cat_links + 1 |
184 | 184 | WHERE cat_id = ' . (int) $data['link_cat']; |
185 | 185 | $this->db->sql_query($sql); |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | $this->notification->add_notifications($notification_type, $notification_data); |
198 | 198 | } |
199 | 199 | |
200 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
201 | - SET ' . $this->db->sql_build_array('UPDATE', $data) . ' |
|
200 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
201 | + SET ' . $this->db->sql_build_array('UPDATE', $data).' |
|
202 | 202 | WHERE link_id = ' . (int) $link_id; |
203 | 203 | $this->db->sql_query($sql); |
204 | 204 | } |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | ); |
225 | 225 | |
226 | 226 | $sql = 'SELECT link_banner |
227 | - FROM ' . DIR_LINK_TABLE . ' |
|
227 | + FROM ' . DIR_LINK_TABLE.' |
|
228 | 228 | WHERE '. $this->db->sql_in_set('link_id', $url_array); |
229 | 229 | $result = $this->db->sql_query($sql); |
230 | 230 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $url_array)); |
247 | 247 | } |
248 | 248 | |
249 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
249 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
250 | 250 | SET cat_links = cat_links - '.sizeof($url_array).' |
251 | 251 | WHERE cat_id = ' . (int) $cat_id; |
252 | 252 | $this->db->sql_query($sql); |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | if ($this->request->is_ajax()) |
265 | 265 | { |
266 | 266 | $sql = 'SELECT cat_links |
267 | - FROM ' . DIR_CAT_TABLE . ' |
|
267 | + FROM ' . DIR_CAT_TABLE.' |
|
268 | 268 | WHERE cat_id = ' . (int) $cat_id; |
269 | 269 | $result = $this->db->sql_query($sql); |
270 | 270 | $data = $this->db->sql_fetchrow($result); |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | public function view($link_id) |
292 | 292 | { |
293 | 293 | $sql = 'SELECT link_id, link_url |
294 | - FROM ' . DIR_LINK_TABLE . ' |
|
294 | + FROM ' . DIR_LINK_TABLE.' |
|
295 | 295 | WHERE link_id = ' . (int) $link_id; |
296 | 296 | $result = $this->db->sql_query($sql); |
297 | 297 | $data = $this->db->sql_fetchrow($result); |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | throw new \phpbb\exception\http_exception(404, 'DIR_ERROR_NO_LINKS'); |
302 | 302 | } |
303 | 303 | |
304 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
304 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
305 | 305 | SET link_view = link_view + 1 |
306 | 306 | WHERE link_id = ' . (int) $link_id; |
307 | 307 | $this->db->sql_query($sql); |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | if ($details['scheme'] == 'https') |
327 | 327 | { |
328 | 328 | $default_port = 443; |
329 | - $hostname = 'tls://' . $details['host']; |
|
329 | + $hostname = 'tls://'.$details['host']; |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | if (!isset($details['path'])) |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | $flag_path = $ext_path.'images/flags/'; |
385 | 385 | $img_flag = 'no_flag.png'; |
386 | 386 | |
387 | - if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path . $data['link_flag'])) |
|
387 | + if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path.$data['link_flag'])) |
|
388 | 388 | { |
389 | 389 | $img_flag = $data['link_flag']; |
390 | 390 | } |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | $list = '<select name="vote">'; |
427 | 427 | for ($i = 0; $i <= 10; $i++) |
428 | 428 | { |
429 | - $list .= '<option value="' . $i . '"' . (($i == 5) ? ' selected="selected"' : '') . '>' . $i . '</option>'; |
|
429 | + $list .= '<option value="'.$i.'"'.(($i == 5) ? ' selected="selected"' : '').'>'.$i.'</option>'; |
|
430 | 430 | } |
431 | 431 | $list .= '</select>'; |
432 | 432 | |
@@ -464,8 +464,8 @@ discard block |
||
464 | 464 | { |
465 | 465 | $thumb = $this->thumb_process($data['link_url']); |
466 | 466 | |
467 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
468 | - SET link_thumb = "' . $this->db->sql_escape($thumb) . '" |
|
467 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
468 | + SET link_thumb = "' . $this->db->sql_escape($thumb).'" |
|
469 | 469 | WHERE link_id = ' . (int) $data['link_id']; |
470 | 470 | $this->db->sql_query($sql); |
471 | 471 | |
@@ -489,8 +489,8 @@ discard block |
||
489 | 489 | { |
490 | 490 | $pagerank = $this->pagerank_process($data['link_url']); |
491 | 491 | |
492 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
493 | - SET link_pagerank = ' . (int) $pagerank . ' |
|
492 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
493 | + SET link_pagerank = ' . (int) $pagerank.' |
|
494 | 494 | WHERE link_id = ' . (int) $data['link_id']; |
495 | 495 | $this->db->sql_query($sql); |
496 | 496 | } |
@@ -499,9 +499,9 @@ discard block |
||
499 | 499 | $pagerank = (int) $data['link_pagerank']; |
500 | 500 | } |
501 | 501 | |
502 | - $prpos=40*$pagerank/10; |
|
503 | - $prneg=40-$prpos; |
|
504 | - $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.'" /> '; |
|
502 | + $prpos = 40 * $pagerank / 10; |
|
503 | + $prneg = 40 - $prpos; |
|
504 | + $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.'" /> '; |
|
505 | 505 | |
506 | 506 | $pagerank = $pagerank == '-1' ? $this->language->lang('DIR_PAGERANK_NOT_AVAILABLE') : $this->language->lang('DIR_FROM_TEN', $pagerank); |
507 | 507 | return $html.$pagerank; |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | $height /= $coef_max; |
547 | 547 | } |
548 | 548 | |
549 | - return '<img src="' . $img_src . '" width="' . $width . '" height="' . $height . '" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />'; |
|
549 | + return '<img src="'.$img_src.'" width="'.$width.'" height="'.$height.'" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />'; |
|
550 | 550 | } |
551 | 551 | return ''; |
552 | 552 | } |
@@ -567,12 +567,12 @@ discard block |
||
567 | 567 | |
568 | 568 | $this->db->sql_transaction('begin'); |
569 | 569 | |
570 | - $sql = 'INSERT INTO ' . DIR_VOTE_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
570 | + $sql = 'INSERT INTO '.DIR_VOTE_TABLE.' '.$this->db->sql_build_array('INSERT', $data); |
|
571 | 571 | $this->db->sql_query($sql); |
572 | 572 | |
573 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
573 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
574 | 574 | SET link_vote = link_vote + 1, |
575 | - link_note = link_note + ' . (int) $data['vote_note'] . ' |
|
575 | + link_note = link_note + ' . (int) $data['vote_note'].' |
|
576 | 576 | WHERE link_id = ' . (int) $link_id; |
577 | 577 | $this->db->sql_query($sql); |
578 | 578 | |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | |
581 | 581 | if ($this->request->is_ajax()) |
582 | 582 | { |
583 | - $sql= 'SELECT link_vote, link_note FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int) $link_id; |
|
583 | + $sql = 'SELECT link_vote, link_note FROM '.DIR_LINK_TABLE.' WHERE link_id = '.(int) $link_id; |
|
584 | 584 | $result = $this->db->sql_query($sql); |
585 | 585 | $data = $this->db->sql_fetchrow($result); |
586 | 586 | |
@@ -614,8 +614,8 @@ discard block |
||
614 | 614 | |
615 | 615 | $details = parse_url($url); |
616 | 616 | |
617 | - $root_url = $details['scheme'].'://'.$details['host']; |
|
618 | - $absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url; |
|
617 | + $root_url = $details['scheme'].'://'.$details['host']; |
|
618 | + $absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url; |
|
619 | 619 | |
620 | 620 | if ($this->config['dir_activ_thumb_remote'] && $this->_ascreen_exist($details['scheme'], $details['host'])) |
621 | 621 | { |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | $destination = $this->dir_helper->get_banner_path(); |
659 | 659 | |
660 | 660 | // Can we upload? |
661 | - $can_upload = ($this->config['dir_storage_banner'] && $this->filesystem->exists($this->root_path . $destination) && $this->filesystem->is_writable($this->root_path . $destination) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false; |
|
661 | + $can_upload = ($this->config['dir_storage_banner'] && $this->filesystem->exists($this->root_path.$destination) && $this->filesystem->is_writable($this->root_path.$destination) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false; |
|
662 | 662 | |
663 | 663 | if ($banner && $can_upload) |
664 | 664 | { |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | |
705 | 705 | $file = $upload->handle_upload('files.types.remote', $banner); |
706 | 706 | |
707 | - $prefix = unique_id() . '_'; |
|
707 | + $prefix = unique_id().'_'; |
|
708 | 708 | $file->clean_filename('real', $prefix); |
709 | 709 | |
710 | 710 | if (sizeof($file->error)) |
@@ -734,7 +734,7 @@ discard block |
||
734 | 734 | { |
735 | 735 | if (!preg_match('#^(http|https|ftp)://#i', $banner)) |
736 | 736 | { |
737 | - $banner = 'http://' . $banner; |
|
737 | + $banner = 'http://'.$banner; |
|
738 | 738 | } |
739 | 739 | if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.(gif|jpg|jpeg|png)$#i', $banner)) |
740 | 740 | { |
@@ -765,8 +765,8 @@ discard block |
||
765 | 765 | } |
766 | 766 | |
767 | 767 | // Check image type |
768 | - $types = \phpbb\files\upload::image_types(); |
|
769 | - $extension = strtolower(\phpbb\files\filespec::get_extension($banner)); |
|
768 | + $types = \phpbb\files\upload::image_types(); |
|
769 | + $extension = strtolower(\phpbb\files\filespec::get_extension($banner)); |
|
770 | 770 | |
771 | 771 | // Check if this is actually an image |
772 | 772 | if ($file_stream = @fopen($banner, 'r')) |
@@ -868,14 +868,14 @@ discard block |
||
868 | 868 | */ |
869 | 869 | public function pagerank_process($q) |
870 | 870 | { |
871 | - $googleDomains = array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch'); |
|
872 | - $seed = $this->language->lang('SEED'); |
|
873 | - $result = 0x01020345; |
|
871 | + $googleDomains = array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch'); |
|
872 | + $seed = $this->language->lang('SEED'); |
|
873 | + $result = 0x01020345; |
|
874 | 874 | $len = strlen($q); |
875 | 875 | |
876 | - for ($i=0; $i<$len; $i++) |
|
876 | + for ($i = 0; $i < $len; $i++) |
|
877 | 877 | { |
878 | - $result ^= ord($seed{$i%strlen($seed)}) ^ ord($q{$i}); |
|
878 | + $result ^= ord($seed{$i % strlen($seed)}) ^ ord($q{$i}); |
|
879 | 879 | $result = (($result >> 23) & 0x1ff) | $result << 9; |
880 | 880 | } |
881 | 881 | |
@@ -886,10 +886,10 @@ discard block |
||
886 | 886 | |
887 | 887 | $ch = sprintf('8%x', $result); |
888 | 888 | $url = 'http://%s/tbr?client=navclient-auto&ch=%s&features=Rank&q=info:%s'; |
889 | - $host = 'toolbarqueries.google'.$googleDomains[mt_rand(0,count($googleDomains)-1)]; |
|
889 | + $host = 'toolbarqueries.google'.$googleDomains[mt_rand(0, count($googleDomains) - 1)]; |
|
890 | 890 | |
891 | - $url = sprintf($url,$host,$ch,$q); |
|
892 | - @$pr = trim(file_get_contents($url,false)); |
|
891 | + $url = sprintf($url, $host, $ch, $q); |
|
892 | + @$pr = trim(file_get_contents($url, false)); |
|
893 | 893 | |
894 | 894 | if (is_numeric(substr(strrchr($pr, ':'), 1))) |
895 | 895 | { |
@@ -931,7 +931,7 @@ discard block |
||
931 | 931 | |
932 | 932 | if (file_exists($flag_path.$img_file)) |
933 | 933 | { |
934 | - $list .= '<option value="' . $img_file . '" ' . (($img_file == $value) ? 'selected="selected"' : '') . '>' . $name . '</option>'; |
|
934 | + $list .= '<option value="'.$img_file.'" '.(($img_file == $value) ? 'selected="selected"' : '').'>'.$name.'</option>'; |
|
935 | 935 | } |
936 | 936 | } |
937 | 937 | |
@@ -947,8 +947,8 @@ discard block |
||
947 | 947 | { |
948 | 948 | if ($this->config['dir_recent_block']) |
949 | 949 | { |
950 | - $limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns']; |
|
951 | - $exclude_array = explode(',', str_replace(' ', '', $this->config['dir_recent_exclude'])); |
|
950 | + $limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns']; |
|
951 | + $exclude_array = explode(',', str_replace(' ', '', $this->config['dir_recent_exclude'])); |
|
952 | 952 | |
953 | 953 | $sql_array = array( |
954 | 954 | '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', |
@@ -981,7 +981,7 @@ discard block |
||
981 | 981 | if (sizeof($rowset)) |
982 | 982 | { |
983 | 983 | $this->template->assign_block_vars('block', array( |
984 | - 'S_COL_WIDTH' => (100 / $this->config['dir_recent_columns']) . '%', |
|
984 | + 'S_COL_WIDTH' => (100 / $this->config['dir_recent_columns']).'%', |
|
985 | 985 | )); |
986 | 986 | |
987 | 987 | foreach ($rowset as $row) |
@@ -1087,7 +1087,7 @@ discard block |
||
1087 | 1087 | 'ON' => 'l.link_user_id = u.user_id' |
1088 | 1088 | ) |
1089 | 1089 | ), |
1090 | - 'WHERE' => 'l.link_back <> "" AND l.link_active = 1 AND l.link_cat = ' . (int) $cat_id); |
|
1090 | + 'WHERE' => 'l.link_back <> "" AND l.link_active = 1 AND l.link_cat = '.(int) $cat_id); |
|
1091 | 1091 | |
1092 | 1092 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
1093 | 1093 | $result = $this->db->sql_query($sql); |
@@ -1096,7 +1096,7 @@ discard block |
||
1096 | 1096 | { |
1097 | 1097 | if ($this->validate_link_back($row['link_back'], false, true) !== false) |
1098 | 1098 | { |
1099 | - if (!$nb_check || ($row['link_nb_check']+1) >= $nb_check) |
|
1099 | + if (!$nb_check || ($row['link_nb_check'] + 1) >= $nb_check) |
|
1100 | 1100 | { |
1101 | 1101 | $del_array[] = $row['link_id']; |
1102 | 1102 | } |
@@ -1130,7 +1130,7 @@ discard block |
||
1130 | 1130 | global $phpbb_log; |
1131 | 1131 | |
1132 | 1132 | $sql = 'SELECT cat_name |
1133 | - FROM ' . DIR_CAT_TABLE . ' |
|
1133 | + FROM ' . DIR_CAT_TABLE.' |
|
1134 | 1134 | WHERE cat_id = ' . (int) $cat_data['cat_id']; |
1135 | 1135 | $result = $this->db->sql_query($sql); |
1136 | 1136 | $row = $this->db->sql_fetchrow($result); |
@@ -1142,9 +1142,9 @@ discard block |
||
1142 | 1142 | |
1143 | 1143 | $this->_check($cat_data['cat_id'], $cat_data['cat_cron_nb_check'], $next_prune); |
1144 | 1144 | |
1145 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . " |
|
1145 | + $sql = 'UPDATE '.DIR_CAT_TABLE." |
|
1146 | 1146 | SET cat_cron_next = $next_prune |
1147 | - WHERE cat_id = " . (int) $cat_data['cat_id']; |
|
1147 | + WHERE cat_id = ".(int) $cat_data['cat_id']; |
|
1148 | 1148 | $this->db->sql_query($sql); |
1149 | 1149 | |
1150 | 1150 | $phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_AUTO_PRUNE', time(), array($row['cat_name'])); |
@@ -1164,7 +1164,7 @@ discard block |
||
1164 | 1164 | { |
1165 | 1165 | if (!class_exists('messenger')) |
1166 | 1166 | { |
1167 | - include($this->root_path . 'includes/functions_messenger.' . $this->php_ext); |
|
1167 | + include($this->root_path.'includes/functions_messenger.'.$this->php_ext); |
|
1168 | 1168 | } |
1169 | 1169 | |
1170 | 1170 | $messenger = new \messenger(false); |
@@ -1173,7 +1173,7 @@ discard block |
||
1173 | 1173 | // We need to define it, because we use user->format_date below |
1174 | 1174 | $this->user->timezone = new \DateTimeZone($this->config['board_timezone']); |
1175 | 1175 | |
1176 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
1176 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
1177 | 1177 | SET link_nb_check = link_nb_check + 1 |
1178 | 1178 | WHERE ' . $this->db->sql_in_set('link_id', array_keys($u_array)); |
1179 | 1179 | $this->db->sql_query($sql); |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | private $cat_data; |
29 | 29 | |
30 | 30 | /** |
31 | - * Constructor. |
|
32 | - * |
|
33 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
34 | - * @param \phpbb\config\config $config Config object |
|
35 | - * @param \ernadoo\phpbbdirectory\core\link $directory_cron PhpBB Directory extension link object |
|
36 | - * @param string $php_ext phpEx |
|
37 | - */ |
|
31 | + * Constructor. |
|
32 | + * |
|
33 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
34 | + * @param \phpbb\config\config $config Config object |
|
35 | + * @param \ernadoo\phpbbdirectory\core\link $directory_cron PhpBB Directory extension link object |
|
36 | + * @param string $php_ext phpEx |
|
37 | + */ |
|
38 | 38 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \ernadoo\phpbbdirectory\core\link $directory_cron, $php_ext) |
39 | 39 | { |
40 | 40 | $this->db = $db; |
@@ -44,66 +44,66 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | - * Manually set categorie data. |
|
48 | - * |
|
49 | - * @param array $cat_data Information about a category to be pruned. |
|
50 | - */ |
|
47 | + * Manually set categorie data. |
|
48 | + * |
|
49 | + * @param array $cat_data Information about a category to be pruned. |
|
50 | + */ |
|
51 | 51 | public function set_categorie_data($cat_data) |
52 | 52 | { |
53 | 53 | $this->cat_data = $cat_data; |
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | - * Runs this cron task. |
|
58 | - * |
|
59 | - * @return null |
|
60 | - */ |
|
57 | + * Runs this cron task. |
|
58 | + * |
|
59 | + * @return null |
|
60 | + */ |
|
61 | 61 | public function run() |
62 | 62 | { |
63 | 63 | $this->dir_cron->auto_check($this->cat_data); |
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | - * Returns whether this cron task can run, given current board configuration. |
|
68 | - * |
|
69 | - * @return bool |
|
70 | - */ |
|
67 | + * Returns whether this cron task can run, given current board configuration. |
|
68 | + * |
|
69 | + * @return bool |
|
70 | + */ |
|
71 | 71 | public function is_runnable() |
72 | 72 | { |
73 | 73 | return !$this->config['use_system_cron'] && !empty($this->cat_data); |
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
77 | - * Returns whether this cron task should run now, because enough time |
|
78 | - * has passed since it was last run. |
|
79 | - * |
|
80 | - * @return bool |
|
81 | - */ |
|
77 | + * Returns whether this cron task should run now, because enough time |
|
78 | + * has passed since it was last run. |
|
79 | + * |
|
80 | + * @return bool |
|
81 | + */ |
|
82 | 82 | public function should_run() |
83 | 83 | { |
84 | 84 | return $this->cat_data['cat_cron_enable'] && $this->cat_data['cat_cron_next'] < time(); |
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
88 | - * Returns parameters of this cron task as an array. |
|
89 | - * The array has one key, c, whose value is id of the category to be pruned. |
|
90 | - * |
|
91 | - * @return array |
|
92 | - */ |
|
88 | + * Returns parameters of this cron task as an array. |
|
89 | + * The array has one key, c, whose value is id of the category to be pruned. |
|
90 | + * |
|
91 | + * @return array |
|
92 | + */ |
|
93 | 93 | public function get_parameters() |
94 | 94 | { |
95 | 95 | return array('c' => $this->cat_data['cat_id']); |
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
99 | - * Parses parameters found in $request, which is an instance of |
|
100 | - * \phpbb\request\request_interface. |
|
101 | - * |
|
102 | - * It is expected to have a key f whose value is id of the forum to be pruned. |
|
103 | - * |
|
104 | - * @param \phpbb\request\request_interface $request Request object. |
|
105 | - * @return null |
|
106 | - */ |
|
99 | + * Parses parameters found in $request, which is an instance of |
|
100 | + * \phpbb\request\request_interface. |
|
101 | + * |
|
102 | + * It is expected to have a key f whose value is id of the forum to be pruned. |
|
103 | + * |
|
104 | + * @param \phpbb\request\request_interface $request Request object. |
|
105 | + * @return null |
|
106 | + */ |
|
107 | 107 | public function parse_parameters(\phpbb\request\request_interface $request) |
108 | 108 | { |
109 | 109 | $this->cat_data = array(); |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \ernadoo\phpbbdirectory\core\link $directory_cron, $php_ext) |
39 | 39 | { |
40 | - $this->db = $db; |
|
41 | - $this->config = $config; |
|
40 | + $this->db = $db; |
|
41 | + $this->config = $config; |
|
42 | 42 | $this->dir_cron = $directory_cron; |
43 | 43 | $this->php_ext = $php_ext; |
44 | 44 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $cat_id = $request->variable('c', 0); |
114 | 114 | |
115 | 115 | $sql = 'SELECT cat_id, cat_cron_enable, cat_cron_next, cat_cron_freq, cat_cron_nb_check |
116 | - FROM ' . DIR_CAT_TABLE . " |
|
116 | + FROM ' . DIR_CAT_TABLE." |
|
117 | 117 | WHERE cat_id = $cat_id"; |
118 | 118 | $result = $this->db->sql_query($sql); |
119 | 119 | $row = $this->db->sql_fetchrow($result); |
@@ -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\language\language $language Language object |
|
47 | - * @param \phpbb\template\template $template Template 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\language\language $language Language object |
|
47 | + * @param \phpbb\template\template $template Template 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\language\language $language, \phpbb\template\template $template, \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\language\language $language, \phpbb\template\template $template, \ernadoo\phpbbdirectory\core\helper $dir_helper, $table_prefix, $php_ext) |
54 | 54 | { |
55 | - $this->db = $db; |
|
56 | - $this->helper = $helper; |
|
55 | + $this->db = $db; |
|
56 | + $this->helper = $helper; |
|
57 | 57 | $this->language = $language; |
58 | 58 | $this->template = $template; |
59 | - $this->dir_helper = $dir_helper; |
|
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 | /** |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function add_page_header_variables() |
103 | 103 | { |
104 | - $ext_theme_path = $this->dir_helper->get_ext_name() . '/styles/prosilver/theme/'; |
|
104 | + $ext_theme_path = $this->dir_helper->get_ext_name().'/styles/prosilver/theme/'; |
|
105 | 105 | $theme_lang_path = $this->language->get_used_language(); |
106 | 106 | |
107 | 107 | // Prevent 'Twig_Error_Loader' if user's lang directory doesn't exist |
108 | - if (!file_exists($ext_theme_path . $theme_lang_path . '/directory.css')) |
|
108 | + if (!file_exists($ext_theme_path.$theme_lang_path.'/directory.css')) |
|
109 | 109 | { |
110 | 110 | // Fallback to English language. |
111 | 111 | $theme_lang_path = \phpbb\language\language::FALLBACK_LANGUAGE; |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function add_page_viewonline($event) |
127 | 127 | { |
128 | - if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/directory') === 0) |
|
128 | + if (strrpos($event['row']['session_page'], 'app.'.$this->php_ext.'/directory') === 0) |
|
129 | 129 | { |
130 | - $event['location'] = $this->language->lang('DIRECTORY'); |
|
131 | - $event['location_url'] = $this->helper->route('ernadoo_phpbbdirectory_base_controller'); |
|
130 | + $event['location'] = $this->language->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; |
@@ -196,17 +196,17 @@ discard block |
||
196 | 196 | $user_ids = array($user_ids); |
197 | 197 | } |
198 | 198 | |
199 | - $sql = 'UPDATE ' . DIR_COMMENT_TABLE . ' |
|
200 | - SET comment_user_id = ' . ANONYMOUS . ' |
|
199 | + $sql = 'UPDATE '.DIR_COMMENT_TABLE.' |
|
200 | + SET comment_user_id = ' . ANONYMOUS.' |
|
201 | 201 | WHERE ' . $this->db->sql_in_set('comment_user_id', $user_ids); |
202 | 202 | $this->db->sql_query($sql); |
203 | 203 | |
204 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
205 | - SET link_user_id = ' . ANONYMOUS . ' |
|
204 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
205 | + SET link_user_id = ' . ANONYMOUS.' |
|
206 | 206 | WHERE ' . $this->db->sql_in_set('link_user_id', $user_ids); |
207 | 207 | $this->db->sql_query($sql); |
208 | 208 | |
209 | - $sql = 'DELETE FROM ' . DIR_WATCH_TABLE . ' |
|
209 | + $sql = 'DELETE FROM '.DIR_WATCH_TABLE.' |
|
210 | 210 | WHERE ' . $this->db->sql_in_set('user_id', $user_ids); |
211 | 211 | $this->db->sql_query($sql); |
212 | 212 | } |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | class convert_module extends \phpbb\db\migration\migration |
17 | 17 | { |
18 | 18 | /** |
19 | - * Skip this migration if an ACP_DIRECTORY module does not exist |
|
20 | - * |
|
21 | - * @return bool True if table does not exist |
|
22 | - * @access public |
|
23 | - */ |
|
19 | + * Skip this migration if an ACP_DIRECTORY module does not exist |
|
20 | + * |
|
21 | + * @return bool True if table does not exist |
|
22 | + * @access public |
|
23 | + */ |
|
24 | 24 | public function effectively_installed() |
25 | 25 | { |
26 | 26 | $sql = 'SELECT module_id |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | - * Add or update data in the database |
|
41 | - * |
|
42 | - * @return array Array of table data |
|
43 | - * @access public |
|
44 | - */ |
|
40 | + * Add or update data in the database |
|
41 | + * |
|
42 | + * @return array Array of table data |
|
43 | + * @access public |
|
44 | + */ |
|
45 | 45 | public function update_data() |
46 | 46 | { |
47 | 47 | return array( |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | public function effectively_installed() |
25 | 25 | { |
26 | 26 | $sql = 'SELECT module_id |
27 | - FROM ' . $this->table_prefix . "modules |
|
27 | + FROM ' . $this->table_prefix."modules |
|
28 | 28 | WHERE module_class = 'acp' |
29 | 29 | AND module_basename = 'acp_directory' |
30 | 30 | AND module_mode = 'main'"; |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | 'module_auth' => 'ext_ernadoo/phpbbdirectory' |
57 | 57 | ); |
58 | 58 | |
59 | - $sql = 'UPDATE ' . $this->table_prefix . 'modules |
|
60 | - SET ' . $this->db->sql_build_array('UPDATE', $module_data) . " |
|
59 | + $sql = 'UPDATE '.$this->table_prefix.'modules |
|
60 | + SET ' . $this->db->sql_build_array('UPDATE', $module_data)." |
|
61 | 61 | WHERE module_basename = 'acp_directory' |
62 | 62 | AND module_mode IN ('main', 'settings', 'cat', 'val')"; |
63 | 63 | $this->db->sql_query($sql); |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | class convert_notifications extends \phpbb\db\migration\migration |
17 | 17 | { |
18 | 18 | /** |
19 | - * Skip this migration if phpbb_directory_notifications table does not exist |
|
20 | - * |
|
21 | - * @return bool True if table does not exist |
|
22 | - * @access public |
|
23 | - */ |
|
19 | + * Skip this migration if phpbb_directory_notifications table does not exist |
|
20 | + * |
|
21 | + * @return bool True if table does not exist |
|
22 | + * @access public |
|
23 | + */ |
|
24 | 24 | public function effectively_installed() |
25 | 25 | { |
26 | 26 | return !$this->db_tools->sql_table_exists($this->table_prefix . 'directory_notifications'); |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | - * Add or update data in the database |
|
38 | - * |
|
39 | - * @return array Array of table data |
|
40 | - * @access public |
|
41 | - */ |
|
37 | + * Add or update data in the database |
|
38 | + * |
|
39 | + * @return array Array of table data |
|
40 | + * @access public |
|
41 | + */ |
|
42 | 42 | public function update_data() |
43 | 43 | { |
44 | 44 | return array( |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | - * Copy category track from 3.0.x table |
|
51 | - * |
|
52 | - * @return null |
|
53 | - */ |
|
50 | + * Copy category track from 3.0.x table |
|
51 | + * |
|
52 | + * @return null |
|
53 | + */ |
|
54 | 54 | public function copy_from_notifications() |
55 | 55 | { |
56 | 56 | $sql = 'SELECT n_user_id, n_cat_id |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function effectively_installed() |
25 | 25 | { |
26 | - return !$this->db_tools->sql_table_exists($this->table_prefix . 'directory_notifications'); |
|
26 | + return !$this->db_tools->sql_table_exists($this->table_prefix.'directory_notifications'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | static public function depends_on() |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | public function copy_from_notifications() |
55 | 55 | { |
56 | 56 | $sql = 'SELECT n_user_id, n_cat_id |
57 | - FROM ' . $this->table_prefix . 'directory_notifications'; |
|
57 | + FROM ' . $this->table_prefix.'directory_notifications'; |
|
58 | 58 | $result = $this->db->sql_query($sql); |
59 | 59 | |
60 | 60 | while ($row = $this->db->sql_fetchrow($result)) |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | 'notify_status' => 1, |
66 | 66 | ); |
67 | 67 | |
68 | - $sql = 'INSERT INTO ' . $this->table_prefix . 'directory_watch ' . $this->db->sql_build_array('INSERT', $data); |
|
68 | + $sql = 'INSERT INTO '.$this->table_prefix.'directory_watch '.$this->db->sql_build_array('INSERT', $data); |
|
69 | 69 | $this->db->sql_query($sql); |
70 | 70 | } |
71 | 71 | $this->db->sql_freeresult($result); |
@@ -259,10 +259,10 @@ discard block |
||
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
262 | - * Create directories for banners/icons uploaded |
|
263 | - * |
|
264 | - * @return null |
|
265 | - */ |
|
262 | + * Create directories for banners/icons uploaded |
|
263 | + * |
|
264 | + * @return null |
|
265 | + */ |
|
266 | 266 | public function create_directories() |
267 | 267 | { |
268 | 268 | $directories = array( |
@@ -281,10 +281,10 @@ discard block |
||
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |
284 | - * Remove directories for banners/icons uploaded |
|
285 | - * |
|
286 | - * @return null |
|
287 | - */ |
|
284 | + * Remove directories for banners/icons uploaded |
|
285 | + * |
|
286 | + * @return null |
|
287 | + */ |
|
288 | 288 | public function remove_directories() |
289 | 289 | { |
290 | 290 | $dir = $this->phpbb_root_path . 'files/ext/ernadoo/phpbbdirectory/'; |
@@ -293,15 +293,15 @@ discard block |
||
293 | 293 | } |
294 | 294 | |
295 | 295 | /** |
296 | - * Attempts to remove recursively the directory named by dirname. |
|
297 | - * |
|
298 | - * @author Mehdi Kabab <http://pioupioum.fr> |
|
299 | - * @copyright Copyright (C) 2009 Mehdi Kabab |
|
300 | - * @license http://www.gnu.org/licenses/gpl.html GNU GPL version 3 or later |
|
301 | - * |
|
302 | - * @param string $dirname Path to the directory. |
|
303 | - * @return null |
|
304 | - */ |
|
296 | + * Attempts to remove recursively the directory named by dirname. |
|
297 | + * |
|
298 | + * @author Mehdi Kabab <http://pioupioum.fr> |
|
299 | + * @copyright Copyright (C) 2009 Mehdi Kabab |
|
300 | + * @license http://www.gnu.org/licenses/gpl.html GNU GPL version 3 or later |
|
301 | + * |
|
302 | + * @param string $dirname Path to the directory. |
|
303 | + * @return null |
|
304 | + */ |
|
305 | 305 | private function _recursive_rmdir($dirname) |
306 | 306 | { |
307 | 307 | if (is_dir($dirname) && !is_link($dirname)) |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | { |
24 | 24 | return array( |
25 | 25 | 'add_tables' => array( |
26 | - $this->table_prefix . 'directory_cats' => array( |
|
26 | + $this->table_prefix.'directory_cats' => array( |
|
27 | 27 | 'COLUMNS' => array( |
28 | 28 | 'cat_id' => array('UINT', null, 'auto_increment'), |
29 | 29 | 'parent_id' => array('UINT', 0), |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | ), |
58 | 58 | ), |
59 | 59 | |
60 | - $this->table_prefix . 'directory_comments' => array( |
|
60 | + $this->table_prefix.'directory_comments' => array( |
|
61 | 61 | 'COLUMNS' => array( |
62 | 62 | 'comment_id' => array('UINT', null, 'auto_increment'), |
63 | 63 | 'comment_date' => array('TIMESTAMP', 0), |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | 'PRIMARY_KEY' => array('comment_id'), |
74 | 74 | ), |
75 | 75 | |
76 | - $this->table_prefix . 'directory_links' => array( |
|
76 | + $this->table_prefix.'directory_links' => array( |
|
77 | 77 | 'COLUMNS' => array( |
78 | 78 | 'link_id' => array('UINT', null, 'auto_increment'), |
79 | 79 | 'link_time' => array('TIMESTAMP', 0), |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | ), |
111 | 111 | ), |
112 | 112 | |
113 | - $this->table_prefix . 'directory_watch' => array( |
|
113 | + $this->table_prefix.'directory_watch' => array( |
|
114 | 114 | 'COLUMNS' => array( |
115 | 115 | 'cat_id' => array('UINT', 0), |
116 | 116 | 'user_id' => array('UINT', 0), |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | ), |
127 | 127 | |
128 | - $this->table_prefix . 'directory_votes' => array( |
|
128 | + $this->table_prefix.'directory_votes' => array( |
|
129 | 129 | 'COLUMNS' => array( |
130 | 130 | 'vote_id' => array('UINT', null, 'auto_increment'), |
131 | 131 | 'vote_link_id' => array('UINT', 0), |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | { |
149 | 149 | return array( |
150 | 150 | 'drop_tables' => array( |
151 | - $this->table_prefix . 'directory_cats', |
|
152 | - $this->table_prefix . 'directory_comments', |
|
153 | - $this->table_prefix . 'directory_links', |
|
154 | - $this->table_prefix . 'directory_votes', |
|
155 | - $this->table_prefix . 'directory_watch', |
|
151 | + $this->table_prefix.'directory_cats', |
|
152 | + $this->table_prefix.'directory_comments', |
|
153 | + $this->table_prefix.'directory_links', |
|
154 | + $this->table_prefix.'directory_votes', |
|
155 | + $this->table_prefix.'directory_watch', |
|
156 | 156 | ), |
157 | 157 | ); |
158 | 158 | } |
@@ -272,10 +272,10 @@ discard block |
||
272 | 272 | |
273 | 273 | foreach ($directories as $dir) |
274 | 274 | { |
275 | - if (!file_exists($this->phpbb_root_path . $dir)) |
|
275 | + if (!file_exists($this->phpbb_root_path.$dir)) |
|
276 | 276 | { |
277 | - @mkdir($this->phpbb_root_path . $dir, 0777, true); |
|
278 | - phpbb_chmod($this->phpbb_root_path . $dir, CHMOD_READ | CHMOD_WRITE); |
|
277 | + @mkdir($this->phpbb_root_path.$dir, 0777, true); |
|
278 | + phpbb_chmod($this->phpbb_root_path.$dir, CHMOD_READ | CHMOD_WRITE); |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | } |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | */ |
288 | 288 | public function remove_directories() |
289 | 289 | { |
290 | - $dir = $this->phpbb_root_path . 'files/ext/ernadoo/phpbbdirectory/'; |
|
290 | + $dir = $this->phpbb_root_path.'files/ext/ernadoo/phpbbdirectory/'; |
|
291 | 291 | |
292 | 292 | $this->_recursive_rmdir($dir); |
293 | 293 | } |
@@ -18,21 +18,21 @@ discard block |
||
18 | 18 | class directory_website_disapproved extends \phpbb\notification\type\base |
19 | 19 | { |
20 | 20 | /** |
21 | - * Get notification type name |
|
22 | - * |
|
23 | - * @return string |
|
24 | - */ |
|
21 | + * Get notification type name |
|
22 | + * |
|
23 | + * @return string |
|
24 | + */ |
|
25 | 25 | public function get_type() |
26 | 26 | { |
27 | 27 | return 'ernadoo.phpbbdirectory.notification.type.directory_website_disapproved'; |
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
31 | - * Notification option data (for outputting to the user) |
|
32 | - * |
|
33 | - * @var bool|array False if the service should use it's default data |
|
34 | - * Array of data (including keys 'id', 'lang', and 'group') |
|
35 | - */ |
|
31 | + * Notification option data (for outputting to the user) |
|
32 | + * |
|
33 | + * @var bool|array False if the service should use it's default data |
|
34 | + * Array of data (including keys 'id', 'lang', and 'group') |
|
35 | + */ |
|
36 | 36 | public static $notification_option = array( |
37 | 37 | 'id' => 'dir_moderation_queue', |
38 | 38 | 'lang' => 'NOTIFICATION_TYPE_DIR_UCP_MODERATION_QUEUE', |
@@ -40,17 +40,17 @@ discard block |
||
40 | 40 | ); |
41 | 41 | |
42 | 42 | /** |
43 | - * Permission to check for (in find_users_for_notification) |
|
44 | - * |
|
45 | - * @var string Permission name |
|
46 | - */ |
|
43 | + * Permission to check for (in find_users_for_notification) |
|
44 | + * |
|
45 | + * @var string Permission name |
|
46 | + */ |
|
47 | 47 | protected $permission = array('a_', 'm_'); |
48 | 48 | |
49 | 49 | /** |
50 | - * Is available |
|
51 | - * |
|
52 | - * @return bool True/False whether or not this is available to the user |
|
53 | - */ |
|
50 | + * Is available |
|
51 | + * |
|
52 | + * @return bool True/False whether or not this is available to the user |
|
53 | + */ |
|
54 | 54 | public function is_available() |
55 | 55 | { |
56 | 56 | $has_permission = $this->auth->acl_gets($this->permission, true); |
@@ -59,21 +59,21 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | - * Get link id |
|
63 | - * |
|
64 | - * @param array $data The data from the link |
|
65 | - * @return int |
|
66 | - */ |
|
62 | + * Get link id |
|
63 | + * |
|
64 | + * @param array $data The data from the link |
|
65 | + * @return int |
|
66 | + */ |
|
67 | 67 | static public function get_item_id($data) |
68 | 68 | { |
69 | 69 | return (int) $data['link_id']; |
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
73 | - * Get parent id - it's not used |
|
74 | - * |
|
75 | - * @param array $data The data from the link |
|
76 | - */ |
|
73 | + * Get parent id - it's not used |
|
74 | + * |
|
75 | + * @param array $data The data from the link |
|
76 | + */ |
|
77 | 77 | static public function get_item_parent_id($data) |
78 | 78 | { |
79 | 79 | // No parent |
@@ -81,12 +81,12 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
84 | - * Find the users who want to receive notifications |
|
85 | - * |
|
86 | - * @param array $data Data from submit link |
|
87 | - * @param array $options Options for finding users for notification |
|
88 | - * @return array |
|
89 | - */ |
|
84 | + * Find the users who want to receive notifications |
|
85 | + * |
|
86 | + * @param array $data Data from submit link |
|
87 | + * @param array $options Options for finding users for notification |
|
88 | + * @return array |
|
89 | + */ |
|
90 | 90 | public function find_users_for_notification($data, $options = array()) |
91 | 91 | { |
92 | 92 | $options = array_merge(array( |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
106 | - * Get the HTML formatted title of this notification |
|
107 | - * |
|
108 | - * @return string |
|
109 | - */ |
|
106 | + * Get the HTML formatted title of this notification |
|
107 | + * |
|
108 | + * @return string |
|
109 | + */ |
|
110 | 110 | public function get_title() |
111 | 111 | { |
112 | 112 | $link_name = $this->get_data('link_name'); |
@@ -116,20 +116,20 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
119 | - * Get email template |
|
120 | - * |
|
121 | - * @return string |
|
122 | - */ |
|
119 | + * Get email template |
|
120 | + * |
|
121 | + * @return string |
|
122 | + */ |
|
123 | 123 | public function get_email_template() |
124 | 124 | { |
125 | 125 | return '@ernadoo_phpbbdirectory/directory_website_disapproved'; |
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
129 | - * Get email template variables |
|
130 | - * |
|
131 | - * @return array |
|
132 | - */ |
|
129 | + * Get email template variables |
|
130 | + * |
|
131 | + * @return array |
|
132 | + */ |
|
133 | 133 | public function get_email_template_variables() |
134 | 134 | { |
135 | 135 | return array( |
@@ -138,33 +138,33 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
141 | - * Get the url to this item |
|
142 | - * |
|
143 | - * @return string URL |
|
144 | - */ |
|
141 | + * Get the url to this item |
|
142 | + * |
|
143 | + * @return string URL |
|
144 | + */ |
|
145 | 145 | public function get_url() |
146 | 146 | { |
147 | 147 | return ''; |
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
151 | - * Users needed to query before this notification can be displayed |
|
152 | - * |
|
153 | - * @return array Array of user_ids |
|
154 | - */ |
|
151 | + * Users needed to query before this notification can be displayed |
|
152 | + * |
|
153 | + * @return array Array of user_ids |
|
154 | + */ |
|
155 | 155 | public function users_to_query() |
156 | 156 | { |
157 | 157 | return array(); |
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
161 | - * Function for preparing the data for insertion in an SQL query |
|
162 | - * (The service handles insertion) |
|
163 | - * |
|
164 | - * @param array $data Data from submit link |
|
165 | - * @param array $pre_create_data Data from pre_create_insert_array() |
|
166 | - * @return array Array of data ready to be inserted into the database |
|
167 | - */ |
|
161 | + * Function for preparing the data for insertion in an SQL query |
|
162 | + * (The service handles insertion) |
|
163 | + * |
|
164 | + * @param array $data Data from submit link |
|
165 | + * @param array $pre_create_data Data from pre_create_insert_array() |
|
166 | + * @return array Array of data ready to be inserted into the database |
|
167 | + */ |
|
168 | 168 | public function create_insert_array($data, $pre_create_data = array()) |
169 | 169 | { |
170 | 170 | $this->set_data('link_name', $data['link_name']); |