@@ -47,20 +47,20 @@ discard block |
||
| 47 | 47 | protected $link; |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | - * Constructor |
|
| 51 | - * |
|
| 52 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 53 | - * @param \phpbb\config\config $config Config object |
|
| 54 | - * @param \phpbb\template\template $template Template object |
|
| 55 | - * @param \phpbb\user $user User object |
|
| 56 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
| 57 | - * @param \phpbb\request\request $request Request object |
|
| 58 | - * @param \phpbb\auth\auth $auth Auth object |
|
| 59 | - * @param \phpbb\pagination $pagination Pagination object |
|
| 60 | - * @param \ernadoo\phpbbdirectory\search\fulltext_directory $search PhpBB Directory extension search object |
|
| 61 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 62 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
| 63 | - */ |
|
| 50 | + * Constructor |
|
| 51 | + * |
|
| 52 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 53 | + * @param \phpbb\config\config $config Config object |
|
| 54 | + * @param \phpbb\template\template $template Template object |
|
| 55 | + * @param \phpbb\user $user User object |
|
| 56 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
| 57 | + * @param \phpbb\request\request $request Request object |
|
| 58 | + * @param \phpbb\auth\auth $auth Auth object |
|
| 59 | + * @param \phpbb\pagination $pagination Pagination object |
|
| 60 | + * @param \ernadoo\phpbbdirectory\search\fulltext_directory $search PhpBB Directory extension search object |
|
| 61 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 62 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
| 63 | + */ |
|
| 64 | 64 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\search\fulltext_directory $search, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
| 65 | 65 | { |
| 66 | 66 | $this->db = $db; |
@@ -85,12 +85,12 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | - * Search controller |
|
| 89 | - * |
|
| 90 | - * @param int $page Page number taken from the URL |
|
| 91 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 92 | - * @throws \phpbb\exception\http_exception |
|
| 93 | - */ |
|
| 88 | + * Search controller |
|
| 89 | + * |
|
| 90 | + * @param int $page Page number taken from the URL |
|
| 91 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 92 | + * @throws \phpbb\exception\http_exception |
|
| 93 | + */ |
|
| 94 | 94 | public function main($page) |
| 95 | 95 | { |
| 96 | 96 | if (!$this->auth->acl_get('u_search_dir')) |
@@ -314,11 +314,11 @@ discard block |
||
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /** |
| 317 | - * |
|
| 318 | - * @param array $search_category |
|
| 319 | - * @param bool $search_child |
|
| 320 | - * @return array Categories to exclude from search |
|
| 321 | - */ |
|
| 317 | + * |
|
| 318 | + * @param array $search_category |
|
| 319 | + * @param bool $search_child |
|
| 320 | + * @return array Categories to exclude from search |
|
| 321 | + */ |
|
| 322 | 322 | private function _get_exclude_categories(&$search_category, $search_child) |
| 323 | 323 | { |
| 324 | 324 | $sql = 'SELECT cat_id, parent_id, right_id |
@@ -63,17 +63,17 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\search\fulltext_directory $search, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
| 65 | 65 | { |
| 66 | - $this->db = $db; |
|
| 66 | + $this->db = $db; |
|
| 67 | 67 | $this->config = $config; |
| 68 | - $this->template = $template; |
|
| 68 | + $this->template = $template; |
|
| 69 | 69 | $this->user = $user; |
| 70 | 70 | $this->helper = $helper; |
| 71 | - $this->request = $request; |
|
| 71 | + $this->request = $request; |
|
| 72 | 72 | $this->auth = $auth; |
| 73 | - $this->pagination = $pagination; |
|
| 74 | - $this->search = $search; |
|
| 75 | - $this->categorie = $categorie; |
|
| 76 | - $this->link = $link; |
|
| 73 | + $this->pagination = $pagination; |
|
| 74 | + $this->search = $search; |
|
| 75 | + $this->categorie = $categorie; |
|
| 76 | + $this->link = $link; |
|
| 77 | 77 | |
| 78 | 78 | $this->user->add_lang_ext('ernadoo/phpbbdirectory', array('directory')); |
| 79 | 79 | $this->user->add_lang('search'); |
@@ -98,24 +98,24 @@ discard block |
||
| 98 | 98 | throw new \phpbb\exception\http_exception(403, 'DIR_ERROR_NOT_AUTH'); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - $cat_id = $this->request->variable('cat_id', 0); |
|
| 102 | - $keywords = $this->request->variable('keywords', '', true); |
|
| 101 | + $cat_id = $this->request->variable('cat_id', 0); |
|
| 102 | + $keywords = $this->request->variable('keywords', '', true); |
|
| 103 | 103 | $search_terms = $this->request->variable('terms', 'all'); |
| 104 | - $search_category = $this->request->variable('cid', array(0)); |
|
| 105 | - $search_fields = $this->request->variable('sf', 'all'); |
|
| 104 | + $search_category = $this->request->variable('cid', array(0)); |
|
| 105 | + $search_fields = $this->request->variable('sf', 'all'); |
|
| 106 | 106 | $search_child = $this->request->variable('sc', true); |
| 107 | - $sort_days = $this->request->variable('st', 0); |
|
| 107 | + $sort_days = $this->request->variable('st', 0); |
|
| 108 | 108 | $sort_key = $this->request->variable('sk', 't'); |
| 109 | 109 | $sort_dir = $this->request->variable('sd', 'd'); |
| 110 | - $start = ($page - 1) * (int) $this->config['dir_show']; |
|
| 110 | + $start = ($page - 1) * (int) $this->config['dir_show']; |
|
| 111 | 111 | |
| 112 | - $default_sort_days = 0; |
|
| 112 | + $default_sort_days = 0; |
|
| 113 | 113 | $default_sort_key = (string) substr($this->config['dir_default_order'], 0, 1); |
| 114 | 114 | $default_sort_dir = (string) substr($this->config['dir_default_order'], 2); |
| 115 | 115 | |
| 116 | 116 | // Categorie ordering options |
| 117 | 117 | $limit_days = array(0 => $this->user->lang['ALL_RESULTS'], 1 => $this->user->lang['1_DAY'], 7 => $this->user->lang['7_DAYS'], 14 => $this->user->lang['2_WEEKS'], 30 => $this->user->lang['1_MONTH'], 90 => $this->user->lang['3_MONTHS'], 180 => $this->user->lang['6_MONTHS'], 365 => $this->user->lang['1_YEAR']); |
| 118 | - $sort_by_text = array('a' => $this->user->lang['AUTHOR'], 't' => $this->user->lang['POST_TIME'], 'r' => $this->user->lang['DIR_COMMENTS_ORDER'], 's' => $this->user->lang['DIR_NAME_ORDER'], 'v' => $this->user->lang['DIR_NB_CLICKS_ORDER']); |
|
| 118 | + $sort_by_text = array('a' => $this->user->lang['AUTHOR'], 't' => $this->user->lang['POST_TIME'], 'r' => $this->user->lang['DIR_COMMENTS_ORDER'], 's' => $this->user->lang['DIR_NAME_ORDER'], 'v' => $this->user->lang['DIR_NB_CLICKS_ORDER']); |
|
| 119 | 119 | $sort_by_sql = array('a' => 'u.username_clean', 't' => array('l.link_time', 'l.link_id'), 'r' => 'l.link_comment', 's' => 'LOWER(l.link_name)', 'v' => 'l.link_view'); |
| 120 | 120 | |
| 121 | 121 | if ($this->config['dir_activ_pagerank']) |
@@ -164,12 +164,12 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit))); |
| 166 | 166 | |
| 167 | - ($u_hilit) ? $u_search['keywords'] = urlencode(htmlspecialchars_decode($keywords)) : ''; |
|
| 168 | - ($search_terms != 'all') ? $u_search['terms'] = $search_terms : ''; |
|
| 169 | - ($cat_id) ? $u_search['cat_id'] = $cat_id : ''; |
|
| 170 | - ($search_category) ? $u_search['cid'] = $search_category : ''; |
|
| 171 | - (!$search_child) ? $u_search['sc'] = 0 : ''; |
|
| 172 | - ($search_fields != 'all') ? $u_search['sf'] = $search_fields : ''; |
|
| 167 | + ($u_hilit) ? $u_search['keywords'] = urlencode(htmlspecialchars_decode($keywords)) : ''; |
|
| 168 | + ($search_terms != 'all') ? $u_search['terms'] = $search_terms : ''; |
|
| 169 | + ($cat_id) ? $u_search['cat_id'] = $cat_id : ''; |
|
| 170 | + ($search_category) ? $u_search['cid'] = $search_category : ''; |
|
| 171 | + (!$search_child) ? $u_search['sc'] = 0 : ''; |
|
| 172 | + ($search_fields != 'all') ? $u_search['sf'] = $search_fields : ''; |
|
| 173 | 173 | |
| 174 | 174 | $base_url = array( |
| 175 | 175 | 'routes' => 'ernadoo_phpbbdirectory_search_controller', |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | foreach ($rowset as $data) |
| 245 | 245 | { |
| 246 | - $s_banner = $this->link->display_bann($data); |
|
| 246 | + $s_banner = $this->link->display_bann($data); |
|
| 247 | 247 | $s_thumb = $this->link->display_thumb($data); |
| 248 | 248 | $s_flag = $this->link->display_flag($data); |
| 249 | 249 | |
@@ -251,8 +251,8 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | if ($hilit) |
| 253 | 253 | { |
| 254 | - $data['link_name'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_name']); |
|
| 255 | - $data['link_description'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_description']); |
|
| 254 | + $data['link_name'] = preg_replace('#(?!<.*)(?<!\w)('.$hilit.')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_name']); |
|
| 255 | + $data['link_description'] = preg_replace('#(?!<.*)(?<!\w)('.$hilit.')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_description']); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | $this->template->assign_block_vars('results', array( |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | private function _get_exclude_categories(&$search_category, $search_child) |
| 323 | 323 | { |
| 324 | 324 | $sql = 'SELECT cat_id, parent_id, right_id |
| 325 | - FROM ' . DIR_CAT_TABLE . ' |
|
| 325 | + FROM ' . DIR_CAT_TABLE.' |
|
| 326 | 326 | ORDER BY left_id'; |
| 327 | 327 | $result = $this->db->sql_query($sql); |
| 328 | 328 | |
@@ -22,11 +22,11 @@ discard block |
||
| 22 | 22 | protected $user; |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | - * Constructor |
|
| 26 | - * |
|
| 27 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 28 | - * @param \phpbb\user $user User object |
|
| 29 | - */ |
|
| 25 | + * Constructor |
|
| 26 | + * |
|
| 27 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 28 | + * @param \phpbb\user $user User object |
|
| 29 | + */ |
|
| 30 | 30 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user) |
| 31 | 31 | { |
| 32 | 32 | $this->db = $db; |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | - * Add a comment |
|
| 38 | - * |
|
| 39 | - * @param array $data Link's data from db |
|
| 40 | - * @return null |
|
| 41 | - */ |
|
| 37 | + * Add a comment |
|
| 38 | + * |
|
| 39 | + * @param array $data Link's data from db |
|
| 40 | + * @return null |
|
| 41 | + */ |
|
| 42 | 42 | public function add($data) |
| 43 | 43 | { |
| 44 | 44 | $this->db->sql_transaction('begin'); |
@@ -55,12 +55,12 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | - * Edit a comment |
|
| 59 | - * |
|
| 60 | - * @param array $data Data to edit |
|
| 61 | - * @param int $comment_id The comment ID |
|
| 62 | - * @return null |
|
| 63 | - */ |
|
| 58 | + * Edit a comment |
|
| 59 | + * |
|
| 60 | + * @param array $data Data to edit |
|
| 61 | + * @param int $comment_id The comment ID |
|
| 62 | + * @return null |
|
| 63 | + */ |
|
| 64 | 64 | public function edit($data, $comment_id) |
| 65 | 65 | { |
| 66 | 66 | $sql = 'UPDATE ' . DIR_COMMENT_TABLE . ' |
@@ -70,12 +70,12 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | - * Delete a comment |
|
| 74 | - * |
|
| 75 | - * @param string $link_id The link ID |
|
| 76 | - * @param string $comment_id The comment ID |
|
| 77 | - * @return null |
|
| 78 | - */ |
|
| 73 | + * Delete a comment |
|
| 74 | + * |
|
| 75 | + * @param string $link_id The link ID |
|
| 76 | + * @param string $comment_id The comment ID |
|
| 77 | + * @return null |
|
| 78 | + */ |
|
| 79 | 79 | public function del($link_id, $comment_id) |
| 80 | 80 | { |
| 81 | 81 | global $request; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user) |
| 31 | 31 | { |
| 32 | - $this->db = $db; |
|
| 32 | + $this->db = $db; |
|
| 33 | 33 | $this->user = $user; |
| 34 | 34 | } |
| 35 | 35 | |
@@ -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'); |
@@ -46,20 +46,20 @@ discard block |
||
| 46 | 46 | protected $php_ext; |
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | - * Constructor |
|
| 50 | - * |
|
| 51 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 52 | - * @param \phpbb\config\config $config Config object |
|
| 53 | - * @param \phpbb\template\template $template Template object |
|
| 54 | - * @param \phpbb\user $user User object |
|
| 55 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
| 56 | - * @param \phpbb\request\request $request Request object |
|
| 57 | - * @param \phpbb\auth\auth $auth Auth object |
|
| 58 | - * @param \phpbb\notification\manager $notification Notification object |
|
| 59 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
| 60 | - * @param string $root_path phpBB root path |
|
| 61 | - * @param string $php_ext phpEx |
|
| 62 | - */ |
|
| 49 | + * Constructor |
|
| 50 | + * |
|
| 51 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 52 | + * @param \phpbb\config\config $config Config object |
|
| 53 | + * @param \phpbb\template\template $template Template object |
|
| 54 | + * @param \phpbb\user $user User object |
|
| 55 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
| 56 | + * @param \phpbb\request\request $request Request object |
|
| 57 | + * @param \phpbb\auth\auth $auth Auth object |
|
| 58 | + * @param \phpbb\notification\manager $notification Notification object |
|
| 59 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
| 60 | + * @param string $root_path phpBB root path |
|
| 61 | + * @param string $php_ext phpEx |
|
| 62 | + */ |
|
| 63 | 63 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\notification\manager $notification, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext) |
| 64 | 64 | { |
| 65 | 65 | $this->db = $db; |
@@ -76,12 +76,12 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | - * Add a link into db |
|
| 80 | - * |
|
| 81 | - * @param array $data Contains all data to insert in db |
|
| 82 | - * @param bool $need_approval Links needs to be approved? |
|
| 83 | - * @return null |
|
| 84 | - */ |
|
| 79 | + * Add a link into db |
|
| 80 | + * |
|
| 81 | + * @param array $data Contains all data to insert in db |
|
| 82 | + * @param bool $need_approval Links needs to be approved? |
|
| 83 | + * @return null |
|
| 84 | + */ |
|
| 85 | 85 | public function add($data, $need_approval) |
| 86 | 86 | { |
| 87 | 87 | $notification_data = array(); |
@@ -126,13 +126,13 @@ discard block |
||
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
| 129 | - * Edit a link of the db |
|
| 130 | - * |
|
| 131 | - * @param array $data Contains all data to edit in db |
|
| 132 | - * @param int $link_id is link's id, for WHERE clause |
|
| 133 | - * @param bool $need_approval Links needs to be approved? |
|
| 134 | - * @return null |
|
| 135 | - */ |
|
| 129 | + * Edit a link of the db |
|
| 130 | + * |
|
| 131 | + * @param array $data Contains all data to edit in db |
|
| 132 | + * @param int $link_id is link's id, for WHERE clause |
|
| 133 | + * @param bool $need_approval Links needs to be approved? |
|
| 134 | + * @return null |
|
| 135 | + */ |
|
| 136 | 136 | public function edit($data, $link_id, $need_approval) |
| 137 | 137 | { |
| 138 | 138 | $notification_data = array( |
@@ -184,12 +184,12 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /** |
| 187 | - * Delete a link of the db |
|
| 188 | - * |
|
| 189 | - * @param int $cat_id The category ID |
|
| 190 | - * @param mixed $link_id Link's id, for WHERE clause |
|
| 191 | - * @return null |
|
| 192 | - */ |
|
| 187 | + * Delete a link of the db |
|
| 188 | + * |
|
| 189 | + * @param int $cat_id The category ID |
|
| 190 | + * @param mixed $link_id Link's id, for WHERE clause |
|
| 191 | + * @return null |
|
| 192 | + */ |
|
| 193 | 193 | public function del($cat_id, $link_id) |
| 194 | 194 | { |
| 195 | 195 | $this->db->sql_transaction('begin'); |
@@ -262,12 +262,12 @@ discard block |
||
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | /** |
| 265 | - * Increments link view counter |
|
| 266 | - * |
|
| 267 | - * @param int $link_id Link's id, for WHERE clause |
|
| 268 | - * @return null |
|
| 269 | - * @throws \phpbb\exception\http_exception |
|
| 270 | - */ |
|
| 265 | + * Increments link view counter |
|
| 266 | + * |
|
| 267 | + * @param int $link_id Link's id, for WHERE clause |
|
| 268 | + * @return null |
|
| 269 | + * @throws \phpbb\exception\http_exception |
|
| 270 | + */ |
|
| 271 | 271 | public function view($link_id) |
| 272 | 272 | { |
| 273 | 273 | $sql = 'SELECT link_id, link_url |
@@ -291,11 +291,11 @@ discard block |
||
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | /** |
| 294 | - * Verify that an URL exist before add into db |
|
| 295 | - * |
|
| 296 | - * @param string $url The URL to check |
|
| 297 | - * @return bool True if url is reachable, else false. |
|
| 298 | - */ |
|
| 294 | + * Verify that an URL exist before add into db |
|
| 295 | + * |
|
| 296 | + * @param string $url The URL to check |
|
| 297 | + * @return bool True if url is reachable, else false. |
|
| 298 | + */ |
|
| 299 | 299 | public function checkurl($url) |
| 300 | 300 | { |
| 301 | 301 | $details = parse_url($url); |
@@ -332,11 +332,11 @@ discard block |
||
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | /** |
| 335 | - * Delete the final '/', if no path |
|
| 336 | - * |
|
| 337 | - * @param string $url URL to clean |
|
| 338 | - * @return string $url The correct string. |
|
| 339 | - */ |
|
| 335 | + * Delete the final '/', if no path |
|
| 336 | + * |
|
| 337 | + * @param string $url URL to clean |
|
| 338 | + * @return string $url The correct string. |
|
| 339 | + */ |
|
| 340 | 340 | public function clean_url($url) |
| 341 | 341 | { |
| 342 | 342 | $details = parse_url($url); |
@@ -349,11 +349,11 @@ discard block |
||
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | /** |
| 352 | - * Display a flag |
|
| 353 | - * |
|
| 354 | - * @param array $data Link's data from db |
|
| 355 | - * @return string Flag path. |
|
| 356 | - */ |
|
| 352 | + * Display a flag |
|
| 353 | + * |
|
| 354 | + * @param array $data Link's data from db |
|
| 355 | + * @return string Flag path. |
|
| 356 | + */ |
|
| 357 | 357 | public function display_flag($data) |
| 358 | 358 | { |
| 359 | 359 | global $phpbb_extension_manager; |
@@ -371,13 +371,13 @@ discard block |
||
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | /** |
| 374 | - * Calculate the link's note |
|
| 375 | - * |
|
| 376 | - * @param int $total_note Sum of all link's notes |
|
| 377 | - * @param int $nb_vote Number of votes |
|
| 378 | - * @param bool $votes_status Votes are enable in this category? |
|
| 379 | - * @return string $note The calculated note. |
|
| 380 | - */ |
|
| 374 | + * Calculate the link's note |
|
| 375 | + * |
|
| 376 | + * @param int $total_note Sum of all link's notes |
|
| 377 | + * @param int $nb_vote Number of votes |
|
| 378 | + * @param bool $votes_status Votes are enable in this category? |
|
| 379 | + * @return string $note The calculated note. |
|
| 380 | + */ |
|
| 381 | 381 | public function display_note($total_note, $nb_vote, $votes_status) |
| 382 | 382 | { |
| 383 | 383 | if (!$votes_status) |
@@ -392,11 +392,11 @@ discard block |
||
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | /** |
| 395 | - * Display the vote form for auth users |
|
| 396 | - * |
|
| 397 | - * @param array $data Link's data from db |
|
| 398 | - * @return null|string Html combo list or nothing if votes are not available. |
|
| 399 | - */ |
|
| 395 | + * Display the vote form for auth users |
|
| 396 | + * |
|
| 397 | + * @param array $data Link's data from db |
|
| 398 | + * @return null|string Html combo list or nothing if votes are not available. |
|
| 399 | + */ |
|
| 400 | 400 | public function display_vote($data) |
| 401 | 401 | { |
| 402 | 402 | if ($this->user->data['is_registered'] && $this->auth->acl_get('u_vote_dir') && empty($data['vote_user_id'])) |
@@ -413,11 +413,11 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | /** |
| 416 | - * Display the RSS icon |
|
| 417 | - * |
|
| 418 | - * @param array $data Link's data from db |
|
| 419 | - * @return null|string RSS feed URL or nothing. |
|
| 420 | - */ |
|
| 416 | + * Display the RSS icon |
|
| 417 | + * |
|
| 418 | + * @param array $data Link's data from db |
|
| 419 | + * @return null|string RSS feed URL or nothing. |
|
| 420 | + */ |
|
| 421 | 421 | public function display_rss($data) |
| 422 | 422 | { |
| 423 | 423 | if ($this->config['dir_activ_rss'] && !empty($data['link_rss'])) |
@@ -427,13 +427,13 @@ discard block |
||
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | /** |
| 430 | - * Display link's thumb if thumb service enabled. |
|
| 431 | - * if thumb don't exists in db or if a new service was choosen in acp |
|
| 432 | - * thumb is research |
|
| 433 | - * |
|
| 434 | - * @param array $data Link's data from db |
|
| 435 | - * @return string|null Thumb or null. |
|
| 436 | - */ |
|
| 430 | + * Display link's thumb if thumb service enabled. |
|
| 431 | + * if thumb don't exists in db or if a new service was choosen in acp |
|
| 432 | + * thumb is research |
|
| 433 | + * |
|
| 434 | + * @param array $data Link's data from db |
|
| 435 | + * @return string|null Thumb or null. |
|
| 436 | + */ |
|
| 437 | 437 | public function display_thumb($data) |
| 438 | 438 | { |
| 439 | 439 | if ($this->config['dir_activ_thumb']) |
@@ -454,11 +454,11 @@ discard block |
||
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | /** |
| 457 | - * Display and calculate PageRank if needed |
|
| 458 | - * |
|
| 459 | - * @param array $data Link's data from db |
|
| 460 | - * @return string Pagerank, 'n/a' or false |
|
| 461 | - */ |
|
| 457 | + * Display and calculate PageRank if needed |
|
| 458 | + * |
|
| 459 | + * @param array $data Link's data from db |
|
| 460 | + * @return string Pagerank, 'n/a' or false |
|
| 461 | + */ |
|
| 462 | 462 | public function display_pagerank($data) |
| 463 | 463 | { |
| 464 | 464 | if ($this->config['dir_activ_pagerank']) |
@@ -488,11 +488,11 @@ discard block |
||
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | /** |
| 491 | - * Display and resize a banner |
|
| 492 | - * |
|
| 493 | - * @param array $data link's data from db |
|
| 494 | - * @return string $s_banner html code. |
|
| 495 | - */ |
|
| 491 | + * Display and resize a banner |
|
| 492 | + * |
|
| 493 | + * @param array $data link's data from db |
|
| 494 | + * @return string $s_banner html code. |
|
| 495 | + */ |
|
| 496 | 496 | public function display_bann($data) |
| 497 | 497 | { |
| 498 | 498 | $s_banner = ''; |
@@ -526,11 +526,11 @@ discard block |
||
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | /** |
| 529 | - * Add a vote in db, for a specifi link |
|
| 530 | - * |
|
| 531 | - * @param int $link_id Link_id from db |
|
| 532 | - * @return null |
|
| 533 | - */ |
|
| 529 | + * Add a vote in db, for a specifi link |
|
| 530 | + * |
|
| 531 | + * @param int $link_id Link_id from db |
|
| 532 | + * @return null |
|
| 533 | + */ |
|
| 534 | 534 | public function add_vote($link_id) |
| 535 | 535 | { |
| 536 | 536 | $data = array( |
@@ -574,11 +574,11 @@ discard block |
||
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | /** |
| 577 | - * Search an appropriate thumb for url |
|
| 578 | - * |
|
| 579 | - * @param string $url Link's url |
|
| 580 | - * @return string The thumb url |
|
| 581 | - */ |
|
| 577 | + * Search an appropriate thumb for url |
|
| 578 | + * |
|
| 579 | + * @param string $url Link's url |
|
| 580 | + * @return string The thumb url |
|
| 581 | + */ |
|
| 582 | 582 | public function thumb_process($url) |
| 583 | 583 | { |
| 584 | 584 | if (!$this->config['dir_activ_thumb']) |
@@ -599,12 +599,12 @@ discard block |
||
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | /** |
| 602 | - * Check if ascreen thumb exists |
|
| 603 | - * |
|
| 604 | - * @param string $protocol The protocol |
|
| 605 | - * @param string $host The hostname |
|
| 606 | - * @return bool True if ascreen file exixts, else false |
|
| 607 | - */ |
|
| 602 | + * Check if ascreen thumb exists |
|
| 603 | + * |
|
| 604 | + * @param string $protocol The protocol |
|
| 605 | + * @param string $host The hostname |
|
| 606 | + * @return bool True if ascreen file exixts, else false |
|
| 607 | + */ |
|
| 608 | 608 | private function _ascreen_exist($protocol, $host) |
| 609 | 609 | { |
| 610 | 610 | if ($thumb_info = @getimagesize($protocol.'://'.$host.'/ascreen.jpg')) |
@@ -619,12 +619,12 @@ discard block |
||
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | /** |
| 622 | - * Primary work on banner, can edit, copy or check a banner |
|
| 623 | - * |
|
| 624 | - * @param string $banner The banner's remote url |
|
| 625 | - * @param array $error The array error, passed by reference |
|
| 626 | - * @return null |
|
| 627 | - */ |
|
| 622 | + * Primary work on banner, can edit, copy or check a banner |
|
| 623 | + * |
|
| 624 | + * @param string $banner The banner's remote url |
|
| 625 | + * @param array $error The array error, passed by reference |
|
| 626 | + * @return null |
|
| 627 | + */ |
|
| 628 | 628 | public function banner_process(&$banner, &$error) |
| 629 | 629 | { |
| 630 | 630 | $old_banner = $this->request->variable('old_banner', ''); |
@@ -660,13 +660,13 @@ discard block |
||
| 660 | 660 | } |
| 661 | 661 | |
| 662 | 662 | /** |
| 663 | - * Copy a remonte banner to server. |
|
| 664 | - * called by banner_process() |
|
| 665 | - * |
|
| 666 | - * @param string $banner The anner's remote url |
|
| 667 | - * @param array $error The array error, passed by reference |
|
| 668 | - * @return false|string String if no errors, else false |
|
| 669 | - */ |
|
| 663 | + * Copy a remonte banner to server. |
|
| 664 | + * called by banner_process() |
|
| 665 | + * |
|
| 666 | + * @param string $banner The anner's remote url |
|
| 667 | + * @param array $error The array error, passed by reference |
|
| 668 | + * @return false|string String if no errors, else false |
|
| 669 | + */ |
|
| 670 | 670 | private function _banner_upload($banner, &$error) |
| 671 | 671 | { |
| 672 | 672 | // Init upload class |
@@ -697,13 +697,13 @@ discard block |
||
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | /** |
| 700 | - * Check than remote banner exists |
|
| 701 | - * called by banner_process() |
|
| 702 | - * |
|
| 703 | - * @param string $banner The banner's remote url |
|
| 704 | - * @param array $error The array error, passed by reference |
|
| 705 | - * @return false|string String if no errors, else false |
|
| 706 | - */ |
|
| 700 | + * Check than remote banner exists |
|
| 701 | + * called by banner_process() |
|
| 702 | + * |
|
| 703 | + * @param string $banner The banner's remote url |
|
| 704 | + * @param array $error The array error, passed by reference |
|
| 705 | + * @return false|string String if no errors, else false |
|
| 706 | + */ |
|
| 707 | 707 | private function _banner_remote($banner, &$error) |
| 708 | 708 | { |
| 709 | 709 | if (!preg_match('#^(http|https|ftp)://#i', $banner)) |
@@ -810,11 +810,11 @@ discard block |
||
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | /** |
| 813 | - * Delete a banner from server |
|
| 814 | - * |
|
| 815 | - * @param string $file The file's name |
|
| 816 | - * @return bool True if delete success, else false |
|
| 817 | - */ |
|
| 813 | + * Delete a banner from server |
|
| 814 | + * |
|
| 815 | + * @param string $file The file's name |
|
| 816 | + * @return bool True if delete success, else false |
|
| 817 | + */ |
|
| 818 | 818 | private function _banner_delete($file) |
| 819 | 819 | { |
| 820 | 820 | if (file_exists($this->dir_helper->get_banner_path($file))) |
@@ -827,18 +827,18 @@ discard block |
||
| 827 | 827 | } |
| 828 | 828 | |
| 829 | 829 | /** |
| 830 | - * PageRank Lookup (Based on Google Toolbar for Mozilla Firefox) |
|
| 831 | - * |
|
| 832 | - * @copyright 2012 HM2K <[email protected]> |
|
| 833 | - * @link http://pagerank.phurix.net/ |
|
| 834 | - * @author James Wade <[email protected]> |
|
| 835 | - * @version $Revision: 2.1 $ |
|
| 836 | - * @require PHP 4.3.0 (file_get_contents) |
|
| 837 | - * @updated 06/10/11 |
|
| 838 | - * |
|
| 839 | - * @param string $q The website URL |
|
| 840 | - * @return string The calculated pagerank, or -1 |
|
| 841 | - */ |
|
| 830 | + * PageRank Lookup (Based on Google Toolbar for Mozilla Firefox) |
|
| 831 | + * |
|
| 832 | + * @copyright 2012 HM2K <[email protected]> |
|
| 833 | + * @link http://pagerank.phurix.net/ |
|
| 834 | + * @author James Wade <[email protected]> |
|
| 835 | + * @version $Revision: 2.1 $ |
|
| 836 | + * @require PHP 4.3.0 (file_get_contents) |
|
| 837 | + * @updated 06/10/11 |
|
| 838 | + * |
|
| 839 | + * @param string $q The website URL |
|
| 840 | + * @return string The calculated pagerank, or -1 |
|
| 841 | + */ |
|
| 842 | 842 | public function pagerank_process($q) |
| 843 | 843 | { |
| 844 | 844 | $googleDomains = array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch'); |
@@ -872,12 +872,12 @@ discard block |
||
| 872 | 872 | } |
| 873 | 873 | |
| 874 | 874 | /** |
| 875 | - * List flags |
|
| 876 | - * |
|
| 877 | - * @param string $flag_path The flag directory path |
|
| 878 | - * @param string $value Selected flag |
|
| 879 | - * @return string $list Html code |
|
| 880 | - */ |
|
| 875 | + * List flags |
|
| 876 | + * |
|
| 877 | + * @param string $flag_path The flag directory path |
|
| 878 | + * @param string $value Selected flag |
|
| 879 | + * @return string $list Html code |
|
| 880 | + */ |
|
| 881 | 881 | public function get_dir_flag_list($flag_path, $value) |
| 882 | 882 | { |
| 883 | 883 | $list = ''; |
@@ -912,10 +912,10 @@ discard block |
||
| 912 | 912 | } |
| 913 | 913 | |
| 914 | 914 | /** |
| 915 | - * Display recents links added |
|
| 916 | - * |
|
| 917 | - * @return null |
|
| 918 | - */ |
|
| 915 | + * Display recents links added |
|
| 916 | + * |
|
| 917 | + * @return null |
|
| 918 | + */ |
|
| 919 | 919 | public function recents() |
| 920 | 920 | { |
| 921 | 921 | if ($this->config['dir_recent_block']) |
@@ -992,13 +992,13 @@ discard block |
||
| 992 | 992 | } |
| 993 | 993 | |
| 994 | 994 | /** |
| 995 | - * Validate back link |
|
| 996 | - * |
|
| 997 | - * @param string $remote_url Page URL contains the backlink |
|
| 998 | - * @param bool $optional Link back is optional in this category? |
|
| 999 | - * @param bool $cron This methos is called by con process? |
|
| 1000 | - * @return false|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) |
|
| 1001 | - */ |
|
| 995 | + * Validate back link |
|
| 996 | + * |
|
| 997 | + * @param string $remote_url Page URL contains the backlink |
|
| 998 | + * @param bool $optional Link back is optional in this category? |
|
| 999 | + * @param bool $cron This methos is called by con process? |
|
| 1000 | + * @return false|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) |
|
| 1001 | + */ |
|
| 1002 | 1002 | public function validate_link_back($remote_url, $optional, $cron = false) |
| 1003 | 1003 | { |
| 1004 | 1004 | if (!$cron) |
@@ -1038,14 +1038,14 @@ discard block |
||
| 1038 | 1038 | } |
| 1039 | 1039 | |
| 1040 | 1040 | /** |
| 1041 | - * Check, for website with backlink specified, if backlink is always here. |
|
| 1042 | - * After $nb_check verification, website is deleted, otherwise, a notification is send to poster |
|
| 1043 | - * |
|
| 1044 | - * @param int $cat_id The categoryID |
|
| 1045 | - * @param int $nb_check Number of check before demete a website |
|
| 1046 | - * @param int $next_prune Date of next auto check |
|
| 1047 | - * @return null |
|
| 1048 | - */ |
|
| 1041 | + * Check, for website with backlink specified, if backlink is always here. |
|
| 1042 | + * After $nb_check verification, website is deleted, otherwise, a notification is send to poster |
|
| 1043 | + * |
|
| 1044 | + * @param int $cat_id The categoryID |
|
| 1045 | + * @param int $nb_check Number of check before demete a website |
|
| 1046 | + * @param int $next_prune Date of next auto check |
|
| 1047 | + * @return null |
|
| 1048 | + */ |
|
| 1049 | 1049 | private function _check($cat_id, $nb_check, $next_prune) |
| 1050 | 1050 | { |
| 1051 | 1051 | $del_array = $update_array = array(); |
@@ -1093,11 +1093,11 @@ discard block |
||
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | 1095 | /** |
| 1096 | - * Method called by cron task. |
|
| 1097 | - * |
|
| 1098 | - * @param array $cat_data Information about category, from db |
|
| 1099 | - * @return null |
|
| 1100 | - */ |
|
| 1096 | + * Method called by cron task. |
|
| 1097 | + * |
|
| 1098 | + * @param array $cat_data Information about category, from db |
|
| 1099 | + * @return null |
|
| 1100 | + */ |
|
| 1101 | 1101 | public function auto_check($cat_data) |
| 1102 | 1102 | { |
| 1103 | 1103 | global $phpbb_log; |
@@ -1127,12 +1127,12 @@ discard block |
||
| 1127 | 1127 | } |
| 1128 | 1128 | |
| 1129 | 1129 | /** |
| 1130 | - * Update website verification number after a missing backlink, and send notificaton |
|
| 1131 | - * |
|
| 1132 | - * @param array $u_array Information about website |
|
| 1133 | - * @param int $next_prune Date of next auto check |
|
| 1134 | - * @return null |
|
| 1135 | - */ |
|
| 1130 | + * Update website verification number after a missing backlink, and send notificaton |
|
| 1131 | + * |
|
| 1132 | + * @param array $u_array Information about website |
|
| 1133 | + * @param int $next_prune Date of next auto check |
|
| 1134 | + * @return null |
|
| 1135 | + */ |
|
| 1136 | 1136 | private function _update_check($u_array, $next_prune) |
| 1137 | 1137 | { |
| 1138 | 1138 | if (!class_exists('messenger')) |
@@ -62,17 +62,17 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\notification\manager $notification, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext) |
| 64 | 64 | { |
| 65 | - $this->db = $db; |
|
| 65 | + $this->db = $db; |
|
| 66 | 66 | $this->config = $config; |
| 67 | - $this->template = $template; |
|
| 67 | + $this->template = $template; |
|
| 68 | 68 | $this->user = $user; |
| 69 | 69 | $this->helper = $helper; |
| 70 | - $this->request = $request; |
|
| 70 | + $this->request = $request; |
|
| 71 | 71 | $this->auth = $auth; |
| 72 | - $this->notification = $notification; |
|
| 73 | - $this->dir_helper = $dir_helper; |
|
| 74 | - $this->root_path = $root_path; |
|
| 75 | - $this->php_ext = $php_ext; |
|
| 72 | + $this->notification = $notification; |
|
| 73 | + $this->dir_helper = $dir_helper; |
|
| 74 | + $this->root_path = $root_path; |
|
| 75 | + $this->php_ext = $php_ext; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -88,13 +88,13 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $this->db->sql_transaction('begin'); |
| 90 | 90 | |
| 91 | - $sql = 'INSERT INTO ' . DIR_LINK_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
| 91 | + $sql = 'INSERT INTO '.DIR_LINK_TABLE.' '.$this->db->sql_build_array('INSERT', $data); |
|
| 92 | 92 | $this->db->sql_query($sql); |
| 93 | 93 | $notification_data['link_id'] = $this->db->sql_nextid(); |
| 94 | 94 | |
| 95 | 95 | if (!$need_approval || $this->auth->acl_get('a_') || $this->auth->acl_get('m_')) |
| 96 | 96 | { |
| 97 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
| 97 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
| 98 | 98 | SET cat_links = cat_links + 1 |
| 99 | 99 | WHERE cat_id = ' . (int) $data['link_cat']; |
| 100 | 100 | $this->db->sql_query($sql); |
@@ -152,14 +152,14 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | $this->db->sql_transaction('begin'); |
| 154 | 154 | |
| 155 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
| 155 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
| 156 | 156 | SET cat_links = cat_links - 1 |
| 157 | 157 | WHERE cat_id = ' . (int) $old_cat; |
| 158 | 158 | $this->db->sql_query($sql); |
| 159 | 159 | |
| 160 | 160 | if (!$need_approval) |
| 161 | 161 | { |
| 162 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
| 162 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
| 163 | 163 | SET cat_links = cat_links + 1 |
| 164 | 164 | WHERE cat_id = ' . (int) $data['link_cat']; |
| 165 | 165 | $this->db->sql_query($sql); |
@@ -177,8 +177,8 @@ discard block |
||
| 177 | 177 | $this->notification->add_notifications($notification_type, $notification_data); |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
| 181 | - SET ' . $this->db->sql_build_array('UPDATE', $data) . ' |
|
| 180 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
| 181 | + SET ' . $this->db->sql_build_array('UPDATE', $data).' |
|
| 182 | 182 | WHERE link_id = ' . (int) $link_id; |
| 183 | 183 | $this->db->sql_query($sql); |
| 184 | 184 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | ); |
| 205 | 205 | |
| 206 | 206 | $sql = 'SELECT link_banner |
| 207 | - FROM ' . DIR_LINK_TABLE . ' |
|
| 207 | + FROM ' . DIR_LINK_TABLE.' |
|
| 208 | 208 | WHERE '. $this->db->sql_in_set('link_id', $url_array); |
| 209 | 209 | $result = $this->db->sql_query($sql); |
| 210 | 210 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | $this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $url_array)); |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
| 229 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
| 230 | 230 | SET cat_links = cat_links - '.sizeof($url_array).' |
| 231 | 231 | WHERE cat_id = ' . (int) $cat_id; |
| 232 | 232 | $this->db->sql_query($sql); |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | if ($this->request->is_ajax()) |
| 245 | 245 | { |
| 246 | 246 | $sql = 'SELECT cat_links |
| 247 | - FROM ' . DIR_CAT_TABLE . ' |
|
| 247 | + FROM ' . DIR_CAT_TABLE.' |
|
| 248 | 248 | WHERE cat_id = ' . (int) $cat_id; |
| 249 | 249 | $result = $this->db->sql_query($sql); |
| 250 | 250 | $data = $this->db->sql_fetchrow($result); |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | public function view($link_id) |
| 272 | 272 | { |
| 273 | 273 | $sql = 'SELECT link_id, link_url |
| 274 | - FROM ' . DIR_LINK_TABLE . ' |
|
| 274 | + FROM ' . DIR_LINK_TABLE.' |
|
| 275 | 275 | WHERE link_id = ' . (int) $link_id; |
| 276 | 276 | $result = $this->db->sql_query($sql); |
| 277 | 277 | $data = $this->db->sql_fetchrow($result); |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | throw new \phpbb\exception\http_exception(404, 'DIR_ERROR_NO_LINKS'); |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
| 284 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
| 285 | 285 | SET link_view = link_view + 1 |
| 286 | 286 | WHERE link_id = ' . (int) $link_id; |
| 287 | 287 | $this->db->sql_query($sql); |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | if ($details['scheme'] == 'https') |
| 307 | 307 | { |
| 308 | 308 | $default_port = 443; |
| 309 | - $hostname = 'tls://' . $details['host']; |
|
| 309 | + $hostname = 'tls://'.$details['host']; |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | if (!isset($details['path'])) |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | $flag_path = $ext_path.'images/flags/'; |
| 365 | 365 | $img_flag = 'no_flag.png'; |
| 366 | 366 | |
| 367 | - if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path . $data['link_flag'])) |
|
| 367 | + if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path.$data['link_flag'])) |
|
| 368 | 368 | { |
| 369 | 369 | $img_flag = $data['link_flag']; |
| 370 | 370 | } |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | $list = '<select name="vote">'; |
| 407 | 407 | for ($i = 0; $i <= 10; $i++) |
| 408 | 408 | { |
| 409 | - $list .= '<option value="' . $i . '"' . (($i == 5) ? ' selected="selected"' : '') . '>' . $i . '</option>'; |
|
| 409 | + $list .= '<option value="'.$i.'"'.(($i == 5) ? ' selected="selected"' : '').'>'.$i.'</option>'; |
|
| 410 | 410 | } |
| 411 | 411 | $list .= '</select>'; |
| 412 | 412 | |
@@ -444,8 +444,8 @@ discard block |
||
| 444 | 444 | { |
| 445 | 445 | $thumb = $this->thumb_process($data['link_url']); |
| 446 | 446 | |
| 447 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
| 448 | - SET link_thumb = "' . $this->db->sql_escape($thumb) . '" |
|
| 447 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
| 448 | + SET link_thumb = "' . $this->db->sql_escape($thumb).'" |
|
| 449 | 449 | WHERE link_id = ' . (int) $data['link_id']; |
| 450 | 450 | $this->db->sql_query($sql); |
| 451 | 451 | |
@@ -469,8 +469,8 @@ discard block |
||
| 469 | 469 | { |
| 470 | 470 | $pagerank = $this->pagerank_process($data['link_url']); |
| 471 | 471 | |
| 472 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
| 473 | - SET link_pagerank = ' . (int) $pagerank . ' |
|
| 472 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
| 473 | + SET link_pagerank = ' . (int) $pagerank.' |
|
| 474 | 474 | WHERE link_id = ' . (int) $data['link_id']; |
| 475 | 475 | $this->db->sql_query($sql); |
| 476 | 476 | } |
@@ -479,9 +479,9 @@ discard block |
||
| 479 | 479 | $pagerank = (int) $data['link_pagerank']; |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | - $prpos=40*$pagerank/10; |
|
| 483 | - $prneg=40-$prpos; |
|
| 484 | - $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.'" /> '; |
|
| 482 | + $prpos = 40 * $pagerank / 10; |
|
| 483 | + $prneg = 40 - $prpos; |
|
| 484 | + $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.'" /> '; |
|
| 485 | 485 | |
| 486 | 486 | $pagerank = $pagerank == '-1' ? $this->user->lang['DIR_PAGERANK_NOT_AVAILABLE'] : $this->user->lang('DIR_FROM_TEN', $pagerank); |
| 487 | 487 | return $html.$pagerank; |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | $height /= $coef_max; |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | - $s_banner = '<img src="' . $img_src . '" width="' . $width . '" height="' . $height . '" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />'; |
|
| 524 | + $s_banner = '<img src="'.$img_src.'" width="'.$width.'" height="'.$height.'" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />'; |
|
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | return $s_banner; |
@@ -543,12 +543,12 @@ discard block |
||
| 543 | 543 | |
| 544 | 544 | $this->db->sql_transaction('begin'); |
| 545 | 545 | |
| 546 | - $sql = 'INSERT INTO ' . DIR_VOTE_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
| 546 | + $sql = 'INSERT INTO '.DIR_VOTE_TABLE.' '.$this->db->sql_build_array('INSERT', $data); |
|
| 547 | 547 | $this->db->sql_query($sql); |
| 548 | 548 | |
| 549 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
| 549 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
| 550 | 550 | SET link_vote = link_vote + 1, |
| 551 | - link_note = link_note + ' . (int) $data['vote_note'] . ' |
|
| 551 | + link_note = link_note + ' . (int) $data['vote_note'].' |
|
| 552 | 552 | WHERE link_id = ' . (int) $link_id; |
| 553 | 553 | $this->db->sql_query($sql); |
| 554 | 554 | |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | |
| 557 | 557 | if ($this->request->is_ajax()) |
| 558 | 558 | { |
| 559 | - $sql= 'SELECT link_vote, link_note FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int) $link_id; |
|
| 559 | + $sql = 'SELECT link_vote, link_note FROM '.DIR_LINK_TABLE.' WHERE link_id = '.(int) $link_id; |
|
| 560 | 560 | $result = $this->db->sql_query($sql); |
| 561 | 561 | $data = $this->db->sql_fetchrow($result); |
| 562 | 562 | |
@@ -590,8 +590,8 @@ discard block |
||
| 590 | 590 | |
| 591 | 591 | $details = parse_url($url); |
| 592 | 592 | |
| 593 | - $root_url = $details['scheme'].'://'.$details['host']; |
|
| 594 | - $absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url; |
|
| 593 | + $root_url = $details['scheme'].'://'.$details['host']; |
|
| 594 | + $absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url; |
|
| 595 | 595 | |
| 596 | 596 | if ($this->config['dir_activ_thumb_remote'] && $this->_ascreen_exist($details['scheme'], $details['host'])) |
| 597 | 597 | { |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | $destination = $this->dir_helper->get_banner_path(); |
| 635 | 635 | |
| 636 | 636 | // Can we upload? |
| 637 | - $can_upload = ($this->config['dir_storage_banner'] && file_exists($this->root_path . $destination) && phpbb_is_writable($this->root_path . $destination) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false; |
|
| 637 | + $can_upload = ($this->config['dir_storage_banner'] && file_exists($this->root_path.$destination) && phpbb_is_writable($this->root_path.$destination) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false; |
|
| 638 | 638 | |
| 639 | 639 | if ($banner && $can_upload) |
| 640 | 640 | { |
@@ -674,13 +674,13 @@ discard block |
||
| 674 | 674 | // Init upload class |
| 675 | 675 | if (!class_exists('fileupload')) |
| 676 | 676 | { |
| 677 | - include($this->root_path . 'includes/functions_upload.' . $this->php_ext); |
|
| 677 | + include($this->root_path.'includes/functions_upload.'.$this->php_ext); |
|
| 678 | 678 | } |
| 679 | 679 | $upload = new \fileupload('DIR_BANNER_', array('jpg', 'jpeg', 'gif', 'png'), $this->config['dir_banner_filesize']); |
| 680 | 680 | |
| 681 | 681 | $file = $upload->remote_upload($banner); |
| 682 | 682 | |
| 683 | - $prefix = unique_id() . '_'; |
|
| 683 | + $prefix = unique_id().'_'; |
|
| 684 | 684 | $file->clean_filename('real', $prefix); |
| 685 | 685 | |
| 686 | 686 | $destination = $this->dir_helper->get_banner_path(); |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | return false; |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | - return $prefix .strtolower($file->uploadname); |
|
| 698 | + return $prefix.strtolower($file->uploadname); |
|
| 699 | 699 | } |
| 700 | 700 | |
| 701 | 701 | /** |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | { |
| 711 | 711 | if (!preg_match('#^(http|https|ftp)://#i', $banner)) |
| 712 | 712 | { |
| 713 | - $banner = 'http://' . $banner; |
|
| 713 | + $banner = 'http://'.$banner; |
|
| 714 | 714 | } |
| 715 | 715 | 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)) |
| 716 | 716 | { |
@@ -737,11 +737,11 @@ discard block |
||
| 737 | 737 | // Check image type |
| 738 | 738 | if (!class_exists('fileupload')) |
| 739 | 739 | { |
| 740 | - include($this->root_path . 'includes/functions_upload.' . $this->php_ext); |
|
| 740 | + include($this->root_path.'includes/functions_upload.'.$this->php_ext); |
|
| 741 | 741 | } |
| 742 | 742 | |
| 743 | - $types = \fileupload::image_types(); |
|
| 744 | - $extension = strtolower(\filespec::get_extension($banner)); |
|
| 743 | + $types = \fileupload::image_types(); |
|
| 744 | + $extension = strtolower(\filespec::get_extension($banner)); |
|
| 745 | 745 | |
| 746 | 746 | // Check if this is actually an image |
| 747 | 747 | if ($file_stream = @fopen($banner, 'r')) |
@@ -843,14 +843,14 @@ discard block |
||
| 843 | 843 | */ |
| 844 | 844 | public function pagerank_process($q) |
| 845 | 845 | { |
| 846 | - $googleDomains = array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch'); |
|
| 847 | - $seed = $this->user->lang['SEED']; |
|
| 848 | - $result = 0x01020345; |
|
| 846 | + $googleDomains = array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch'); |
|
| 847 | + $seed = $this->user->lang['SEED']; |
|
| 848 | + $result = 0x01020345; |
|
| 849 | 849 | $len = strlen($q); |
| 850 | 850 | |
| 851 | - for ($i=0; $i<$len; $i++) |
|
| 851 | + for ($i = 0; $i < $len; $i++) |
|
| 852 | 852 | { |
| 853 | - $result ^= ord($seed{$i%strlen($seed)}) ^ ord($q{$i}); |
|
| 853 | + $result ^= ord($seed{$i % strlen($seed)}) ^ ord($q{$i}); |
|
| 854 | 854 | $result = (($result >> 23) & 0x1ff) | $result << 9; |
| 855 | 855 | } |
| 856 | 856 | |
@@ -861,10 +861,10 @@ discard block |
||
| 861 | 861 | |
| 862 | 862 | $ch = sprintf('8%x', $result); |
| 863 | 863 | $url = 'http://%s/tbr?client=navclient-auto&ch=%s&features=Rank&q=info:%s'; |
| 864 | - $host = 'toolbarqueries.google'.$googleDomains[mt_rand(0,count($googleDomains)-1)]; |
|
| 864 | + $host = 'toolbarqueries.google'.$googleDomains[mt_rand(0, count($googleDomains) - 1)]; |
|
| 865 | 865 | |
| 866 | - $url = sprintf($url,$host,$ch,$q); |
|
| 867 | - @$pr = trim(file_get_contents($url,false)); |
|
| 866 | + $url = sprintf($url, $host, $ch, $q); |
|
| 867 | + @$pr = trim(file_get_contents($url, false)); |
|
| 868 | 868 | |
| 869 | 869 | if (is_numeric(substr(strrchr($pr, ':'), 1))) |
| 870 | 870 | { |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | |
| 907 | 907 | if (file_exists($flag_path.$img_file)) |
| 908 | 908 | { |
| 909 | - $list .= '<option value="' . $img_file . '" ' . (($img_file == $value) ? 'selected="selected"' : '') . '>' . $name . '</option>'; |
|
| 909 | + $list .= '<option value="'.$img_file.'" '.(($img_file == $value) ? 'selected="selected"' : '').'>'.$name.'</option>'; |
|
| 910 | 910 | } |
| 911 | 911 | } |
| 912 | 912 | |
@@ -922,8 +922,8 @@ discard block |
||
| 922 | 922 | { |
| 923 | 923 | if ($this->config['dir_recent_block']) |
| 924 | 924 | { |
| 925 | - $limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns']; |
|
| 926 | - $exclude_array = explode(',', str_replace(' ', '', $this->config['dir_recent_exclude'])); |
|
| 925 | + $limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns']; |
|
| 926 | + $exclude_array = explode(',', str_replace(' ', '', $this->config['dir_recent_exclude'])); |
|
| 927 | 927 | |
| 928 | 928 | $sql_array = array( |
| 929 | 929 | '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', |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | if (sizeof($rowset)) |
| 957 | 957 | { |
| 958 | 958 | $this->template->assign_block_vars('block', array( |
| 959 | - 'S_COL_WIDTH' => (100 / $this->config['dir_recent_columns']) . '%', |
|
| 959 | + 'S_COL_WIDTH' => (100 / $this->config['dir_recent_columns']).'%', |
|
| 960 | 960 | )); |
| 961 | 961 | |
| 962 | 962 | foreach ($rowset as $row) |
@@ -1062,7 +1062,7 @@ discard block |
||
| 1062 | 1062 | 'ON' => 'l.link_user_id = u.user_id' |
| 1063 | 1063 | ) |
| 1064 | 1064 | ), |
| 1065 | - 'WHERE' => 'l.link_back <> "" AND l.link_active = 1 AND l.link_cat = ' . (int) $cat_id); |
|
| 1065 | + 'WHERE' => 'l.link_back <> "" AND l.link_active = 1 AND l.link_cat = '.(int) $cat_id); |
|
| 1066 | 1066 | |
| 1067 | 1067 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
| 1068 | 1068 | $result = $this->db->sql_query($sql); |
@@ -1071,7 +1071,7 @@ discard block |
||
| 1071 | 1071 | { |
| 1072 | 1072 | if ($this->validate_link_back($row['link_back'], false, true) !== false) |
| 1073 | 1073 | { |
| 1074 | - if (!$nb_check || ($row['link_nb_check']+1) >= $nb_check) |
|
| 1074 | + if (!$nb_check || ($row['link_nb_check'] + 1) >= $nb_check) |
|
| 1075 | 1075 | { |
| 1076 | 1076 | $del_array[] = $row['link_id']; |
| 1077 | 1077 | } |
@@ -1105,7 +1105,7 @@ discard block |
||
| 1105 | 1105 | global $phpbb_log; |
| 1106 | 1106 | |
| 1107 | 1107 | $sql = 'SELECT cat_name |
| 1108 | - FROM ' . DIR_CAT_TABLE . ' |
|
| 1108 | + FROM ' . DIR_CAT_TABLE.' |
|
| 1109 | 1109 | WHERE cat_id = ' . (int) $cat_data['cat_id']; |
| 1110 | 1110 | $result = $this->db->sql_query($sql); |
| 1111 | 1111 | $row = $this->db->sql_fetchrow($result); |
@@ -1117,9 +1117,9 @@ discard block |
||
| 1117 | 1117 | |
| 1118 | 1118 | $this->_check($cat_data['cat_id'], $cat_data['cat_cron_nb_check'], $next_prune); |
| 1119 | 1119 | |
| 1120 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . " |
|
| 1120 | + $sql = 'UPDATE '.DIR_CAT_TABLE." |
|
| 1121 | 1121 | SET cat_cron_next = $next_prune |
| 1122 | - WHERE cat_id = " . (int) $cat_data['cat_id']; |
|
| 1122 | + WHERE cat_id = ".(int) $cat_data['cat_id']; |
|
| 1123 | 1123 | $this->db->sql_query($sql); |
| 1124 | 1124 | |
| 1125 | 1125 | $phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_AUTO_PRUNE', time(), array($row['cat_name'])); |
@@ -1139,7 +1139,7 @@ discard block |
||
| 1139 | 1139 | { |
| 1140 | 1140 | if (!class_exists('messenger')) |
| 1141 | 1141 | { |
| 1142 | - include($this->root_path . 'includes/functions_messenger.' . $this->php_ext); |
|
| 1142 | + include($this->root_path.'includes/functions_messenger.'.$this->php_ext); |
|
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | 1145 | $messenger = new \messenger(false); |
@@ -1148,7 +1148,7 @@ discard block |
||
| 1148 | 1148 | // We need to define it, because we use user->format_date below |
| 1149 | 1149 | $this->user->timezone = new \DateTimeZone($this->config['board_timezone']); |
| 1150 | 1150 | |
| 1151 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
| 1151 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
| 1152 | 1152 | SET link_nb_check = link_nb_check + 1 |
| 1153 | 1153 | WHERE ' . $this->db->sql_in_set('link_id', array_keys($u_array)); |
| 1154 | 1154 | $this->db->sql_query($sql); |
@@ -13,11 +13,11 @@ |
||
| 13 | 13 | class nestedset_category extends \phpbb\tree\nestedset |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * Construct |
|
| 17 | - * |
|
| 18 | - * @param \phpbb\db\driver\driver_interface $db Database connection |
|
| 19 | - * @param \phpbb\lock\db $lock Lock class used to lock the table when moving forums around |
|
| 20 | - */ |
|
| 16 | + * Construct |
|
| 17 | + * |
|
| 18 | + * @param \phpbb\db\driver\driver_interface $db Database connection |
|
| 19 | + * @param \phpbb\lock\db $lock Lock class used to lock the table when moving forums around |
|
| 20 | + */ |
|
| 21 | 21 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\lock\db $lock) |
| 22 | 22 | { |
| 23 | 23 | parent::__construct( |
@@ -39,17 +39,17 @@ discard block |
||
| 39 | 39 | protected $php_ext; |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | - * Constructor |
|
| 43 | - * |
|
| 44 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 45 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
| 46 | - * @param \phpbb\template\template $template Template object |
|
| 47 | - * @param \phpbb\user $user User object |
|
| 48 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
| 49 | - * @param string $table_prefix prefix table |
|
| 50 | - * @param string $php_ext phpEx |
|
| 51 | - * @access public |
|
| 52 | - */ |
|
| 42 | + * Constructor |
|
| 43 | + * |
|
| 44 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 45 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
| 46 | + * @param \phpbb\template\template $template Template object |
|
| 47 | + * @param \phpbb\user $user User object |
|
| 48 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
| 49 | + * @param string $table_prefix prefix table |
|
| 50 | + * @param string $php_ext phpEx |
|
| 51 | + * @access public |
|
| 52 | + */ |
|
| 53 | 53 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\helper $dir_helper, $table_prefix, $php_ext) |
| 54 | 54 | { |
| 55 | 55 | $this->db = $db; |
@@ -62,12 +62,12 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | - * Assign functions defined in this class to event listeners in the core |
|
| 66 | - * |
|
| 67 | - * @return array |
|
| 68 | - * @static |
|
| 69 | - * @access public |
|
| 70 | - */ |
|
| 65 | + * Assign functions defined in this class to event listeners in the core |
|
| 66 | + * |
|
| 67 | + * @return array |
|
| 68 | + * @static |
|
| 69 | + * @access public |
|
| 70 | + */ |
|
| 71 | 71 | static public function getSubscribedEvents() |
| 72 | 72 | { |
| 73 | 73 | return array( |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | - * Define table constants |
|
| 85 | - * |
|
| 86 | - * @return null |
|
| 87 | - */ |
|
| 84 | + * Define table constants |
|
| 85 | + * |
|
| 86 | + * @return null |
|
| 87 | + */ |
|
| 88 | 88 | public function set_constants_tables() |
| 89 | 89 | { |
| 90 | 90 | define('DIR_CAT_TABLE', $this->table_prefix.'directory_cats'); |
@@ -95,10 +95,10 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | - * Display links to Directory |
|
| 99 | - * |
|
| 100 | - * @return null |
|
| 101 | - */ |
|
| 98 | + * Display links to Directory |
|
| 99 | + * |
|
| 100 | + * @return null |
|
| 101 | + */ |
|
| 102 | 102 | public function add_page_header_variables() |
| 103 | 103 | { |
| 104 | 104 | $ext_theme_path = $this->dir_helper->get_ext_name() . '/styles/prosilver/theme/'; |
@@ -118,11 +118,11 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
| 121 | - * Show users as viewing Directory on Who Is Online page |
|
| 122 | - * |
|
| 123 | - * @param object $event The event object |
|
| 124 | - * @return null |
|
| 125 | - */ |
|
| 121 | + * Show users as viewing Directory on Who Is Online page |
|
| 122 | + * |
|
| 123 | + * @param object $event The event object |
|
| 124 | + * @return null |
|
| 125 | + */ |
|
| 126 | 126 | public function add_page_viewonline($event) |
| 127 | 127 | { |
| 128 | 128 | if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/directory') === 0) |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
| 136 | - * Load common language files during user setup |
|
| 137 | - * |
|
| 138 | - * @param object $event The event object |
|
| 139 | - * @return null |
|
| 140 | - */ |
|
| 136 | + * Load common language files during user setup |
|
| 137 | + * |
|
| 138 | + * @param object $event The event object |
|
| 139 | + * @return null |
|
| 140 | + */ |
|
| 141 | 141 | public function load_language_on_setup($event) |
| 142 | 142 | { |
| 143 | 143 | $lang_set_ext = $event['lang_set_ext']; |
@@ -149,11 +149,11 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
| 152 | - * Add administrative permissions to manage Directory |
|
| 153 | - * |
|
| 154 | - * @param object $event The event object |
|
| 155 | - * @return null |
|
| 156 | - */ |
|
| 152 | + * Add administrative permissions to manage Directory |
|
| 153 | + * |
|
| 154 | + * @param object $event The event object |
|
| 155 | + * @return null |
|
| 156 | + */ |
|
| 157 | 157 | public function permissions_add_directory($event) |
| 158 | 158 | { |
| 159 | 159 | $categories = $event['categories']; |
@@ -182,11 +182,11 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /** |
| 185 | - * Update Directory tables if needed, after deleted an user |
|
| 186 | - * |
|
| 187 | - * @param object $event The event object |
|
| 188 | - * @return null |
|
| 189 | - */ |
|
| 185 | + * Update Directory tables if needed, after deleted an user |
|
| 186 | + * |
|
| 187 | + * @param object $event The event object |
|
| 188 | + * @return null |
|
| 189 | + */ |
|
| 190 | 190 | public function update_links_with_anonymous($event) |
| 191 | 191 | { |
| 192 | 192 | $user_ids = $event['user_ids']; |
@@ -52,13 +52,13 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\helper $dir_helper, $table_prefix, $php_ext) |
| 54 | 54 | { |
| 55 | - $this->db = $db; |
|
| 56 | - $this->helper = $helper; |
|
| 57 | - $this->template = $template; |
|
| 58 | - $this->user = $user; |
|
| 59 | - $this->dir_helper = $dir_helper; |
|
| 55 | + $this->db = $db; |
|
| 56 | + $this->helper = $helper; |
|
| 57 | + $this->template = $template; |
|
| 58 | + $this->user = $user; |
|
| 59 | + $this->dir_helper = $dir_helper; |
|
| 60 | 60 | $this->table_prefix = $table_prefix; |
| 61 | - $this->php_ext = $php_ext; |
|
| 61 | + $this->php_ext = $php_ext; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -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->user->lang_name; |
| 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 = 'en'; |
@@ -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->user->lang['DIRECTORY']; |
|
| 131 | - $event['location_url'] = $this->helper->route('ernadoo_phpbbdirectory_base_controller'); |
|
| 130 | + $event['location'] = $this->user->lang['DIRECTORY']; |
|
| 131 | + $event['location_url'] = $this->helper->route('ernadoo_phpbbdirectory_base_controller'); |
|
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
@@ -158,24 +158,24 @@ discard block |
||
| 158 | 158 | { |
| 159 | 159 | $categories = $event['categories']; |
| 160 | 160 | $categories = array_merge($categories, array('dir' => 'ACL_CAT_DIRECTORY')); |
| 161 | - $event['categories'] = $categories; |
|
| 161 | + $event['categories'] = $categories; |
|
| 162 | 162 | |
| 163 | 163 | $permissions = $event['permissions']; |
| 164 | 164 | |
| 165 | 165 | $permissions = array_merge($permissions, array( |
| 166 | - 'm_delete_dir' => array('lang' => 'ACL_M_DELETE_DIR', 'cat' => 'dir'), |
|
| 167 | - 'm_delete_comment_dir' => array('lang' => 'ACL_M_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
| 168 | - 'm_edit_dir' => array('lang' => 'ACL_M_EDIT_DIR', 'cat' => 'dir'), |
|
| 169 | - 'm_edit_comment_dir' => array('lang' => 'ACL_M_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
| 170 | - |
|
| 171 | - 'u_comment_dir' => array('lang' => 'ACL_U_COMMENT_DIR', 'cat' => 'dir'), |
|
| 172 | - 'u_delete_dir' => array('lang' => 'ACL_U_DELETE_DIR', 'cat' => 'dir'), |
|
| 173 | - 'u_delete_comment_dir' => array('lang' => 'ACL_U_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
| 174 | - 'u_edit_dir' => array('lang' => 'ACL_U_EDIT_DIR', 'cat' => 'dir'), |
|
| 175 | - 'u_edit_comment_dir' => array('lang' => 'ACL_U_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
| 176 | - 'u_search_dir' => array('lang' => 'ACL_U_SEARCH_DIR', 'cat' => 'dir'), |
|
| 177 | - 'u_submit_dir' => array('lang' => 'ACL_U_SUBMIT_DIR', 'cat' => 'dir'), |
|
| 178 | - 'u_vote_dir' => array('lang' => 'ACL_U_VOTE_DIR', 'cat' => 'dir'), |
|
| 166 | + 'm_delete_dir' => array('lang' => 'ACL_M_DELETE_DIR', 'cat' => 'dir'), |
|
| 167 | + 'm_delete_comment_dir' => array('lang' => 'ACL_M_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
| 168 | + 'm_edit_dir' => array('lang' => 'ACL_M_EDIT_DIR', 'cat' => 'dir'), |
|
| 169 | + 'm_edit_comment_dir' => array('lang' => 'ACL_M_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
| 170 | + |
|
| 171 | + 'u_comment_dir' => array('lang' => 'ACL_U_COMMENT_DIR', 'cat' => 'dir'), |
|
| 172 | + 'u_delete_dir' => array('lang' => 'ACL_U_DELETE_DIR', 'cat' => 'dir'), |
|
| 173 | + 'u_delete_comment_dir' => array('lang' => 'ACL_U_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
| 174 | + 'u_edit_dir' => array('lang' => 'ACL_U_EDIT_DIR', 'cat' => 'dir'), |
|
| 175 | + 'u_edit_comment_dir' => array('lang' => 'ACL_U_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
| 176 | + 'u_search_dir' => array('lang' => 'ACL_U_SEARCH_DIR', 'cat' => 'dir'), |
|
| 177 | + 'u_submit_dir' => array('lang' => 'ACL_U_SUBMIT_DIR', 'cat' => 'dir'), |
|
| 178 | + 'u_vote_dir' => array('lang' => 'ACL_U_VOTE_DIR', 'cat' => 'dir'), |
|
| 179 | 179 | )); |
| 180 | 180 | |
| 181 | 181 | $event['permissions'] = $permissions; |
@@ -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 | } |
@@ -44,18 +44,18 @@ discard block |
||
| 44 | 44 | public $data = array(); |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | - * Constructor |
|
| 48 | - * |
|
| 49 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 50 | - * @param \phpbb\config\config $config Config object |
|
| 51 | - * @param \phpbb\template\template $template Template object |
|
| 52 | - * @param \phpbb\user $user User object |
|
| 53 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
| 54 | - * @param \phpbb\request\request $request Request object |
|
| 55 | - * @param \phpbb\auth\auth $auth Auth object |
|
| 56 | - * @param \phpbb\cron\manager $cron Cron object |
|
| 57 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
| 58 | - */ |
|
| 47 | + * Constructor |
|
| 48 | + * |
|
| 49 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 50 | + * @param \phpbb\config\config $config Config object |
|
| 51 | + * @param \phpbb\template\template $template Template object |
|
| 52 | + * @param \phpbb\user $user User object |
|
| 53 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
| 54 | + * @param \phpbb\request\request $request Request object |
|
| 55 | + * @param \phpbb\auth\auth $auth Auth object |
|
| 56 | + * @param \phpbb\cron\manager $cron Cron object |
|
| 57 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
| 58 | + */ |
|
| 59 | 59 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\cron\manager $cron, \ernadoo\phpbbdirectory\core\helper $dir_helper) |
| 60 | 60 | { |
| 61 | 61 | $this->db = $db; |
@@ -70,21 +70,21 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | - * Function for get approval setting |
|
| 74 | - * used in edit mode for test the setting of new category's link |
|
| 75 | - * |
|
| 76 | - * @return bool |
|
| 77 | - */ |
|
| 73 | + * Function for get approval setting |
|
| 74 | + * used in edit mode for test the setting of new category's link |
|
| 75 | + * |
|
| 76 | + * @return bool |
|
| 77 | + */ |
|
| 78 | 78 | public function need_approval() |
| 79 | 79 | { |
| 80 | 80 | return (bool) $this->data['cat_validate']; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | - * Generate Jumpbox |
|
| 85 | - * |
|
| 86 | - * @return null |
|
| 87 | - */ |
|
| 84 | + * Generate Jumpbox |
|
| 85 | + * |
|
| 86 | + * @return null |
|
| 87 | + */ |
|
| 88 | 88 | public function make_cat_jumpbox() |
| 89 | 89 | { |
| 90 | 90 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
@@ -137,12 +137,12 @@ discard block |
||
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
| 140 | - * Generate a list of directory's categories |
|
| 141 | - * |
|
| 142 | - * @param int $select_id Selected category |
|
| 143 | - * @param array $ignore_id Array of ignored categories |
|
| 144 | - * @return string $cat_list html code |
|
| 145 | - */ |
|
| 140 | + * Generate a list of directory's categories |
|
| 141 | + * |
|
| 142 | + * @param int $select_id Selected category |
|
| 143 | + * @param array $ignore_id Array of ignored categories |
|
| 144 | + * @return string $cat_list html code |
|
| 145 | + */ |
|
| 146 | 146 | public function make_cat_select($select_id = 0, $ignore_id = array()) |
| 147 | 147 | { |
| 148 | 148 | $ignore_id = is_array($ignore_id) ? $ignore_id : array($ignore_id); |
@@ -188,10 +188,10 @@ discard block |
||
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
| 191 | - * Display cat or subcat |
|
| 192 | - * |
|
| 193 | - * @return null |
|
| 194 | - */ |
|
| 191 | + * Display cat or subcat |
|
| 192 | + * |
|
| 193 | + * @return null |
|
| 194 | + */ |
|
| 195 | 195 | public function display() |
| 196 | 196 | { |
| 197 | 197 | $cat_rows = $subcats = array(); |
@@ -320,11 +320,11 @@ discard block |
||
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | /** |
| 323 | - * Get informations about a cat or subcat |
|
| 324 | - * |
|
| 325 | - * @param int $cat_id The category ID |
|
| 326 | - * @return null|false |
|
| 327 | - */ |
|
| 323 | + * Get informations about a cat or subcat |
|
| 324 | + * |
|
| 325 | + * @param int $cat_id The category ID |
|
| 326 | + * @return null|false |
|
| 327 | + */ |
|
| 328 | 328 | public function get($cat_id = 0) |
| 329 | 329 | { |
| 330 | 330 | if ($cat_id) |
@@ -352,11 +352,11 @@ discard block |
||
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | /** |
| 355 | - * Create category navigation links for given category, create parent |
|
| 356 | - * list if currently null, assign basic category info to template |
|
| 357 | - * |
|
| 358 | - * @param array $dir_cat_data |
|
| 359 | - */ |
|
| 355 | + * Create category navigation links for given category, create parent |
|
| 356 | + * list if currently null, assign basic category info to template |
|
| 357 | + * |
|
| 358 | + * @param array $dir_cat_data |
|
| 359 | + */ |
|
| 360 | 360 | public function generate_dir_nav(&$dir_cat_data) |
| 361 | 361 | { |
| 362 | 362 | global $phpbb_container; |
@@ -393,12 +393,12 @@ discard block |
||
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | /** |
| 396 | - * Return good key language |
|
| 397 | - * |
|
| 398 | - * @param bool $validate True if approbation needed before publication |
|
| 399 | - * @return string Information about approval, depends on user auth level |
|
| 400 | - * @throws \phpbb\exception\runtime_exception |
|
| 401 | - */ |
|
| 396 | + * Return good key language |
|
| 397 | + * |
|
| 398 | + * @param bool $validate True if approbation needed before publication |
|
| 399 | + * @return string Information about approval, depends on user auth level |
|
| 400 | + * @throws \phpbb\exception\runtime_exception |
|
| 401 | + */ |
|
| 402 | 402 | public function dir_submit_type($validate) |
| 403 | 403 | { |
| 404 | 404 | if ($validate && !$this->auth->acl_get('a_')) |
@@ -422,15 +422,15 @@ discard block |
||
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | /** |
| 425 | - * Category watching common code |
|
| 426 | - * |
|
| 427 | - * @param string $mode Watch or unwatch a category |
|
| 428 | - * @param array $s_watching An empty array, passed by reference |
|
| 429 | - * @param int $user_id The user ID |
|
| 430 | - * @param int $cat_id The category ID |
|
| 431 | - * @param string $notify_status User is watching the category? |
|
| 432 | - * @return null|string |
|
| 433 | - */ |
|
| 425 | + * Category watching common code |
|
| 426 | + * |
|
| 427 | + * @param string $mode Watch or unwatch a category |
|
| 428 | + * @param array $s_watching An empty array, passed by reference |
|
| 429 | + * @param int $user_id The user ID |
|
| 430 | + * @param int $cat_id The category ID |
|
| 431 | + * @param string $notify_status User is watching the category? |
|
| 432 | + * @return null|string |
|
| 433 | + */ |
|
| 434 | 434 | public function watch_categorie($mode, &$s_watching, $user_id, $cat_id, $notify_status) |
| 435 | 435 | { |
| 436 | 436 | // Is user watching this thread? |
@@ -516,11 +516,11 @@ discard block |
||
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | /** |
| 519 | - * Return Category name |
|
| 520 | - * |
|
| 521 | - * @param int $cat_id The category ID |
|
| 522 | - * @return string The category name |
|
| 523 | - */ |
|
| 519 | + * Return Category name |
|
| 520 | + * |
|
| 521 | + * @param int $cat_id The category ID |
|
| 522 | + * @return string The category name |
|
| 523 | + */ |
|
| 524 | 524 | static public function getname($cat_id) |
| 525 | 525 | { |
| 526 | 526 | global $db; |
@@ -58,15 +58,15 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\cron\manager $cron, \ernadoo\phpbbdirectory\core\helper $dir_helper) |
| 60 | 60 | { |
| 61 | - $this->db = $db; |
|
| 61 | + $this->db = $db; |
|
| 62 | 62 | $this->config = $config; |
| 63 | - $this->template = $template; |
|
| 63 | + $this->template = $template; |
|
| 64 | 64 | $this->user = $user; |
| 65 | 65 | $this->helper = $helper; |
| 66 | - $this->request = $request; |
|
| 66 | + $this->request = $request; |
|
| 67 | 67 | $this->auth = $auth; |
| 68 | 68 | $this->cron = $cron; |
| 69 | - $this->dir_helper = $dir_helper; |
|
| 69 | + $this->dir_helper = $dir_helper; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | public function make_cat_jumpbox() |
| 89 | 89 | { |
| 90 | 90 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
| 91 | - FROM ' . DIR_CAT_TABLE . ' |
|
| 91 | + FROM ' . DIR_CAT_TABLE.' |
|
| 92 | 92 | ORDER BY left_id ASC'; |
| 93 | 93 | $result = $this->db->sql_query($sql, 600); |
| 94 | 94 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | // This query is identical to the jumpbox one |
| 151 | 151 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
| 152 | - FROM ' . DIR_CAT_TABLE . ' |
|
| 152 | + FROM ' . DIR_CAT_TABLE.' |
|
| 153 | 153 | ORDER BY left_id ASC'; |
| 154 | 154 | $result = $this->db->sql_query($sql, 600); |
| 155 | 155 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | $selected = (($row['cat_id'] == $select_id) ? ' selected="selected"' : ''); |
| 182 | - $cat_list .= '<option value="' . $row['cat_id'] . '"' . (($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected) . '>' . $padding . $row['cat_name'] . '</option>'; |
|
| 182 | + $cat_list .= '<option value="'.$row['cat_id'].'"'.(($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected).'>'.$padding.$row['cat_name'].'</option>'; |
|
| 183 | 183 | } |
| 184 | 184 | $this->db->sql_freeresult($result); |
| 185 | 185 | unset($padding_store); |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | public function display() |
| 196 | 196 | { |
| 197 | - $cat_rows = $subcats = array(); |
|
| 197 | + $cat_rows = $subcats = array(); |
|
| 198 | 198 | $parent_id = $visible_cats = 0; |
| 199 | 199 | |
| 200 | 200 | $sql_array = array( |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | else |
| 213 | 213 | { |
| 214 | 214 | $root_data = $this->data; |
| 215 | - $sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id']; |
|
| 215 | + $sql_where = 'left_id > '.$root_data['left_id'].' AND left_id < '.$root_data['right_id']; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | $sql = $this->db->sql_build_query('SELECT', array( |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | { |
| 260 | 260 | foreach ($subcats[$dir_cat_id] as $subcat_id => $subcat_row) |
| 261 | 261 | { |
| 262 | - $row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links']+$subcat_row['links']) : $row['cat_links']; |
|
| 262 | + $row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links'] + $subcat_row['links']) : $row['cat_links']; |
|
| 263 | 263 | |
| 264 | 264 | if ($subcat_row['display'] && $subcat_row['parent_id'] == $dir_cat_id) |
| 265 | 265 | { |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | if ($task->is_ready()) |
| 315 | 315 | { |
| 316 | 316 | $url = $task->get_url(); |
| 317 | - $this->template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="" />'); |
|
| 317 | + $this->template->assign_var('RUN_CRON_TASK', '<img src="'.$url.'" width="1" height="1" alt="" />'); |
|
| 318 | 318 | } |
| 319 | 319 | } |
| 320 | 320 | } |
@@ -336,10 +336,10 @@ discard block |
||
| 336 | 336 | 'LEFT_JOIN' => array( |
| 337 | 337 | array( |
| 338 | 338 | 'FROM' => array(DIR_WATCH_TABLE => 'w'), |
| 339 | - 'ON' => 'c.cat_id = w.cat_id AND w.user_id = ' . (int) $this->user->data['user_id'] |
|
| 339 | + 'ON' => 'c.cat_id = w.cat_id AND w.user_id = '.(int) $this->user->data['user_id'] |
|
| 340 | 340 | ), |
| 341 | 341 | ), |
| 342 | - 'WHERE' => 'c.cat_id = ' . (int) $cat_id |
|
| 342 | + 'WHERE' => 'c.cat_id = '.(int) $cat_id |
|
| 343 | 343 | ); |
| 344 | 344 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
| 345 | 345 | $result = $this->db->sql_query($sql); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | $this->template->assign_block_vars('dir_navlinks', array( |
| 377 | 377 | 'FORUM_NAME' => $parent_data['cat_name'], |
| 378 | 378 | 'FORUM_ID' => $parent_cat_id, |
| 379 | - 'MICRODATA' => $microdata_attr . '="' . $parent_cat_id . '"', |
|
| 379 | + 'MICRODATA' => $microdata_attr.'="'.$parent_cat_id.'"', |
|
| 380 | 380 | 'U_VIEW_FORUM' => $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $parent_cat_id)), |
| 381 | 381 | )); |
| 382 | 382 | } |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | $this->template->assign_block_vars('dir_navlinks', array( |
| 386 | 386 | 'FORUM_NAME' => $dir_cat_data['cat_name'], |
| 387 | 387 | 'FORUM_ID' => $dir_cat_data['cat_id'], |
| 388 | - 'MICRODATA' => $microdata_attr . '="' . $dir_cat_data['cat_id'] . '"', |
|
| 388 | + 'MICRODATA' => $microdata_attr.'="'.$dir_cat_data['cat_id'].'"', |
|
| 389 | 389 | 'U_VIEW_FORUM' => $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $dir_cat_data['cat_id'])), |
| 390 | 390 | )); |
| 391 | 391 | |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | { |
| 443 | 443 | if ($mode == 'unwatch') |
| 444 | 444 | { |
| 445 | - $sql = 'DELETE FROM ' . DIR_WATCH_TABLE . " |
|
| 445 | + $sql = 'DELETE FROM '.DIR_WATCH_TABLE." |
|
| 446 | 446 | WHERE cat_id = $cat_id |
| 447 | 447 | AND user_id = $user_id"; |
| 448 | 448 | $this->db->sql_query($sql); |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | |
| 453 | 453 | if (!$this->request->is_ajax()) |
| 454 | 454 | { |
| 455 | - $message .= '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>'); |
|
| 455 | + $message .= '<br /><br />'.$this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>'); |
|
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | meta_refresh(3, $redirect_url); |
@@ -464,8 +464,8 @@ discard block |
||
| 464 | 464 | |
| 465 | 465 | if ($notify_status != NOTIFY_YES) |
| 466 | 466 | { |
| 467 | - $sql = 'UPDATE ' . DIR_WATCH_TABLE . ' |
|
| 468 | - SET notify_status = ' . NOTIFY_YES . " |
|
| 467 | + $sql = 'UPDATE '.DIR_WATCH_TABLE.' |
|
| 468 | + SET notify_status = ' . NOTIFY_YES." |
|
| 469 | 469 | WHERE cat_id = $cat_id |
| 470 | 470 | AND user_id = $user_id"; |
| 471 | 471 | $this->db->sql_query($sql); |
@@ -476,8 +476,8 @@ discard block |
||
| 476 | 476 | { |
| 477 | 477 | if ($mode == 'watch') |
| 478 | 478 | { |
| 479 | - $sql = 'INSERT INTO ' . DIR_WATCH_TABLE . " (user_id, cat_id, notify_status) |
|
| 480 | - VALUES ($user_id, $cat_id, " . NOTIFY_YES . ')'; |
|
| 479 | + $sql = 'INSERT INTO '.DIR_WATCH_TABLE." (user_id, cat_id, notify_status) |
|
| 480 | + VALUES ($user_id, $cat_id, ".NOTIFY_YES.')'; |
|
| 481 | 481 | $this->db->sql_query($sql); |
| 482 | 482 | |
| 483 | 483 | $redirect_url = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)); |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | |
| 486 | 486 | if (!$this->request->is_ajax()) |
| 487 | 487 | { |
| 488 | - $message .= '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>'); |
|
| 488 | + $message .= '<br /><br />'.$this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>'); |
|
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | meta_refresh(3, $redirect_url); |
@@ -505,10 +505,10 @@ discard block |
||
| 505 | 505 | |
| 506 | 506 | if ($can_watch) |
| 507 | 507 | { |
| 508 | - $s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch'))); |
|
| 508 | + $s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch'))); |
|
| 509 | 509 | $s_watching['link_toggle'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => ((!$is_watching) ? 'unwatch' : 'watch'))); |
| 510 | - $s_watching['title'] = $this->user->lang[(($is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT']; |
|
| 511 | - $s_watching['title_toggle'] = $this->user->lang[((!$is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT']; |
|
| 510 | + $s_watching['title'] = $this->user->lang[(($is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT']; |
|
| 511 | + $s_watching['title_toggle'] = $this->user->lang[((!$is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT']; |
|
| 512 | 512 | $s_watching['is_watching'] = $is_watching; |
| 513 | 513 | } |
| 514 | 514 | |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | global $db; |
| 527 | 527 | |
| 528 | 528 | $sql = 'SELECT cat_name |
| 529 | - FROM ' . DIR_CAT_TABLE . ' |
|
| 529 | + FROM ' . DIR_CAT_TABLE.' |
|
| 530 | 530 | WHERE cat_id = ' . (int) $cat_id; |
| 531 | 531 | $result = $db->sql_query($sql); |
| 532 | 532 | $row = $db->sql_fetchrow($result); |
@@ -19,10 +19,10 @@ discard block |
||
| 19 | 19 | public $u_action; |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * |
|
| 23 | - * @param int $id |
|
| 24 | - * @param string $mode |
|
| 25 | - */ |
|
| 22 | + * |
|
| 23 | + * @param int $id |
|
| 24 | + * @param string $mode |
|
| 25 | + */ |
|
| 26 | 26 | public function main($id, $mode) |
| 27 | 27 | { |
| 28 | 28 | global $request, $phpbb_container; |
@@ -187,11 +187,11 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
| 190 | - * Display thumb services available |
|
| 191 | - * |
|
| 192 | - * @param string $url_selected |
|
| 193 | - * @return string |
|
| 194 | - */ |
|
| 190 | + * Display thumb services available |
|
| 191 | + * |
|
| 192 | + * @param string $url_selected |
|
| 193 | + * @return string |
|
| 194 | + */ |
|
| 195 | 195 | public function get_thumb_service_list($url_selected) |
| 196 | 196 | { |
| 197 | 197 | $thumbshot = array( |
@@ -211,11 +211,11 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /** |
| 214 | - * Display order drop-down list |
|
| 215 | - * |
|
| 216 | - * @param string $order_selected |
|
| 217 | - * @return string |
|
| 218 | - */ |
|
| 214 | + * Display order drop-down list |
|
| 215 | + * |
|
| 216 | + * @param string $order_selected |
|
| 217 | + * @return string |
|
| 218 | + */ |
|
| 219 | 219 | public function get_order_list($order_selected) |
| 220 | 220 | { |
| 221 | 221 | global $user; |
@@ -244,8 +244,8 @@ discard block |
||
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
| 247 | - * Adjust all three max_filesize config vars for display |
|
| 248 | - */ |
|
| 247 | + * Adjust all three max_filesize config vars for display |
|
| 248 | + */ |
|
| 249 | 249 | public function max_filesize($value, $key = '') |
| 250 | 250 | { |
| 251 | 251 | // Determine size var and adjust the value accordingly |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | { |
| 205 | 205 | $selected = ($url == $url_selected) ? 'selected="selected"' : ''; |
| 206 | 206 | |
| 207 | - $select_options .= '<option value="' . $url . '" ' . $selected . '>' . parse_url($url, PHP_URL_HOST) . '</option>'; |
|
| 207 | + $select_options .= '<option value="'.$url.'" '.$selected.'>'.parse_url($url, PHP_URL_HOST).'</option>'; |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | return $select_options; |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | { |
| 238 | 238 | $selected = ($i == $order_selected) ? 'selected="selected"' : ''; |
| 239 | 239 | $order_substr = trim(str_replace(' ', '_', $i)); |
| 240 | - $tpl .= '<option value="' . $i . '" ' . $selected . '>' . $user->lang['DIR_ORDER_' . strtoupper($order_substr)] . '</option>'; |
|
| 240 | + $tpl .= '<option value="'.$i.'" '.$selected.'>'.$user->lang['DIR_ORDER_'.strtoupper($order_substr)].'</option>'; |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | return ($tpl); |
@@ -254,6 +254,6 @@ discard block |
||
| 254 | 254 | $value = $filesize['value']; |
| 255 | 255 | |
| 256 | 256 | // size and maxlength must not be specified for input of type number |
| 257 | - return '<input type="number" id="' . $key . '" min="0" max="999999999999999" step="any" name="config[' . $key . ']" value="' . $value . '" /> <select name="' . $key . '">' . size_select_options($size_var) . '</select>'; |
|
| 257 | + return '<input type="number" id="'.$key.'" min="0" max="999999999999999" step="any" name="config['.$key.']" value="'.$value.'" /> <select name="'.$key.'">'.size_select_options($size_var).'</select>'; |
|
| 258 | 258 | } |
| 259 | 259 | } |