@@ -37,8 +37,8 @@  | 
                                                    ||
| 37 | 37 | */  | 
                                                        
| 38 | 38 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \ernadoo\phpbbdirectory\core\link $directory_cron, $php_ext)  | 
                                                        
| 39 | 39 |  	{ | 
                                                        
| 40 | - $this->db = $db;  | 
                                                        |
| 41 | - $this->config = $config;  | 
                                                        |
| 40 | + $this->db = $db;  | 
                                                        |
| 41 | + $this->config = $config;  | 
                                                        |
| 42 | 42 | $this->dir_cron = $directory_cron;  | 
                                                        
| 43 | 43 | $this->php_ext = $php_ext;  | 
                                                        
| 44 | 44 | }  | 
                                                        
@@ -28,13 +28,13 @@ discard block  | 
                                                    ||
| 28 | 28 | private $cat_data;  | 
                                                        
| 29 | 29 | |
| 30 | 30 | /**  | 
                                                        
| 31 | - * Constructor.  | 
                                                        |
| 32 | - *  | 
                                                        |
| 33 | - * @param \phpbb\db\driver\driver_interface $db Database object  | 
                                                        |
| 34 | - * @param \phpbb\config\config $config Config object  | 
                                                        |
| 35 | - * @param \ernadoo\phpbbdirectory\core\cron $directory_cron PhpBB Directory extension link object  | 
                                                        |
| 36 | - * @param string $php_ext phpEx  | 
                                                        |
| 37 | - */  | 
                                                        |
| 31 | + * Constructor.  | 
                                                        |
| 32 | + *  | 
                                                        |
| 33 | + * @param \phpbb\db\driver\driver_interface $db Database object  | 
                                                        |
| 34 | + * @param \phpbb\config\config $config Config object  | 
                                                        |
| 35 | + * @param \ernadoo\phpbbdirectory\core\cron $directory_cron PhpBB Directory extension link object  | 
                                                        |
| 36 | + * @param string $php_ext phpEx  | 
                                                        |
| 37 | + */  | 
                                                        |
| 38 | 38 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \ernadoo\phpbbdirectory\core\cron $directory_cron, $php_ext)  | 
                                                        
| 39 | 39 |  	{ | 
                                                        
| 40 | 40 | $this->db = $db;  | 
                                                        
@@ -44,66 +44,66 @@ discard block  | 
                                                    ||
| 44 | 44 | }  | 
                                                        
| 45 | 45 | |
| 46 | 46 | /**  | 
                                                        
| 47 | - * Manually set categorie data.  | 
                                                        |
| 48 | - *  | 
                                                        |
| 49 | - * @param array $cat_data Information about a category to be pruned.  | 
                                                        |
| 50 | - */  | 
                                                        |
| 47 | + * Manually set categorie data.  | 
                                                        |
| 48 | + *  | 
                                                        |
| 49 | + * @param array $cat_data Information about a category to be pruned.  | 
                                                        |
| 50 | + */  | 
                                                        |
| 51 | 51 | public function set_categorie_data($cat_data)  | 
                                                        
| 52 | 52 |  	{ | 
                                                        
| 53 | 53 | $this->cat_data = $cat_data;  | 
                                                        
| 54 | 54 | }  | 
                                                        
| 55 | 55 | |
| 56 | 56 | /**  | 
                                                        
| 57 | - * Runs this cron task.  | 
                                                        |
| 58 | - *  | 
                                                        |
| 59 | - * @return null  | 
                                                        |
| 60 | - */  | 
                                                        |
| 57 | + * Runs this cron task.  | 
                                                        |
| 58 | + *  | 
                                                        |
| 59 | + * @return null  | 
                                                        |
| 60 | + */  | 
                                                        |
| 61 | 61 | public function run()  | 
                                                        
| 62 | 62 |  	{ | 
                                                        
| 63 | 63 | $this->dir_cron->auto_check($this->cat_data);  | 
                                                        
| 64 | 64 | }  | 
                                                        
| 65 | 65 | |
| 66 | 66 | /**  | 
                                                        
| 67 | - * Returns whether this cron task can run, given current board configuration.  | 
                                                        |
| 68 | - *  | 
                                                        |
| 69 | - * @return bool  | 
                                                        |
| 70 | - */  | 
                                                        |
| 67 | + * Returns whether this cron task can run, given current board configuration.  | 
                                                        |
| 68 | + *  | 
                                                        |
| 69 | + * @return bool  | 
                                                        |
| 70 | + */  | 
                                                        |
| 71 | 71 | public function is_runnable()  | 
                                                        
| 72 | 72 |  	{ | 
                                                        
| 73 | 73 | return !$this->config['use_system_cron'] && !empty($this->cat_data);  | 
                                                        
| 74 | 74 | }  | 
                                                        
| 75 | 75 | |
| 76 | 76 | /**  | 
                                                        
| 77 | - * Returns whether this cron task should run now, because enough time  | 
                                                        |
| 78 | - * has passed since it was last run.  | 
                                                        |
| 79 | - *  | 
                                                        |
| 80 | - * @return bool  | 
                                                        |
| 81 | - */  | 
                                                        |
| 77 | + * Returns whether this cron task should run now, because enough time  | 
                                                        |
| 78 | + * has passed since it was last run.  | 
                                                        |
| 79 | + *  | 
                                                        |
| 80 | + * @return bool  | 
                                                        |
| 81 | + */  | 
                                                        |
| 82 | 82 | public function should_run()  | 
                                                        
| 83 | 83 |  	{ | 
                                                        
| 84 | 84 | return $this->cat_data['cat_cron_enable'] && $this->cat_data['cat_cron_next'] < time();  | 
                                                        
| 85 | 85 | }  | 
                                                        
| 86 | 86 | |
| 87 | 87 | /**  | 
                                                        
| 88 | - * Returns parameters of this cron task as an array.  | 
                                                        |
| 89 | - * The array has one key, c, whose value is id of the category to be pruned.  | 
                                                        |
| 90 | - *  | 
                                                        |
| 91 | - * @return array  | 
                                                        |
| 92 | - */  | 
                                                        |
| 88 | + * Returns parameters of this cron task as an array.  | 
                                                        |
| 89 | + * The array has one key, c, whose value is id of the category to be pruned.  | 
                                                        |
| 90 | + *  | 
                                                        |
| 91 | + * @return array  | 
                                                        |
| 92 | + */  | 
                                                        |
| 93 | 93 | public function get_parameters()  | 
                                                        
| 94 | 94 |  	{ | 
                                                        
| 95 | 95 |  		return array('c' => $this->cat_data['cat_id']); | 
                                                        
| 96 | 96 | }  | 
                                                        
| 97 | 97 | |
| 98 | 98 | /**  | 
                                                        
| 99 | - * Parses parameters found in $request, which is an instance of  | 
                                                        |
| 100 | - * \phpbb\request\request_interface.  | 
                                                        |
| 101 | - *  | 
                                                        |
| 102 | - * It is expected to have a key f whose value is id of the forum to be pruned.  | 
                                                        |
| 103 | - *  | 
                                                        |
| 104 | - * @param \phpbb\request\request_interface $request Request object.  | 
                                                        |
| 105 | - * @return null  | 
                                                        |
| 106 | - */  | 
                                                        |
| 99 | + * Parses parameters found in $request, which is an instance of  | 
                                                        |
| 100 | + * \phpbb\request\request_interface.  | 
                                                        |
| 101 | + *  | 
                                                        |
| 102 | + * It is expected to have a key f whose value is id of the forum to be pruned.  | 
                                                        |
| 103 | + *  | 
                                                        |
| 104 | + * @param \phpbb\request\request_interface $request Request object.  | 
                                                        |
| 105 | + * @return null  | 
                                                        |
| 106 | + */  | 
                                                        |
| 107 | 107 | public function parse_parameters(\phpbb\request\request_interface $request)  | 
                                                        
| 108 | 108 |  	{ | 
                                                        
| 109 | 109 | $this->cat_data = array();  | 
                                                        
@@ -37,7 +37,6 @@  | 
                                                    ||
| 37 | 37 | /**  | 
                                                        
| 38 | 38 | * Set the watch_table  | 
                                                        
| 39 | 39 | *  | 
                                                        
| 40 | - * @param string $helper  | 
                                                        |
| 41 | 40 | * @return null  | 
                                                        
| 42 | 41 | */  | 
                                                        
| 43 | 42 | public function set_watch_table($watch_table)  | 
                                                        
@@ -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))  | 
                                                        
@@ -69,18 +69,18 @@ discard block  | 
                                                    ||
| 69 | 69 | */  | 
                                                        
| 70 | 70 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\search\fulltext_directory $search, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link)  | 
                                                        
| 71 | 71 |  	{ | 
                                                        
| 72 | - $this->db = $db;  | 
                                                        |
| 73 | - $this->config = $config;  | 
                                                        |
| 72 | + $this->db = $db;  | 
                                                        |
| 73 | + $this->config = $config;  | 
                                                        |
| 74 | 74 | $this->language = $language;  | 
                                                        
| 75 | 75 | $this->template = $template;  | 
                                                        
| 76 | 76 | $this->user = $user;  | 
                                                        
| 77 | - $this->helper = $helper;  | 
                                                        |
| 78 | - $this->request = $request;  | 
                                                        |
| 77 | + $this->helper = $helper;  | 
                                                        |
| 78 | + $this->request = $request;  | 
                                                        |
| 79 | 79 | $this->auth = $auth;  | 
                                                        
| 80 | - $this->pagination = $pagination;  | 
                                                        |
| 81 | - $this->search = $search;  | 
                                                        |
| 82 | - $this->categorie = $categorie;  | 
                                                        |
| 83 | - $this->link = $link;  | 
                                                        |
| 80 | + $this->pagination = $pagination;  | 
                                                        |
| 81 | + $this->search = $search;  | 
                                                        |
| 82 | + $this->categorie = $categorie;  | 
                                                        |
| 83 | + $this->link = $link;  | 
                                                        |
| 84 | 84 | |
| 85 | 85 |  		$language->add_lang('directory', 'ernadoo/phpbbdirectory'); | 
                                                        
| 86 | 86 |  		$language->add_lang('search'); | 
                                                        
@@ -104,24 +104,24 @@ discard block  | 
                                                    ||
| 104 | 104 | throw new \phpbb\exception\http_exception(403, 'DIR_ERROR_NOT_AUTH');  | 
                                                        
| 105 | 105 | }  | 
                                                        
| 106 | 106 | |
| 107 | -		$cat_id				= $this->request->variable('cat_id', 0); | 
                                                        |
| 108 | -		$keywords			= $this->request->variable('keywords', '', true); | 
                                                        |
| 107 | +		$cat_id = $this->request->variable('cat_id', 0); | 
                                                        |
| 108 | +		$keywords = $this->request->variable('keywords', '', true); | 
                                                        |
| 109 | 109 |  		$search_terms		= $this->request->variable('terms', 'all'); | 
                                                        
| 110 | -		$search_category	= $this->request->variable('cid', array(0)); | 
                                                        |
| 111 | -		$search_fields		= $this->request->variable('sf', 'all'); | 
                                                        |
| 110 | +		$search_category = $this->request->variable('cid', array(0)); | 
                                                        |
| 111 | +		$search_fields = $this->request->variable('sf', 'all'); | 
                                                        |
| 112 | 112 |  		$search_child		= $this->request->variable('sc', true); | 
                                                        
| 113 | -		$sort_days			= $this->request->variable('st', 0); | 
                                                        |
| 113 | +		$sort_days = $this->request->variable('st', 0); | 
                                                        |
| 114 | 114 |  		$sort_key			= $this->request->variable('sk', 't'); | 
                                                        
| 115 | 115 |  		$sort_dir			= $this->request->variable('sd', 'd'); | 
                                                        
| 116 | - $start = ($page - 1) * (int) $this->config['dir_show'];  | 
                                                        |
| 116 | + $start = ($page - 1) * (int) $this->config['dir_show'];  | 
                                                        |
| 117 | 117 | |
| 118 | - $default_sort_days = 0;  | 
                                                        |
| 118 | + $default_sort_days = 0;  | 
                                                        |
| 119 | 119 | $default_sort_key = (string) substr($this->config['dir_default_order'], 0, 1);  | 
                                                        
| 120 | 120 | $default_sort_dir = (string) substr($this->config['dir_default_order'], 2);  | 
                                                        
| 121 | 121 | |
| 122 | 122 | // Categorie ordering options  | 
                                                        
| 123 | 123 |  		$limit_days		= array(0 => $this->language->lang('ALL_RESULTS'), 1 => $this->language->lang('1_DAY'), 7 => $this->language->lang('7_DAYS'), 14 => $this->language->lang('2_WEEKS'), 30 => $this->language->lang('1_MONTH'), 90 => $this->language->lang('3_MONTHS'), 180 => $this->language->lang('6_MONTHS'), 365 => $this->language->lang('1_YEAR')); | 
                                                        
| 124 | -		$sort_by_text	= array('a' => $this->language->lang('AUTHOR'), 't' => $this->language->lang('POST_TIME'), 'r' => $this->language->lang('DIR_COMMENTS_ORDER'), 's' =>  $this->language->lang('DIR_NAME_ORDER'), 'v' => $this->language->lang('DIR_NB_CLICKS_ORDER')); | 
                                                        |
| 124 | +		$sort_by_text = array('a' => $this->language->lang('AUTHOR'), 't' => $this->language->lang('POST_TIME'), 'r' => $this->language->lang('DIR_COMMENTS_ORDER'), 's' =>  $this->language->lang('DIR_NAME_ORDER'), 'v' => $this->language->lang('DIR_NB_CLICKS_ORDER')); | 
                                                        |
| 125 | 125 |  		$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'); | 
                                                        
| 126 | 126 | |
| 127 | 127 | if ($this->config['dir_activ_pagerank'])  | 
                                                        
@@ -170,12 +170,12 @@ discard block  | 
                                                    ||
| 170 | 170 | |
| 171 | 171 |  			$u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit))); | 
                                                        
| 172 | 172 | |
| 173 | - ($u_hilit) ? $u_search['keywords'] = urlencode(htmlspecialchars_decode($keywords)) : '';  | 
                                                        |
| 174 | - ($search_terms != 'all') ? $u_search['terms'] = $search_terms : '';  | 
                                                        |
| 175 | - ($cat_id) ? $u_search['cat_id'] = $cat_id : '';  | 
                                                        |
| 176 | - ($search_category) ? $u_search['cid'] = $search_category : '';  | 
                                                        |
| 177 | - (!$search_child) ? $u_search['sc'] = 0 : '';  | 
                                                        |
| 178 | - ($search_fields != 'all') ? $u_search['sf'] = $search_fields : '';  | 
                                                        |
| 173 | + ($u_hilit) ? $u_search['keywords'] = urlencode(htmlspecialchars_decode($keywords)) : '';  | 
                                                        |
| 174 | + ($search_terms != 'all') ? $u_search['terms'] = $search_terms : '';  | 
                                                        |
| 175 | + ($cat_id) ? $u_search['cat_id'] = $cat_id : '';  | 
                                                        |
| 176 | + ($search_category) ? $u_search['cid'] = $search_category : '';  | 
                                                        |
| 177 | + (!$search_child) ? $u_search['sc'] = 0 : '';  | 
                                                        |
| 178 | + ($search_fields != 'all') ? $u_search['sf'] = $search_fields : '';  | 
                                                        |
| 179 | 179 | |
| 180 | 180 | $base_url = array(  | 
                                                        
| 181 | 181 | 'routes' => 'ernadoo_phpbbdirectory_search_controller',  | 
                                                        
@@ -249,7 +249,7 @@ discard block  | 
                                                    ||
| 249 | 249 | |
| 250 | 250 | foreach ($rowset as $data)  | 
                                                        
| 251 | 251 |  					{ | 
                                                        
| 252 | - $s_banner = $this->link->display_bann($data);  | 
                                                        |
| 252 | + $s_banner = $this->link->display_bann($data);  | 
                                                        |
| 253 | 253 | $s_thumb = $this->link->display_thumb($data);  | 
                                                        
| 254 | 254 | $s_flag = $this->link->display_flag($data);  | 
                                                        
| 255 | 255 | |
@@ -257,8 +257,8 @@ discard block  | 
                                                    ||
| 257 | 257 | |
| 258 | 258 | if ($hilit)  | 
                                                        
| 259 | 259 |  						{ | 
                                                        
| 260 | -							$data['link_name'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_name']); | 
                                                        |
| 261 | -							$data['link_description'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_description']); | 
                                                        |
| 260 | +							$data['link_name'] = preg_replace('#(?!<.*)(?<!\w)('.$hilit.')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_name']); | 
                                                        |
| 261 | +							$data['link_description'] = preg_replace('#(?!<.*)(?<!\w)('.$hilit.')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_description']); | 
                                                        |
| 262 | 262 | }  | 
                                                        
| 263 | 263 | |
| 264 | 264 |  						$this->template->assign_block_vars('results', array( | 
                                                        
@@ -328,7 +328,7 @@ discard block  | 
                                                    ||
| 328 | 328 | private function _get_exclude_categories(&$search_category, $search_child)  | 
                                                        
| 329 | 329 |  	{ | 
                                                        
| 330 | 330 | $sql = 'SELECT cat_id, parent_id, right_id  | 
                                                        
| 331 | - FROM ' . $this->categories_table . '  | 
                                                        |
| 331 | + FROM ' . $this->categories_table.'  | 
                                                        |
| 332 | 332 | ORDER BY left_id';  | 
                                                        
| 333 | 333 | $result = $this->db->sql_query($sql);  | 
                                                        
| 334 | 334 | |
@@ -64,16 +64,16 @@ discard block  | 
                                                    ||
| 64 | 64 | */  | 
                                                        
| 65 | 65 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link)  | 
                                                        
| 66 | 66 |  	{ | 
                                                        
| 67 | - $this->db = $db;  | 
                                                        |
| 68 | - $this->config = $config;  | 
                                                        |
| 67 | + $this->db = $db;  | 
                                                        |
| 68 | + $this->config = $config;  | 
                                                        |
| 69 | 69 | $this->language = $language;  | 
                                                        
| 70 | 70 | $this->template = $template;  | 
                                                        
| 71 | 71 | $this->user = $user;  | 
                                                        
| 72 | - $this->helper = $helper;  | 
                                                        |
| 73 | - $this->request = $request;  | 
                                                        |
| 72 | + $this->helper = $helper;  | 
                                                        |
| 73 | + $this->request = $request;  | 
                                                        |
| 74 | 74 | $this->auth = $auth;  | 
                                                        
| 75 | - $this->pagination = $pagination;  | 
                                                        |
| 76 | - $this->categorie = $categorie;  | 
                                                        |
| 75 | + $this->pagination = $pagination;  | 
                                                        |
| 76 | + $this->categorie = $categorie;  | 
                                                        |
| 77 | 77 | $this->link = $link;  | 
                                                        
| 78 | 78 | |
| 79 | 79 |  		$language->add_lang('directory', 'ernadoo/phpbbdirectory'); | 
                                                        
@@ -117,18 +117,18 @@ discard block  | 
                                                    ||
| 117 | 117 | |
| 118 | 118 | $start = ($page - 1) * $this->config['dir_show'];  | 
                                                        
| 119 | 119 | |
| 120 | - $default_sort_days = 0;  | 
                                                        |
| 120 | + $default_sort_days = 0;  | 
                                                        |
| 121 | 121 | $default_sort_key = (string) substr($this->config['dir_default_order'], 0, 1);  | 
                                                        
| 122 | 122 | $default_sort_dir = (string) substr($this->config['dir_default_order'], 2);  | 
                                                        
| 123 | 123 | |
| 124 | 124 |  		$sort_days	= (!$sort_days) ? $this->request->variable('st', $default_sort_days) : $sort_days; | 
                                                        
| 125 | 125 |  		$sort_key 	= (!$sort_key) ? $this->request->variable('sk', $default_sort_key) : $sort_key; | 
                                                        
| 126 | -		$sort_dir	= (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir; | 
                                                        |
| 126 | +		$sort_dir = (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir; | 
                                                        |
| 127 | 127 | $link_list = $rowset = array();  | 
                                                        
| 128 | 128 | |
| 129 | 129 | // Categorie ordering options  | 
                                                        
| 130 | 130 |  		$limit_days		= array(0 => $this->language->lang('SEE_ALL'), 1 => $this->language->lang('1_DAY'), 7 => $this->language->lang('7_DAYS'), 14 => $this->language->lang('2_WEEKS'), 30 => $this->language->lang('1_MONTH'), 90 => $this->language->lang('3_MONTHS'), 180 => $this->language->lang('6_MONTHS'), 365 => $this->language->lang('1_YEAR')); | 
                                                        
| 131 | -		$sort_by_text	= array('a' => $this->language->lang('AUTHOR'), 't' => $this->language->lang('POST_TIME'), 'r' => $this->language->lang('DIR_COMMENTS_ORDER'), 's' =>  $this->language->lang('DIR_NAME_ORDER'), 'v' => $this->language->lang('DIR_NB_CLICKS_ORDER')); | 
                                                        |
| 131 | +		$sort_by_text = array('a' => $this->language->lang('AUTHOR'), 't' => $this->language->lang('POST_TIME'), 'r' => $this->language->lang('DIR_COMMENTS_ORDER'), 's' =>  $this->language->lang('DIR_NAME_ORDER'), 'v' => $this->language->lang('DIR_NB_CLICKS_ORDER')); | 
                                                        |
| 132 | 132 |  		$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'); | 
                                                        
| 133 | 133 | |
| 134 | 134 | if ($this->config['dir_activ_pagerank'])  | 
                                                        
@@ -167,8 +167,8 @@ discard block  | 
                                                    ||
| 167 | 167 | $min_post_time = time() - ($sort_days * 86400);  | 
                                                        
| 168 | 168 | |
| 169 | 169 | $sql = 'SELECT COUNT(link_id) AS nb_links  | 
                                                        
| 170 | - FROM ' . $this->links_table . '  | 
                                                        |
| 171 | - WHERE link_cat = ' . (int) $cat_id . '  | 
                                                        |
| 170 | + FROM ' . $this->links_table.'  | 
                                                        |
| 171 | + WHERE link_cat = ' . (int) $cat_id.'  | 
                                                        |
| 172 | 172 | AND link_time >= ' . $min_post_time;  | 
                                                        
| 173 | 173 | $result = $this->db->sql_query($sql);  | 
                                                        
| 174 | 174 |  			$nb_links = (int) $this->db->sql_fetchfield('nb_links'); | 
                                                        
@@ -183,7 +183,7 @@ discard block  | 
                                                    ||
| 183 | 183 | else  | 
                                                        
| 184 | 184 |  		{ | 
                                                        
| 185 | 185 | $sql_limit_time = '';  | 
                                                        
| 186 | - $nb_links = (int) $this->categorie->data['cat_links'];  | 
                                                        |
| 186 | + $nb_links = (int) $this->categorie->data['cat_links'];  | 
                                                        |
| 187 | 187 | }  | 
                                                        
| 188 | 188 | |
| 189 | 189 | // Make sure $start is set to the last page if it exceeds the amount  | 
                                                        
@@ -246,11 +246,11 @@ discard block  | 
                                                    ||
| 246 | 246 | |
| 247 | 247 | if (is_array($sort_by_sql[$sort_key]))  | 
                                                        
| 248 | 248 |  		{ | 
                                                        
| 249 | -			$sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; | 
                                                        |
| 249 | +			$sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction; | 
                                                        |
| 250 | 250 | }  | 
                                                        
| 251 | 251 | else  | 
                                                        
| 252 | 252 |  		{ | 
                                                        
| 253 | - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;  | 
                                                        |
| 253 | + $sql_sort_order = $sort_by_sql[$sort_key].' '.$direction;  | 
                                                        |
| 254 | 254 | }  | 
                                                        
| 255 | 255 | |
| 256 | 256 | // Grab just the sorted link ids  | 
                                                        
@@ -293,7 +293,7 @@ discard block  | 
                                                    ||
| 293 | 293 | ),  | 
                                                        
| 294 | 294 | array(  | 
                                                        
| 295 | 295 | 'FROM' => array($this->votes_table => 'v'),  | 
                                                        
| 296 | - 'ON' => 'l.link_id = v.vote_link_id AND v.vote_user_id = ' . $this->user->data['user_id']  | 
                                                        |
| 296 | + 'ON' => 'l.link_id = v.vote_link_id AND v.vote_user_id = '.$this->user->data['user_id']  | 
                                                        |
| 297 | 297 | )  | 
                                                        
| 298 | 298 | ),  | 
                                                        
| 299 | 299 |  				'WHERE'		=> $this->db->sql_in_set('l.link_id', $link_list) | 
                                                        
@@ -310,8 +310,8 @@ discard block  | 
                                                    ||
| 310 | 310 | |
| 311 | 311 | $link_list = ($store_reverse) ? array_reverse($link_list) : $link_list;  | 
                                                        
| 312 | 312 | |
| 313 | - $votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false;  | 
                                                        |
| 314 | - $comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false;  | 
                                                        |
| 313 | + $votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false;  | 
                                                        |
| 314 | + $comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false;  | 
                                                        |
| 315 | 315 | |
| 316 | 316 | foreach ($link_list as $link_id)  | 
                                                        
| 317 | 317 |  			{ | 
                                                        
@@ -321,11 +321,11 @@ discard block  | 
                                                    ||
| 321 | 321 | $s_note = $this->link->display_note($site['link_note'], $site['link_vote'], $votes_status);  | 
                                                        
| 322 | 322 | $s_thumb = $this->link->display_thumb($site);  | 
                                                        
| 323 | 323 | $s_vote = $this->link->display_vote($site);  | 
                                                        
| 324 | - $s_banner = $this->link->display_bann($site);  | 
                                                        |
| 325 | - $s_pr = $this->link->display_pagerank($site);  | 
                                                        |
| 326 | - $s_rss = $this->link->display_rss($site);  | 
                                                        |
| 324 | + $s_banner = $this->link->display_bann($site);  | 
                                                        |
| 325 | + $s_pr = $this->link->display_pagerank($site);  | 
                                                        |
| 326 | + $s_rss = $this->link->display_rss($site);  | 
                                                        |
| 327 | 327 | |
| 328 | -				$edit_allowed 	= ($this->user->data['is_registered'] && ($this->auth->acl_get('m_edit_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_edit_dir')))); | 
                                                        |
| 328 | +				$edit_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_edit_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_edit_dir')))); | 
                                                        |
| 329 | 329 |  				$delete_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_delete_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_delete_dir')))); | 
                                                        
| 330 | 330 | |
| 331 | 331 |  				$this->template->assign_block_vars('site', array( | 
                                                        
@@ -362,7 +362,7 @@ discard block  | 
                                                    ||
| 362 | 362 |  			$this->template->assign_block_vars('no_draw_link', array()); | 
                                                        
| 363 | 363 | }  | 
                                                        
| 364 | 364 | |
| 365 | -		$page_title = $this->language->lang('DIRECTORY') . ' - ' . $this->categorie->data['cat_name']; | 
                                                        |
| 365 | +		$page_title = $this->language->lang('DIRECTORY').' - '.$this->categorie->data['cat_name']; | 
                                                        |
| 366 | 366 | |
| 367 | 367 | $this->categorie->display();  | 
                                                        
| 368 | 368 | |
@@ -80,16 +80,16 @@ discard block  | 
                                                    ||
| 80 | 80 | */  | 
                                                        
| 81 | 81 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\comment $comment, $root_path, $php_ext)  | 
                                                        
| 82 | 82 |  	{ | 
                                                        
| 83 | - $this->db = $db;  | 
                                                        |
| 84 | - $this->config = $config;  | 
                                                        |
| 83 | + $this->db = $db;  | 
                                                        |
| 84 | + $this->config = $config;  | 
                                                        |
| 85 | 85 | $this->language = $language;  | 
                                                        
| 86 | 86 | $this->template = $template;  | 
                                                        
| 87 | 87 | $this->user = $user;  | 
                                                        
| 88 | - $this->helper = $helper;  | 
                                                        |
| 89 | - $this->request = $request;  | 
                                                        |
| 88 | + $this->helper = $helper;  | 
                                                        |
| 89 | + $this->request = $request;  | 
                                                        |
| 90 | 90 | $this->auth = $auth;  | 
                                                        
| 91 | - $this->pagination = $pagination;  | 
                                                        |
| 92 | - $this->captcha_factory = $captcha_factory;  | 
                                                        |
| 91 | + $this->pagination = $pagination;  | 
                                                        |
| 92 | + $this->captcha_factory = $captcha_factory;  | 
                                                        |
| 93 | 93 | $this->categorie = $categorie;  | 
                                                        
| 94 | 94 | $this->comment = $comment;  | 
                                                        
| 95 | 95 | $this->root_path = $root_path;  | 
                                                        
@@ -130,7 +130,7 @@ discard block  | 
                                                    ||
| 130 | 130 | }  | 
                                                        
| 131 | 131 | |
| 132 | 132 | $sql = 'SELECT *  | 
                                                        
| 133 | - FROM ' . $this->comments_table . '  | 
                                                        |
| 133 | + FROM ' . $this->comments_table.'  | 
                                                        |
| 134 | 134 | WHERE comment_id = ' . (int) $comment_id;  | 
                                                        
| 135 | 135 | $result = $this->db->sql_query($sql);  | 
                                                        
| 136 | 136 | $value = $this->db->sql_fetchrow($result);  | 
                                                        
@@ -147,7 +147,7 @@ discard block  | 
                                                    ||
| 147 | 147 |  			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id)); | 
                                                        
| 148 | 148 | meta_refresh(3, $meta_info);  | 
                                                        
| 149 | 149 |  			$message = $this->language->lang('DIR_COMMENT_DELETE_OK'); | 
                                                        
| 150 | -			$message = $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>'); | 
                                                        |
| 150 | +			$message = $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="'.$meta_info.'">', '</a>'); | 
                                                        |
| 151 | 151 | return $this->helper->message($message);  | 
                                                        
| 152 | 152 | }  | 
                                                        
| 153 | 153 | else  | 
                                                        
@@ -169,7 +169,7 @@ discard block  | 
                                                    ||
| 169 | 169 | $this->_check_comments_enable($link_id);  | 
                                                        
| 170 | 170 | |
| 171 | 171 | $sql = 'SELECT *  | 
                                                        
| 172 | - FROM ' . $this->comments_table . '  | 
                                                        |
| 172 | + FROM ' . $this->comments_table.'  | 
                                                        |
| 173 | 173 | WHERE comment_id = ' . (int) $comment_id;  | 
                                                        
| 174 | 174 | $result = $this->db->sql_query($sql);  | 
                                                        
| 175 | 175 | $value = $this->db->sql_fetchrow($result);  | 
                                                        
@@ -182,7 +182,7 @@ discard block  | 
                                                    ||
| 182 | 182 | $comment_text = generate_text_for_edit($value['comment_text'], $value['comment_uid'], $value['comment_flags']);  | 
                                                        
| 183 | 183 | $this->s_comment = $comment_text['text'];  | 
                                                        
| 184 | 184 | |
| 185 | -		$submit	= $this->request->is_set_post('update_comment') ? true : false; | 
                                                        |
| 185 | +		$submit = $this->request->is_set_post('update_comment') ? true : false; | 
                                                        |
| 186 | 186 | |
| 187 | 187 | // If form is done  | 
                                                        
| 188 | 188 | if ($submit)  | 
                                                        
@@ -238,15 +238,15 @@ discard block  | 
                                                    ||
| 238 | 238 | $this->_check_comments_enable($link_id);  | 
                                                        
| 239 | 239 | |
| 240 | 240 |  		$comment_id = $this->request->variable('c', 0); | 
                                                        
| 241 | -		$view 		= $this->request->variable('view', ''); | 
                                                        |
| 242 | - $start = ($page - 1) * $this->config['dir_comments_per_page'];  | 
                                                        |
| 241 | +		$view = $this->request->variable('view', ''); | 
                                                        |
| 242 | + $start = ($page - 1) * $this->config['dir_comments_per_page'];  | 
                                                        |
| 243 | 243 | |
| 244 | 244 |  		$this->s_hidden_fields = array_merge($this->s_hidden_fields, array('page' => $page)); | 
                                                        
| 245 | 245 | |
| 246 | 246 | $this->_populate_form($link_id, $mode);  | 
                                                        
| 247 | 247 | |
| 248 | 248 | $sql = 'SELECT COUNT(comment_id) AS nb_comments  | 
                                                        
| 249 | - FROM ' . $this->comments_table . '  | 
                                                        |
| 249 | + FROM ' . $this->comments_table.'  | 
                                                        |
| 250 | 250 | WHERE comment_link_id = ' . (int) $link_id;  | 
                                                        
| 251 | 251 | $result = $this->db->sql_query($sql);  | 
                                                        
| 252 | 252 |  		$nb_comments = (int) $this->db->sql_fetchfield('nb_comments'); | 
                                                        
@@ -266,10 +266,10 @@ discard block  | 
                                                    ||
| 266 | 266 | ),  | 
                                                        
| 267 | 267 | array(  | 
                                                        
| 268 | 268 | 'FROM' => array(ZEBRA_TABLE => 'z'),  | 
                                                        
| 269 | - 'ON' => 'z.user_id = ' . $this->user->data['user_id'] . ' AND z.zebra_id = a.comment_user_id'  | 
                                                        |
| 269 | + 'ON' => 'z.user_id = '.$this->user->data['user_id'].' AND z.zebra_id = a.comment_user_id'  | 
                                                        |
| 270 | 270 | )  | 
                                                        
| 271 | 271 | ),  | 
                                                        
| 272 | - 'WHERE' => 'a.comment_link_id = ' . (int) $link_id,  | 
                                                        |
| 272 | + 'WHERE' => 'a.comment_link_id = '.(int) $link_id,  | 
                                                        |
| 273 | 273 | 'ORDER_BY' => 'a.comment_date DESC');  | 
                                                        
| 274 | 274 |  		$sql = $this->db->sql_build_query('SELECT', $sql_array); | 
                                                        
| 275 | 275 | $result = $this->db->sql_query_limit($sql, $this->config['dir_comments_per_page'], $start);  | 
                                                        
@@ -298,12 +298,12 @@ discard block  | 
                                                    ||
| 298 | 298 | 'S_COMMENT' => generate_text_for_display($comments['comment_text'], $comments['comment_uid'], $comments['comment_bitfield'], $comments['comment_flags']),  | 
                                                        
| 299 | 299 | 'S_ID' => $comments['comment_id'],  | 
                                                        
| 300 | 300 | |
| 301 | -				'U_EDIT'			=> ($edit_allowed) 		? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '', | 
                                                        |
| 302 | -				'U_DELETE'			=> ($delete_allowed) 	? $this->helper->route('ernadoo_phpbbdirectory_comment_delete_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'], '_referer' => $this->helper->get_current_url())) : '', | 
                                                        |
| 301 | +				'U_EDIT'			=> ($edit_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '', | 
                                                        |
| 302 | +				'U_DELETE'			=> ($delete_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_delete_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'], '_referer' => $this->helper->get_current_url())) : '', | 
                                                        |
| 303 | 303 | |
| 304 | 304 | 'S_IGNORE_POST' => ($comments['foe'] && ($view != 'show' || $comment_id != $comments['comment_id'])) ? true : false,  | 
                                                        
| 305 | 305 |  				'L_IGNORE_POST'		=> ($comments['foe']) ? $this->language->lang('POST_BY_FOE', get_username_string('full', $comments['comment_user_id'], $comments['username'], $comments['user_colour']), '<a href="'.$this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '', | 
                                                        
| 306 | -				'L_POST_DISPLAY'	=> ($comments['foe']) ? $this->language->lang('POST_DISPLAY', '<a class="display_post" data-post-id="' . $comments['comment_id'] . '" href="' . $this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?c='.(int) $comments['comment_id'] . '&view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '', | 
                                                        |
| 306 | +				'L_POST_DISPLAY'	=> ($comments['foe']) ? $this->language->lang('POST_DISPLAY', '<a class="display_post" data-post-id="'.$comments['comment_id'].'" href="'.$this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?c='.(int) $comments['comment_id'].'&view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '', | 
                                                        |
| 307 | 307 | |
| 308 | 308 |  				'S_INFO'			=> $this->auth->acl_get('m_info'), | 
                                                        
| 309 | 309 | ));  | 
                                                        
@@ -343,7 +343,7 @@ discard block  | 
                                                    ||
| 343 | 343 | |
| 344 | 344 |  		if (!function_exists('validate_data')) | 
                                                        
| 345 | 345 |  		{ | 
                                                        
| 346 | - include($this->root_path . 'includes/functions_user.' . $this->php_ext);  | 
                                                        |
| 346 | + include($this->root_path.'includes/functions_user.'.$this->php_ext);  | 
                                                        |
| 347 | 347 | }  | 
                                                        
| 348 | 348 | |
| 349 | 349 | $error = validate_data(  | 
                                                        
@@ -405,7 +405,7 @@ discard block  | 
                                                    ||
| 405 | 405 |  			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id)); | 
                                                        
| 406 | 406 | meta_refresh(3, $meta_info);  | 
                                                        
| 407 | 407 |  			$message = $this->language->lang('DIR_'.strtoupper($mode).'_COMMENT_OK'); | 
                                                        
| 408 | -			$message = $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>'); | 
                                                        |
| 408 | +			$message = $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="'.$meta_info.'">', '</a>'); | 
                                                        |
| 409 | 409 | return $this->helper->message($message);  | 
                                                        
| 410 | 410 | }  | 
                                                        
| 411 | 411 | else  | 
                                                        
@@ -428,7 +428,7 @@ discard block  | 
                                                    ||
| 428 | 428 | private function _check_comments_enable($link_id)  | 
                                                        
| 429 | 429 |  	{ | 
                                                        
| 430 | 430 | $sql = 'SELECT link_cat  | 
                                                        
| 431 | - FROM ' . $this->links_table . '  | 
                                                        |
| 431 | + FROM ' . $this->links_table.'  | 
                                                        |
| 432 | 432 | WHERE link_id = ' . (int) $link_id;  | 
                                                        
| 433 | 433 | $result = $this->db->sql_query($sql);  | 
                                                        
| 434 | 434 |  		$cat_id = (int) $this->db->sql_fetchfield('link_cat'); | 
                                                        
@@ -470,11 +470,11 @@ discard block  | 
                                                    ||
| 470 | 470 | |
| 471 | 471 |  		if (!function_exists('generate_smilies')) | 
                                                        
| 472 | 472 |  		{ | 
                                                        
| 473 | - include($this->root_path . 'includes/functions_posting.' . $this->php_ext);  | 
                                                        |
| 473 | + include($this->root_path.'includes/functions_posting.'.$this->php_ext);  | 
                                                        |
| 474 | 474 | }  | 
                                                        
| 475 | 475 |  		if (!function_exists('display_custom_bbcodes')) | 
                                                        
| 476 | 476 |  		{ | 
                                                        
| 477 | - include($this->root_path . 'includes/functions_display.' . $this->php_ext);  | 
                                                        |
| 477 | + include($this->root_path.'includes/functions_display.'.$this->php_ext);  | 
                                                        |
| 478 | 478 | }  | 
                                                        
| 479 | 479 | |
| 480 | 480 |  		generate_smilies('inline', 0); | 
                                                        
@@ -484,11 +484,11 @@ discard block  | 
                                                    ||
| 484 | 484 | $this->template->assign_vars(array(  | 
                                                        
| 485 | 485 |  			'S_AUTH_COMM' 		=> $this->auth->acl_get('u_comment_dir'), | 
                                                        
| 486 | 486 | |
| 487 | -			'BBCODE_STATUS'		=> ($this->config['dir_allow_bbcode']) 	? $this->language->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'), | 
                                                        |
| 488 | -			'IMG_STATUS'		=> ($this->config['dir_allow_bbcode']) 	? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'), | 
                                                        |
| 489 | -			'SMILIES_STATUS'	=> ($this->config['dir_allow_smilies'])	? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'), | 
                                                        |
| 490 | -			'URL_STATUS'		=> ($this->config['dir_allow_links'])	? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'), | 
                                                        |
| 491 | -			'FLASH_STATUS'		=> ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash'])	? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'), | 
                                                        |
| 487 | +			'BBCODE_STATUS'		=> ($this->config['dir_allow_bbcode']) ? $this->language->lang('BBCODE_IS_ON', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>'), | 
                                                        |
| 488 | +			'IMG_STATUS'		=> ($this->config['dir_allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'), | 
                                                        |
| 489 | +			'SMILIES_STATUS'	=> ($this->config['dir_allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'), | 
                                                        |
| 490 | +			'URL_STATUS'		=> ($this->config['dir_allow_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'), | 
                                                        |
| 491 | +			'FLASH_STATUS'		=> ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'), | 
                                                        |
| 492 | 492 | |
| 493 | 493 |  			'L_DIR_REPLY_EXP'	=> $this->language->lang('DIR_REPLY_EXP', $this->config['dir_length_comments']), | 
                                                        
| 494 | 494 | |
@@ -69,22 +69,22 @@ discard block  | 
                                                    ||
| 69 | 69 | protected $php_ext;  | 
                                                        
| 70 | 70 | |
| 71 | 71 | /**  | 
                                                        
| 72 | - * Constructor  | 
                                                        |
| 73 | - *  | 
                                                        |
| 74 | - * @param \phpbb\db\driver\driver_interface $db Database object  | 
                                                        |
| 75 | - * @param \phpbb\config\config $config Config object  | 
                                                        |
| 76 | - * @param \phpbb\language\language $language Language object  | 
                                                        |
| 77 | - * @param \phpbb\template\template $template Template object  | 
                                                        |
| 78 | - * @param \phpbb\user $user User object  | 
                                                        |
| 79 | - * @param \phpbb\controller\helper $helper Controller helper object  | 
                                                        |
| 80 | - * @param \phpbb\request\request $request Request object  | 
                                                        |
| 81 | - * @param \phpbb\auth\auth $auth Auth object  | 
                                                        |
| 82 | - * @param \phpbb\captcha\factory $captcha_factory Captcha object  | 
                                                        |
| 83 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object  | 
                                                        |
| 84 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object  | 
                                                        |
| 85 | - * @param string $root_path phpBB root path  | 
                                                        |
| 86 | - * @param string $php_ext phpEx  | 
                                                        |
| 87 | - */  | 
                                                        |
| 72 | + * Constructor  | 
                                                        |
| 73 | + *  | 
                                                        |
| 74 | + * @param \phpbb\db\driver\driver_interface $db Database object  | 
                                                        |
| 75 | + * @param \phpbb\config\config $config Config object  | 
                                                        |
| 76 | + * @param \phpbb\language\language $language Language object  | 
                                                        |
| 77 | + * @param \phpbb\template\template $template Template object  | 
                                                        |
| 78 | + * @param \phpbb\user $user User object  | 
                                                        |
| 79 | + * @param \phpbb\controller\helper $helper Controller helper object  | 
                                                        |
| 80 | + * @param \phpbb\request\request $request Request object  | 
                                                        |
| 81 | + * @param \phpbb\auth\auth $auth Auth object  | 
                                                        |
| 82 | + * @param \phpbb\captcha\factory $captcha_factory Captcha object  | 
                                                        |
| 83 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object  | 
                                                        |
| 84 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object  | 
                                                        |
| 85 | + * @param string $root_path phpBB root path  | 
                                                        |
| 86 | + * @param string $php_ext phpEx  | 
                                                        |
| 87 | + */  | 
                                                        |
| 88 | 88 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext)  | 
                                                        
| 89 | 89 |  	{ | 
                                                        
| 90 | 90 | $this->db = $db;  | 
                                                        
@@ -109,12 +109,12 @@ discard block  | 
                                                    ||
| 109 | 109 | }  | 
                                                        
| 110 | 110 | |
| 111 | 111 | /**  | 
                                                        
| 112 | - * Delete a link  | 
                                                        |
| 113 | - *  | 
                                                        |
| 114 | - * @param int $cat_id The category ID  | 
                                                        |
| 115 | - * @param int $link_id The link ID  | 
                                                        |
| 116 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object  | 
                                                        |
| 117 | - */  | 
                                                        |
| 112 | + * Delete a link  | 
                                                        |
| 113 | + *  | 
                                                        |
| 114 | + * @param int $cat_id The category ID  | 
                                                        |
| 115 | + * @param int $link_id The link ID  | 
                                                        |
| 116 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object  | 
                                                        |
| 117 | + */  | 
                                                        |
| 118 | 118 | public function delete_link($cat_id, $link_id)  | 
                                                        
| 119 | 119 |  	{ | 
                                                        
| 120 | 120 |  		if ($this->request->is_set_post('cancel')) | 
                                                        
@@ -157,13 +157,13 @@ discard block  | 
                                                    ||
| 157 | 157 | }  | 
                                                        
| 158 | 158 | |
| 159 | 159 | /**  | 
                                                        
| 160 | - * Edit a link  | 
                                                        |
| 161 | - *  | 
                                                        |
| 162 | - * @param int $cat_id The category ID  | 
                                                        |
| 163 | - * @param int $link_id The link ID  | 
                                                        |
| 164 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object  | 
                                                        |
| 165 | - * @throws \phpbb\exception\http_exception  | 
                                                        |
| 166 | - */  | 
                                                        |
| 160 | + * Edit a link  | 
                                                        |
| 161 | + *  | 
                                                        |
| 162 | + * @param int $cat_id The category ID  | 
                                                        |
| 163 | + * @param int $link_id The link ID  | 
                                                        |
| 164 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object  | 
                                                        |
| 165 | + * @throws \phpbb\exception\http_exception  | 
                                                        |
| 166 | + */  | 
                                                        |
| 167 | 167 | public function edit_link($cat_id, $link_id)  | 
                                                        
| 168 | 168 |  	{ | 
                                                        
| 169 | 169 | $sql = 'SELECT link_user_id  | 
                                                        
@@ -238,12 +238,12 @@ discard block  | 
                                                    ||
| 238 | 238 | }  | 
                                                        
| 239 | 239 | |
| 240 | 240 | /**  | 
                                                        
| 241 | - * Display add form  | 
                                                        |
| 242 | - *  | 
                                                        |
| 243 | - * @param int $cat_id The category ID  | 
                                                        |
| 244 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object  | 
                                                        |
| 245 | - * @throws \phpbb\exception\http_exception  | 
                                                        |
| 246 | - */  | 
                                                        |
| 241 | + * Display add form  | 
                                                        |
| 242 | + *  | 
                                                        |
| 243 | + * @param int $cat_id The category ID  | 
                                                        |
| 244 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object  | 
                                                        |
| 245 | + * @throws \phpbb\exception\http_exception  | 
                                                        |
| 246 | + */  | 
                                                        |
| 247 | 247 | public function new_link($cat_id)  | 
                                                        
| 248 | 248 |  	{ | 
                                                        
| 249 | 249 |  		if (!$this->auth->acl_get('u_submit_dir')) | 
                                                        
@@ -285,23 +285,23 @@ discard block  | 
                                                    ||
| 285 | 285 | }  | 
                                                        
| 286 | 286 | |
| 287 | 287 | /**  | 
                                                        
| 288 | - * View link controller  | 
                                                        |
| 289 | - *  | 
                                                        |
| 290 | - * @param int $link_id The link ID  | 
                                                        |
| 291 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object  | 
                                                        |
| 292 | - */  | 
                                                        |
| 288 | + * View link controller  | 
                                                        |
| 289 | + *  | 
                                                        |
| 290 | + * @param int $link_id The link ID  | 
                                                        |
| 291 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object  | 
                                                        |
| 292 | + */  | 
                                                        |
| 293 | 293 | public function view_link($link_id)  | 
                                                        
| 294 | 294 |  	{ | 
                                                        
| 295 | 295 | return $this->link->view($link_id);  | 
                                                        
| 296 | 296 | }  | 
                                                        
| 297 | 297 | |
| 298 | 298 | /**  | 
                                                        
| 299 | - * Vote for a link  | 
                                                        |
| 300 | - *  | 
                                                        |
| 301 | - * @param int $cat_id The category ID  | 
                                                        |
| 302 | - * @param int $link_id The link ID  | 
                                                        |
| 303 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object  | 
                                                        |
| 304 | - */  | 
                                                        |
| 299 | + * Vote for a link  | 
                                                        |
| 300 | + *  | 
                                                        |
| 301 | + * @param int $cat_id The category ID  | 
                                                        |
| 302 | + * @param int $link_id The link ID  | 
                                                        |
| 303 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object  | 
                                                        |
| 304 | + */  | 
                                                        |
| 305 | 305 | public function vote_link($cat_id, $link_id)  | 
                                                        
| 306 | 306 |  	{ | 
                                                        
| 307 | 307 | $this->categorie->get($cat_id);  | 
                                                        
@@ -337,14 +337,14 @@ discard block  | 
                                                    ||
| 337 | 337 | }  | 
                                                        
| 338 | 338 | |
| 339 | 339 | /**  | 
                                                        
| 340 | - * Routine  | 
                                                        |
| 341 | - *  | 
                                                        |
| 342 | - * @param int $cat_id The category ID  | 
                                                        |
| 343 | - * @param int $link_id The link ID  | 
                                                        |
| 344 | - * @param string $mode add|edit  | 
                                                        |
| 345 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object  | 
                                                        |
| 346 | - * @throws \phpbb\exception\http_exception  | 
                                                        |
| 347 | - */  | 
                                                        |
| 340 | + * Routine  | 
                                                        |
| 341 | + *  | 
                                                        |
| 342 | + * @param int $cat_id The category ID  | 
                                                        |
| 343 | + * @param int $link_id The link ID  | 
                                                        |
| 344 | + * @param string $mode add|edit  | 
                                                        |
| 345 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object  | 
                                                        |
| 346 | + * @throws \phpbb\exception\http_exception  | 
                                                        |
| 347 | + */  | 
                                                        |
| 348 | 348 | private function _data_processing($cat_id, $link_id = 0, $mode = 'new')  | 
                                                        
| 349 | 349 |  	{ | 
                                                        
| 350 | 350 |  		if (($mode == 'edit' && !$this->auth->acl_get('m_edit_dir') && !$this->auth->acl_get('u_edit_dir')) || ($mode == 'new' && !$this->auth->acl_get('u_submit_dir'))) | 
                                                        
@@ -434,8 +434,8 @@ discard block  | 
                                                    ||
| 434 | 434 | if (!$error)  | 
                                                        
| 435 | 435 |  		{ | 
                                                        
| 436 | 436 | /**  | 
                                                        
| 437 | - * No errrors, we execute heavy tasks wich need a valid url  | 
                                                        |
| 438 | - */  | 
                                                        |
| 437 | + * No errrors, we execute heavy tasks wich need a valid url  | 
                                                        |
| 438 | + */  | 
                                                        |
| 439 | 439 | |
| 440 | 440 | // Banner  | 
                                                        
| 441 | 441 | $this->link->banner_process($this->banner, $error);  | 
                                                        
@@ -520,11 +520,11 @@ discard block  | 
                                                    ||
| 520 | 520 | }  | 
                                                        
| 521 | 521 | |
| 522 | 522 | /**  | 
                                                        
| 523 | - * Display a banner  | 
                                                        |
| 524 | - *  | 
                                                        |
| 525 | - * @param string $banner_img Path to banner file  | 
                                                        |
| 526 | - * @return Response object  | 
                                                        |
| 527 | - */  | 
                                                        |
| 523 | + * Display a banner  | 
                                                        |
| 524 | + *  | 
                                                        |
| 525 | + * @param string $banner_img Path to banner file  | 
                                                        |
| 526 | + * @return Response object  | 
                                                        |
| 527 | + */  | 
                                                        |
| 528 | 528 | public function return_banner($banner_img)  | 
                                                        
| 529 | 529 |  	{ | 
                                                        
| 530 | 530 |  		if (!function_exists('file_gc')) | 
                                                        
@@ -558,13 +558,13 @@ discard block  | 
                                                    ||
| 558 | 558 | }  | 
                                                        
| 559 | 559 | |
| 560 | 560 | /**  | 
                                                        
| 561 | - * Populate form when an error occurred  | 
                                                        |
| 562 | - *  | 
                                                        |
| 563 | - * @param int $cat_id The category ID  | 
                                                        |
| 564 | - * @param string $mode add|edit  | 
                                                        |
| 565 | - * @param string $title Page title (depends of $mode)  | 
                                                        |
| 566 | - * @return null  | 
                                                        |
| 567 | - */  | 
                                                        |
| 561 | + * Populate form when an error occurred  | 
                                                        |
| 562 | + *  | 
                                                        |
| 563 | + * @param int $cat_id The category ID  | 
                                                        |
| 564 | + * @param string $mode add|edit  | 
                                                        |
| 565 | + * @param string $title Page title (depends of $mode)  | 
                                                        |
| 566 | + * @return null  | 
                                                        |
| 567 | + */  | 
                                                        |
| 568 | 568 | private function _populate_form($cat_id, $mode, $title)  | 
                                                        
| 569 | 569 |  	{ | 
                                                        
| 570 | 570 | global $phpbb_extension_manager;  | 
                                                        
@@ -87,19 +87,19 @@ discard block  | 
                                                    ||
| 87 | 87 | */  | 
                                                        
| 88 | 88 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext)  | 
                                                        
| 89 | 89 |  	{ | 
                                                        
| 90 | - $this->db = $db;  | 
                                                        |
| 91 | - $this->config = $config;  | 
                                                        |
| 90 | + $this->db = $db;  | 
                                                        |
| 91 | + $this->config = $config;  | 
                                                        |
| 92 | 92 | $this->language = $language;  | 
                                                        
| 93 | 93 | $this->template = $template;  | 
                                                        
| 94 | 94 | $this->user = $user;  | 
                                                        
| 95 | - $this->helper = $helper;  | 
                                                        |
| 96 | - $this->request = $request;  | 
                                                        |
| 95 | + $this->helper = $helper;  | 
                                                        |
| 96 | + $this->request = $request;  | 
                                                        |
| 97 | 97 | $this->auth = $auth;  | 
                                                        
| 98 | - $this->captcha_factory = $captcha_factory;  | 
                                                        |
| 98 | + $this->captcha_factory = $captcha_factory;  | 
                                                        |
| 99 | 99 | $this->categorie = $categorie;  | 
                                                        
| 100 | 100 | $this->link = $link;  | 
                                                        
| 101 | 101 | $this->root_path = $root_path;  | 
                                                        
| 102 | - $this->php_ext = $php_ext;  | 
                                                        |
| 102 | + $this->php_ext = $php_ext;  | 
                                                        |
| 103 | 103 | |
| 104 | 104 |  		$language->add_lang('directory', 'ernadoo/phpbbdirectory'); | 
                                                        
| 105 | 105 | |
@@ -124,7 +124,7 @@ discard block  | 
                                                    ||
| 124 | 124 | }  | 
                                                        
| 125 | 125 | |
| 126 | 126 | $sql = 'SELECT link_user_id  | 
                                                        
| 127 | - FROM ' . $this->links_table . '  | 
                                                        |
| 127 | + FROM ' . $this->links_table.'  | 
                                                        |
| 128 | 128 | WHERE link_id = ' . (int) $link_id;  | 
                                                        
| 129 | 129 | $result = $this->db->sql_query($sql);  | 
                                                        
| 130 | 130 | $link_data = $this->db->sql_fetchrow($result);  | 
                                                        
@@ -147,7 +147,7 @@ discard block  | 
                                                    ||
| 147 | 147 | |
| 148 | 148 |  			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)); | 
                                                        
| 149 | 149 | meta_refresh(3, $meta_info);  | 
                                                        
| 150 | -			$message = $this->language->lang('DIR_DELETE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)) . '">', '</a>'); | 
                                                        |
| 150 | +			$message = $this->language->lang('DIR_DELETE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)).'">', '</a>'); | 
                                                        |
| 151 | 151 | return $this->helper->message($message);  | 
                                                        
| 152 | 152 | }  | 
                                                        
| 153 | 153 | else  | 
                                                        
@@ -167,7 +167,7 @@ discard block  | 
                                                    ||
| 167 | 167 | public function edit_link($cat_id, $link_id)  | 
                                                        
| 168 | 168 |  	{ | 
                                                        
| 169 | 169 | $sql = 'SELECT link_user_id  | 
                                                        
| 170 | - FROM ' . $this->links_table . '  | 
                                                        |
| 170 | + FROM ' . $this->links_table.'  | 
                                                        |
| 171 | 171 | WHERE link_id = ' . (int) $link_id;  | 
                                                        
| 172 | 172 | $result = $this->db->sql_query($sql);  | 
                                                        
| 173 | 173 | $link_data = $this->db->sql_fetchrow($result);  | 
                                                        
@@ -183,7 +183,7 @@ discard block  | 
                                                    ||
| 183 | 183 |  		$cat_id		= $this->request->variable('id', $cat_id); | 
                                                        
| 184 | 184 |  		$submit		= $this->request->is_set_post('submit') ? true : false; | 
                                                        
| 185 | 185 |  		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false; | 
                                                        
| 186 | -		$title		= $this->language->lang('DIR_EDIT_SITE'); | 
                                                        |
| 186 | +		$title = $this->language->lang('DIR_EDIT_SITE'); | 
                                                        |
| 187 | 187 | |
| 188 | 188 |  		$this->template->assign_block_vars('dir_navlinks', array( | 
                                                        
| 189 | 189 | 'FORUM_NAME' => $title,  | 
                                                        
@@ -203,7 +203,7 @@ discard block  | 
                                                    ||
| 203 | 203 | else  | 
                                                        
| 204 | 204 |  		{ | 
                                                        
| 205 | 205 | $sql = 'SELECT link_id, link_uid, link_flags, link_bitfield, link_cat, link_url, link_description, link_guest_email, link_name, link_rss, link_back, link_banner, link_flag, link_cat, link_time  | 
                                                        
| 206 | - FROM ' . $this->links_table . '  | 
                                                        |
| 206 | + FROM ' . $this->links_table.'  | 
                                                        |
| 207 | 207 | WHERE link_id = ' . (int) $link_id;  | 
                                                        
| 208 | 208 | $result = $this->db->sql_query($sql);  | 
                                                        
| 209 | 209 | |
@@ -219,15 +219,15 @@ discard block  | 
                                                    ||
| 219 | 219 | 'old_banner' => $site['link_banner'],  | 
                                                        
| 220 | 220 | );  | 
                                                        
| 221 | 221 | |
| 222 | - $site_description = generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']);  | 
                                                        |
| 223 | -			$site['link_banner'] 	= (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : ''; | 
                                                        |
| 222 | + $site_description = generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']);  | 
                                                        |
| 223 | +			$site['link_banner'] = (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : ''; | 
                                                        |
| 224 | 224 | |
| 225 | - $this->url = $site['link_url'];  | 
                                                        |
| 226 | - $this->site_name = $site['link_name'];  | 
                                                        |
| 225 | + $this->url = $site['link_url'];  | 
                                                        |
| 226 | + $this->site_name = $site['link_name'];  | 
                                                        |
| 227 | 227 | $this->description = $site_description['text'];  | 
                                                        
| 228 | 228 | $this->guest_email = $site['link_guest_email'];  | 
                                                        
| 229 | - $this->rss = $site['link_rss'];  | 
                                                        |
| 230 | - $this->banner = $site['link_banner'];  | 
                                                        |
| 229 | + $this->rss = $site['link_rss'];  | 
                                                        |
| 230 | + $this->banner = $site['link_banner'];  | 
                                                        |
| 231 | 231 | $this->back = $site['link_back'];  | 
                                                        
| 232 | 232 | $this->flag = $site['link_flag'];  | 
                                                        
| 233 | 233 | }  | 
                                                        
@@ -254,7 +254,7 @@ discard block  | 
                                                    ||
| 254 | 254 |  		$cat_id		= $this->request->variable('id', $cat_id); | 
                                                        
| 255 | 255 |  		$submit		= $this->request->is_set_post('submit') ? true : false; | 
                                                        
| 256 | 256 |  		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false; | 
                                                        
| 257 | -		$title		= $this->language->lang('DIR_NEW_SITE'); | 
                                                        |
| 257 | +		$title = $this->language->lang('DIR_NEW_SITE'); | 
                                                        |
| 258 | 258 | |
| 259 | 259 |  		$this->template->assign_block_vars('dir_navlinks', array( | 
                                                        
| 260 | 260 | 'FORUM_NAME' => $title,  | 
                                                        
@@ -318,7 +318,7 @@ discard block  | 
                                                    ||
| 318 | 318 | |
| 319 | 319 | // We check if user had already vot for this website.  | 
                                                        
| 320 | 320 | $sql = 'SELECT vote_link_id  | 
                                                        
| 321 | - FROM ' . $this->votes_table . '  | 
                                                        |
| 321 | + FROM ' . $this->votes_table.'  | 
                                                        |
| 322 | 322 |  			WHERE ' . $this->db->sql_build_array('SELECT', $data); | 
                                                        
| 323 | 323 | $result = $this->db->sql_query($sql);  | 
                                                        
| 324 | 324 | $data = $this->db->sql_fetchrow($result);  | 
                                                        
@@ -332,7 +332,7 @@ discard block  | 
                                                    ||
| 332 | 332 | |
| 333 | 333 |  		$meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)); | 
                                                        
| 334 | 334 | meta_refresh(3, $meta_info);  | 
                                                        
| 335 | -		$message = $this->language->lang('DIR_VOTE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $meta_info . '">', '</a>'); | 
                                                        |
| 335 | +		$message = $this->language->lang('DIR_VOTE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$meta_info.'">', '</a>'); | 
                                                        |
| 336 | 336 | return $this->helper->message($message);  | 
                                                        
| 337 | 337 | }  | 
                                                        
| 338 | 338 | |
@@ -357,18 +357,18 @@ discard block  | 
                                                    ||
| 357 | 357 |  			return $this->helper->message('FORM_INVALID'); | 
                                                        
| 358 | 358 | }  | 
                                                        
| 359 | 359 | |
| 360 | -		$this->url			= $this->request->variable('url', ''); | 
                                                        |
| 361 | -		$this->site_name	= $this->request->variable('site_name', '', true); | 
                                                        |
| 360 | +		$this->url = $this->request->variable('url', ''); | 
                                                        |
| 361 | +		$this->site_name = $this->request->variable('site_name', '', true); | 
                                                        |
| 362 | 362 |  		$this->description	= $this->request->variable('description', '', true); | 
                                                        
| 363 | 363 |  		$this->guest_email	= $this->request->variable('guest_email', ''); | 
                                                        
| 364 | -		$this->rss			= $this->request->variable('rss', ''); | 
                                                        |
| 365 | -		$this->banner 		= $this->request->variable('banner', ''); | 
                                                        |
| 364 | +		$this->rss = $this->request->variable('rss', ''); | 
                                                        |
| 365 | +		$this->banner = $this->request->variable('banner', ''); | 
                                                        |
| 366 | 366 |  		$this->back			= $this->request->variable('back', ''); | 
                                                        
| 367 | 367 |  		$this->flag 		= $this->request->variable('flag', ''); | 
                                                        
| 368 | 368 | |
| 369 | 369 |  		if (!function_exists('validate_data')) | 
                                                        
| 370 | 370 |  		{ | 
                                                        
| 371 | - include($this->root_path . 'includes/functions_user.' . $this->php_ext);  | 
                                                        |
| 371 | + include($this->root_path.'includes/functions_user.'.$this->php_ext);  | 
                                                        |
| 372 | 372 | }  | 
                                                        
| 373 | 373 | |
| 374 | 374 | // We define variables to check  | 
                                                        
@@ -391,17 +391,17 @@ discard block  | 
                                                    ||
| 391 | 391 | 'site_name' => array(  | 
                                                        
| 392 | 392 |  				array('string', false, 1, 100)), | 
                                                        
| 393 | 393 | 'website' => array(  | 
                                                        
| 394 | -				array('string',	false, 12, 255), | 
                                                        |
| 395 | -				array('match',	true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), | 
                                                        |
| 394 | +				array('string', false, 12, 255), | 
                                                        |
| 395 | +				array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), | 
                                                        |
| 396 | 396 | 'description' => array(  | 
                                                        
| 397 | 397 |  				array('string', !$this->categorie->data['cat_must_describe'], 1, $this->config['dir_length_describe'])), | 
                                                        
| 398 | 398 | 'rss' => array(  | 
                                                        
| 399 | 399 |  				array('string', true, 12, 255), | 
                                                        
| 400 | -				array('match',	empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), | 
                                                        |
| 400 | +				array('match', empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), | 
                                                        |
| 401 | 401 | 'banner' => array(  | 
                                                        
| 402 | 402 |  				array('string', true, 5, 255)), | 
                                                        
| 403 | 403 | 'back' => array(  | 
                                                        
| 404 | -				array('string',	!$this->categorie->data['cat_link_back'], 12, 255), | 
                                                        |
| 404 | +				array('string', !$this->categorie->data['cat_link_back'], 12, 255), | 
                                                        |
| 405 | 405 | array(array($this->link, 'link_back'), true)),  | 
                                                        
| 406 | 406 | 'cat' => array(  | 
                                                        
| 407 | 407 |  				array('num', '', 1)) | 
                                                        
@@ -450,8 +450,8 @@ discard block  | 
                                                    ||
| 450 | 450 | // Still no errors?? So let's go!  | 
                                                        
| 451 | 451 | if (!$error)  | 
                                                        
| 452 | 452 |  		{ | 
                                                        
| 453 | -			$this->banner	= (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner; | 
                                                        |
| 454 | - $this->url = $this->link->clean_url($this->url);  | 
                                                        |
| 453 | +			$this->banner = (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner; | 
                                                        |
| 454 | + $this->url = $this->link->clean_url($this->url);  | 
                                                        |
| 455 | 455 | |
| 456 | 456 | $data_edit = array(  | 
                                                        
| 457 | 457 | 'link_user_id' => $this->link_user_id,  | 
                                                        
@@ -500,7 +500,7 @@ discard block  | 
                                                    ||
| 500 | 500 |  			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)); | 
                                                        
| 501 | 501 | meta_refresh(3, $meta_info);  | 
                                                        
| 502 | 502 |  			$message	= ($need_approval) ? $this->language->lang('DIR_'.strtoupper($mode).'_SITE_ACTIVE') : $this->language->lang('DIR_'.strtoupper($mode).'_SITE_OK'); | 
                                                        
| 503 | -			$message	= $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)) . '">', '</a>'); | 
                                                        |
| 503 | +			$message	= $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)).'">', '</a>'); | 
                                                        |
| 504 | 504 | return $this->helper->message($message);  | 
                                                        
| 505 | 505 | }  | 
                                                        
| 506 | 506 | else  | 
                                                        
@@ -529,7 +529,7 @@ discard block  | 
                                                    ||
| 529 | 529 |  	{ | 
                                                        
| 530 | 530 |  		if (!function_exists('file_gc')) | 
                                                        
| 531 | 531 |  		{ | 
                                                        
| 532 | - include($this->root_path . 'includes/functions_download.' . $this->php_ext);  | 
                                                        |
| 532 | + include($this->root_path.'includes/functions_download.'.$this->php_ext);  | 
                                                        |
| 533 | 533 | }  | 
                                                        
| 534 | 534 | |
| 535 | 535 | $file_path = $this->get_banner_path($banner_img);  | 
                                                        
@@ -584,7 +584,7 @@ discard block  | 
                                                    ||
| 584 | 584 | |
| 585 | 585 |  		if (!function_exists('display_custom_bbcodes')) | 
                                                        
| 586 | 586 |  		{ | 
                                                        
| 587 | - include($this->root_path . 'includes/functions_display.' . $this->php_ext);  | 
                                                        |
| 587 | + include($this->root_path.'includes/functions_display.'.$this->php_ext);  | 
                                                        |
| 588 | 588 | }  | 
                                                        
| 589 | 589 | display_custom_bbcodes();  | 
                                                        
| 590 | 590 |  		add_form_key('dir_form'); | 
                                                        
@@ -593,17 +593,17 @@ discard block  | 
                                                    ||
| 593 | 593 | $flag_path = $ext_path.'images/flags/';  | 
                                                        
| 594 | 594 | |
| 595 | 595 | $s_guest = (!$this->user->data['is_registered'] || !empty($this->guest_email));  | 
                                                        
| 596 | - $s_rss = $this->config['dir_activ_rss'];  | 
                                                        |
| 597 | - $s_banner = $this->config['dir_activ_banner'];  | 
                                                        |
| 596 | + $s_rss = $this->config['dir_activ_rss'];  | 
                                                        |
| 597 | + $s_banner = $this->config['dir_activ_banner'];  | 
                                                        |
| 598 | 598 | $s_back = $this->categorie->data['cat_link_back'];  | 
                                                        
| 599 | 599 | $s_flag = $this->config['dir_activ_flag'];  | 
                                                        
| 600 | 600 | |
| 601 | 601 | $this->template->assign_vars(array(  | 
                                                        
| 602 | -			'BBCODE_STATUS'			=> ($this->config['allow_bbcode']) 	? $this->language->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'), | 
                                                        |
| 603 | -			'IMG_STATUS'			=> ($this->config['allow_bbcode'])	? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'), | 
                                                        |
| 602 | +			'BBCODE_STATUS'			=> ($this->config['allow_bbcode']) ? $this->language->lang('BBCODE_IS_ON', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>'), | 
                                                        |
| 603 | +			'IMG_STATUS'			=> ($this->config['allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'), | 
                                                        |
| 604 | 604 |  			'SMILIES_STATUS'		=> ($this->config['allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'), | 
                                                        
| 605 | 605 |  			'URL_STATUS'			=> ($this->config['allow_post_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'), | 
                                                        
| 606 | -			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash'])	? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'), | 
                                                        |
| 606 | +			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'), | 
                                                        |
| 607 | 607 | |
| 608 | 608 | 'L_TITLE' => $title,  | 
                                                        
| 609 | 609 |  			'L_DIR_DESCRIPTION_EXP'	=> $this->language->lang('DIR_DESCRIPTION_EXP', $this->config['dir_length_describe']), | 
                                                        
@@ -66,22 +66,22 @@ discard block  | 
                                                    ||
| 66 | 66 | private $links_data;  | 
                                                        
| 67 | 67 | |
| 68 | 68 | /**  | 
                                                        
| 69 | - * Constructor  | 
                                                        |
| 70 | - *  | 
                                                        |
| 71 | - * @param \phpbb\config\config $config Config object  | 
                                                        |
| 72 | - * @param \phpbb\db\driver\driver_interface $db Database object  | 
                                                        |
| 73 | - * @param \phpbb\pagination $pagination Pagination object  | 
                                                        |
| 74 | - * @param \phpbb\language\language $language Language object  | 
                                                        |
| 75 | - * @param \phpbb\log\log $log Log object  | 
                                                        |
| 76 | - * @param \phpbb\notification\manager $notification Notification object  | 
                                                        |
| 77 | - * @param \phpbb\request\request $request Request object  | 
                                                        |
| 78 | - * @param \phpbb\template\template $template Template object  | 
                                                        |
| 79 | - * @param \phpbb\user $user User object  | 
                                                        |
| 80 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object  | 
                                                        |
| 81 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object  | 
                                                        |
| 82 | - * @param string $root_path phpBB root path  | 
                                                        |
| 83 | - * @param string $php_ext phpEx  | 
                                                        |
| 84 | - */  | 
                                                        |
| 69 | + * Constructor  | 
                                                        |
| 70 | + *  | 
                                                        |
| 71 | + * @param \phpbb\config\config $config Config object  | 
                                                        |
| 72 | + * @param \phpbb\db\driver\driver_interface $db Database object  | 
                                                        |
| 73 | + * @param \phpbb\pagination $pagination Pagination object  | 
                                                        |
| 74 | + * @param \phpbb\language\language $language Language object  | 
                                                        |
| 75 | + * @param \phpbb\log\log $log Log object  | 
                                                        |
| 76 | + * @param \phpbb\notification\manager $notification Notification object  | 
                                                        |
| 77 | + * @param \phpbb\request\request $request Request object  | 
                                                        |
| 78 | + * @param \phpbb\template\template $template Template object  | 
                                                        |
| 79 | + * @param \phpbb\user $user User object  | 
                                                        |
| 80 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object  | 
                                                        |
| 81 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object  | 
                                                        |
| 82 | + * @param string $root_path phpBB root path  | 
                                                        |
| 83 | + * @param string $php_ext phpEx  | 
                                                        |
| 84 | + */  | 
                                                        |
| 85 | 85 | public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\notification\manager $notification, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext)  | 
                                                        
| 86 | 86 |  	{ | 
                                                        
| 87 | 87 | $this->config = $config;  | 
                                                        
@@ -102,11 +102,11 @@ discard block  | 
                                                    ||
| 102 | 102 | }  | 
                                                        
| 103 | 103 | |
| 104 | 104 | /**  | 
                                                        
| 105 | - * Display confirm box  | 
                                                        |
| 106 | - *  | 
                                                        |
| 107 | - * @param array $mark Website selected for (dis)approval  | 
                                                        |
| 108 | - * @return null  | 
                                                        |
| 109 | - */  | 
                                                        |
| 105 | + * Display confirm box  | 
                                                        |
| 106 | + *  | 
                                                        |
| 107 | + * @param array $mark Website selected for (dis)approval  | 
                                                        |
| 108 | + * @return null  | 
                                                        |
| 109 | + */  | 
                                                        |
| 110 | 110 | public function display_confirm($mark)  | 
                                                        
| 111 | 111 |  	{ | 
                                                        
| 112 | 112 | $s_hidden_fields = array(  | 
                                                        
@@ -118,10 +118,10 @@ discard block  | 
                                                    ||
| 118 | 118 | }  | 
                                                        
| 119 | 119 | |
| 120 | 120 | /**  | 
                                                        
| 121 | - * Display website list for (dis)approval  | 
                                                        |
| 122 | - *  | 
                                                        |
| 123 | - * @return null  | 
                                                        |
| 124 | - */  | 
                                                        |
| 121 | + * Display website list for (dis)approval  | 
                                                        |
| 122 | + *  | 
                                                        |
| 123 | + * @return null  | 
                                                        |
| 124 | + */  | 
                                                        |
| 125 | 125 | public function display_websites()  | 
                                                        
| 126 | 126 |  	{ | 
                                                        
| 127 | 127 | global $phpbb_admin_path;  | 
                                                        
@@ -225,11 +225,11 @@ discard block  | 
                                                    ||
| 225 | 225 | }  | 
                                                        
| 226 | 226 | |
| 227 | 227 | /**  | 
                                                        
| 228 | - * Get link's information and call appropriate action  | 
                                                        |
| 229 | - *  | 
                                                        |
| 230 | - * @param array $mark Website selected for (dis)approval  | 
                                                        |
| 231 | - * @return null  | 
                                                        |
| 232 | - */  | 
                                                        |
| 228 | + * Get link's information and call appropriate action  | 
                                                        |
| 229 | + *  | 
                                                        |
| 230 | + * @param array $mark Website selected for (dis)approval  | 
                                                        |
| 231 | + * @return null  | 
                                                        |
| 232 | + */  | 
                                                        |
| 233 | 233 | public function exec_action($mark)  | 
                                                        
| 234 | 234 |  	{ | 
                                                        
| 235 | 235 | $this->_get_infos_links($mark);  | 
                                                        
@@ -252,10 +252,10 @@ discard block  | 
                                                    ||
| 252 | 252 | }  | 
                                                        
| 253 | 253 | |
| 254 | 254 | /**  | 
                                                        
| 255 | - * Notify users which had submitted their websites  | 
                                                        |
| 256 | - *  | 
                                                        |
| 257 | - * @return null  | 
                                                        |
| 258 | - */  | 
                                                        |
| 255 | + * Notify users which had submitted their websites  | 
                                                        |
| 256 | + *  | 
                                                        |
| 257 | + * @return null  | 
                                                        |
| 258 | + */  | 
                                                        |
| 259 | 259 | public function notifiy_submiters()  | 
                                                        
| 260 | 260 |  	{ | 
                                                        
| 261 | 261 |  		if (!class_exists('messenger')) | 
                                                        
@@ -299,22 +299,22 @@ discard block  | 
                                                    ||
| 299 | 299 | }  | 
                                                        
| 300 | 300 | |
| 301 | 301 | /**  | 
                                                        
| 302 | - * Set page url  | 
                                                        |
| 303 | - *  | 
                                                        |
| 304 | - * @param string $u_action Custom form action  | 
                                                        |
| 305 | - * @return null  | 
                                                        |
| 306 | - * @access public  | 
                                                        |
| 307 | - */  | 
                                                        |
| 302 | + * Set page url  | 
                                                        |
| 303 | + *  | 
                                                        |
| 304 | + * @param string $u_action Custom form action  | 
                                                        |
| 305 | + * @return null  | 
                                                        |
| 306 | + * @access public  | 
                                                        |
| 307 | + */  | 
                                                        |
| 308 | 308 | public function set_page_url($u_action)  | 
                                                        
| 309 | 309 |  	{ | 
                                                        
| 310 | 310 | $this->u_action = $u_action;  | 
                                                        
| 311 | 311 | }  | 
                                                        
| 312 | 312 | |
| 313 | 313 | /**  | 
                                                        
| 314 | - * Approve action  | 
                                                        |
| 315 | - *  | 
                                                        |
| 316 | - * @return null  | 
                                                        |
| 317 | - */  | 
                                                        |
| 314 | + * Approve action  | 
                                                        |
| 315 | + *  | 
                                                        |
| 316 | + * @return null  | 
                                                        |
| 317 | + */  | 
                                                        |
| 318 | 318 | private function _action_approved()  | 
                                                        
| 319 | 319 |  	{ | 
                                                        
| 320 | 320 | foreach ($this->links_data as $row)  | 
                                                        
@@ -343,10 +343,10 @@ discard block  | 
                                                    ||
| 343 | 343 | }  | 
                                                        
| 344 | 344 | |
| 345 | 345 | /**  | 
                                                        
| 346 | - * Disapprove action  | 
                                                        |
| 347 | - *  | 
                                                        |
| 348 | - * @return null  | 
                                                        |
| 349 | - */  | 
                                                        |
| 346 | + * Disapprove action  | 
                                                        |
| 347 | + *  | 
                                                        |
| 348 | + * @return null  | 
                                                        |
| 349 | + */  | 
                                                        |
| 350 | 350 | private function _action_disapproved()  | 
                                                        
| 351 | 351 |  	{ | 
                                                        
| 352 | 352 | foreach ($this->links_data as $row)  | 
                                                        
@@ -367,11 +367,11 @@ discard block  | 
                                                    ||
| 367 | 367 | }  | 
                                                        
| 368 | 368 | |
| 369 | 369 | /**  | 
                                                        
| 370 | - * Get informations about links selected  | 
                                                        |
| 371 | - *  | 
                                                        |
| 372 | - * @param $mark Website selected for (dis)approval  | 
                                                        |
| 373 | - * @return null  | 
                                                        |
| 374 | - */  | 
                                                        |
| 370 | + * Get informations about links selected  | 
                                                        |
| 371 | + *  | 
                                                        |
| 372 | + * @param $mark Website selected for (dis)approval  | 
                                                        |
| 373 | + * @return null  | 
                                                        |
| 374 | + */  | 
                                                        |
| 375 | 375 | private function _get_infos_links($mark)  | 
                                                        
| 376 | 376 |  	{ | 
                                                        
| 377 | 377 | $sql_array = array(  | 
                                                        
@@ -406,11 +406,11 @@ discard block  | 
                                                    ||
| 406 | 406 | }  | 
                                                        
| 407 | 407 | |
| 408 | 408 | /**  | 
                                                        
| 409 | - * Notify users which watch categories  | 
                                                        |
| 410 | - *  | 
                                                        |
| 411 | - * @param $row Informations about website  | 
                                                        |
| 412 | - * @return null  | 
                                                        |
| 413 | - */  | 
                                                        |
| 409 | + * Notify users which watch categories  | 
                                                        |
| 410 | + *  | 
                                                        |
| 411 | + * @param $row Informations about website  | 
                                                        |
| 412 | + * @return null  | 
                                                        |
| 413 | + */  | 
                                                        |
| 414 | 414 | private function _notify_suscribers($row)  | 
                                                        
| 415 | 415 |  	{ | 
                                                        
| 416 | 416 | $notification_data = array(  | 
                                                        
@@ -84,21 +84,21 @@ discard block  | 
                                                    ||
| 84 | 84 | */  | 
                                                        
| 85 | 85 | public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\notification\manager $notification, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext)  | 
                                                        
| 86 | 86 |  	{ | 
                                                        
| 87 | - $this->config = $config;  | 
                                                        |
| 88 | - $this->db = $db;  | 
                                                        |
| 89 | - $this->pagination = $pagination;  | 
                                                        |
| 87 | + $this->config = $config;  | 
                                                        |
| 88 | + $this->db = $db;  | 
                                                        |
| 89 | + $this->pagination = $pagination;  | 
                                                        |
| 90 | 90 | $this->language = $language;  | 
                                                        
| 91 | 91 | $this->phpbb_log = $log;  | 
                                                        
| 92 | - $this->notification = $notification;  | 
                                                        |
| 93 | - $this->request = $request;  | 
                                                        |
| 92 | + $this->notification = $notification;  | 
                                                        |
| 93 | + $this->request = $request;  | 
                                                        |
| 94 | 94 | $this->template = $template;  | 
                                                        
| 95 | 95 | $this->user = $user;  | 
                                                        
| 96 | 96 | $this->categorie = $categorie;  | 
                                                        
| 97 | 97 | $this->link = $link;  | 
                                                        
| 98 | 98 | $this->root_path = $root_path;  | 
                                                        
| 99 | - $this->php_ext = $php_ext;  | 
                                                        |
| 99 | + $this->php_ext = $php_ext;  | 
                                                        |
| 100 | 100 | |
| 101 | -		$this->action		= $this->request->variable('action', ''); | 
                                                        |
| 101 | +		$this->action = $this->request->variable('action', ''); | 
                                                        |
| 102 | 102 | }  | 
                                                        
| 103 | 103 | |
| 104 | 104 | /**  | 
                                                        
@@ -127,14 +127,14 @@ discard block  | 
                                                    ||
| 127 | 127 | global $phpbb_admin_path;  | 
                                                        
| 128 | 128 | |
| 129 | 129 | // Sort keys  | 
                                                        
| 130 | -		$sort_days	= $this->request->variable('st', 0); | 
                                                        |
| 130 | +		$sort_days = $this->request->variable('st', 0); | 
                                                        |
| 131 | 131 |  		$sort_key	= $this->request->variable('sk', 't'); | 
                                                        
| 132 | 132 |  		$sort_dir	= $this->request->variable('sd', 'd'); | 
                                                        
| 133 | 133 | |
| 134 | 134 | // Number of entries to display  | 
                                                        
| 135 | 135 |  		$per_page = $this->request->variable('links_per_page', (int) $this->config['dir_show']); | 
                                                        
| 136 | 136 | |
| 137 | -		$start	= $this->request->variable('start', 0); | 
                                                        |
| 137 | +		$start = $this->request->variable('start', 0); | 
                                                        |
| 138 | 138 | |
| 139 | 139 | // Categorie ordering options  | 
                                                        
| 140 | 140 |  		$limit_days		= array(0 => $this->language->lang('SEE_ALL'), 1 => $this->language->lang('1_DAY'), 7 => $this->language->lang('7_DAYS'), 14 => $this->language->lang('2_WEEKS'), 30 => $this->language->lang('1_MONTH'), 90 => $this->language->lang('3_MONTHS'), 180 => $this->language->lang('6_MONTHS'), 365 => $this->language->lang('1_YEAR')); | 
                                                        
@@ -150,15 +150,15 @@ discard block  | 
                                                    ||
| 150 | 150 | |
| 151 | 151 | if (is_array($sort_by_sql[$sort_key]))  | 
                                                        
| 152 | 152 |  		{ | 
                                                        
| 153 | -			$sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; | 
                                                        |
| 153 | +			$sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction; | 
                                                        |
| 154 | 154 | }  | 
                                                        
| 155 | 155 | else  | 
                                                        
| 156 | 156 |  		{ | 
                                                        
| 157 | - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;  | 
                                                        |
| 157 | + $sql_sort_order = $sort_by_sql[$sort_key].' '.$direction;  | 
                                                        |
| 158 | 158 | }  | 
                                                        
| 159 | 159 | |
| 160 | 160 | $sql = 'SELECT COUNT(1) AS total_links  | 
                                                        
| 161 | - FROM ' . $this->links_table . '  | 
                                                        |
| 161 | + FROM ' . $this->links_table.'  | 
                                                        |
| 162 | 162 | WHERE link_active = 0' .  | 
                                                        
| 163 | 163 | (($sql_where) ? " AND link_time >= $sql_where" : '');  | 
                                                        
| 164 | 164 | $result = $this->db->sql_query($sql);  | 
                                                        
@@ -182,7 +182,7 @@ discard block  | 
                                                    ||
| 182 | 182 | 'ON' => 'u.user_id = l.link_user_id'  | 
                                                        
| 183 | 183 | )  | 
                                                        
| 184 | 184 | ),  | 
                                                        
| 185 | - 'WHERE' => 'l.link_active = 0' . (($sql_where) ? " AND l.link_time >= $sql_where" : ''),  | 
                                                        |
| 185 | + 'WHERE' => 'l.link_active = 0'.(($sql_where) ? " AND l.link_time >= $sql_where" : ''),  | 
                                                        |
| 186 | 186 | 'ORDER_BY' => $sql_sort_order);  | 
                                                        
| 187 | 187 | |
| 188 | 188 |  		$sql = $this->db->sql_build_query('SELECT', $sql_array); | 
                                                        
@@ -209,7 +209,7 @@ discard block  | 
                                                    ||
| 209 | 209 | |
| 210 | 210 |  		$option_ary = array('approved' => 'DIR_LINK_ACTIVATE', 'disapproved' => 'DIR_LINK_DELETE'); | 
                                                        
| 211 | 211 | |
| 212 | - $base_url = $this->u_action . "&$u_sort_param&links_per_page=$per_page";  | 
                                                        |
| 212 | + $base_url = $this->u_action."&$u_sort_param&links_per_page=$per_page";  | 
                                                        |
| 213 | 213 | $this->pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_links, $per_page, $start);  | 
                                                        
| 214 | 214 | |
| 215 | 215 | $this->template->assign_vars(array(  | 
                                                        
@@ -220,7 +220,7 @@ discard block  | 
                                                    ||
| 220 | 220 | 'S_SORT_DIR' => $s_sort_dir,  | 
                                                        
| 221 | 221 | 'LINKS_PER_PAGE' => $per_page,  | 
                                                        
| 222 | 222 | |
| 223 | - 'U_ACTION' => $this->u_action . "&$u_sort_param&links_per_page=$per_page&start=$start",  | 
                                                        |
| 223 | + 'U_ACTION' => $this->u_action."&$u_sort_param&links_per_page=$per_page&start=$start",  | 
                                                        |
| 224 | 224 | ));  | 
                                                        
| 225 | 225 | }  | 
                                                        
| 226 | 226 | |
@@ -248,7 +248,7 @@ discard block  | 
                                                    ||
| 248 | 248 | return;  | 
                                                        
| 249 | 249 | }  | 
                                                        
| 250 | 250 | |
| 251 | -		$this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_LINK_' . strtoupper($this->action), time(), array(implode(', ', $this->affected_link_name))); | 
                                                        |
| 251 | +		$this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_LINK_'.strtoupper($this->action), time(), array(implode(', ', $this->affected_link_name))); | 
                                                        |
| 252 | 252 | }  | 
                                                        
| 253 | 253 | |
| 254 | 254 | /**  | 
                                                        
@@ -260,7 +260,7 @@ discard block  | 
                                                    ||
| 260 | 260 |  	{ | 
                                                        
| 261 | 261 |  		if (!class_exists('messenger')) | 
                                                        
| 262 | 262 |  		{ | 
                                                        
| 263 | - include($this->root_path . 'includes/functions_messenger.' . $this->php_ext);  | 
                                                        |
| 263 | + include($this->root_path.'includes/functions_messenger.'.$this->php_ext);  | 
                                                        |
| 264 | 264 | }  | 
                                                        
| 265 | 265 | $messenger = new \messenger(false);  | 
                                                        
| 266 | 266 | |
@@ -327,15 +327,15 @@ discard block  | 
                                                    ||
| 327 | 327 | 'link_cat' => (int) $row['link_cat'],  | 
                                                        
| 328 | 328 | );  | 
                                                        
| 329 | 329 | |
| 330 | - $sql = 'UPDATE ' . $this->links_table . '  | 
                                                        |
| 331 | -							SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' | 
                                                        |
| 330 | + $sql = 'UPDATE '.$this->links_table.'  | 
                                                        |
| 331 | +							SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' | 
                                                        |
| 332 | 332 | WHERE link_id = ' . (int) $row['link_id'];  | 
                                                        
| 333 | 333 | $this->db->sql_query($sql);  | 
                                                        
| 334 | 334 | }  | 
                                                        
| 335 | 335 | |
| 336 | 336 | foreach ($this->cat_data as $cat_id => $count)  | 
                                                        
| 337 | 337 |  		{ | 
                                                        
| 338 | - $sql = 'UPDATE ' . $this->categories_table . '  | 
                                                        |
| 338 | + $sql = 'UPDATE '.$this->categories_table.'  | 
                                                        |
| 339 | 339 | SET cat_links = cat_links + '.$count.'  | 
                                                        
| 340 | 340 | WHERE cat_id = ' . (int) $cat_id;  | 
                                                        
| 341 | 341 | $this->db->sql_query($sql);  | 
                                                        
@@ -361,7 +361,7 @@ discard block  | 
                                                    ||
| 361 | 361 | }  | 
                                                        
| 362 | 362 | }  | 
                                                        
| 363 | 363 | |
| 364 | - $sql = 'DELETE FROM ' . $this->links_table . ' WHERE link_id = ' . (int) $row['link_id'];  | 
                                                        |
| 364 | + $sql = 'DELETE FROM '.$this->links_table.' WHERE link_id = '.(int) $row['link_id'];  | 
                                                        |
| 365 | 365 | $this->db->sql_query($sql);  | 
                                                        
| 366 | 366 | }  | 
                                                        
| 367 | 367 | }  | 
                                                        
@@ -69,19 +69,19 @@ discard block  | 
                                                    ||
| 69 | 69 | private $update;  | 
                                                        
| 70 | 70 | |
| 71 | 71 | /**  | 
                                                        
| 72 | - * Constructor  | 
                                                        |
| 73 | - *  | 
                                                        |
| 74 | - * @param \phpbb\cache\service $cache Cache object  | 
                                                        |
| 75 | - * @param \phpbb\db\driver\driver_interface $db Database object  | 
                                                        |
| 76 | - * @param \phpbb\controller\helper $helper Helper object  | 
                                                        |
| 77 | - * @param \phpbb\language\language $language Language object  | 
                                                        |
| 78 | - * @param \phpbb\log\log $log Log object  | 
                                                        |
| 79 | - * @param \phpbb\request\request $request Request object  | 
                                                        |
| 80 | - * @param \phpbb\template\template $template Template object  | 
                                                        |
| 81 | - * @param \phpbb\user $user User object  | 
                                                        |
| 82 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object  | 
                                                        |
| 83 | - * @param \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category PhpBB Directory extension nestedset object  | 
                                                        |
| 84 | - */  | 
                                                        |
| 72 | + * Constructor  | 
                                                        |
| 73 | + *  | 
                                                        |
| 74 | + * @param \phpbb\cache\service $cache Cache object  | 
                                                        |
| 75 | + * @param \phpbb\db\driver\driver_interface $db Database object  | 
                                                        |
| 76 | + * @param \phpbb\controller\helper $helper Helper object  | 
                                                        |
| 77 | + * @param \phpbb\language\language $language Language object  | 
                                                        |
| 78 | + * @param \phpbb\log\log $log Log object  | 
                                                        |
| 79 | + * @param \phpbb\request\request $request Request object  | 
                                                        |
| 80 | + * @param \phpbb\template\template $template Template object  | 
                                                        |
| 81 | + * @param \phpbb\user $user User object  | 
                                                        |
| 82 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object  | 
                                                        |
| 83 | + * @param \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category PhpBB Directory extension nestedset object  | 
                                                        |
| 84 | + */  | 
                                                        |
| 85 | 85 | public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category)  | 
                                                        
| 86 | 86 |  	{ | 
                                                        
| 87 | 87 | $this->cache = $cache;  | 
                                                        
@@ -105,10 +105,10 @@ discard block  | 
                                                    ||
| 105 | 105 | }  | 
                                                        
| 106 | 106 | |
| 107 | 107 | /**  | 
                                                        
| 108 | - * Initialize defaults data for add page  | 
                                                        |
| 109 | - *  | 
                                                        |
| 110 | - * @return null  | 
                                                        |
| 111 | - */  | 
                                                        |
| 108 | + * Initialize defaults data for add page  | 
                                                        |
| 109 | + *  | 
                                                        |
| 110 | + * @return null  | 
                                                        |
| 111 | + */  | 
                                                        |
| 112 | 112 | public function action_add()  | 
                                                        
| 113 | 113 |  	{ | 
                                                        
| 114 | 114 | $this->cat_id = $this->parent_id;  | 
                                                        
@@ -142,10 +142,10 @@ discard block  | 
                                                    ||
| 142 | 142 | }  | 
                                                        
| 143 | 143 | |
| 144 | 144 | /**  | 
                                                        
| 145 | - * Display deleting page  | 
                                                        |
| 146 | - *  | 
                                                        |
| 147 | - * @return null  | 
                                                        |
| 148 | - */  | 
                                                        |
| 145 | + * Display deleting page  | 
                                                        |
| 146 | + *  | 
                                                        |
| 147 | + * @return null  | 
                                                        |
| 148 | + */  | 
                                                        |
| 149 | 149 | public function action_delete()  | 
                                                        
| 150 | 150 |  	{ | 
                                                        
| 151 | 151 | if (!$this->cat_id)  | 
                                                        
@@ -196,10 +196,10 @@ discard block  | 
                                                    ||
| 196 | 196 | }  | 
                                                        
| 197 | 197 | |
| 198 | 198 | /**  | 
                                                        
| 199 | - * Initialize data for edit page  | 
                                                        |
| 200 | - *  | 
                                                        |
| 201 | - * @return null  | 
                                                        |
| 202 | - */  | 
                                                        |
| 199 | + * Initialize data for edit page  | 
                                                        |
| 200 | + *  | 
                                                        |
| 201 | + * @return null  | 
                                                        |
| 202 | + */  | 
                                                        |
| 203 | 203 | public function action_edit()  | 
                                                        
| 204 | 204 |  	{ | 
                                                        
| 205 | 205 | $row = $this->_get_cat_info($this->cat_id);  | 
                                                        
@@ -226,10 +226,10 @@ discard block  | 
                                                    ||
| 226 | 226 | }  | 
                                                        
| 227 | 227 | |
| 228 | 228 | /**  | 
                                                        
| 229 | - * Move order categories  | 
                                                        |
| 230 | - *  | 
                                                        |
| 231 | - * @return null  | 
                                                        |
| 232 | - */  | 
                                                        |
| 229 | + * Move order categories  | 
                                                        |
| 230 | + *  | 
                                                        |
| 231 | + * @return null  | 
                                                        |
| 232 | + */  | 
                                                        |
| 233 | 233 | public function action_move()  | 
                                                        
| 234 | 234 |  	{ | 
                                                        
| 235 | 235 | if (!$this->cat_id)  | 
                                                        
@@ -272,10 +272,10 @@ discard block  | 
                                                    ||
| 272 | 272 | }  | 
                                                        
| 273 | 273 | |
| 274 | 274 | /**  | 
                                                        
| 275 | - * Display progress bar for syncinc categories  | 
                                                        |
| 276 | - *  | 
                                                        |
| 277 | - * @return null  | 
                                                        |
| 278 | - */  | 
                                                        |
| 275 | + * Display progress bar for syncinc categories  | 
                                                        |
| 276 | + *  | 
                                                        |
| 277 | + * @return null  | 
                                                        |
| 278 | + */  | 
                                                        |
| 279 | 279 | public function action_progress_bar()  | 
                                                        
| 280 | 280 |  	{ | 
                                                        
| 281 | 281 |  		$start = $this->request->variable('start', 0); | 
                                                        
@@ -296,10 +296,10 @@ discard block  | 
                                                    ||
| 296 | 296 | }  | 
                                                        
| 297 | 297 | |
| 298 | 298 | /**  | 
                                                        
| 299 | - * Get link's ID interval for _sync_dir_links()  | 
                                                        |
| 300 | - *  | 
                                                        |
| 301 | - * @return null  | 
                                                        |
| 302 | - */  | 
                                                        |
| 299 | + * Get link's ID interval for _sync_dir_links()  | 
                                                        |
| 300 | + *  | 
                                                        |
| 301 | + * @return null  | 
                                                        |
| 302 | + */  | 
                                                        |
| 303 | 303 | public function action_sync()  | 
                                                        
| 304 | 304 |  	{ | 
                                                        
| 305 | 305 | if (!$this->cat_id)  | 
                                                        
@@ -383,10 +383,10 @@ discard block  | 
                                                    ||
| 383 | 383 | }  | 
                                                        
| 384 | 384 | |
| 385 | 385 | /**  | 
                                                        
| 386 | - * Sync category data  | 
                                                        |
| 387 | - *  | 
                                                        |
| 388 | - * @return null  | 
                                                        |
| 389 | - */  | 
                                                        |
| 386 | + * Sync category data  | 
                                                        |
| 387 | + *  | 
                                                        |
| 388 | + * @return null  | 
                                                        |
| 389 | + */  | 
                                                        |
| 390 | 390 | public function action_sync_cat()  | 
                                                        
| 391 | 391 |  	{ | 
                                                        
| 392 | 392 | $sql = 'SELECT cat_name  | 
                                                        
@@ -410,10 +410,10 @@ discard block  | 
                                                    ||
| 410 | 410 | }  | 
                                                        
| 411 | 411 | |
| 412 | 412 | /**  | 
                                                        
| 413 | - * Display categories page  | 
                                                        |
| 414 | - *  | 
                                                        |
| 415 | - * @return null  | 
                                                        |
| 416 | - */  | 
                                                        |
| 413 | + * Display categories page  | 
                                                        |
| 414 | + *  | 
                                                        |
| 415 | + * @return null  | 
                                                        |
| 416 | + */  | 
                                                        |
| 417 | 417 | public function display_cats()  | 
                                                        
| 418 | 418 |  	{ | 
                                                        
| 419 | 419 | // Default management page  | 
                                                        
@@ -508,22 +508,22 @@ discard block  | 
                                                    ||
| 508 | 508 | }  | 
                                                        
| 509 | 509 | |
| 510 | 510 | /**  | 
                                                        
| 511 | - * Set page url  | 
                                                        |
| 512 | - *  | 
                                                        |
| 513 | - * @param string $u_action Custom form action  | 
                                                        |
| 514 | - * @return null  | 
                                                        |
| 515 | - * @access public  | 
                                                        |
| 516 | - */  | 
                                                        |
| 511 | + * Set page url  | 
                                                        |
| 512 | + *  | 
                                                        |
| 513 | + * @param string $u_action Custom form action  | 
                                                        |
| 514 | + * @return null  | 
                                                        |
| 515 | + * @access public  | 
                                                        |
| 516 | + */  | 
                                                        |
| 517 | 517 | public function set_page_url($u_action)  | 
                                                        
| 518 | 518 |  	{ | 
                                                        
| 519 | 519 | $this->u_action = $u_action;  | 
                                                        
| 520 | 520 | }  | 
                                                        
| 521 | 521 | |
| 522 | 522 | /**  | 
                                                        
| 523 | - * Update cat table  | 
                                                        |
| 524 | - *  | 
                                                        |
| 525 | - * @return null  | 
                                                        |
| 526 | - */  | 
                                                        |
| 523 | + * Update cat table  | 
                                                        |
| 524 | + *  | 
                                                        |
| 525 | + * @return null  | 
                                                        |
| 526 | + */  | 
                                                        |
| 527 | 527 | public function update()  | 
                                                        
| 528 | 528 |  	{ | 
                                                        
| 529 | 529 | if (!check_form_key($this->form_key))  | 
                                                        
@@ -617,11 +617,11 @@ discard block  | 
                                                    ||
| 617 | 617 | }  | 
                                                        
| 618 | 618 | |
| 619 | 619 | /**  | 
                                                        
| 620 | - * Display form  | 
                                                        |
| 621 | - *  | 
                                                        |
| 622 | - * @param string $parents_list Drop-down list  | 
                                                        |
| 623 | - * @return null  | 
                                                        |
| 624 | - */  | 
                                                        |
| 620 | + * Display form  | 
                                                        |
| 621 | + *  | 
                                                        |
| 622 | + * @param string $parents_list Drop-down list  | 
                                                        |
| 623 | + * @return null  | 
                                                        |
| 624 | + */  | 
                                                        |
| 625 | 625 | private function _display_cat_form($parents_list)  | 
                                                        
| 626 | 626 |  	{ | 
                                                        
| 627 | 627 | $dir_cat_desc_data = array(  | 
                                                        
@@ -691,11 +691,11 @@ discard block  | 
                                                    ||
| 691 | 691 | }  | 
                                                        
| 692 | 692 | |
| 693 | 693 | /**  | 
                                                        
| 694 | - * Get category details  | 
                                                        |
| 695 | - *  | 
                                                        |
| 696 | - * @param int $cat_id The category ID  | 
                                                        |
| 697 | - * @return array  | 
                                                        |
| 698 | - */  | 
                                                        |
| 694 | + * Get category details  | 
                                                        |
| 695 | + *  | 
                                                        |
| 696 | + * @param int $cat_id The category ID  | 
                                                        |
| 697 | + * @return array  | 
                                                        |
| 698 | + */  | 
                                                        |
| 699 | 699 | private function _get_cat_info($cat_id)  | 
                                                        
| 700 | 700 |  	{ | 
                                                        
| 701 | 701 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next  | 
                                                        
@@ -714,10 +714,10 @@ discard block  | 
                                                    ||
| 714 | 714 | }  | 
                                                        
| 715 | 715 | |
| 716 | 716 | /**  | 
                                                        
| 717 | - * Update category data  | 
                                                        |
| 718 | - *  | 
                                                        |
| 719 | - * @return array  | 
                                                        |
| 720 | - */  | 
                                                        |
| 717 | + * Update category data  | 
                                                        |
| 718 | + *  | 
                                                        |
| 719 | + * @return array  | 
                                                        |
| 720 | + */  | 
                                                        |
| 721 | 721 | private function _update_cat_data()  | 
                                                        
| 722 | 722 |  	{ | 
                                                        
| 723 | 723 | if (!$this->cat_data['cat_name'])  | 
                                                        
@@ -811,14 +811,14 @@ discard block  | 
                                                    ||
| 811 | 811 | }  | 
                                                        
| 812 | 812 | |
| 813 | 813 | /**  | 
                                                        
| 814 | - * Remove complete category  | 
                                                        |
| 815 | - *  | 
                                                        |
| 816 | - * @param string $action_links Action for categories links  | 
                                                        |
| 817 | - * @param string $action_subcats Action for sub-categories  | 
                                                        |
| 818 | - * @param int $links_to_id New category ID for links  | 
                                                        |
| 819 | - * @param int $subcats_to_id New category ID for sub-categories  | 
                                                        |
| 820 | - * @return array  | 
                                                        |
| 821 | - */  | 
                                                        |
| 814 | + * Remove complete category  | 
                                                        |
| 815 | + *  | 
                                                        |
| 816 | + * @param string $action_links Action for categories links  | 
                                                        |
| 817 | + * @param string $action_subcats Action for sub-categories  | 
                                                        |
| 818 | + * @param int $links_to_id New category ID for links  | 
                                                        |
| 819 | + * @param int $subcats_to_id New category ID for sub-categories  | 
                                                        |
| 820 | + * @return array  | 
                                                        |
| 821 | + */  | 
                                                        |
| 822 | 822 | private function _delete_cat($action_links = 'delete', $action_subcats = 'delete', $links_to_id = 0, $subcats_to_id = 0)  | 
                                                        
| 823 | 823 |  	{ | 
                                                        
| 824 | 824 | $this->cat_data = $this->_get_cat_info($this->cat_id);  | 
                                                        
@@ -935,12 +935,12 @@ discard block  | 
                                                    ||
| 935 | 935 | }  | 
                                                        
| 936 | 936 | |
| 937 | 937 | /**  | 
                                                        
| 938 | - * Move category content from one to another forum  | 
                                                        |
| 939 | - *  | 
                                                        |
| 940 | - * @param int $from_id  | 
                                                        |
| 941 | - * @param int $to_id  | 
                                                        |
| 942 | - * @return null  | 
                                                        |
| 943 | - */  | 
                                                        |
| 938 | + * Move category content from one to another forum  | 
                                                        |
| 939 | + *  | 
                                                        |
| 940 | + * @param int $from_id  | 
                                                        |
| 941 | + * @param int $to_id  | 
                                                        |
| 942 | + * @return null  | 
                                                        |
| 943 | + */  | 
                                                        |
| 944 | 944 | private function _move_cat_content($from_id, $to_id)  | 
                                                        
| 945 | 945 |  	{ | 
                                                        
| 946 | 946 | $sql = 'UPDATE ' . $this->links_table . '  | 
                                                        
@@ -956,10 +956,10 @@ discard block  | 
                                                    ||
| 956 | 956 | }  | 
                                                        
| 957 | 957 | |
| 958 | 958 | /**  | 
                                                        
| 959 | - * Delete category content  | 
                                                        |
| 960 | - *  | 
                                                        |
| 961 | - * @return array  | 
                                                        |
| 962 | - */  | 
                                                        |
| 959 | + * Delete category content  | 
                                                        |
| 960 | + *  | 
                                                        |
| 961 | + * @return array  | 
                                                        |
| 962 | + */  | 
                                                        |
| 963 | 963 | private function _delete_cat_content()  | 
                                                        
| 964 | 964 |  	{ | 
                                                        
| 965 | 965 |  		$this->db->sql_transaction('begin'); | 
                                                        
@@ -1018,11 +1018,11 @@ discard block  | 
                                                    ||
| 1018 | 1018 | }  | 
                                                        
| 1019 | 1019 | |
| 1020 | 1020 | /**  | 
                                                        
| 1021 | - * Update links counter  | 
                                                        |
| 1022 | - *  | 
                                                        |
| 1023 | - * @param int $cat_id The category ID  | 
                                                        |
| 1024 | - * @return null  | 
                                                        |
| 1025 | - */  | 
                                                        |
| 1021 | + * Update links counter  | 
                                                        |
| 1022 | + *  | 
                                                        |
| 1023 | + * @param int $cat_id The category ID  | 
                                                        |
| 1024 | + * @return null  | 
                                                        |
| 1025 | + */  | 
                                                        |
| 1026 | 1026 | private function _sync_dir_cat($cat_id)  | 
                                                        
| 1027 | 1027 |  	{ | 
                                                        
| 1028 | 1028 | $sql = 'SELECT COUNT(link_id) AS num_links  | 
                                                        
@@ -1040,12 +1040,12 @@ discard block  | 
                                                    ||
| 1040 | 1040 | }  | 
                                                        
| 1041 | 1041 | |
| 1042 | 1042 | /**  | 
                                                        
| 1043 | - * Update link data (note, vote, comment)  | 
                                                        |
| 1044 | - *  | 
                                                        |
| 1045 | - * @param int $start  | 
                                                        |
| 1046 | - * @param int $stop  | 
                                                        |
| 1047 | - * @return null  | 
                                                        |
| 1048 | - */  | 
                                                        |
| 1043 | + * Update link data (note, vote, comment)  | 
                                                        |
| 1044 | + *  | 
                                                        |
| 1045 | + * @param int $start  | 
                                                        |
| 1046 | + * @param int $stop  | 
                                                        |
| 1047 | + * @return null  | 
                                                        |
| 1048 | + */  | 
                                                        |
| 1049 | 1049 | private function _sync_dir_links($start, $stop)  | 
                                                        
| 1050 | 1050 |  	{ | 
                                                        
| 1051 | 1051 | $sql_ary = array(  | 
                                                        
@@ -1088,12 +1088,12 @@ discard block  | 
                                                    ||
| 1088 | 1088 | }  | 
                                                        
| 1089 | 1089 | |
| 1090 | 1090 | /**  | 
                                                        
| 1091 | - * Display icons drop-down list  | 
                                                        |
| 1092 | - *  | 
                                                        |
| 1093 | - * @param string $icons_path  | 
                                                        |
| 1094 | - * @param string $img_selected  | 
                                                        |
| 1095 | - * @return string  | 
                                                        |
| 1096 | - */  | 
                                                        |
| 1091 | + * Display icons drop-down list  | 
                                                        |
| 1092 | + *  | 
                                                        |
| 1093 | + * @param string $icons_path  | 
                                                        |
| 1094 | + * @param string $img_selected  | 
                                                        |
| 1095 | + * @return string  | 
                                                        |
| 1096 | + */  | 
                                                        |
| 1097 | 1097 | private function _get_dir_icon_list($icons_path, $img_selected)  | 
                                                        
| 1098 | 1098 |  	{ | 
                                                        
| 1099 | 1099 | $imglist = filelist($icons_path, '');  | 
                                                        
@@ -84,23 +84,23 @@ discard block  | 
                                                    ||
| 84 | 84 | */  | 
                                                        
| 85 | 85 | public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category)  | 
                                                        
| 86 | 86 |  	{ | 
                                                        
| 87 | - $this->cache = $cache;  | 
                                                        |
| 88 | - $this->db = $db;  | 
                                                        |
| 89 | - $this->helper = $helper;  | 
                                                        |
| 87 | + $this->cache = $cache;  | 
                                                        |
| 88 | + $this->db = $db;  | 
                                                        |
| 89 | + $this->helper = $helper;  | 
                                                        |
| 90 | 90 | $this->language = $language;  | 
                                                        
| 91 | 91 | $this->phpbb_log = $log;  | 
                                                        
| 92 | - $this->request = $request;  | 
                                                        |
| 92 | + $this->request = $request;  | 
                                                        |
| 93 | 93 | $this->template = $template;  | 
                                                        
| 94 | - $this->user = $user;  | 
                                                        |
| 94 | + $this->user = $user;  | 
                                                        |
| 95 | 95 | $this->categorie = $categorie;  | 
                                                        
| 96 | - $this->nestedset_category = $nestedset_category;  | 
                                                        |
| 96 | + $this->nestedset_category = $nestedset_category;  | 
                                                        |
| 97 | 97 | |
| 98 | 98 | $this->form_key = 'acp_dir_cat';  | 
                                                        
| 99 | 99 | add_form_key($this->form_key);  | 
                                                        
| 100 | 100 | |
| 101 | 101 |  		$this->action		= $this->request->variable('action', ''); | 
                                                        
| 102 | 102 |  		$this->cat_id		= $request->variable('c', 0); | 
                                                        
| 103 | -		$this->parent_id	= $request->variable('parent_id', 0); | 
                                                        |
| 103 | +		$this->parent_id = $request->variable('parent_id', 0); | 
                                                        |
| 104 | 104 |  		$this->update		= ($this->request->is_set_post('update')) ? true : false; | 
                                                        
| 105 | 105 | }  | 
                                                        
| 106 | 106 | |
@@ -150,7 +150,7 @@ discard block  | 
                                                    ||
| 150 | 150 |  	{ | 
                                                        
| 151 | 151 | if (!$this->cat_id)  | 
                                                        
| 152 | 152 |  		{ | 
                                                        
| 153 | -			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); | 
                                                        |
| 153 | +			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); | 
                                                        |
| 154 | 154 | }  | 
                                                        
| 155 | 155 | |
| 156 | 156 | $this->cat_data = $this->_get_cat_info($this->cat_id);  | 
                                                        
@@ -166,7 +166,7 @@ discard block  | 
                                                    ||
| 166 | 166 | $cat_list = $this->categorie->make_cat_select((int) $this->cat_data['parent_id'], $subcats_id);  | 
                                                        
| 167 | 167 | |
| 168 | 168 | $sql = 'SELECT cat_id  | 
                                                        
| 169 | - FROM ' . $this->categories_table . '  | 
                                                        |
| 169 | + FROM ' . $this->categories_table.'  | 
                                                        |
| 170 | 170 | WHERE cat_id <> ' . (int) $this->cat_id;  | 
                                                        
| 171 | 171 | $result = $this->db->sql_query_limit($sql, 1);  | 
                                                        
| 172 | 172 | |
@@ -182,8 +182,8 @@ discard block  | 
                                                    ||
| 182 | 182 | |
| 183 | 183 | $this->template->assign_vars(array(  | 
                                                        
| 184 | 184 | 'S_DELETE_DIR_CAT' => true,  | 
                                                        
| 185 | -			'U_ACTION'				=> $this->u_action . "&parent_id={$parent_id}&action=delete&c=$this->cat_id", | 
                                                        |
| 186 | - 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id,  | 
                                                        |
| 185 | +			'U_ACTION'				=> $this->u_action."&parent_id={$parent_id}&action=delete&c=$this->cat_id", | 
                                                        |
| 186 | + 'U_BACK' => $this->u_action.'&parent_id='.$this->parent_id,  | 
                                                        |
| 187 | 187 | |
| 188 | 188 | 'DIR_CAT_NAME' => $this->cat_data['cat_name'],  | 
                                                        
| 189 | 189 | 'S_HAS_SUBCATS' => ($this->cat_data['right_id'] - $this->cat_data['left_id'] > 1) ? true : false,  | 
                                                        
@@ -234,11 +234,11 @@ discard block  | 
                                                    ||
| 234 | 234 |  	{ | 
                                                        
| 235 | 235 | if (!$this->cat_id)  | 
                                                        
| 236 | 236 |  		{ | 
                                                        
| 237 | -			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); | 
                                                        |
| 237 | +			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); | 
                                                        |
| 238 | 238 | }  | 
                                                        
| 239 | 239 | |
| 240 | 240 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id  | 
                                                        
| 241 | - FROM ' . $this->categories_table . '  | 
                                                        |
| 241 | + FROM ' . $this->categories_table.'  | 
                                                        |
| 242 | 242 | WHERE cat_id = ' . (int) $this->cat_id;  | 
                                                        
| 243 | 243 | $result = $this->db->sql_query($sql);  | 
                                                        
| 244 | 244 | $row = $this->db->sql_fetchrow($result);  | 
                                                        
@@ -246,7 +246,7 @@ discard block  | 
                                                    ||
| 246 | 246 | |
| 247 | 247 | if (!$row)  | 
                                                        
| 248 | 248 |  		{ | 
                                                        
| 249 | -			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); | 
                                                        |
| 249 | +			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); | 
                                                        |
| 250 | 250 | }  | 
                                                        
| 251 | 251 | |
| 252 | 252 | try  | 
                                                        
@@ -260,7 +260,7 @@ discard block  | 
                                                    ||
| 260 | 260 | |
| 261 | 261 | if ($move_cat_name !== false)  | 
                                                        
| 262 | 262 |  		{ | 
                                                        
| 263 | -			$this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_' . strtoupper($this->action), time(), array($row['cat_name'], $move_cat_name)); | 
                                                        |
| 263 | +			$this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_'.strtoupper($this->action), time(), array($row['cat_name'], $move_cat_name)); | 
                                                        |
| 264 | 264 |  			$this->cache->destroy('sql', $this->categories_table); | 
                                                        
| 265 | 265 | }  | 
                                                        
| 266 | 266 | |
@@ -304,13 +304,13 @@ discard block  | 
                                                    ||
| 304 | 304 |  	{ | 
                                                        
| 305 | 305 | if (!$this->cat_id)  | 
                                                        
| 306 | 306 |  		{ | 
                                                        
| 307 | -			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); | 
                                                        |
| 307 | +			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); | 
                                                        |
| 308 | 308 | }  | 
                                                        
| 309 | 309 | |
| 310 | 310 | @set_time_limit(0);  | 
                                                        
| 311 | 311 | |
| 312 | 312 | $sql = 'SELECT cat_name, cat_links  | 
                                                        
| 313 | - FROM ' . $this->categories_table . '  | 
                                                        |
| 313 | + FROM ' . $this->categories_table.'  | 
                                                        |
| 314 | 314 | WHERE cat_id = ' . (int) $this->cat_id;  | 
                                                        
| 315 | 315 | $result = $this->db->sql_query($sql);  | 
                                                        
| 316 | 316 | $row = $this->db->sql_fetchrow($result);  | 
                                                        
@@ -318,12 +318,12 @@ discard block  | 
                                                    ||
| 318 | 318 | |
| 319 | 319 | if (!$row)  | 
                                                        
| 320 | 320 |  		{ | 
                                                        
| 321 | -			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); | 
                                                        |
| 321 | +			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); | 
                                                        |
| 322 | 322 | }  | 
                                                        
| 323 | 323 | |
| 324 | 324 | $sql = 'SELECT MIN(link_id) as min_link_id, MAX(link_id) as max_link_id  | 
                                                        
| 325 | - FROM ' . $this->links_table . '  | 
                                                        |
| 326 | - WHERE link_cat = ' . (int) $this->cat_id . '  | 
                                                        |
| 325 | + FROM ' . $this->links_table.'  | 
                                                        |
| 326 | + WHERE link_cat = ' . (int) $this->cat_id.'  | 
                                                        |
| 327 | 327 | AND link_active = 1';  | 
                                                        
| 328 | 328 | $result = $this->db->sql_query($sql);  | 
                                                        
| 329 | 329 | $row2 = $this->db->sql_fetchrow($result);  | 
                                                        
@@ -345,23 +345,23 @@ discard block  | 
                                                    ||
| 345 | 345 |  		{ | 
                                                        
| 346 | 346 | // We really need to find a way of showing statistics... no progress here  | 
                                                        
| 347 | 347 | $sql = 'SELECT COUNT(link_id) as num_links  | 
                                                        
| 348 | - FROM ' . $this->links_table . '  | 
                                                        |
| 349 | - WHERE link_cat = ' . (int) $this->cat_id . '  | 
                                                        |
| 348 | + FROM ' . $this->links_table.'  | 
                                                        |
| 349 | + WHERE link_cat = ' . (int) $this->cat_id.'  | 
                                                        |
| 350 | 350 | AND link_active = 1  | 
                                                        
| 351 | - AND link_id BETWEEN ' . $start . ' AND ' . $end;  | 
                                                        |
| 351 | + AND link_id BETWEEN ' . $start.' AND '.$end;  | 
                                                        |
| 352 | 352 | $result = $this->db->sql_query($sql);  | 
                                                        
| 353 | 353 |  			$links_done = $this->request->variable('links_done', 0) + (int) $this->db->sql_fetchfield('num_links'); | 
                                                        
| 354 | 354 | $this->db->sql_freeresult($result);  | 
                                                        
| 355 | 355 | |
| 356 | 356 | $start += $batch_size;  | 
                                                        
| 357 | 357 | |
| 358 | -			$url = $this->u_action . "&parent_id={$this->parent_id}&c=$this->cat_id&action=sync&start=$start&links_done=$links_done&total={$row['cat_links']}"; | 
                                                        |
| 358 | +			$url = $this->u_action."&parent_id={$this->parent_id}&c=$this->cat_id&action=sync&start=$start&links_done=$links_done&total={$row['cat_links']}"; | 
                                                        |
| 359 | 359 | |
| 360 | 360 | meta_refresh(0, $url);  | 
                                                        
| 361 | 361 | |
| 362 | 362 | $this->template->assign_vars(array(  | 
                                                        
| 363 | -				'U_PROGRESS_BAR'		=> $this->u_action . "&action=progress_bar&start=$links_done&total={$row['cat_links']}", | 
                                                        |
| 364 | -				'UA_PROGRESS_BAR'		=> addslashes($this->u_action . "&action=progress_bar&start=$links_done&total={$row['cat_links']}"), | 
                                                        |
| 363 | +				'U_PROGRESS_BAR'		=> $this->u_action."&action=progress_bar&start=$links_done&total={$row['cat_links']}", | 
                                                        |
| 364 | +				'UA_PROGRESS_BAR'		=> addslashes($this->u_action."&action=progress_bar&start=$links_done&total={$row['cat_links']}"), | 
                                                        |
| 365 | 365 | 'S_CONTINUE_SYNC' => true,  | 
                                                        
| 366 | 366 |  				'L_PROGRESS_EXPLAIN'	=> $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', $links_done, $row['cat_links'])) | 
                                                        
| 367 | 367 | );  | 
                                                        
@@ -369,12 +369,12 @@ discard block  | 
                                                    ||
| 369 | 369 | return;  | 
                                                        
| 370 | 370 | }  | 
                                                        
| 371 | 371 | |
| 372 | -		$url = $this->u_action . "&parent_id={$this->parent_id}&c=$this->cat_id&action=sync_cat"; | 
                                                        |
| 372 | +		$url = $this->u_action."&parent_id={$this->parent_id}&c=$this->cat_id&action=sync_cat"; | 
                                                        |
| 373 | 373 | meta_refresh(0, $url);  | 
                                                        
| 374 | 374 | |
| 375 | 375 | $this->template->assign_vars(array(  | 
                                                        
| 376 | - 'U_PROGRESS_BAR' => $this->u_action . '&action=progress_bar',  | 
                                                        |
| 377 | - 'UA_PROGRESS_BAR' => addslashes($this->u_action . '&action=progress_bar'),  | 
                                                        |
| 376 | + 'U_PROGRESS_BAR' => $this->u_action.'&action=progress_bar',  | 
                                                        |
| 377 | + 'UA_PROGRESS_BAR' => addslashes($this->u_action.'&action=progress_bar'),  | 
                                                        |
| 378 | 378 | 'S_CONTINUE_SYNC' => true,  | 
                                                        
| 379 | 379 |  			'L_PROGRESS_EXPLAIN'	=> $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', 0, $row['cat_links'])) | 
                                                        
| 380 | 380 | );  | 
                                                        
@@ -390,7 +390,7 @@ discard block  | 
                                                    ||
| 390 | 390 | public function action_sync_cat()  | 
                                                        
| 391 | 391 |  	{ | 
                                                        
| 392 | 392 | $sql = 'SELECT cat_name  | 
                                                        
| 393 | - FROM ' . $this->categories_table . '  | 
                                                        |
| 393 | + FROM ' . $this->categories_table.'  | 
                                                        |
| 394 | 394 | WHERE cat_id = ' . (int) $this->cat_id;  | 
                                                        
| 395 | 395 | $result = $this->db->sql_query($sql);  | 
                                                        
| 396 | 396 | $row = $this->db->sql_fetchrow($result);  | 
                                                        
@@ -398,7 +398,7 @@ discard block  | 
                                                    ||
| 398 | 398 | |
| 399 | 399 | if (!$row)  | 
                                                        
| 400 | 400 |  		{ | 
                                                        
| 401 | -			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); | 
                                                        |
| 401 | +			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); | 
                                                        |
| 402 | 402 | }  | 
                                                        
| 403 | 403 | |
| 404 | 404 | $this->_sync_dir_cat($this->cat_id);  | 
                                                        
@@ -423,7 +423,7 @@ discard block  | 
                                                    ||
| 423 | 423 | }  | 
                                                        
| 424 | 424 | else  | 
                                                        
| 425 | 425 |  		{ | 
                                                        
| 426 | -			$navigation = '<a href="' . $this->u_action . '">' . $this->language->lang('DIR_INDEX') . '</a>'; | 
                                                        |
| 426 | +			$navigation = '<a href="'.$this->u_action.'">'.$this->language->lang('DIR_INDEX').'</a>'; | 
                                                        |
| 427 | 427 | |
| 428 | 428 | $cats_nav = $this->nestedset_category->get_path_data($this->parent_id);  | 
                                                        
| 429 | 429 | |
@@ -431,11 +431,11 @@ discard block  | 
                                                    ||
| 431 | 431 |  			{ | 
                                                        
| 432 | 432 | if ($row['cat_id'] == $this->parent_id)  | 
                                                        
| 433 | 433 |  				{ | 
                                                        
| 434 | - $navigation .= ' -> ' . $row['cat_name'];  | 
                                                        |
| 434 | + $navigation .= ' -> '.$row['cat_name'];  | 
                                                        |
| 435 | 435 | }  | 
                                                        
| 436 | 436 | else  | 
                                                        
| 437 | 437 |  				{ | 
                                                        
| 438 | - $navigation .= ' -> <a href="' . $this->u_action . '&parent_id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a>';  | 
                                                        |
| 438 | + $navigation .= ' -> <a href="'.$this->u_action.'&parent_id='.$row['cat_id'].'">'.$row['cat_name'].'</a>';  | 
                                                        |
| 439 | 439 | }  | 
                                                        
| 440 | 440 | }  | 
                                                        
| 441 | 441 | }  | 
                                                        
@@ -449,8 +449,8 @@ discard block  | 
                                                    ||
| 449 | 449 | }  | 
                                                        
| 450 | 450 | |
| 451 | 451 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_name, cat_icon, cat_desc_uid, cat_desc_bitfield, cat_desc, cat_desc_options, cat_links  | 
                                                        
| 452 | - FROM ' . $this->categories_table . '  | 
                                                        |
| 453 | - WHERE parent_id = ' . (int) $this->parent_id . '  | 
                                                        |
| 452 | + FROM ' . $this->categories_table.'  | 
                                                        |
| 453 | + WHERE parent_id = ' . (int) $this->parent_id.'  | 
                                                        |
| 454 | 454 | ORDER BY left_id';  | 
                                                        
| 455 | 455 | $result = $this->db->sql_query($sql);  | 
                                                        
| 456 | 456 | |
@@ -458,23 +458,23 @@ discard block  | 
                                                    ||
| 458 | 458 |  		{ | 
                                                        
| 459 | 459 | do  | 
                                                        
| 460 | 460 |  			{ | 
                                                        
| 461 | -				$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="' . $this->language->lang('DIR_SUBCAT') . '" />' : '<img src="images/icon_folder.gif" alt="' . $this->language->lang('FOLDER') . '" />'; | 
                                                        |
| 461 | +				$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="'.$this->language->lang('DIR_SUBCAT').'" />' : '<img src="images/icon_folder.gif" alt="'.$this->language->lang('FOLDER').'" />'; | 
                                                        |
| 462 | 462 | |
| 463 | -				$url = $this->u_action . "&parent_id=$this->parent_id&c={$row['cat_id']}"; | 
                                                        |
| 463 | +				$url = $this->u_action."&parent_id=$this->parent_id&c={$row['cat_id']}"; | 
                                                        |
| 464 | 464 | |
| 465 | 465 |  				$this->template->assign_block_vars('cats', array( | 
                                                        
| 466 | 466 | 'FOLDER_IMAGE' => $folder_image,  | 
                                                        
| 467 | -					'CAT_IMAGE'			=> ($row['cat_icon']) ? '<img src="' . $this->get_img_path('icons', $row['cat_icon']) . '" alt="" />' : '', | 
                                                        |
| 467 | +					'CAT_IMAGE'			=> ($row['cat_icon']) ? '<img src="'.$this->get_img_path('icons', $row['cat_icon']).'" alt="" />' : '', | 
                                                        |
| 468 | 468 | 'CAT_NAME' => $row['cat_name'],  | 
                                                        
| 469 | 469 | 'CAT_DESCRIPTION' => generate_text_for_display($row['cat_desc'], $row['cat_desc_uid'], $row['cat_desc_bitfield'], $row['cat_desc_options']),  | 
                                                        
| 470 | 470 | 'CAT_LINKS' => $row['cat_links'],  | 
                                                        
| 471 | 471 | |
| 472 | - 'U_CAT' => $this->u_action . '&parent_id=' . $row['cat_id'],  | 
                                                        |
| 473 | - 'U_MOVE_UP' => $url . '&action=move_up',  | 
                                                        |
| 474 | - 'U_MOVE_DOWN' => $url . '&action=move_down',  | 
                                                        |
| 475 | - 'U_EDIT' => $url . '&action=edit',  | 
                                                        |
| 476 | - 'U_DELETE' => $url . '&action=delete',  | 
                                                        |
| 477 | - 'U_SYNC' => $url . '&action=sync')  | 
                                                        |
| 472 | + 'U_CAT' => $this->u_action.'&parent_id='.$row['cat_id'],  | 
                                                        |
| 473 | + 'U_MOVE_UP' => $url.'&action=move_up',  | 
                                                        |
| 474 | + 'U_MOVE_DOWN' => $url.'&action=move_down',  | 
                                                        |
| 475 | + 'U_EDIT' => $url.'&action=edit',  | 
                                                        |
| 476 | + 'U_DELETE' => $url.'&action=delete',  | 
                                                        |
| 477 | + 'U_SYNC' => $url.'&action=sync')  | 
                                                        |
| 478 | 478 | );  | 
                                                        
| 479 | 479 | }  | 
                                                        
| 480 | 480 | while ($row = $this->db->sql_fetchrow($result));  | 
                                                        
@@ -483,14 +483,14 @@ discard block  | 
                                                    ||
| 483 | 483 |  		{ | 
                                                        
| 484 | 484 | $row = $this->_get_cat_info($this->parent_id);  | 
                                                        
| 485 | 485 | |
| 486 | - $url = $this->u_action . '&parent_id=' . $this->parent_id . '&c=' . $row['cat_id'];  | 
                                                        |
| 486 | + $url = $this->u_action.'&parent_id='.$this->parent_id.'&c='.$row['cat_id'];  | 
                                                        |
| 487 | 487 | |
| 488 | 488 | $this->template->assign_vars(array(  | 
                                                        
| 489 | 489 | 'S_NO_CATS' => true,  | 
                                                        
| 490 | 490 | |
| 491 | - 'U_EDIT' => $url . '&action=edit',  | 
                                                        |
| 492 | - 'U_DELETE' => $url . '&action=delete',  | 
                                                        |
| 493 | - 'U_SYNC' => $url . '&action=sync')  | 
                                                        |
| 491 | + 'U_EDIT' => $url.'&action=edit',  | 
                                                        |
| 492 | + 'U_DELETE' => $url.'&action=delete',  | 
                                                        |
| 493 | + 'U_SYNC' => $url.'&action=sync')  | 
                                                        |
| 494 | 494 | );  | 
                                                        
| 495 | 495 | }  | 
                                                        
| 496 | 496 | $this->db->sql_freeresult($result);  | 
                                                        
@@ -500,10 +500,10 @@ discard block  | 
                                                    ||
| 500 | 500 | 'NAVIGATION' => $navigation,  | 
                                                        
| 501 | 501 | 'CAT_BOX' => $cat_box,  | 
                                                        
| 502 | 502 | 'U_SEL_ACTION' => $this->u_action,  | 
                                                        
| 503 | - 'U_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id,  | 
                                                        |
| 503 | + 'U_ACTION' => $this->u_action.'&parent_id='.$this->parent_id,  | 
                                                        |
| 504 | 504 | |
| 505 | - 'U_PROGRESS_BAR' => $this->u_action . '&action=progress_bar',  | 
                                                        |
| 506 | - 'UA_PROGRESS_BAR' => addslashes($this->u_action . '&action=progress_bar'),  | 
                                                        |
| 505 | + 'U_PROGRESS_BAR' => $this->u_action.'&action=progress_bar',  | 
                                                        |
| 506 | + 'UA_PROGRESS_BAR' => addslashes($this->u_action.'&action=progress_bar'),  | 
                                                        |
| 507 | 507 | ));  | 
                                                        
| 508 | 508 | }  | 
                                                        
| 509 | 509 | |
@@ -535,10 +535,10 @@ discard block  | 
                                                    ||
| 535 | 535 | switch ($this->action)  | 
                                                        
| 536 | 536 |  		{ | 
                                                        
| 537 | 537 | case 'delete':  | 
                                                        
| 538 | -				$action_subcats	= $this->request->variable('action_subcats', ''); | 
                                                        |
| 539 | -				$subcats_to_id	= $this->request->variable('subcats_to_id', 0); | 
                                                        |
| 540 | -				$action_links	= $this->request->variable('action_links', ''); | 
                                                        |
| 541 | -				$links_to_id	= $this->request->variable('links_to_id', 0); | 
                                                        |
| 538 | +				$action_subcats = $this->request->variable('action_subcats', ''); | 
                                                        |
| 539 | +				$subcats_to_id = $this->request->variable('subcats_to_id', 0); | 
                                                        |
| 540 | +				$action_links = $this->request->variable('action_links', ''); | 
                                                        |
| 541 | +				$links_to_id = $this->request->variable('links_to_id', 0); | 
                                                        |
| 542 | 542 | |
| 543 | 543 | try  | 
                                                        
| 544 | 544 |  				{ | 
                                                        
@@ -556,7 +556,7 @@ discard block  | 
                                                    ||
| 556 | 556 | |
| 557 | 557 |  				$this->cache->destroy('sql', $this->categories_table); | 
                                                        
| 558 | 558 | |
| 559 | -				trigger_error($this->language->lang('DIR_CAT_DELETED') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); | 
                                                        |
| 559 | +				trigger_error($this->language->lang('DIR_CAT_DELETED').adm_back_link($this->u_action.'&parent_id='.$this->parent_id)); | 
                                                        |
| 560 | 560 | |
| 561 | 561 | break;  | 
                                                        
| 562 | 562 | |
@@ -609,7 +609,7 @@ discard block  | 
                                                    ||
| 609 | 609 | |
| 610 | 610 |  					$message = ($this->action == 'add') ? $this->language->lang('DIR_CAT_CREATED') : $this->language->lang('DIR_CAT_UPDATED'); | 
                                                        
| 611 | 611 | |
| 612 | - trigger_error($message . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));  | 
                                                        |
| 612 | + trigger_error($message.adm_back_link($this->u_action.'&parent_id='.$this->parent_id));  | 
                                                        |
| 613 | 613 | }  | 
                                                        
| 614 | 614 | |
| 615 | 615 | break;  | 
                                                        
@@ -654,10 +654,10 @@ discard block  | 
                                                    ||
| 654 | 654 | 'S_CAT_PARENT_ID' => $this->cat_data['parent_id'],  | 
                                                        
| 655 | 655 | 'S_ADD_ACTION' => ($this->action == 'add') ? true : false,  | 
                                                        
| 656 | 656 | |
| 657 | - 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id,  | 
                                                        |
| 658 | -			'U_EDIT_ACTION'		=> $this->u_action . "&parent_id={$this->parent_id}&action=$this->action&c=$this->cat_id", | 
                                                        |
| 657 | + 'U_BACK' => $this->u_action.'&parent_id='.$this->parent_id,  | 
                                                        |
| 658 | +			'U_EDIT_ACTION'		=> $this->u_action."&parent_id={$this->parent_id}&action=$this->action&c=$this->cat_id", | 
                                                        |
| 659 | 659 | |
| 660 | -			'L_TITLE'					=> $this->language->lang('DIR_' . strtoupper($this->action) . '_CAT'), | 
                                                        |
| 660 | +			'L_TITLE'					=> $this->language->lang('DIR_'.strtoupper($this->action).'_CAT'), | 
                                                        |
| 661 | 661 |  			'ERROR_MSG'					=> (sizeof($this->errors)) ? implode('<br />', $this->errors) : '', | 
                                                        
| 662 | 662 |  			'ICON_IMAGE'				=> ($this->cat_data['cat_icon']) ? $this->get_img_path('icons', $this->cat_data['cat_icon']) : 'images/spacer.gif', | 
                                                        
| 663 | 663 | |
@@ -699,7 +699,7 @@ discard block  | 
                                                    ||
| 699 | 699 | private function _get_cat_info($cat_id)  | 
                                                        
| 700 | 700 |  	{ | 
                                                        
| 701 | 701 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next  | 
                                                        
| 702 | - FROM ' . $this->categories_table . '  | 
                                                        |
| 702 | + FROM ' . $this->categories_table.'  | 
                                                        |
| 703 | 703 | WHERE cat_id = ' . (int) $cat_id;  | 
                                                        
| 704 | 704 | $result = $this->db->sql_query($sql);  | 
                                                        
| 705 | 705 | $row = $this->db->sql_fetchrow($result);  | 
                                                        
@@ -762,7 +762,7 @@ discard block  | 
                                                    ||
| 762 | 762 |  		{ | 
                                                        
| 763 | 763 | if ($cat_data_sql['cat_cron_enable'])  | 
                                                        
| 764 | 764 |  			{ | 
                                                        
| 765 | - $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400;  | 
                                                        |
| 765 | + $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400;  | 
                                                        |
| 766 | 766 | }  | 
                                                        
| 767 | 767 | |
| 768 | 768 | $this->cat_data = $this->nestedset_category->insert($cat_data_sql);  | 
                                                        
@@ -785,13 +785,13 @@ discard block  | 
                                                    ||
| 785 | 785 | |
| 786 | 786 | if ($cat_data_sql['cat_cron_enable'] && ($row['cat_cron_freq'] != $cat_data_sql['cat_cron_freq'] || !$row['cat_cron_enable']))  | 
                                                        
| 787 | 787 |  			{ | 
                                                        
| 788 | - $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400;  | 
                                                        |
| 788 | + $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400;  | 
                                                        |
| 789 | 789 | }  | 
                                                        
| 790 | 790 | |
| 791 | 791 | if ($row['cat_name'] != $cat_data_sql['cat_name'])  | 
                                                        
| 792 | 792 |  			{ | 
                                                        
| 793 | 793 | // the cat name has changed, clear the parents list of all categories (for safety)  | 
                                                        
| 794 | - $sql = 'UPDATE ' . $this->categories_table . "  | 
                                                        |
| 794 | + $sql = 'UPDATE '.$this->categories_table."  | 
                                                        |
| 795 | 795 | SET cat_parents = ''";  | 
                                                        
| 796 | 796 | $this->db->sql_query($sql);  | 
                                                        
| 797 | 797 | }  | 
                                                        
@@ -799,8 +799,8 @@ discard block  | 
                                                    ||
| 799 | 799 | // Setting the cat id to the categorie id is not really received well by some dbs. ;)  | 
                                                        
| 800 | 800 | unset($cat_data_sql['cat_id']);  | 
                                                        
| 801 | 801 | |
| 802 | - $sql = 'UPDATE ' . $this->categories_table . '  | 
                                                        |
| 803 | -				SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql) . ' | 
                                                        |
| 802 | + $sql = 'UPDATE '.$this->categories_table.'  | 
                                                        |
| 803 | +				SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql).' | 
                                                        |
| 804 | 804 | WHERE cat_id = ' . (int) $this->cat_id;  | 
                                                        
| 805 | 805 | $this->db->sql_query($sql);  | 
                                                        
| 806 | 806 | |
@@ -841,7 +841,7 @@ discard block  | 
                                                    ||
| 841 | 841 | $log_action_links = 'MOVE_LINKS';  | 
                                                        
| 842 | 842 | |
| 843 | 843 | $sql = 'SELECT cat_name  | 
                                                        
| 844 | - FROM ' . $this->categories_table . '  | 
                                                        |
| 844 | + FROM ' . $this->categories_table.'  | 
                                                        |
| 845 | 845 | WHERE cat_id = ' . (int) $links_to_id;  | 
                                                        
| 846 | 846 | $result = $this->db->sql_query($sql);  | 
                                                        
| 847 | 847 | $row = $this->db->sql_fetchrow($result);  | 
                                                        
@@ -943,12 +943,12 @@ discard block  | 
                                                    ||
| 943 | 943 | */  | 
                                                        
| 944 | 944 | private function _move_cat_content($from_id, $to_id)  | 
                                                        
| 945 | 945 |  	{ | 
                                                        
| 946 | - $sql = 'UPDATE ' . $this->links_table . '  | 
                                                        |
| 947 | - SET link_cat = ' . (int) $to_id . '  | 
                                                        |
| 946 | + $sql = 'UPDATE '.$this->links_table.'  | 
                                                        |
| 947 | + SET link_cat = ' . (int) $to_id.'  | 
                                                        |
| 948 | 948 | WHERE link_cat = ' . (int) $from_id;  | 
                                                        
| 949 | 949 | $this->db->sql_query($sql);  | 
                                                        
| 950 | 950 | |
| 951 | - $sql = 'DELETE FROM ' . $this->watch_table . '  | 
                                                        |
| 951 | + $sql = 'DELETE FROM '.$this->watch_table.'  | 
                                                        |
| 952 | 952 | WHERE cat_id = ' . (int) $from_id;  | 
                                                        
| 953 | 953 | $this->db->sql_query($sql);  | 
                                                        
| 954 | 954 | |
@@ -966,7 +966,7 @@ discard block  | 
                                                    ||
| 966 | 966 | |
| 967 | 967 | // Before we remove anything we make sure we are able to adjust the post counts later. ;)  | 
                                                        
| 968 | 968 | $sql = 'SELECT link_id, link_banner  | 
                                                        
| 969 | - FROM ' . $this->links_table . '  | 
                                                        |
| 969 | + FROM ' . $this->links_table.'  | 
                                                        |
| 970 | 970 | WHERE link_cat = ' . (int) $this->cat_id;  | 
                                                        
| 971 | 971 | $result = $this->db->sql_query($sql);  | 
                                                        
| 972 | 972 | |
@@ -997,7 +997,7 @@ discard block  | 
                                                    ||
| 997 | 997 | |
| 998 | 998 | foreach ($link_datas_ary as $table => $field)  | 
                                                        
| 999 | 999 |  			{ | 
                                                        
| 1000 | -				$this->db->sql_query("DELETE FROM $table WHERE " . $this->db->sql_in_set($field, $link_ids)); | 
                                                        |
| 1000 | +				$this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $link_ids)); | 
                                                        |
| 1001 | 1001 | }  | 
                                                        
| 1002 | 1002 | }  | 
                                                        
| 1003 | 1003 | |
@@ -1009,7 +1009,7 @@ discard block  | 
                                                    ||
| 1009 | 1009 | |
| 1010 | 1010 | foreach ($cat_datas_ary as $table => $field)  | 
                                                        
| 1011 | 1011 |  		{ | 
                                                        
| 1012 | -			$this->db->sql_query("DELETE FROM $table WHERE $field = " . (int) $this->cat_id); | 
                                                        |
| 1012 | +			$this->db->sql_query("DELETE FROM $table WHERE $field = ".(int) $this->cat_id); | 
                                                        |
| 1013 | 1013 | }  | 
                                                        
| 1014 | 1014 | |
| 1015 | 1015 |  		$this->db->sql_transaction('commit'); | 
                                                        
@@ -1026,15 +1026,15 @@ discard block  | 
                                                    ||
| 1026 | 1026 | private function _sync_dir_cat($cat_id)  | 
                                                        
| 1027 | 1027 |  	{ | 
                                                        
| 1028 | 1028 | $sql = 'SELECT COUNT(link_id) AS num_links  | 
                                                        
| 1029 | - FROM ' . $this->links_table . '  | 
                                                        |
| 1030 | - WHERE link_cat = ' . (int) $cat_id . '  | 
                                                        |
| 1029 | + FROM ' . $this->links_table.'  | 
                                                        |
| 1030 | + WHERE link_cat = ' . (int) $cat_id.'  | 
                                                        |
| 1031 | 1031 | AND link_active = 1';  | 
                                                        
| 1032 | 1032 | $result = $this->db->sql_query($sql);  | 
                                                        
| 1033 | 1033 |  		$total_links = (int) $this->db->sql_fetchfield('num_links'); | 
                                                        
| 1034 | 1034 | $this->db->sql_freeresult($result);  | 
                                                        
| 1035 | 1035 | |
| 1036 | - $sql = 'UPDATE ' . $this->categories_table . '  | 
                                                        |
| 1037 | - SET cat_links = ' . $total_links . '  | 
                                                        |
| 1036 | + $sql = 'UPDATE '.$this->categories_table.'  | 
                                                        |
| 1037 | + SET cat_links = ' . $total_links.'  | 
                                                        |
| 1038 | 1038 | WHERE cat_id = ' . (int) $cat_id;  | 
                                                        
| 1039 | 1039 | $this->db->sql_query($sql);  | 
                                                        
| 1040 | 1040 | }  | 
                                                        
@@ -1054,33 +1054,33 @@ discard block  | 
                                                    ||
| 1054 | 1054 | 'link_vote' => 0,  | 
                                                        
| 1055 | 1055 | );  | 
                                                        
| 1056 | 1056 | |
| 1057 | - $sql = 'UPDATE ' . $this->links_table . '  | 
                                                        |
| 1058 | -			SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' | 
                                                        |
| 1059 | - WHERE link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop;  | 
                                                        |
| 1057 | + $sql = 'UPDATE '.$this->links_table.'  | 
                                                        |
| 1058 | +			SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' | 
                                                        |
| 1059 | + WHERE link_id BETWEEN ' . (int) $start.' AND '.(int) $stop;  | 
                                                        |
| 1060 | 1060 | $this->db->sql_query($sql);  | 
                                                        
| 1061 | 1061 | |
| 1062 | - $sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM ' . $this->votes_table . '  | 
                                                        |
| 1063 | - WHERE vote_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . '  | 
                                                        |
| 1062 | + $sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM '.$this->votes_table.'  | 
                                                        |
| 1063 | + WHERE vote_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.'  | 
                                                        |
| 1064 | 1064 | GROUP BY vote_link_id';  | 
                                                        
| 1065 | 1065 | $result = $this->db->sql_query($sql);  | 
                                                        
| 1066 | 1066 | while ($tmp = $this->db->sql_fetchrow($result))  | 
                                                        
| 1067 | 1067 |  		{ | 
                                                        
| 1068 | - $sql = 'UPDATE ' . $this->links_table . '  | 
                                                        |
| 1069 | - SET link_note = ' . (int) $tmp['total'] . ', link_vote = ' . (int) $tmp['nb_vote'] . '  | 
                                                        |
| 1068 | + $sql = 'UPDATE '.$this->links_table.'  | 
                                                        |
| 1069 | + SET link_note = ' . (int) $tmp['total'].', link_vote = '.(int) $tmp['nb_vote'].'  | 
                                                        |
| 1070 | 1070 | WHERE link_id = ' . (int) $tmp['vote_link_id'];  | 
                                                        
| 1071 | 1071 | $this->db->sql_query($sql);  | 
                                                        
| 1072 | 1072 | }  | 
                                                        
| 1073 | 1073 | $this->db->sql_freeresult($result);  | 
                                                        
| 1074 | 1074 | |
| 1075 | 1075 | $sql = 'SELECT comment_link_id, COUNT(comment_id) AS nb_comment  | 
                                                        
| 1076 | - FROM ' . $this->comments_table . '  | 
                                                        |
| 1077 | - WHERE comment_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . '  | 
                                                        |
| 1076 | + FROM ' . $this->comments_table.'  | 
                                                        |
| 1077 | + WHERE comment_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.'  | 
                                                        |
| 1078 | 1078 | GROUP BY comment_link_id';  | 
                                                        
| 1079 | 1079 | $result = $this->db->sql_query($sql);  | 
                                                        
| 1080 | 1080 | while ($tmp = $this->db->sql_fetchrow($result))  | 
                                                        
| 1081 | 1081 |  		{ | 
                                                        
| 1082 | - $sql = 'UPDATE ' . $this->links_table . '  | 
                                                        |
| 1083 | - SET link_comment = ' . (int) $tmp['nb_comment'] . '  | 
                                                        |
| 1082 | + $sql = 'UPDATE '.$this->links_table.'  | 
                                                        |
| 1083 | + SET link_comment = ' . (int) $tmp['nb_comment'].'  | 
                                                        |
| 1084 | 1084 | WHERE link_id = ' . (int) $tmp['comment_link_id'];  | 
                                                        
| 1085 | 1085 | $this->db->sql_query($sql);  | 
                                                        
| 1086 | 1086 | }  | 
                                                        
@@ -1105,7 +1105,7 @@ discard block  | 
                                                    ||
| 1105 | 1105 | |
| 1106 | 1106 | foreach ($img_ary as $img)  | 
                                                        
| 1107 | 1107 |  			{ | 
                                                        
| 1108 | - $img = $path . $img;  | 
                                                        |
| 1108 | + $img = $path.$img;  | 
                                                        |
| 1109 | 1109 | $selected = '';  | 
                                                        
| 1110 | 1110 | |
| 1111 | 1111 | if (strlen($img) > 255)  | 
                                                        
@@ -1118,7 +1118,7 @@ discard block  | 
                                                    ||
| 1118 | 1118 | $selected = ' selected="selected"';  | 
                                                        
| 1119 | 1119 | }  | 
                                                        
| 1120 | 1120 | |
| 1121 | - $filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';  | 
                                                        |
| 1121 | + $filename_list .= '<option value="'.htmlspecialchars($img).'"'.$selected.'>'.$img.'</option>';  | 
                                                        |
| 1122 | 1122 | }  | 
                                                        
| 1123 | 1123 | }  | 
                                                        
| 1124 | 1124 | |
@@ -30,13 +30,13 @@ discard block  | 
                                                    ||
| 30 | 30 | protected $u_action;  | 
                                                        
| 31 | 31 | |
| 32 | 32 | /**  | 
                                                        
| 33 | - * Constructor  | 
                                                        |
| 34 | - *  | 
                                                        |
| 35 | - * @param \phpbb\db\driver\driver_interface $db Database object  | 
                                                        |
| 36 | - * @param \phpbb\language\language $language Language object  | 
                                                        |
| 37 | - * @param \phpbb\request\request $request Request object  | 
                                                        |
| 38 | - * @param \phpbb\template\template $template Template object  | 
                                                        |
| 39 | - */  | 
                                                        |
| 33 | + * Constructor  | 
                                                        |
| 34 | + *  | 
                                                        |
| 35 | + * @param \phpbb\db\driver\driver_interface $db Database object  | 
                                                        |
| 36 | + * @param \phpbb\language\language $language Language object  | 
                                                        |
| 37 | + * @param \phpbb\request\request $request Request object  | 
                                                        |
| 38 | + * @param \phpbb\template\template $template Template object  | 
                                                        |
| 39 | + */  | 
                                                        |
| 40 | 40 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, \phpbb\request\request $request, \phpbb\template\template $template)  | 
                                                        
| 41 | 41 |  	{ | 
                                                        
| 42 | 42 | $this->db = $db;  | 
                                                        
@@ -46,11 +46,11 @@ discard block  | 
                                                    ||
| 46 | 46 | }  | 
                                                        
| 47 | 47 | |
| 48 | 48 | /**  | 
                                                        
| 49 | - * Display confirm box  | 
                                                        |
| 50 | - *  | 
                                                        |
| 51 | - * @param string $action Requested action  | 
                                                        |
| 52 | - * @return null  | 
                                                        |
| 53 | - */  | 
                                                        |
| 49 | + * Display confirm box  | 
                                                        |
| 50 | + *  | 
                                                        |
| 51 | + * @param string $action Requested action  | 
                                                        |
| 52 | + * @return null  | 
                                                        |
| 53 | + */  | 
                                                        |
| 54 | 54 | public function display_confirm($action)  | 
                                                        
| 55 | 55 |  	{ | 
                                                        
| 56 | 56 | switch ($action)  | 
                                                        
@@ -88,10 +88,10 @@ discard block  | 
                                                    ||
| 88 | 88 | }  | 
                                                        
| 89 | 89 | |
| 90 | 90 | /**  | 
                                                        
| 91 | - * Display phpBB Directory statistics  | 
                                                        |
| 92 | - *  | 
                                                        |
| 93 | - * @return null  | 
                                                        |
| 94 | - */  | 
                                                        |
| 91 | + * Display phpBB Directory statistics  | 
                                                        |
| 92 | + *  | 
                                                        |
| 93 | + * @return null  | 
                                                        |
| 94 | + */  | 
                                                        |
| 95 | 95 | public function display_stats()  | 
                                                        
| 96 | 96 |  	{ | 
                                                        
| 97 | 97 | // Count number of categories  | 
                                                        
@@ -178,11 +178,11 @@ discard block  | 
                                                    ||
| 178 | 178 | }  | 
                                                        
| 179 | 179 | |
| 180 | 180 | /**  | 
                                                        
| 181 | - * Execute action requested  | 
                                                        |
| 182 | - *  | 
                                                        |
| 183 | - * @param string $action Requested action  | 
                                                        |
| 184 | - * @return null  | 
                                                        |
| 185 | - */  | 
                                                        |
| 181 | + * Execute action requested  | 
                                                        |
| 182 | + *  | 
                                                        |
| 183 | + * @param string $action Requested action  | 
                                                        |
| 184 | + * @return null  | 
                                                        |
| 185 | + */  | 
                                                        |
| 186 | 186 | public function exec_action($action)  | 
                                                        
| 187 | 187 |  	{ | 
                                                        
| 188 | 188 | switch ($action)  | 
                                                        
@@ -257,23 +257,23 @@ discard block  | 
                                                    ||
| 257 | 257 | }  | 
                                                        
| 258 | 258 | |
| 259 | 259 | /**  | 
                                                        
| 260 | - * Set page url  | 
                                                        |
| 261 | - *  | 
                                                        |
| 262 | - * @param string $u_action Custom form action  | 
                                                        |
| 263 | - * @return null  | 
                                                        |
| 264 | - * @access public  | 
                                                        |
| 265 | - */  | 
                                                        |
| 260 | + * Set page url  | 
                                                        |
| 261 | + *  | 
                                                        |
| 262 | + * @param string $u_action Custom form action  | 
                                                        |
| 263 | + * @return null  | 
                                                        |
| 264 | + * @access public  | 
                                                        |
| 265 | + */  | 
                                                        |
| 266 | 266 | public function set_page_url($u_action)  | 
                                                        
| 267 | 267 |  	{ | 
                                                        
| 268 | 268 | $this->u_action = $u_action;  | 
                                                        
| 269 | 269 | }  | 
                                                        
| 270 | 270 | |
| 271 | 271 | /**  | 
                                                        
| 272 | - * Get orphan banners  | 
                                                        |
| 273 | - *  | 
                                                        |
| 274 | - * @param bool $delete True if we want to delete banners, else false  | 
                                                        |
| 275 | - * @return null|int Number of orphan files, else null  | 
                                                        |
| 276 | - */  | 
                                                        |
| 272 | + * Get orphan banners  | 
                                                        |
| 273 | + *  | 
                                                        |
| 274 | + * @param bool $delete True if we want to delete banners, else false  | 
                                                        |
| 275 | + * @return null|int Number of orphan files, else null  | 
                                                        |
| 276 | + */  | 
                                                        |
| 277 | 277 | private function _orphan_files($delete = false)  | 
                                                        
| 278 | 278 |  	{ | 
                                                        
| 279 | 279 | $banner_path = $this->get_banner_path();  | 
                                                        
@@ -39,10 +39,10 @@ discard block  | 
                                                    ||
| 39 | 39 | */  | 
                                                        
| 40 | 40 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, \phpbb\request\request $request, \phpbb\template\template $template)  | 
                                                        
| 41 | 41 |  	{ | 
                                                        
| 42 | - $this->db = $db;  | 
                                                        |
| 42 | + $this->db = $db;  | 
                                                        |
| 43 | 43 | $this->language = $language;  | 
                                                        
| 44 | 44 | $this->template = $template;  | 
                                                        
| 45 | - $this->request = $request;  | 
                                                        |
| 45 | + $this->request = $request;  | 
                                                        |
| 46 | 46 | }  | 
                                                        
| 47 | 47 | |
| 48 | 48 | /**  | 
                                                        
@@ -148,7 +148,7 @@ discard block  | 
                                                    ||
| 148 | 148 |  			{ | 
                                                        
| 149 | 149 | if ($file[0] != '.' && $file[0] != '..' && strpos($file, 'index.') === false && strpos($file, '.db') === false)  | 
                                                        
| 150 | 150 |  				{ | 
                                                        
| 151 | - $banners_dir_size += filesize($banners_path . $file);  | 
                                                        |
| 151 | + $banners_dir_size += filesize($banners_path.$file);  | 
                                                        |
| 152 | 152 | }  | 
                                                        
| 153 | 153 | }  | 
                                                        
| 154 | 154 | closedir($banners_dir);  | 
                                                        
@@ -167,7 +167,7 @@ discard block  | 
                                                    ||
| 167 | 167 | 'U_ACTION' => $this->u_action,  | 
                                                        
| 168 | 168 | |
| 169 | 169 | 'TOTAL_CATS' => $total_cats,  | 
                                                        
| 170 | - 'TOTAL_LINKS' => $total_links-$waiting_links,  | 
                                                        |
| 170 | + 'TOTAL_LINKS' => $total_links - $waiting_links,  | 
                                                        |
| 171 | 171 | 'WAITING_LINKS' => $waiting_links,  | 
                                                        
| 172 | 172 | 'TOTAL_COMMENTS' => $total_comments,  | 
                                                        
| 173 | 173 | 'TOTAL_VOTES' => $total_votes,  | 
                                                        
@@ -192,15 +192,15 @@ discard block  | 
                                                    ||
| 192 | 192 |  				{ | 
                                                        
| 193 | 193 | case 'sqlite':  | 
                                                        
| 194 | 194 | case 'firebird':  | 
                                                        
| 195 | -						$this->db->sql_query('DELETE FROM ' . $this->votes_table); | 
                                                        |
| 195 | +						$this->db->sql_query('DELETE FROM '.$this->votes_table); | 
                                                        |
| 196 | 196 | break;  | 
                                                        
| 197 | 197 | |
| 198 | 198 | default:  | 
                                                        
| 199 | -						$this->db->sql_query('TRUNCATE TABLE ' . $this->votes_table); | 
                                                        |
| 199 | +						$this->db->sql_query('TRUNCATE TABLE '.$this->votes_table); | 
                                                        |
| 200 | 200 | break;  | 
                                                        
| 201 | 201 | }  | 
                                                        
| 202 | 202 | |
| 203 | - $sql = 'UPDATE ' . $this->links_table . '  | 
                                                        |
| 203 | + $sql = 'UPDATE '.$this->links_table.'  | 
                                                        |
| 204 | 204 | SET link_vote = 0, link_note = 0';  | 
                                                        
| 205 | 205 | $this->db->sql_query($sql);  | 
                                                        
| 206 | 206 | |
@@ -215,15 +215,15 @@ discard block  | 
                                                    ||
| 215 | 215 |  				{ | 
                                                        
| 216 | 216 | case 'sqlite':  | 
                                                        
| 217 | 217 | case 'firebird':  | 
                                                        
| 218 | -						$this->db->sql_query('DELETE FROM ' . $this->comments_table); | 
                                                        |
| 218 | +						$this->db->sql_query('DELETE FROM '.$this->comments_table); | 
                                                        |
| 219 | 219 | break;  | 
                                                        
| 220 | 220 | |
| 221 | 221 | default:  | 
                                                        
| 222 | -						$this->db->sql_query('TRUNCATE TABLE ' . $this->comments_table); | 
                                                        |
| 222 | +						$this->db->sql_query('TRUNCATE TABLE '.$this->comments_table); | 
                                                        |
| 223 | 223 | break;  | 
                                                        
| 224 | 224 | }  | 
                                                        
| 225 | 225 | |
| 226 | - $sql = 'UPDATE ' . $this->links_table . '  | 
                                                        |
| 226 | + $sql = 'UPDATE '.$this->links_table.'  | 
                                                        |
| 227 | 227 | SET link_comment = 0';  | 
                                                        
| 228 | 228 | $this->db->sql_query($sql);  | 
                                                        
| 229 | 229 | |
@@ -235,7 +235,7 @@ discard block  | 
                                                    ||
| 235 | 235 | break;  | 
                                                        
| 236 | 236 | |
| 237 | 237 | case 'clicks':  | 
                                                        
| 238 | - $sql = 'UPDATE ' . $this->links_table . '  | 
                                                        |
| 238 | + $sql = 'UPDATE '.$this->links_table.'  | 
                                                        |
| 239 | 239 | SET link_view = 0';  | 
                                                        
| 240 | 240 | $this->db->sql_query($sql);  | 
                                                        
| 241 | 241 | |
@@ -289,7 +289,7 @@ discard block  | 
                                                    ||
| 289 | 289 |  			{ | 
                                                        
| 290 | 290 | $physical_files[] = $img;  | 
                                                        
| 291 | 291 | }  | 
                                                        
| 292 | - $sql = 'SELECT link_banner FROM ' . $this->links_table . '  | 
                                                        |
| 292 | + $sql = 'SELECT link_banner FROM '.$this->links_table.'  | 
                                                        |
| 293 | 293 | WHERE link_banner <> \'\'';  | 
                                                        
| 294 | 294 | $result = $this->db->sql_query($sql);  | 
                                                        
| 295 | 295 | |