@@ -46,18 +46,18 @@ discard block |
||
| 46 | 46 | public $data = array(); |
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | - * Constructor |
|
| 50 | - * |
|
| 51 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 52 | - * @param \phpbb\config\config $config Config object |
|
| 53 | - * @param \phpbb\language\language $language Language object |
|
| 54 | - * @param \phpbb\template\template $template Template object |
|
| 55 | - * @param \phpbb\user $user User object |
|
| 56 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
| 57 | - * @param \phpbb\request\request $request Request object |
|
| 58 | - * @param \phpbb\auth\auth $auth Auth object |
|
| 59 | - * @param \phpbb\cron\manager $cron Cron object |
|
| 60 | - */ |
|
| 49 | + * Constructor |
|
| 50 | + * |
|
| 51 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 52 | + * @param \phpbb\config\config $config Config object |
|
| 53 | + * @param \phpbb\language\language $language Language object |
|
| 54 | + * @param \phpbb\template\template $template Template object |
|
| 55 | + * @param \phpbb\user $user User object |
|
| 56 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
| 57 | + * @param \phpbb\request\request $request Request object |
|
| 58 | + * @param \phpbb\auth\auth $auth Auth object |
|
| 59 | + * @param \phpbb\cron\manager $cron Cron object |
|
| 60 | + */ |
|
| 61 | 61 | 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\cron\manager $cron) |
| 62 | 62 | { |
| 63 | 63 | $this->db = $db; |
@@ -72,21 +72,21 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | - * Function for get approval setting |
|
| 76 | - * used in edit mode for test the setting of new category's link |
|
| 77 | - * |
|
| 78 | - * @return bool |
|
| 79 | - */ |
|
| 75 | + * Function for get approval setting |
|
| 76 | + * used in edit mode for test the setting of new category's link |
|
| 77 | + * |
|
| 78 | + * @return bool |
|
| 79 | + */ |
|
| 80 | 80 | public function need_approval() |
| 81 | 81 | { |
| 82 | 82 | return (bool) $this->data['cat_validate']; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | - * Generate Jumpbox |
|
| 87 | - * |
|
| 88 | - * @return null |
|
| 89 | - */ |
|
| 86 | + * Generate Jumpbox |
|
| 87 | + * |
|
| 88 | + * @return null |
|
| 89 | + */ |
|
| 90 | 90 | public function make_cat_jumpbox() |
| 91 | 91 | { |
| 92 | 92 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
@@ -139,12 +139,12 @@ discard block |
||
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | - * Generate a list of directory's categories |
|
| 143 | - * |
|
| 144 | - * @param int $select_id Selected category |
|
| 145 | - * @param array $ignore_id Array of ignored categories |
|
| 146 | - * @return string $cat_list html code |
|
| 147 | - */ |
|
| 142 | + * Generate a list of directory's categories |
|
| 143 | + * |
|
| 144 | + * @param int $select_id Selected category |
|
| 145 | + * @param array $ignore_id Array of ignored categories |
|
| 146 | + * @return string $cat_list html code |
|
| 147 | + */ |
|
| 148 | 148 | public function make_cat_select($select_id = 0, $ignore_id = array()) |
| 149 | 149 | { |
| 150 | 150 | $ignore_id = is_array($ignore_id) ? $ignore_id : array($ignore_id); |
@@ -190,10 +190,10 @@ discard block |
||
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | /** |
| 193 | - * Display cat or subcat |
|
| 194 | - * |
|
| 195 | - * @return null |
|
| 196 | - */ |
|
| 193 | + * Display cat or subcat |
|
| 194 | + * |
|
| 195 | + * @return null |
|
| 196 | + */ |
|
| 197 | 197 | public function display() |
| 198 | 198 | { |
| 199 | 199 | $cat_rows = $subcats = array(); |
@@ -322,11 +322,11 @@ discard block |
||
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | /** |
| 325 | - * Get informations about a cat or subcat |
|
| 326 | - * |
|
| 327 | - * @param int $cat_id The category ID |
|
| 328 | - * @return null|false |
|
| 329 | - */ |
|
| 325 | + * Get informations about a cat or subcat |
|
| 326 | + * |
|
| 327 | + * @param int $cat_id The category ID |
|
| 328 | + * @return null|false |
|
| 329 | + */ |
|
| 330 | 330 | public function get($cat_id = 0) |
| 331 | 331 | { |
| 332 | 332 | if ($cat_id) |
@@ -354,11 +354,11 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | /** |
| 357 | - * Create category navigation links for given category, create parent |
|
| 358 | - * list if currently null, assign basic category info to template |
|
| 359 | - * |
|
| 360 | - * @param array $dir_cat_data |
|
| 361 | - */ |
|
| 357 | + * Create category navigation links for given category, create parent |
|
| 358 | + * list if currently null, assign basic category info to template |
|
| 359 | + * |
|
| 360 | + * @param array $dir_cat_data |
|
| 361 | + */ |
|
| 362 | 362 | public function generate_dir_nav(&$dir_cat_data) |
| 363 | 363 | { |
| 364 | 364 | global $phpbb_container; |
@@ -395,12 +395,12 @@ discard block |
||
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | /** |
| 398 | - * Return good key language |
|
| 399 | - * |
|
| 400 | - * @param bool $validate True if approbation needed before publication |
|
| 401 | - * @return string Information about approval, depends on user auth level |
|
| 402 | - * @throws \phpbb\exception\runtime_exception |
|
| 403 | - */ |
|
| 398 | + * Return good key language |
|
| 399 | + * |
|
| 400 | + * @param bool $validate True if approbation needed before publication |
|
| 401 | + * @return string Information about approval, depends on user auth level |
|
| 402 | + * @throws \phpbb\exception\runtime_exception |
|
| 403 | + */ |
|
| 404 | 404 | public function dir_submit_type($validate) |
| 405 | 405 | { |
| 406 | 406 | if ($validate && !$this->auth->acl_get('a_')) |
@@ -424,15 +424,15 @@ discard block |
||
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | /** |
| 427 | - * Category watching common code |
|
| 428 | - * |
|
| 429 | - * @param string $mode Watch or unwatch a category |
|
| 430 | - * @param array $s_watching An empty array, passed by reference |
|
| 431 | - * @param int $user_id The user ID |
|
| 432 | - * @param int $cat_id The category ID |
|
| 433 | - * @param string $notify_status User is watching the category? |
|
| 434 | - * @return null|string |
|
| 435 | - */ |
|
| 427 | + * Category watching common code |
|
| 428 | + * |
|
| 429 | + * @param string $mode Watch or unwatch a category |
|
| 430 | + * @param array $s_watching An empty array, passed by reference |
|
| 431 | + * @param int $user_id The user ID |
|
| 432 | + * @param int $cat_id The category ID |
|
| 433 | + * @param string $notify_status User is watching the category? |
|
| 434 | + * @return null|string |
|
| 435 | + */ |
|
| 436 | 436 | public function watch_categorie($mode, &$s_watching, $user_id, $cat_id, $notify_status) |
| 437 | 437 | { |
| 438 | 438 | // Is user watching this thread? |
@@ -518,11 +518,11 @@ discard block |
||
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | /** |
| 521 | - * Return Category name |
|
| 522 | - * |
|
| 523 | - * @param int $cat_id The category ID |
|
| 524 | - * @return string The category name |
|
| 525 | - */ |
|
| 521 | + * Return Category name |
|
| 522 | + * |
|
| 523 | + * @param int $cat_id The category ID |
|
| 524 | + * @return string The category name |
|
| 525 | + */ |
|
| 526 | 526 | static public function getname($cat_id) |
| 527 | 527 | { |
| 528 | 528 | global $db, $phpbb_container; |
@@ -60,13 +60,13 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | 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\cron\manager $cron) |
| 62 | 62 | { |
| 63 | - $this->db = $db; |
|
| 64 | - $this->config = $config; |
|
| 63 | + $this->db = $db; |
|
| 64 | + $this->config = $config; |
|
| 65 | 65 | $this->language = $language; |
| 66 | 66 | $this->template = $template; |
| 67 | 67 | $this->user = $user; |
| 68 | - $this->helper = $helper; |
|
| 69 | - $this->request = $request; |
|
| 68 | + $this->helper = $helper; |
|
| 69 | + $this->request = $request; |
|
| 70 | 70 | $this->auth = $auth; |
| 71 | 71 | $this->cron = $cron; |
| 72 | 72 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | public function make_cat_jumpbox() |
| 91 | 91 | { |
| 92 | 92 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
| 93 | - FROM ' . $this->categories_table . ' |
|
| 93 | + FROM ' . $this->categories_table.' |
|
| 94 | 94 | ORDER BY left_id ASC'; |
| 95 | 95 | $result = $this->db->sql_query($sql, 600); |
| 96 | 96 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | // This query is identical to the jumpbox one |
| 153 | 153 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
| 154 | - FROM ' . $this->categories_table . ' |
|
| 154 | + FROM ' . $this->categories_table.' |
|
| 155 | 155 | ORDER BY left_id ASC'; |
| 156 | 156 | $result = $this->db->sql_query($sql, 600); |
| 157 | 157 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | $selected = (($row['cat_id'] == $select_id) ? ' selected="selected"' : ''); |
| 184 | - $cat_list .= '<option value="' . $row['cat_id'] . '"' . (($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected) . '>' . $padding . $row['cat_name'] . '</option>'; |
|
| 184 | + $cat_list .= '<option value="'.$row['cat_id'].'"'.(($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected).'>'.$padding.$row['cat_name'].'</option>'; |
|
| 185 | 185 | } |
| 186 | 186 | $this->db->sql_freeresult($result); |
| 187 | 187 | unset($padding_store); |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | public function display() |
| 198 | 198 | { |
| 199 | - $cat_rows = $subcats = array(); |
|
| 199 | + $cat_rows = $subcats = array(); |
|
| 200 | 200 | $parent_id = $visible_cats = 0; |
| 201 | 201 | |
| 202 | 202 | $sql_array = array( |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | else |
| 215 | 215 | { |
| 216 | 216 | $root_data = $this->data; |
| 217 | - $sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id']; |
|
| 217 | + $sql_where = 'left_id > '.$root_data['left_id'].' AND left_id < '.$root_data['right_id']; |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | $sql = $this->db->sql_build_query('SELECT', array( |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | { |
| 262 | 262 | foreach ($subcats[$dir_cat_id] as $subcat_id => $subcat_row) |
| 263 | 263 | { |
| 264 | - $row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links']+$subcat_row['links']) : $row['cat_links']; |
|
| 264 | + $row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links'] + $subcat_row['links']) : $row['cat_links']; |
|
| 265 | 265 | |
| 266 | 266 | if ($subcat_row['display'] && $subcat_row['parent_id'] == $dir_cat_id) |
| 267 | 267 | { |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | if ($task->is_ready()) |
| 317 | 317 | { |
| 318 | 318 | $url = $task->get_url(); |
| 319 | - $this->template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="" />'); |
|
| 319 | + $this->template->assign_var('RUN_CRON_TASK', '<img src="'.$url.'" width="1" height="1" alt="" />'); |
|
| 320 | 320 | } |
| 321 | 321 | } |
| 322 | 322 | } |
@@ -338,10 +338,10 @@ discard block |
||
| 338 | 338 | 'LEFT_JOIN' => array( |
| 339 | 339 | array( |
| 340 | 340 | 'FROM' => array($this->watch_table => 'w'), |
| 341 | - 'ON' => 'c.cat_id = w.cat_id AND w.user_id = ' . (int) $this->user->data['user_id'] |
|
| 341 | + 'ON' => 'c.cat_id = w.cat_id AND w.user_id = '.(int) $this->user->data['user_id'] |
|
| 342 | 342 | ), |
| 343 | 343 | ), |
| 344 | - 'WHERE' => 'c.cat_id = ' . (int) $cat_id |
|
| 344 | + 'WHERE' => 'c.cat_id = '.(int) $cat_id |
|
| 345 | 345 | ); |
| 346 | 346 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
| 347 | 347 | $result = $this->db->sql_query($sql); |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | $this->template->assign_block_vars('dir_navlinks', array( |
| 379 | 379 | 'FORUM_NAME' => $parent_data['cat_name'], |
| 380 | 380 | 'FORUM_ID' => $parent_cat_id, |
| 381 | - 'MICRODATA' => $microdata_attr . '="' . $parent_cat_id . '"', |
|
| 381 | + 'MICRODATA' => $microdata_attr.'="'.$parent_cat_id.'"', |
|
| 382 | 382 | 'U_VIEW_FORUM' => $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $parent_cat_id)), |
| 383 | 383 | )); |
| 384 | 384 | } |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | $this->template->assign_block_vars('dir_navlinks', array( |
| 388 | 388 | 'FORUM_NAME' => $dir_cat_data['cat_name'], |
| 389 | 389 | 'FORUM_ID' => $dir_cat_data['cat_id'], |
| 390 | - 'MICRODATA' => $microdata_attr . '="' . $dir_cat_data['cat_id'] . '"', |
|
| 390 | + 'MICRODATA' => $microdata_attr.'="'.$dir_cat_data['cat_id'].'"', |
|
| 391 | 391 | 'U_VIEW_FORUM' => $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $dir_cat_data['cat_id'])), |
| 392 | 392 | )); |
| 393 | 393 | |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | { |
| 445 | 445 | if ($mode == 'unwatch') |
| 446 | 446 | { |
| 447 | - $sql = 'DELETE FROM ' . $this->watch_table . " |
|
| 447 | + $sql = 'DELETE FROM '.$this->watch_table." |
|
| 448 | 448 | WHERE cat_id = $cat_id |
| 449 | 449 | AND user_id = $user_id"; |
| 450 | 450 | $this->db->sql_query($sql); |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | |
| 455 | 455 | if (!$this->request->is_ajax()) |
| 456 | 456 | { |
| 457 | - $message .= '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>'); |
|
| 457 | + $message .= '<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>'); |
|
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | meta_refresh(3, $redirect_url); |
@@ -466,8 +466,8 @@ discard block |
||
| 466 | 466 | |
| 467 | 467 | if ($notify_status != NOTIFY_YES) |
| 468 | 468 | { |
| 469 | - $sql = 'UPDATE ' . $this->watch_table . ' |
|
| 470 | - SET notify_status = ' . NOTIFY_YES . " |
|
| 469 | + $sql = 'UPDATE '.$this->watch_table.' |
|
| 470 | + SET notify_status = ' . NOTIFY_YES." |
|
| 471 | 471 | WHERE cat_id = $cat_id |
| 472 | 472 | AND user_id = $user_id"; |
| 473 | 473 | $this->db->sql_query($sql); |
@@ -478,8 +478,8 @@ discard block |
||
| 478 | 478 | { |
| 479 | 479 | if ($mode == 'watch') |
| 480 | 480 | { |
| 481 | - $sql = 'INSERT INTO ' . $this->watch_table . " (user_id, cat_id, notify_status) |
|
| 482 | - VALUES ($user_id, $cat_id, " . NOTIFY_YES . ')'; |
|
| 481 | + $sql = 'INSERT INTO '.$this->watch_table." (user_id, cat_id, notify_status) |
|
| 482 | + VALUES ($user_id, $cat_id, ".NOTIFY_YES.')'; |
|
| 483 | 483 | $this->db->sql_query($sql); |
| 484 | 484 | |
| 485 | 485 | $redirect_url = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)); |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | |
| 488 | 488 | if (!$this->request->is_ajax()) |
| 489 | 489 | { |
| 490 | - $message .= '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>'); |
|
| 490 | + $message .= '<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>'); |
|
| 491 | 491 | } |
| 492 | 492 | |
| 493 | 493 | meta_refresh(3, $redirect_url); |
@@ -507,10 +507,10 @@ discard block |
||
| 507 | 507 | |
| 508 | 508 | if ($can_watch) |
| 509 | 509 | { |
| 510 | - $s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch'))); |
|
| 510 | + $s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch'))); |
|
| 511 | 511 | $s_watching['link_toggle'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => ((!$is_watching) ? 'unwatch' : 'watch'))); |
| 512 | - $s_watching['title'] = $this->language->lang((($is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT'); |
|
| 513 | - $s_watching['title_toggle'] = $this->language->lang(((!$is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT'); |
|
| 512 | + $s_watching['title'] = $this->language->lang((($is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT'); |
|
| 513 | + $s_watching['title_toggle'] = $this->language->lang(((!$is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT'); |
|
| 514 | 514 | $s_watching['is_watching'] = $is_watching; |
| 515 | 515 | } |
| 516 | 516 | |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | $categories_table = $phpbb_container->getParameter('tables.dir.categories'); |
| 531 | 531 | |
| 532 | 532 | $sql = 'SELECT cat_name |
| 533 | - FROM ' . $categories_table . ' |
|
| 533 | + FROM ' . $categories_table.' |
|
| 534 | 534 | WHERE cat_id = ' . (int) $cat_id; |
| 535 | 535 | $result = $db->sql_query($sql); |
| 536 | 536 | $row = $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\config\config $config Config object |
|
| 46 | - * @param \phpbb\log\log $phpbb_log Log object |
|
| 47 | - * @param \phpbb\user $user User object |
|
| 48 | - * @param \phpbb\notification\manager $notification Notification object |
|
| 49 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
| 50 | - * @param string $root_path phpBB root path |
|
| 51 | - * @param string $php_ext phpEx |
|
| 52 | - */ |
|
| 42 | + * Constructor |
|
| 43 | + * |
|
| 44 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 45 | + * @param \phpbb\config\config $config Config object |
|
| 46 | + * @param \phpbb\log\log $phpbb_log Log object |
|
| 47 | + * @param \phpbb\user $user User object |
|
| 48 | + * @param \phpbb\notification\manager $notification Notification object |
|
| 49 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
| 50 | + * @param string $root_path phpBB root path |
|
| 51 | + * @param string $php_ext phpEx |
|
| 52 | + */ |
|
| 53 | 53 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\log\log $phpbb_log, \phpbb\user $user, \phpbb\notification\manager $notification, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext) |
| 54 | 54 | { |
| 55 | 55 | $this->db = $db; |
@@ -63,11 +63,11 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | - * Method called by cron task. |
|
| 67 | - * |
|
| 68 | - * @param array $cat_data Information about category, from db |
|
| 69 | - * @return null |
|
| 70 | - */ |
|
| 66 | + * Method called by cron task. |
|
| 67 | + * |
|
| 68 | + * @param array $cat_data Information about category, from db |
|
| 69 | + * @return null |
|
| 70 | + */ |
|
| 71 | 71 | public function auto_check($cat_data) |
| 72 | 72 | { |
| 73 | 73 | $sql = 'SELECT cat_name |
@@ -116,14 +116,14 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | - * Check, for website with backlink specified, if backlink is always here. |
|
| 120 | - * After $nb_check verification, website is deleted, otherwise, a notification is send to poster |
|
| 121 | - * |
|
| 122 | - * @param int $cat_id The category ID |
|
| 123 | - * @param int $nb_check Number of check before demete a website |
|
| 124 | - * @param int $next_prune Date of next auto check |
|
| 125 | - * @return null |
|
| 126 | - */ |
|
| 119 | + * Check, for website with backlink specified, if backlink is always here. |
|
| 120 | + * After $nb_check verification, website is deleted, otherwise, a notification is send to poster |
|
| 121 | + * |
|
| 122 | + * @param int $cat_id The category ID |
|
| 123 | + * @param int $nb_check Number of check before demete a website |
|
| 124 | + * @param int $next_prune Date of next auto check |
|
| 125 | + * @return null |
|
| 126 | + */ |
|
| 127 | 127 | private function _check($cat_id, $nb_check, $next_prune) |
| 128 | 128 | { |
| 129 | 129 | $del_array = $update_array = array(); |
@@ -171,12 +171,12 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
| 174 | - * Update website verification number after a missing backlink, and send notificaton |
|
| 175 | - * |
|
| 176 | - * @param array $u_array Information about website |
|
| 177 | - * @param int $next_prune Date of next auto check |
|
| 178 | - * @return null |
|
| 179 | - */ |
|
| 174 | + * Update website verification number after a missing backlink, and send notificaton |
|
| 175 | + * |
|
| 176 | + * @param array $u_array Information about website |
|
| 177 | + * @param int $next_prune Date of next auto check |
|
| 178 | + * @return null |
|
| 179 | + */ |
|
| 180 | 180 | private function _update_check($u_array, $next_prune) |
| 181 | 181 | { |
| 182 | 182 | if (!class_exists('messenger')) |
@@ -52,14 +52,14 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\log\log $phpbb_log, \phpbb\user $user, \phpbb\notification\manager $notification, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext) |
| 54 | 54 | { |
| 55 | - $this->db = $db; |
|
| 56 | - $this->config = $config; |
|
| 57 | - $this->phpbb_log = $phpbb_log; |
|
| 55 | + $this->db = $db; |
|
| 56 | + $this->config = $config; |
|
| 57 | + $this->phpbb_log = $phpbb_log; |
|
| 58 | 58 | $this->user = $user; |
| 59 | - $this->notification = $notification; |
|
| 59 | + $this->notification = $notification; |
|
| 60 | 60 | $this->link = $link; |
| 61 | - $this->root_path = $root_path; |
|
| 62 | - $this->php_ext = $php_ext; |
|
| 61 | + $this->root_path = $root_path; |
|
| 62 | + $this->php_ext = $php_ext; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | public function auto_check($cat_data) |
| 72 | 72 | { |
| 73 | 73 | $sql = 'SELECT cat_name |
| 74 | - FROM ' . $this->categories_table . ' |
|
| 74 | + FROM ' . $this->categories_table.' |
|
| 75 | 75 | WHERE cat_id = ' . (int) $cat_data['cat_id']; |
| 76 | 76 | $result = $this->db->sql_query($sql); |
| 77 | 77 | $row = $this->db->sql_fetchrow($result); |
@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $this->_check($cat_data['cat_id'], $cat_data['cat_cron_nb_check'], $next_prune); |
| 85 | 85 | |
| 86 | - $sql = 'UPDATE ' . $this->categories_table . " |
|
| 86 | + $sql = 'UPDATE '.$this->categories_table." |
|
| 87 | 87 | SET cat_cron_next = $next_prune |
| 88 | - WHERE cat_id = " . (int) $cat_data['cat_id']; |
|
| 88 | + WHERE cat_id = ".(int) $cat_data['cat_id']; |
|
| 89 | 89 | $this->db->sql_query($sql); |
| 90 | 90 | |
| 91 | 91 | $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_AUTO_PRUNE', time(), array($row['cat_name'])); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | public function get_cat($cat_id) |
| 104 | 104 | { |
| 105 | 105 | $sql = 'SELECT cat_id, cat_cron_enable, cat_cron_next, cat_cron_freq, cat_cron_nb_check |
| 106 | - FROM ' . $this->categories_table . ' |
|
| 106 | + FROM ' . $this->categories_table.' |
|
| 107 | 107 | WHERE cat_id = ' . (int) $cat_id; |
| 108 | 108 | $result = $this->db->sql_query($sql); |
| 109 | 109 | $row = $this->db->sql_fetchrow($result); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | 'ON' => 'l.link_user_id = u.user_id' |
| 139 | 139 | ) |
| 140 | 140 | ), |
| 141 | - 'WHERE' => 'l.link_back <> "" AND l.link_active = 1 AND l.link_cat = ' . (int) $cat_id); |
|
| 141 | + 'WHERE' => 'l.link_back <> "" AND l.link_active = 1 AND l.link_cat = '.(int) $cat_id); |
|
| 142 | 142 | |
| 143 | 143 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
| 144 | 144 | $result = $this->db->sql_query($sql); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | { |
| 148 | 148 | if ($this->link->validate_link_back($row['link_back'], false, true) !== false) |
| 149 | 149 | { |
| 150 | - if (!$nb_check || ($row['link_nb_check']+1) >= $nb_check) |
|
| 150 | + if (!$nb_check || ($row['link_nb_check'] + 1) >= $nb_check) |
|
| 151 | 151 | { |
| 152 | 152 | $del_array[] = $row['link_id']; |
| 153 | 153 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | { |
| 182 | 182 | if (!class_exists('messenger')) |
| 183 | 183 | { |
| 184 | - include($this->root_path . 'includes/functions_messenger.' . $this->php_ext); |
|
| 184 | + include($this->root_path.'includes/functions_messenger.'.$this->php_ext); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | $messenger = new \messenger(false); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | // We need to define it, because we use user->format_date below |
| 191 | 191 | $this->user->timezone = new \DateTimeZone($this->config['board_timezone']); |
| 192 | 192 | |
| 193 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 193 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 194 | 194 | SET link_nb_check = link_nb_check + 1 |
| 195 | 195 | WHERE ' . $this->db->sql_in_set('link_id', array_keys($u_array)); |
| 196 | 196 | $this->db->sql_query($sql); |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language) |
| 30 | 30 | { |
| 31 | - $this->db = $db; |
|
| 32 | - $this->language = $language; |
|
| 31 | + $this->db = $db; |
|
| 32 | + $this->language = $language; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -42,10 +42,10 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | $this->db->sql_transaction('begin'); |
| 44 | 44 | |
| 45 | - $sql = 'INSERT INTO ' . $this->comments_table . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
| 45 | + $sql = 'INSERT INTO '.$this->comments_table.' '.$this->db->sql_build_array('INSERT', $data); |
|
| 46 | 46 | $this->db->sql_query($sql); |
| 47 | 47 | |
| 48 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 48 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 49 | 49 | SET link_comment = link_comment + 1 |
| 50 | 50 | WHERE link_id = ' . (int) $data['comment_link_id']; |
| 51 | 51 | $this->db->sql_query($sql); |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function edit($data, $comment_id) |
| 64 | 64 | { |
| 65 | - $sql = 'UPDATE ' . $this->comments_table . ' |
|
| 66 | - SET ' . $this->db->sql_build_array('UPDATE', $data) . ' |
|
| 65 | + $sql = 'UPDATE '.$this->comments_table.' |
|
| 66 | + SET ' . $this->db->sql_build_array('UPDATE', $data).' |
|
| 67 | 67 | WHERE comment_id = ' . (int) $comment_id; |
| 68 | 68 | $this->db->sql_query($sql); |
| 69 | 69 | } |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | $this->db->sql_transaction('begin'); |
| 83 | 83 | |
| 84 | - $sql = 'DELETE FROM ' . $this->comments_table . ' WHERE comment_id = ' . (int) $comment_id; |
|
| 84 | + $sql = 'DELETE FROM '.$this->comments_table.' WHERE comment_id = '.(int) $comment_id; |
|
| 85 | 85 | $this->db->sql_query($sql); |
| 86 | 86 | |
| 87 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 87 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 88 | 88 | SET link_comment = link_comment - 1 |
| 89 | 89 | WHERE link_id = ' . (int) $link_id; |
| 90 | 90 | $this->db->sql_query($sql); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | if ($request->is_ajax()) |
| 95 | 95 | { |
| 96 | 96 | $sql = 'SELECT COUNT(comment_id) AS nb_comments |
| 97 | - FROM ' . $this->comments_table . ' |
|
| 97 | + FROM ' . $this->comments_table.' |
|
| 98 | 98 | WHERE comment_link_id = ' . (int) $link_id; |
| 99 | 99 | $result = $this->db->sql_query($sql); |
| 100 | 100 | $nb_comments = (int) $this->db->sql_fetchfield('nb_comments'); |
@@ -21,11 +21,11 @@ discard block |
||
| 21 | 21 | protected $language; |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * Constructor |
|
| 25 | - * |
|
| 26 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 27 | - * @param \phpbb\language\language $language Language object |
|
| 28 | - */ |
|
| 24 | + * Constructor |
|
| 25 | + * |
|
| 26 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 27 | + * @param \phpbb\language\language $language Language object |
|
| 28 | + */ |
|
| 29 | 29 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language) |
| 30 | 30 | { |
| 31 | 31 | $this->db = $db; |
@@ -33,11 +33,11 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | - * Add a comment |
|
| 37 | - * |
|
| 38 | - * @param array $data Link's data from db |
|
| 39 | - * @return null |
|
| 40 | - */ |
|
| 36 | + * Add a comment |
|
| 37 | + * |
|
| 38 | + * @param array $data Link's data from db |
|
| 39 | + * @return null |
|
| 40 | + */ |
|
| 41 | 41 | public function add($data) |
| 42 | 42 | { |
| 43 | 43 | $this->db->sql_transaction('begin'); |
@@ -54,12 +54,12 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | - * Edit a comment |
|
| 58 | - * |
|
| 59 | - * @param array $data Data to edit |
|
| 60 | - * @param int $comment_id The comment ID |
|
| 61 | - * @return null |
|
| 62 | - */ |
|
| 57 | + * Edit a comment |
|
| 58 | + * |
|
| 59 | + * @param array $data Data to edit |
|
| 60 | + * @param int $comment_id The comment ID |
|
| 61 | + * @return null |
|
| 62 | + */ |
|
| 63 | 63 | public function edit($data, $comment_id) |
| 64 | 64 | { |
| 65 | 65 | $sql = 'UPDATE ' . $this->comments_table . ' |
@@ -69,12 +69,12 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | - * Delete a comment |
|
| 73 | - * |
|
| 74 | - * @param string $link_id The link ID |
|
| 75 | - * @param string $comment_id The comment ID |
|
| 76 | - * @return null |
|
| 77 | - */ |
|
| 72 | + * Delete a comment |
|
| 73 | + * |
|
| 74 | + * @param string $link_id The link ID |
|
| 75 | + * @param string $comment_id The comment ID |
|
| 76 | + * @return null |
|
| 77 | + */ |
|
| 78 | 78 | public function del($link_id, $comment_id) |
| 79 | 79 | { |
| 80 | 80 | global $request; |
@@ -57,23 +57,23 @@ discard block |
||
| 57 | 57 | protected $php_ext; |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | - * Constructor |
|
| 61 | - * |
|
| 62 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 63 | - * @param \phpbb\config\config $config Config object |
|
| 64 | - * @param \phpbb\language\language $language Language object |
|
| 65 | - * @param \phpbb\template\template $template Template object |
|
| 66 | - * @param \phpbb\user $user User object |
|
| 67 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
| 68 | - * @param \phpbb\request\request $request Request object |
|
| 69 | - * @param \phpbb\auth\auth $auth Auth object |
|
| 70 | - * @param \phpbb\notification\manager $notification Notification object |
|
| 71 | - * @param \phpbb\filesystem\filesystem_interface $filesystem phpBB filesystem helper |
|
| 72 | - * @param \FastImageSize\FastImageSize $imagesize FastImageSize class |
|
| 73 | - * @param \phpbb\files\factory $files_factory File classes factory |
|
| 74 | - * @param string $root_path phpBB root path |
|
| 75 | - * @param string $php_ext phpEx |
|
| 76 | - */ |
|
| 60 | + * Constructor |
|
| 61 | + * |
|
| 62 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 63 | + * @param \phpbb\config\config $config Config object |
|
| 64 | + * @param \phpbb\language\language $language Language object |
|
| 65 | + * @param \phpbb\template\template $template Template object |
|
| 66 | + * @param \phpbb\user $user User object |
|
| 67 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
| 68 | + * @param \phpbb\request\request $request Request object |
|
| 69 | + * @param \phpbb\auth\auth $auth Auth object |
|
| 70 | + * @param \phpbb\notification\manager $notification Notification object |
|
| 71 | + * @param \phpbb\filesystem\filesystem_interface $filesystem phpBB filesystem helper |
|
| 72 | + * @param \FastImageSize\FastImageSize $imagesize FastImageSize class |
|
| 73 | + * @param \phpbb\files\factory $files_factory File classes factory |
|
| 74 | + * @param string $root_path phpBB root path |
|
| 75 | + * @param string $php_ext phpEx |
|
| 76 | + */ |
|
| 77 | 77 | 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, $root_path, $php_ext) |
| 78 | 78 | { |
| 79 | 79 | $this->db = $db; |
@@ -93,12 +93,12 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | - * Add a link into db |
|
| 97 | - * |
|
| 98 | - * @param array $data Contains all data to insert in db |
|
| 99 | - * @param bool $need_approval Links needs to be approved? |
|
| 100 | - * @return null |
|
| 101 | - */ |
|
| 96 | + * Add a link into db |
|
| 97 | + * |
|
| 98 | + * @param array $data Contains all data to insert in db |
|
| 99 | + * @param bool $need_approval Links needs to be approved? |
|
| 100 | + * @return null |
|
| 101 | + */ |
|
| 102 | 102 | public function add($data, $need_approval) |
| 103 | 103 | { |
| 104 | 104 | $notification_data = array(); |
@@ -143,13 +143,13 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
| 146 | - * Edit a link of the db |
|
| 147 | - * |
|
| 148 | - * @param array $data Contains all data to edit in db |
|
| 149 | - * @param int $link_id is link's id, for WHERE clause |
|
| 150 | - * @param bool $need_approval Links needs to be approved? |
|
| 151 | - * @return null |
|
| 152 | - */ |
|
| 146 | + * Edit a link of the db |
|
| 147 | + * |
|
| 148 | + * @param array $data Contains all data to edit in db |
|
| 149 | + * @param int $link_id is link's id, for WHERE clause |
|
| 150 | + * @param bool $need_approval Links needs to be approved? |
|
| 151 | + * @return null |
|
| 152 | + */ |
|
| 153 | 153 | public function edit($data, $link_id, $need_approval) |
| 154 | 154 | { |
| 155 | 155 | $notification_data = array( |
@@ -201,12 +201,12 @@ discard block |
||
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /** |
| 204 | - * Delete a link of the db |
|
| 205 | - * |
|
| 206 | - * @param int $cat_id The category ID |
|
| 207 | - * @param mixed $link_id Link's id, for WHERE clause |
|
| 208 | - * @return null |
|
| 209 | - */ |
|
| 204 | + * Delete a link of the db |
|
| 205 | + * |
|
| 206 | + * @param int $cat_id The category ID |
|
| 207 | + * @param mixed $link_id Link's id, for WHERE clause |
|
| 208 | + * @return null |
|
| 209 | + */ |
|
| 210 | 210 | public function del($cat_id, $link_id) |
| 211 | 211 | { |
| 212 | 212 | $this->db->sql_transaction('begin'); |
@@ -279,12 +279,12 @@ discard block |
||
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | /** |
| 282 | - * Increments link view counter |
|
| 283 | - * |
|
| 284 | - * @param int $link_id Link's id, for WHERE clause |
|
| 285 | - * @return null |
|
| 286 | - * @throws \phpbb\exception\http_exception |
|
| 287 | - */ |
|
| 282 | + * Increments link view counter |
|
| 283 | + * |
|
| 284 | + * @param int $link_id Link's id, for WHERE clause |
|
| 285 | + * @return null |
|
| 286 | + * @throws \phpbb\exception\http_exception |
|
| 287 | + */ |
|
| 288 | 288 | public function view($link_id) |
| 289 | 289 | { |
| 290 | 290 | $sql = 'SELECT link_id, link_url |
@@ -308,11 +308,11 @@ discard block |
||
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | /** |
| 311 | - * Verify that an URL exist before add into db |
|
| 312 | - * |
|
| 313 | - * @param string $url The URL to check |
|
| 314 | - * @return bool True if url is reachable, else false. |
|
| 315 | - */ |
|
| 311 | + * Verify that an URL exist before add into db |
|
| 312 | + * |
|
| 313 | + * @param string $url The URL to check |
|
| 314 | + * @return bool True if url is reachable, else false. |
|
| 315 | + */ |
|
| 316 | 316 | public function checkurl($url) |
| 317 | 317 | { |
| 318 | 318 | $details = parse_url($url); |
@@ -351,11 +351,11 @@ discard block |
||
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | /** |
| 354 | - * Delete the final '/', if no path |
|
| 355 | - * |
|
| 356 | - * @param string $url URL to clean |
|
| 357 | - * @return string $url The correct string. |
|
| 358 | - */ |
|
| 354 | + * Delete the final '/', if no path |
|
| 355 | + * |
|
| 356 | + * @param string $url URL to clean |
|
| 357 | + * @return string $url The correct string. |
|
| 358 | + */ |
|
| 359 | 359 | public function clean_url($url) |
| 360 | 360 | { |
| 361 | 361 | $details = parse_url($url); |
@@ -368,11 +368,11 @@ discard block |
||
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | /** |
| 371 | - * Display a flag |
|
| 372 | - * |
|
| 373 | - * @param array $data Link's data from db |
|
| 374 | - * @return string Flag path. |
|
| 375 | - */ |
|
| 371 | + * Display a flag |
|
| 372 | + * |
|
| 373 | + * @param array $data Link's data from db |
|
| 374 | + * @return string Flag path. |
|
| 375 | + */ |
|
| 376 | 376 | public function display_flag($data) |
| 377 | 377 | { |
| 378 | 378 | global $phpbb_extension_manager; |
@@ -390,13 +390,13 @@ discard block |
||
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | /** |
| 393 | - * Calculate the link's note |
|
| 394 | - * |
|
| 395 | - * @param int $total_note Sum of all link's notes |
|
| 396 | - * @param int $nb_vote Number of votes |
|
| 397 | - * @param bool $votes_status Votes are enable in this category? |
|
| 398 | - * @return string $note The calculated note. |
|
| 399 | - */ |
|
| 393 | + * Calculate the link's note |
|
| 394 | + * |
|
| 395 | + * @param int $total_note Sum of all link's notes |
|
| 396 | + * @param int $nb_vote Number of votes |
|
| 397 | + * @param bool $votes_status Votes are enable in this category? |
|
| 398 | + * @return string $note The calculated note. |
|
| 399 | + */ |
|
| 400 | 400 | public function display_note($total_note, $nb_vote, $votes_status) |
| 401 | 401 | { |
| 402 | 402 | if (!$votes_status) |
@@ -411,11 +411,11 @@ discard block |
||
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | /** |
| 414 | - * Display the vote form for auth users |
|
| 415 | - * |
|
| 416 | - * @param array $data Link's data from db |
|
| 417 | - * @return null|string Html combo list or nothing if votes are not available. |
|
| 418 | - */ |
|
| 414 | + * Display the vote form for auth users |
|
| 415 | + * |
|
| 416 | + * @param array $data Link's data from db |
|
| 417 | + * @return null|string Html combo list or nothing if votes are not available. |
|
| 418 | + */ |
|
| 419 | 419 | public function display_vote($data) |
| 420 | 420 | { |
| 421 | 421 | if ($this->user->data['is_registered'] && $this->auth->acl_get('u_vote_dir') && empty($data['vote_user_id'])) |
@@ -432,11 +432,11 @@ discard block |
||
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | /** |
| 435 | - * Display the RSS icon |
|
| 436 | - * |
|
| 437 | - * @param array $data Link's data from db |
|
| 438 | - * @return null|string RSS feed URL or nothing. |
|
| 439 | - */ |
|
| 435 | + * Display the RSS icon |
|
| 436 | + * |
|
| 437 | + * @param array $data Link's data from db |
|
| 438 | + * @return null|string RSS feed URL or nothing. |
|
| 439 | + */ |
|
| 440 | 440 | public function display_rss($data) |
| 441 | 441 | { |
| 442 | 442 | if ($this->config['dir_activ_rss'] && !empty($data['link_rss'])) |
@@ -446,13 +446,13 @@ discard block |
||
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | /** |
| 449 | - * Display link's thumb if thumb service enabled. |
|
| 450 | - * if thumb don't exists in db or if a new service was choosen in acp |
|
| 451 | - * thumb is research |
|
| 452 | - * |
|
| 453 | - * @param array $data Link's data from db |
|
| 454 | - * @return string|null Thumb or null. |
|
| 455 | - */ |
|
| 449 | + * Display link's thumb if thumb service enabled. |
|
| 450 | + * if thumb don't exists in db or if a new service was choosen in acp |
|
| 451 | + * thumb is research |
|
| 452 | + * |
|
| 453 | + * @param array $data Link's data from db |
|
| 454 | + * @return string|null Thumb or null. |
|
| 455 | + */ |
|
| 456 | 456 | public function display_thumb($data) |
| 457 | 457 | { |
| 458 | 458 | if ($this->config['dir_activ_thumb']) |
@@ -473,11 +473,11 @@ discard block |
||
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | /** |
| 476 | - * Display and calculate PageRank if needed |
|
| 477 | - * |
|
| 478 | - * @param array $data Link's data from db |
|
| 479 | - * @return string Pagerank, 'n/a' or false |
|
| 480 | - */ |
|
| 476 | + * Display and calculate PageRank if needed |
|
| 477 | + * |
|
| 478 | + * @param array $data Link's data from db |
|
| 479 | + * @return string Pagerank, 'n/a' or false |
|
| 480 | + */ |
|
| 481 | 481 | public function display_pagerank($data) |
| 482 | 482 | { |
| 483 | 483 | if ($this->config['dir_activ_pagerank']) |
@@ -507,11 +507,11 @@ discard block |
||
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | /** |
| 510 | - * Display and resize a banner |
|
| 511 | - * |
|
| 512 | - * @param array $data link's data from db |
|
| 513 | - * @return string $s_banner html code. |
|
| 514 | - */ |
|
| 510 | + * Display and resize a banner |
|
| 511 | + * |
|
| 512 | + * @param array $data link's data from db |
|
| 513 | + * @return string $s_banner html code. |
|
| 514 | + */ |
|
| 515 | 515 | public function display_bann($data) |
| 516 | 516 | { |
| 517 | 517 | if (!empty($data['link_banner'])) |
@@ -549,11 +549,11 @@ discard block |
||
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | /** |
| 552 | - * Add a vote in db, for a specifi link |
|
| 553 | - * |
|
| 554 | - * @param int $link_id Link_id from db |
|
| 555 | - * @return null |
|
| 556 | - */ |
|
| 552 | + * Add a vote in db, for a specifi link |
|
| 553 | + * |
|
| 554 | + * @param int $link_id Link_id from db |
|
| 555 | + * @return null |
|
| 556 | + */ |
|
| 557 | 557 | public function add_vote($link_id) |
| 558 | 558 | { |
| 559 | 559 | $data = array( |
@@ -597,11 +597,11 @@ discard block |
||
| 597 | 597 | } |
| 598 | 598 | |
| 599 | 599 | /** |
| 600 | - * Search an appropriate thumb for url |
|
| 601 | - * |
|
| 602 | - * @param string $url Link's url |
|
| 603 | - * @return string The thumb url |
|
| 604 | - */ |
|
| 600 | + * Search an appropriate thumb for url |
|
| 601 | + * |
|
| 602 | + * @param string $url Link's url |
|
| 603 | + * @return string The thumb url |
|
| 604 | + */ |
|
| 605 | 605 | public function thumb_process($url) |
| 606 | 606 | { |
| 607 | 607 | if (!$this->config['dir_activ_thumb']) |
@@ -622,12 +622,12 @@ discard block |
||
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | /** |
| 625 | - * Check if ascreen thumb exists |
|
| 626 | - * |
|
| 627 | - * @param string $protocol The protocol |
|
| 628 | - * @param string $host The hostname |
|
| 629 | - * @return bool True if ascreen file exixts, else false |
|
| 630 | - */ |
|
| 625 | + * Check if ascreen thumb exists |
|
| 626 | + * |
|
| 627 | + * @param string $protocol The protocol |
|
| 628 | + * @param string $host The hostname |
|
| 629 | + * @return bool True if ascreen file exixts, else false |
|
| 630 | + */ |
|
| 631 | 631 | private function _ascreen_exist($protocol, $host) |
| 632 | 632 | { |
| 633 | 633 | if (($thumb_info = $this->imagesize->getImageSize($protocol.'://'.$host.'/ascreen.jpg')) !== false) |
@@ -642,12 +642,12 @@ discard block |
||
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | /** |
| 645 | - * Primary work on banner, can edit, copy or check a banner |
|
| 646 | - * |
|
| 647 | - * @param string $banner The banner's remote url |
|
| 648 | - * @param array $error The array error, passed by reference |
|
| 649 | - * @return null |
|
| 650 | - */ |
|
| 645 | + * Primary work on banner, can edit, copy or check a banner |
|
| 646 | + * |
|
| 647 | + * @param string $banner The banner's remote url |
|
| 648 | + * @param array $error The array error, passed by reference |
|
| 649 | + * @return null |
|
| 650 | + */ |
|
| 651 | 651 | public function banner_process(&$banner, &$error) |
| 652 | 652 | { |
| 653 | 653 | $old_banner = $this->request->variable('old_banner', ''); |
@@ -683,13 +683,13 @@ discard block |
||
| 683 | 683 | } |
| 684 | 684 | |
| 685 | 685 | /** |
| 686 | - * Copy a remonte banner to server. |
|
| 687 | - * called by banner_process() |
|
| 688 | - * |
|
| 689 | - * @param string $banner The banner's remote url |
|
| 690 | - * @param array $error The array error, passed by reference |
|
| 691 | - * @return false|string String if no errors, else false |
|
| 692 | - */ |
|
| 686 | + * Copy a remonte banner to server. |
|
| 687 | + * called by banner_process() |
|
| 688 | + * |
|
| 689 | + * @param string $banner The banner's remote url |
|
| 690 | + * @param array $error The array error, passed by reference |
|
| 691 | + * @return false|string String if no errors, else false |
|
| 692 | + */ |
|
| 693 | 693 | private function _banner_upload($banner, &$error) |
| 694 | 694 | { |
| 695 | 695 | /** @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->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) |
@@ -76,20 +76,20 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | 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, $root_path, $php_ext) |
| 78 | 78 | { |
| 79 | - $this->db = $db; |
|
| 80 | - $this->config = $config; |
|
| 79 | + $this->db = $db; |
|
| 80 | + $this->config = $config; |
|
| 81 | 81 | $this->language = $language; |
| 82 | 82 | $this->template = $template; |
| 83 | 83 | $this->user = $user; |
| 84 | - $this->helper = $helper; |
|
| 85 | - $this->request = $request; |
|
| 84 | + $this->helper = $helper; |
|
| 85 | + $this->request = $request; |
|
| 86 | 86 | $this->auth = $auth; |
| 87 | - $this->notification = $notification; |
|
| 88 | - $this->filesystem = $filesystem; |
|
| 87 | + $this->notification = $notification; |
|
| 88 | + $this->filesystem = $filesystem; |
|
| 89 | 89 | $this->imagesize = $imagesize; |
| 90 | - $this->files_factory = $files_factory; |
|
| 90 | + $this->files_factory = $files_factory; |
|
| 91 | 91 | $this->root_path = $root_path; |
| 92 | - $this->php_ext = $php_ext; |
|
| 92 | + $this->php_ext = $php_ext; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -105,13 +105,13 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | $this->db->sql_transaction('begin'); |
| 107 | 107 | |
| 108 | - $sql = 'INSERT INTO ' . $this->links_table . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
| 108 | + $sql = 'INSERT INTO '.$this->links_table.' '.$this->db->sql_build_array('INSERT', $data); |
|
| 109 | 109 | $this->db->sql_query($sql); |
| 110 | 110 | $notification_data['link_id'] = $this->db->sql_nextid(); |
| 111 | 111 | |
| 112 | 112 | if (!$need_approval || $this->auth->acl_get('a_') || $this->auth->acl_get('m_')) |
| 113 | 113 | { |
| 114 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
| 114 | + $sql = 'UPDATE '.$this->categories_table.' |
|
| 115 | 115 | SET cat_links = cat_links + 1 |
| 116 | 116 | WHERE cat_id = ' . (int) $data['link_cat']; |
| 117 | 117 | $this->db->sql_query($sql); |
@@ -169,14 +169,14 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | $this->db->sql_transaction('begin'); |
| 171 | 171 | |
| 172 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
| 172 | + $sql = 'UPDATE '.$this->categories_table.' |
|
| 173 | 173 | SET cat_links = cat_links - 1 |
| 174 | 174 | WHERE cat_id = ' . (int) $old_cat; |
| 175 | 175 | $this->db->sql_query($sql); |
| 176 | 176 | |
| 177 | 177 | if (!$need_approval) |
| 178 | 178 | { |
| 179 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
| 179 | + $sql = 'UPDATE '.$this->categories_table.' |
|
| 180 | 180 | SET cat_links = cat_links + 1 |
| 181 | 181 | WHERE cat_id = ' . (int) $data['link_cat']; |
| 182 | 182 | $this->db->sql_query($sql); |
@@ -194,8 +194,8 @@ discard block |
||
| 194 | 194 | $this->notification->add_notifications($notification_type, $notification_data); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 198 | - SET ' . $this->db->sql_build_array('UPDATE', $data) . ' |
|
| 197 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 198 | + SET ' . $this->db->sql_build_array('UPDATE', $data).' |
|
| 199 | 199 | WHERE link_id = ' . (int) $link_id; |
| 200 | 200 | $this->db->sql_query($sql); |
| 201 | 201 | } |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | ); |
| 222 | 222 | |
| 223 | 223 | $sql = 'SELECT link_banner |
| 224 | - FROM ' . $this->links_table . ' |
|
| 224 | + FROM ' . $this->links_table.' |
|
| 225 | 225 | WHERE '. $this->db->sql_in_set('link_id', $url_array); |
| 226 | 226 | $result = $this->db->sql_query($sql); |
| 227 | 227 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | $this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $url_array)); |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
| 246 | + $sql = 'UPDATE '.$this->categories_table.' |
|
| 247 | 247 | SET cat_links = cat_links - '.sizeof($url_array).' |
| 248 | 248 | WHERE cat_id = ' . (int) $cat_id; |
| 249 | 249 | $this->db->sql_query($sql); |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | if ($this->request->is_ajax()) |
| 262 | 262 | { |
| 263 | 263 | $sql = 'SELECT cat_links |
| 264 | - FROM ' . $this->categories_table . ' |
|
| 264 | + FROM ' . $this->categories_table.' |
|
| 265 | 265 | WHERE cat_id = ' . (int) $cat_id; |
| 266 | 266 | $result = $this->db->sql_query($sql); |
| 267 | 267 | $data = $this->db->sql_fetchrow($result); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | public function view($link_id) |
| 289 | 289 | { |
| 290 | 290 | $sql = 'SELECT link_id, link_url |
| 291 | - FROM ' . $this->links_table . ' |
|
| 291 | + FROM ' . $this->links_table.' |
|
| 292 | 292 | WHERE link_id = ' . (int) $link_id; |
| 293 | 293 | $result = $this->db->sql_query($sql); |
| 294 | 294 | $data = $this->db->sql_fetchrow($result); |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | throw new \phpbb\exception\http_exception(404, 'DIR_ERROR_NO_LINKS'); |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 301 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 302 | 302 | SET link_view = link_view + 1 |
| 303 | 303 | WHERE link_id = ' . (int) $link_id; |
| 304 | 304 | $this->db->sql_query($sql); |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | if ($details['scheme'] == 'https') |
| 324 | 324 | { |
| 325 | 325 | $default_port = 443; |
| 326 | - $hostname = 'tls://' . $details['host']; |
|
| 326 | + $hostname = 'tls://'.$details['host']; |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | if (!isset($details['path'])) |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | $flag_path = $ext_path.'images/flags/'; |
| 382 | 382 | $img_flag = 'no_flag.png'; |
| 383 | 383 | |
| 384 | - if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path . $data['link_flag'])) |
|
| 384 | + if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path.$data['link_flag'])) |
|
| 385 | 385 | { |
| 386 | 386 | $img_flag = $data['link_flag']; |
| 387 | 387 | } |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $list = '<select name="vote">'; |
| 424 | 424 | for ($i = 0; $i <= 10; $i++) |
| 425 | 425 | { |
| 426 | - $list .= '<option value="' . $i . '"' . (($i == 5) ? ' selected="selected"' : '') . '>' . $i . '</option>'; |
|
| 426 | + $list .= '<option value="'.$i.'"'.(($i == 5) ? ' selected="selected"' : '').'>'.$i.'</option>'; |
|
| 427 | 427 | } |
| 428 | 428 | $list .= '</select>'; |
| 429 | 429 | |
@@ -461,8 +461,8 @@ discard block |
||
| 461 | 461 | { |
| 462 | 462 | $thumb = $this->thumb_process($data['link_url']); |
| 463 | 463 | |
| 464 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 465 | - SET link_thumb = "' . $this->db->sql_escape($thumb) . '" |
|
| 464 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 465 | + SET link_thumb = "' . $this->db->sql_escape($thumb).'" |
|
| 466 | 466 | WHERE link_id = ' . (int) $data['link_id']; |
| 467 | 467 | $this->db->sql_query($sql); |
| 468 | 468 | |
@@ -486,8 +486,8 @@ discard block |
||
| 486 | 486 | { |
| 487 | 487 | $pagerank = $this->pagerank_process($data['link_url']); |
| 488 | 488 | |
| 489 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 490 | - SET link_pagerank = ' . (int) $pagerank . ' |
|
| 489 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 490 | + SET link_pagerank = ' . (int) $pagerank.' |
|
| 491 | 491 | WHERE link_id = ' . (int) $data['link_id']; |
| 492 | 492 | $this->db->sql_query($sql); |
| 493 | 493 | } |
@@ -496,9 +496,9 @@ discard block |
||
| 496 | 496 | $pagerank = (int) $data['link_pagerank']; |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | - $prpos=40*$pagerank/10; |
|
| 500 | - $prneg=40-$prpos; |
|
| 501 | - $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.'" /> '; |
|
| 499 | + $prpos = 40 * $pagerank / 10; |
|
| 500 | + $prneg = 40 - $prpos; |
|
| 501 | + $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 | 502 | |
| 503 | 503 | $pagerank = $pagerank == '-1' ? $this->language->lang('DIR_PAGERANK_NOT_AVAILABLE') : $this->language->lang('DIR_FROM_TEN', $pagerank); |
| 504 | 504 | return $html.$pagerank; |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | $height /= $coef_max; |
| 544 | 544 | } |
| 545 | 545 | |
| 546 | - return '<img src="' . $img_src . '" width="' . $width . '" height="' . $height . '" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />'; |
|
| 546 | + return '<img src="'.$img_src.'" width="'.$width.'" height="'.$height.'" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />'; |
|
| 547 | 547 | } |
| 548 | 548 | return ''; |
| 549 | 549 | } |
@@ -564,12 +564,12 @@ discard block |
||
| 564 | 564 | |
| 565 | 565 | $this->db->sql_transaction('begin'); |
| 566 | 566 | |
| 567 | - $sql = 'INSERT INTO ' . $this->votes_table . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
| 567 | + $sql = 'INSERT INTO '.$this->votes_table.' '.$this->db->sql_build_array('INSERT', $data); |
|
| 568 | 568 | $this->db->sql_query($sql); |
| 569 | 569 | |
| 570 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 570 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 571 | 571 | SET link_vote = link_vote + 1, |
| 572 | - link_note = link_note + ' . (int) $data['vote_note'] . ' |
|
| 572 | + link_note = link_note + ' . (int) $data['vote_note'].' |
|
| 573 | 573 | WHERE link_id = ' . (int) $link_id; |
| 574 | 574 | $this->db->sql_query($sql); |
| 575 | 575 | |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | |
| 578 | 578 | if ($this->request->is_ajax()) |
| 579 | 579 | { |
| 580 | - $sql= 'SELECT link_vote, link_note FROM ' . $this->links_table . ' WHERE link_id = ' . (int) $link_id; |
|
| 580 | + $sql = 'SELECT link_vote, link_note FROM '.$this->links_table.' WHERE link_id = '.(int) $link_id; |
|
| 581 | 581 | $result = $this->db->sql_query($sql); |
| 582 | 582 | $data = $this->db->sql_fetchrow($result); |
| 583 | 583 | |
@@ -611,8 +611,8 @@ discard block |
||
| 611 | 611 | |
| 612 | 612 | $details = parse_url($url); |
| 613 | 613 | |
| 614 | - $root_url = $details['scheme'].'://'.$details['host']; |
|
| 615 | - $absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url; |
|
| 614 | + $root_url = $details['scheme'].'://'.$details['host']; |
|
| 615 | + $absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url; |
|
| 616 | 616 | |
| 617 | 617 | if ($this->config['dir_activ_thumb_remote'] && $this->_ascreen_exist($details['scheme'], $details['host'])) |
| 618 | 618 | { |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | $destination = $this->get_banner_path(); |
| 656 | 656 | |
| 657 | 657 | // Can we upload? |
| 658 | - $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; |
|
| 658 | + $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; |
|
| 659 | 659 | |
| 660 | 660 | if ($banner && $can_upload) |
| 661 | 661 | { |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | |
| 702 | 702 | $file = $upload->handle_upload('files.types.remote', $banner); |
| 703 | 703 | |
| 704 | - $prefix = unique_id() . '_'; |
|
| 704 | + $prefix = unique_id().'_'; |
|
| 705 | 705 | $file->clean_filename('real', $prefix); |
| 706 | 706 | |
| 707 | 707 | if (sizeof($file->error)) |
@@ -732,7 +732,7 @@ discard block |
||
| 732 | 732 | { |
| 733 | 733 | if (!preg_match('#^(http|https|ftp)://#i', $banner)) |
| 734 | 734 | { |
| 735 | - $banner = 'http://' . $banner; |
|
| 735 | + $banner = 'http://'.$banner; |
|
| 736 | 736 | } |
| 737 | 737 | 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)) |
| 738 | 738 | { |
@@ -763,8 +763,8 @@ discard block |
||
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | // Check image type |
| 766 | - $types = \phpbb\files\upload::image_types(); |
|
| 767 | - $extension = strtolower(\phpbb\files\filespec::get_extension($banner)); |
|
| 766 | + $types = \phpbb\files\upload::image_types(); |
|
| 767 | + $extension = strtolower(\phpbb\files\filespec::get_extension($banner)); |
|
| 768 | 768 | |
| 769 | 769 | // Check if this is actually an image |
| 770 | 770 | if ($file_stream = @fopen($banner, 'r')) |
@@ -866,14 +866,14 @@ discard block |
||
| 866 | 866 | */ |
| 867 | 867 | public function pagerank_process($q) |
| 868 | 868 | { |
| 869 | - $googleDomains = array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch'); |
|
| 870 | - $seed = $this->language->lang('SEED'); |
|
| 871 | - $result = 0x01020345; |
|
| 869 | + $googleDomains = array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch'); |
|
| 870 | + $seed = $this->language->lang('SEED'); |
|
| 871 | + $result = 0x01020345; |
|
| 872 | 872 | $len = strlen($q); |
| 873 | 873 | |
| 874 | - for ($i=0; $i<$len; $i++) |
|
| 874 | + for ($i = 0; $i < $len; $i++) |
|
| 875 | 875 | { |
| 876 | - $result ^= ord($seed{$i%strlen($seed)}) ^ ord($q{$i}); |
|
| 876 | + $result ^= ord($seed{$i % strlen($seed)}) ^ ord($q{$i}); |
|
| 877 | 877 | $result = (($result >> 23) & 0x1ff) | $result << 9; |
| 878 | 878 | } |
| 879 | 879 | |
@@ -884,10 +884,10 @@ discard block |
||
| 884 | 884 | |
| 885 | 885 | $ch = sprintf('8%x', $result); |
| 886 | 886 | $url = 'http://%s/tbr?client=navclient-auto&ch=%s&features=Rank&q=info:%s'; |
| 887 | - $host = 'toolbarqueries.google'.$googleDomains[mt_rand(0,count($googleDomains)-1)]; |
|
| 887 | + $host = 'toolbarqueries.google'.$googleDomains[mt_rand(0, count($googleDomains) - 1)]; |
|
| 888 | 888 | |
| 889 | - $url = sprintf($url,$host,$ch,$q); |
|
| 890 | - @$pr = trim(file_get_contents($url,false)); |
|
| 889 | + $url = sprintf($url, $host, $ch, $q); |
|
| 890 | + @$pr = trim(file_get_contents($url, false)); |
|
| 891 | 891 | |
| 892 | 892 | if (is_numeric(substr(strrchr($pr, ':'), 1))) |
| 893 | 893 | { |
@@ -929,7 +929,7 @@ discard block |
||
| 929 | 929 | |
| 930 | 930 | if (file_exists($flag_path.$img_file)) |
| 931 | 931 | { |
| 932 | - $list .= '<option value="' . $img_file . '" ' . (($img_file == $value) ? 'selected="selected"' : '') . '>' . $name . '</option>'; |
|
| 932 | + $list .= '<option value="'.$img_file.'" '.(($img_file == $value) ? 'selected="selected"' : '').'>'.$name.'</option>'; |
|
| 933 | 933 | } |
| 934 | 934 | } |
| 935 | 935 | |
@@ -945,8 +945,8 @@ discard block |
||
| 945 | 945 | { |
| 946 | 946 | if ($this->config['dir_recent_block']) |
| 947 | 947 | { |
| 948 | - $limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns']; |
|
| 949 | - $exclude_array = explode(',', str_replace(' ', '', $this->config['dir_recent_exclude'])); |
|
| 948 | + $limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns']; |
|
| 949 | + $exclude_array = explode(',', str_replace(' ', '', $this->config['dir_recent_exclude'])); |
|
| 950 | 950 | |
| 951 | 951 | $sql_array = array( |
| 952 | 952 | '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', |
@@ -979,7 +979,7 @@ discard block |
||
| 979 | 979 | if (sizeof($rowset)) |
| 980 | 980 | { |
| 981 | 981 | $this->template->assign_block_vars('block', array( |
| 982 | - 'S_COL_WIDTH' => (100 / $this->config['dir_recent_columns']) . '%', |
|
| 982 | + 'S_COL_WIDTH' => (100 / $this->config['dir_recent_columns']).'%', |
|
| 983 | 983 | )); |
| 984 | 984 | |
| 985 | 985 | foreach ($rowset as $row) |
@@ -122,9 +122,9 @@ |
||
| 122 | 122 | $users = array(); |
| 123 | 123 | |
| 124 | 124 | $sql = 'SELECT user_id |
| 125 | - FROM ' . $this->watch_table . ' |
|
| 126 | - WHERE cat_id = ' . (int) $data['cat_id'] . ' |
|
| 127 | - AND notify_status = ' . NOTIFY_YES . ' |
|
| 125 | + FROM ' . $this->watch_table.' |
|
| 126 | + WHERE cat_id = ' . (int) $data['cat_id'].' |
|
| 127 | + AND notify_status = ' . NOTIFY_YES.' |
|
| 128 | 128 | AND user_id <> ' . (int) $data['user_from']; |
| 129 | 129 | $result = $this->db->sql_query($sql); |
| 130 | 130 | while ($row = $this->db->sql_fetchrow($result)) |
@@ -24,11 +24,11 @@ discard block |
||
| 24 | 24 | protected $watch_table; |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * Set the controller helper |
|
| 28 | - * |
|
| 29 | - * @param \phpbb\controller\helper $helper |
|
| 30 | - * @return null |
|
| 31 | - */ |
|
| 27 | + * Set the controller helper |
|
| 28 | + * |
|
| 29 | + * @param \phpbb\controller\helper $helper |
|
| 30 | + * @return null |
|
| 31 | + */ |
|
| 32 | 32 | public function set_controller_helper(\phpbb\controller\helper $helper) |
| 33 | 33 | { |
| 34 | 34 | $this->helper = $helper; |
@@ -46,21 +46,21 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | - * Get notification type name |
|
| 50 | - * |
|
| 51 | - * @return string |
|
| 52 | - */ |
|
| 49 | + * Get notification type name |
|
| 50 | + * |
|
| 51 | + * @return string |
|
| 52 | + */ |
|
| 53 | 53 | public function get_type() |
| 54 | 54 | { |
| 55 | 55 | return 'ernadoo.phpbbdirectory.notification.type.directory_website'; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | - * Notification option data (for outputting to the user) |
|
| 60 | - * |
|
| 61 | - * @var bool|array False if the service should use it's default data |
|
| 62 | - * Array of data (including keys 'id', 'lang', and 'group') |
|
| 63 | - */ |
|
| 59 | + * Notification option data (for outputting to the user) |
|
| 60 | + * |
|
| 61 | + * @var bool|array False if the service should use it's default data |
|
| 62 | + * Array of data (including keys 'id', 'lang', and 'group') |
|
| 63 | + */ |
|
| 64 | 64 | public static $notification_option = array( |
| 65 | 65 | 'lang' => 'NOTIFICATION_TYPE_DIR_UCP_WEBSITE', |
| 66 | 66 | 'group' => 'NOTIFICATION_DIR_UCP', |
@@ -75,31 +75,31 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | - * Is available |
|
| 79 | - * |
|
| 80 | - * @return bool True/False whether or not this is available to the user |
|
| 81 | - */ |
|
| 78 | + * Is available |
|
| 79 | + * |
|
| 80 | + * @return bool True/False whether or not this is available to the user |
|
| 81 | + */ |
|
| 82 | 82 | public function is_available() |
| 83 | 83 | { |
| 84 | 84 | return true; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | - * Get link id |
|
| 89 | - * |
|
| 90 | - * @param array $data The data from the link |
|
| 91 | - * @return int |
|
| 92 | - */ |
|
| 88 | + * Get link id |
|
| 89 | + * |
|
| 90 | + * @param array $data The data from the link |
|
| 91 | + * @return int |
|
| 92 | + */ |
|
| 93 | 93 | static public function get_item_id($data) |
| 94 | 94 | { |
| 95 | 95 | return (int) $data['link_id']; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | - * Get parent id - it's not used |
|
| 100 | - * |
|
| 101 | - * @param array $data The data from the link |
|
| 102 | - */ |
|
| 99 | + * Get parent id - it's not used |
|
| 100 | + * |
|
| 101 | + * @param array $data The data from the link |
|
| 102 | + */ |
|
| 103 | 103 | static public function get_item_parent_id($data) |
| 104 | 104 | { |
| 105 | 105 | // No parent |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | - * Find the users who want to receive notifications |
|
| 111 | - * |
|
| 112 | - * @param array $data Data from submit link |
|
| 113 | - * @param array $options Options for finding users for notification |
|
| 114 | - * @return array |
|
| 115 | - */ |
|
| 110 | + * Find the users who want to receive notifications |
|
| 111 | + * |
|
| 112 | + * @param array $data Data from submit link |
|
| 113 | + * @param array $options Options for finding users for notification |
|
| 114 | + * @return array |
|
| 115 | + */ |
|
| 116 | 116 | public function find_users_for_notification($data, $options = array()) |
| 117 | 117 | { |
| 118 | 118 | $options = array_merge(array( |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
| 147 | - * Get the user's avatar |
|
| 148 | - */ |
|
| 147 | + * Get the user's avatar |
|
| 148 | + */ |
|
| 149 | 149 | public function get_avatar() |
| 150 | 150 | { |
| 151 | 151 | return $this->user_loader->get_avatar($this->get_data('user_from'), false, true); |
@@ -153,10 +153,10 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | |
| 155 | 155 | /** |
| 156 | - * Get the HTML formatted title of this notification |
|
| 157 | - * |
|
| 158 | - * @return string |
|
| 159 | - */ |
|
| 156 | + * Get the HTML formatted title of this notification |
|
| 157 | + * |
|
| 158 | + * @return string |
|
| 159 | + */ |
|
| 160 | 160 | |
| 161 | 161 | public function get_title() |
| 162 | 162 | { |
@@ -169,20 +169,20 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | |
| 171 | 171 | /** |
| 172 | - * Get email template |
|
| 173 | - * |
|
| 174 | - * @return string |
|
| 175 | - */ |
|
| 172 | + * Get email template |
|
| 173 | + * |
|
| 174 | + * @return string |
|
| 175 | + */ |
|
| 176 | 176 | public function get_email_template() |
| 177 | 177 | { |
| 178 | 178 | return '@ernadoo_phpbbdirectory/directory_website'; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | /** |
| 182 | - * Get email template variables |
|
| 183 | - * |
|
| 184 | - * @return array |
|
| 185 | - */ |
|
| 182 | + * Get email template variables |
|
| 183 | + * |
|
| 184 | + * @return array |
|
| 185 | + */ |
|
| 186 | 186 | public function get_email_template_variables() |
| 187 | 187 | { |
| 188 | 188 | return array( |
@@ -194,33 +194,33 @@ discard block |
||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
| 197 | - * Get the url to this item |
|
| 198 | - * |
|
| 199 | - * @return string URL |
|
| 200 | - */ |
|
| 197 | + * Get the url to this item |
|
| 198 | + * |
|
| 199 | + * @return string URL |
|
| 200 | + */ |
|
| 201 | 201 | public function get_url() |
| 202 | 202 | { |
| 203 | 203 | return $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $this->get_data('cat_id'))); |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /** |
| 207 | - * Users needed to query before this notification can be displayed |
|
| 208 | - * |
|
| 209 | - * @return array Array of user_ids |
|
| 210 | - */ |
|
| 207 | + * Users needed to query before this notification can be displayed |
|
| 208 | + * |
|
| 209 | + * @return array Array of user_ids |
|
| 210 | + */ |
|
| 211 | 211 | public function users_to_query() |
| 212 | 212 | { |
| 213 | 213 | return array($this->get_data('user_from')); |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | /** |
| 217 | - * Function for preparing the data for insertion in an SQL query |
|
| 218 | - * (The service handles insertion) |
|
| 219 | - * |
|
| 220 | - * @param array $data Data from submit link |
|
| 221 | - * @param array $pre_create_data Data from pre_create_insert_array() |
|
| 222 | - * @return array Array of data ready to be inserted into the database |
|
| 223 | - */ |
|
| 217 | + * Function for preparing the data for insertion in an SQL query |
|
| 218 | + * (The service handles insertion) |
|
| 219 | + * |
|
| 220 | + * @param array $data Data from submit link |
|
| 221 | + * @param array $pre_create_data Data from pre_create_insert_array() |
|
| 222 | + * @return array Array of data ready to be inserted into the database |
|
| 223 | + */ |
|
| 224 | 224 | public function create_insert_array($data, $pre_create_data = array()) |
| 225 | 225 | { |
| 226 | 226 | $this->set_data('link_name', $data['link_name']); |
@@ -69,20 +69,20 @@ discard block |
||
| 69 | 69 | $match_search_query = ''; |
| 70 | 70 | foreach ($matches as $match) |
| 71 | 71 | { |
| 72 | - $match_search_query .= (($match_search_query) ? ' OR ' : '') . 'LOWER('. $match . ') '; |
|
| 73 | - $match_search_query .= $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), $this->db->get_any_char() . strtolower($word) . $this->db->get_any_char())); |
|
| 72 | + $match_search_query .= (($match_search_query) ? ' OR ' : '').'LOWER('.$match.') '; |
|
| 73 | + $match_search_query .= $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), $this->db->get_any_char().strtolower($word).$this->db->get_any_char())); |
|
| 74 | 74 | } |
| 75 | - $search_query .= ((!$search_query) ? '' : (($terms == 'all') ? ' AND ' : ' OR ')) . '(' . $match_search_query . ')'; |
|
| 75 | + $search_query .= ((!$search_query) ? '' : (($terms == 'all') ? ' AND ' : ' OR ')).'('.$match_search_query.')'; |
|
| 76 | 76 | } |
| 77 | 77 | $direction = (($sort_dir == 'd') ? 'DESC' : 'ASC'); |
| 78 | 78 | |
| 79 | 79 | if (is_array($sort_by_sql[$sort_key])) |
| 80 | 80 | { |
| 81 | - $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; |
|
| 81 | + $sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction; |
|
| 82 | 82 | } |
| 83 | 83 | else |
| 84 | 84 | { |
| 85 | - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; |
|
| 85 | + $sql_sort_order = $sort_by_sql[$sort_key].' '.$direction; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | $sql_array = array( |
@@ -90,10 +90,10 @@ discard block |
||
| 90 | 90 | 'FROM' => array( |
| 91 | 91 | $this->links_table => 'l'), |
| 92 | 92 | 'WHERE' => 'l.link_active = 1 |
| 93 | - ' . (($search_query) ? 'AND (' . $search_query . ')' : '') . ' |
|
| 94 | - ' . (sizeof($ex_cid_ary) ? ' AND ' . $this->db->sql_in_set('l.link_cat', $ex_cid_ary, true) : '') . ' |
|
| 95 | - ' . (($cat_id) ? ' AND ' . $this->db->sql_in_set('l.link_cat', $cat_id) : '') . ' |
|
| 96 | - ' . (($sort_days) ? ' AND l.link_time >= ' . (time() - ($sort_days * 86400)) : ''), |
|
| 93 | + ' . (($search_query) ? 'AND ('.$search_query.')' : '').' |
|
| 94 | + ' . (sizeof($ex_cid_ary) ? ' AND '.$this->db->sql_in_set('l.link_cat', $ex_cid_ary, true) : '').' |
|
| 95 | + ' . (($cat_id) ? ' AND '.$this->db->sql_in_set('l.link_cat', $cat_id) : '').' |
|
| 96 | + ' . (($sort_days) ? ' AND l.link_time >= '.(time() - ($sort_days * 86400)) : ''), |
|
| 97 | 97 | 'ORDER_BY' => $sql_sort_order |
| 98 | 98 | ); |
| 99 | 99 | |
@@ -37,37 +37,37 @@ discard block |
||
| 37 | 37 | private $ext_name = 'ernadoo/phpbbdirectory'; |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - * Set the extension manager |
|
| 41 | - * |
|
| 42 | - * @param \phpbb\extension\manager $phpbb_extension_manager |
|
| 43 | - * @return null |
|
| 44 | - */ |
|
| 40 | + * Set the extension manager |
|
| 41 | + * |
|
| 42 | + * @param \phpbb\extension\manager $phpbb_extension_manager |
|
| 43 | + * @return null |
|
| 44 | + */ |
|
| 45 | 45 | public function set_extension_manager(\phpbb\extension\manager $phpbb_extension_manager) |
| 46 | 46 | { |
| 47 | 47 | $this->extension_manager = $phpbb_extension_manager; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | - * Set the path helper |
|
| 52 | - * |
|
| 53 | - * @param \phpbb\path_helper $path_helper |
|
| 54 | - * @return null |
|
| 55 | - */ |
|
| 51 | + * Set the path helper |
|
| 52 | + * |
|
| 53 | + * @param \phpbb\path_helper $path_helper |
|
| 54 | + * @return null |
|
| 55 | + */ |
|
| 56 | 56 | public function set_path_helper(\phpbb\path_helper $path_helper) |
| 57 | 57 | { |
| 58 | 58 | $this->path_helper = $path_helper; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | - * Set the tables names |
|
| 63 | - * |
|
| 64 | - * @param string $categories_table |
|
| 65 | - * @param string $comments_table |
|
| 66 | - * @param string $links_table |
|
| 67 | - * @param string $votes_table |
|
| 68 | - * @param string $watch_table |
|
| 69 | - * @return null |
|
| 70 | - */ |
|
| 62 | + * Set the tables names |
|
| 63 | + * |
|
| 64 | + * @param string $categories_table |
|
| 65 | + * @param string $comments_table |
|
| 66 | + * @param string $links_table |
|
| 67 | + * @param string $votes_table |
|
| 68 | + * @param string $watch_table |
|
| 69 | + * @return null |
|
| 70 | + */ |
|
| 71 | 71 | public function set_tables($categories_table, $comments_table, $links_table, $votes_table, $watch_table) |
| 72 | 72 | { |
| 73 | 73 | $this->comments_table = $comments_table; |
@@ -77,48 +77,48 @@ discard block |
||
| 77 | 77 | $this->categories_table = $categories_table; |
| 78 | 78 | } |
| 79 | 79 | /** |
| 80 | - * Return ext name |
|
| 81 | - * |
|
| 82 | - * @param bool $web_root_path Whether the path should be relative to web root |
|
| 83 | - * @return string Path to an extension |
|
| 84 | - */ |
|
| 80 | + * Return ext name |
|
| 81 | + * |
|
| 82 | + * @param bool $web_root_path Whether the path should be relative to web root |
|
| 83 | + * @return string Path to an extension |
|
| 84 | + */ |
|
| 85 | 85 | public function get_ext_name($web_root_path = false) |
| 86 | 86 | { |
| 87 | 87 | return (($web_root_path) ? $this->path_helper->get_web_root_path() : '') . $this->extension_manager->get_extension_path($this->ext_name); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | - * Return path to resource image |
|
| 92 | - * |
|
| 93 | - * @param string $type is ressource type (flags|icons) |
|
| 94 | - * @param string $image is the resource to display |
|
| 95 | - * @return string The relative path to ressource |
|
| 96 | - */ |
|
| 91 | + * Return path to resource image |
|
| 92 | + * |
|
| 93 | + * @param string $type is ressource type (flags|icons) |
|
| 94 | + * @param string $image is the resource to display |
|
| 95 | + * @return string The relative path to ressource |
|
| 96 | + */ |
|
| 97 | 97 | public function get_img_path($type, $image = '') |
| 98 | 98 | { |
| 99 | 99 | return $this->get_ext_name(true) . 'images/' . $type . '/' . $image; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | - * Return path to banner |
|
| 104 | - * |
|
| 105 | - * @param string $banner is the physical name |
|
| 106 | - * @return string The relative path to banner |
|
| 107 | - */ |
|
| 103 | + * Return path to banner |
|
| 104 | + * |
|
| 105 | + * @param string $banner is the physical name |
|
| 106 | + * @return string The relative path to banner |
|
| 107 | + */ |
|
| 108 | 108 | public function get_banner_path($banner = '') |
| 109 | 109 | { |
| 110 | 110 | return 'files/' . $this->get_ext_name() . 'banners/' . $banner; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
| 114 | - * Return array entries that match the pattern |
|
| 115 | - * |
|
| 116 | - * @link http://php.net/manual/fr/function.preg-grep.php#95787 |
|
| 117 | - * |
|
| 118 | - * @param string $pattern The pattern to search for |
|
| 119 | - * @param array $input The input array |
|
| 120 | - * @return array $vals Returns an array indexed using the keys from the input array |
|
| 121 | - */ |
|
| 114 | + * Return array entries that match the pattern |
|
| 115 | + * |
|
| 116 | + * @link http://php.net/manual/fr/function.preg-grep.php#95787 |
|
| 117 | + * |
|
| 118 | + * @param string $pattern The pattern to search for |
|
| 119 | + * @param array $input The input array |
|
| 120 | + * @return array $vals Returns an array indexed using the keys from the input array |
|
| 121 | + */ |
|
| 122 | 122 | public function preg_grep_keys($pattern, $input) |
| 123 | 123 | { |
| 124 | 124 | $keys = preg_grep($pattern, array_keys($input)); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function set_extension_manager(\phpbb\extension\manager $phpbb_extension_manager) |
| 46 | 46 | { |
| 47 | - $this->extension_manager = $phpbb_extension_manager; |
|
| 47 | + $this->extension_manager = $phpbb_extension_manager; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -70,11 +70,11 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function set_tables($categories_table, $comments_table, $links_table, $votes_table, $watch_table) |
| 72 | 72 | { |
| 73 | - $this->comments_table = $comments_table; |
|
| 73 | + $this->comments_table = $comments_table; |
|
| 74 | 74 | $this->links_table = $links_table; |
| 75 | 75 | $this->votes_table = $votes_table; |
| 76 | 76 | $this->watch_table = $watch_table; |
| 77 | - $this->categories_table = $categories_table; |
|
| 77 | + $this->categories_table = $categories_table; |
|
| 78 | 78 | } |
| 79 | 79 | /** |
| 80 | 80 | * Return ext name |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function get_ext_name($web_root_path = false) |
| 86 | 86 | { |
| 87 | - return (($web_root_path) ? $this->path_helper->get_web_root_path() : '') . $this->extension_manager->get_extension_path($this->ext_name); |
|
| 87 | + return (($web_root_path) ? $this->path_helper->get_web_root_path() : '').$this->extension_manager->get_extension_path($this->ext_name); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function get_img_path($type, $image = '') |
| 98 | 98 | { |
| 99 | - return $this->get_ext_name(true) . 'images/' . $type . '/' . $image; |
|
| 99 | + return $this->get_ext_name(true).'images/'.$type.'/'.$image; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function get_banner_path($banner = '') |
| 109 | 109 | { |
| 110 | - return 'files/' . $this->get_ext_name() . 'banners/' . $banner; |
|
| 110 | + return 'files/'.$this->get_ext_name().'banners/'.$banner; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |