| @@ -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 | |
| @@ -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']), | 
| @@ -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 | } | 
| @@ -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 | |
| @@ -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 | |
| @@ -49,12 +49,12 @@ discard block | ||
| 49 | 49 | */ | 
| 50 | 50 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\template\template $template, $table_prefix, $php_ext) | 
| 51 | 51 |  	{ | 
| 52 | - $this->db = $db; | |
| 53 | - $this->helper = $helper; | |
| 52 | + $this->db = $db; | |
| 53 | + $this->helper = $helper; | |
| 54 | 54 | $this->language = $language; | 
| 55 | 55 | $this->template = $template; | 
| 56 | 56 | $this->table_prefix = $table_prefix; | 
| 57 | - $this->php_ext = $php_ext; | |
| 57 | + $this->php_ext = $php_ext; | |
| 58 | 58 | } | 
| 59 | 59 | |
| 60 | 60 | /** | 
| @@ -82,11 +82,11 @@ discard block | ||
| 82 | 82 | */ | 
| 83 | 83 | public function add_page_header_variables() | 
| 84 | 84 |  	{ | 
| 85 | - $ext_theme_path = $this->get_ext_name() . '/styles/prosilver/theme/'; | |
| 85 | + $ext_theme_path = $this->get_ext_name().'/styles/prosilver/theme/'; | |
| 86 | 86 | $theme_lang_path = $this->language->get_used_language(); | 
| 87 | 87 | |
| 88 | 88 | // Prevent 'Twig_Error_Loader' if user's lang directory doesn't exist | 
| 89 | - if (!file_exists($ext_theme_path . $theme_lang_path . '/directory.css')) | |
| 89 | + if (!file_exists($ext_theme_path.$theme_lang_path.'/directory.css')) | |
| 90 | 90 |  		{ | 
| 91 | 91 | // Fallback to English language. | 
| 92 | 92 | $theme_lang_path = \phpbb\language\language::FALLBACK_LANGUAGE; | 
| @@ -106,10 +106,10 @@ discard block | ||
| 106 | 106 | */ | 
| 107 | 107 | public function add_page_viewonline($event) | 
| 108 | 108 |  	{ | 
| 109 | - if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/directory') === 0) | |
| 109 | + if (strrpos($event['row']['session_page'], 'app.'.$this->php_ext.'/directory') === 0) | |
| 110 | 110 |  		{ | 
| 111 | -			$event['location']		= $this->language->lang('DIRECTORY'); | |
| 112 | -			$event['location_url']	= $this->helper->route('ernadoo_phpbbdirectory_base_controller'); | |
| 111 | +			$event['location'] = $this->language->lang('DIRECTORY'); | |
| 112 | +			$event['location_url'] = $this->helper->route('ernadoo_phpbbdirectory_base_controller'); | |
| 113 | 113 | } | 
| 114 | 114 | } | 
| 115 | 115 | |
| @@ -139,24 +139,24 @@ discard block | ||
| 139 | 139 |  	{ | 
| 140 | 140 | $categories = $event['categories']; | 
| 141 | 141 |  		$categories				= array_merge($categories, array('dir' => 'ACL_CAT_DIRECTORY')); | 
| 142 | - $event['categories'] = $categories; | |
| 142 | + $event['categories'] = $categories; | |
| 143 | 143 | |
| 144 | 144 | $permissions = $event['permissions']; | 
| 145 | 145 | |
| 146 | 146 | $permissions = array_merge($permissions, array( | 
| 147 | -			'm_delete_dir'			=> array('lang' => 'ACL_M_DELETE_DIR', 			'cat' => 'dir'), | |
| 148 | -			'm_delete_comment_dir'	=> array('lang' => 'ACL_M_DELETE_COMMENT_DIR',	'cat' => 'dir'), | |
| 149 | -			'm_edit_dir'			=> array('lang' => 'ACL_M_EDIT_DIR',			'cat' => 'dir'), | |
| 150 | -			'm_edit_comment_dir'	=> array('lang' => 'ACL_M_EDIT_COMMENT_DIR',	'cat' => 'dir'), | |
| 151 | - | |
| 152 | -			'u_comment_dir'			=> array('lang' => 'ACL_U_COMMENT_DIR',			'cat' => 'dir'), | |
| 153 | -			'u_delete_dir'			=> array('lang' => 'ACL_U_DELETE_DIR',			'cat' => 'dir'), | |
| 154 | -			'u_delete_comment_dir'	=> array('lang' => 'ACL_U_DELETE_COMMENT_DIR',	'cat' => 'dir'), | |
| 155 | -			'u_edit_dir'			=> array('lang' => 'ACL_U_EDIT_DIR',			'cat' => 'dir'), | |
| 156 | -			'u_edit_comment_dir'	=> array('lang' => 'ACL_U_EDIT_COMMENT_DIR',	'cat' => 'dir'), | |
| 157 | -			'u_search_dir'			=> array('lang' => 'ACL_U_SEARCH_DIR',			'cat' => 'dir'), | |
| 158 | -			'u_submit_dir'			=> array('lang' => 'ACL_U_SUBMIT_DIR',			'cat' => 'dir'), | |
| 159 | -			'u_vote_dir'			=> array('lang' => 'ACL_U_VOTE_DIR',			'cat' => 'dir'), | |
| 147 | +			'm_delete_dir'			=> array('lang' => 'ACL_M_DELETE_DIR', 'cat' => 'dir'), | |
| 148 | +			'm_delete_comment_dir'	=> array('lang' => 'ACL_M_DELETE_COMMENT_DIR', 'cat' => 'dir'), | |
| 149 | +			'm_edit_dir'			=> array('lang' => 'ACL_M_EDIT_DIR', 'cat' => 'dir'), | |
| 150 | +			'm_edit_comment_dir'	=> array('lang' => 'ACL_M_EDIT_COMMENT_DIR', 'cat' => 'dir'), | |
| 151 | + | |
| 152 | +			'u_comment_dir'			=> array('lang' => 'ACL_U_COMMENT_DIR', 'cat' => 'dir'), | |
| 153 | +			'u_delete_dir'			=> array('lang' => 'ACL_U_DELETE_DIR', 'cat' => 'dir'), | |
| 154 | +			'u_delete_comment_dir'	=> array('lang' => 'ACL_U_DELETE_COMMENT_DIR', 'cat' => 'dir'), | |
| 155 | +			'u_edit_dir'			=> array('lang' => 'ACL_U_EDIT_DIR', 'cat' => 'dir'), | |
| 156 | +			'u_edit_comment_dir'	=> array('lang' => 'ACL_U_EDIT_COMMENT_DIR', 'cat' => 'dir'), | |
| 157 | +			'u_search_dir'			=> array('lang' => 'ACL_U_SEARCH_DIR', 'cat' => 'dir'), | |
| 158 | +			'u_submit_dir'			=> array('lang' => 'ACL_U_SUBMIT_DIR', 'cat' => 'dir'), | |
| 159 | +			'u_vote_dir'			=> array('lang' => 'ACL_U_VOTE_DIR', 'cat' => 'dir'), | |
| 160 | 160 | )); | 
| 161 | 161 | |
| 162 | 162 | $event['permissions'] = $permissions; | 
| @@ -177,17 +177,17 @@ discard block | ||
| 177 | 177 | $user_ids = array($user_ids); | 
| 178 | 178 | } | 
| 179 | 179 | |
| 180 | - $sql = 'UPDATE ' . $this->comments_table . ' | |
| 181 | - SET comment_user_id = ' . ANONYMOUS . ' | |
| 180 | + $sql = 'UPDATE '.$this->comments_table.' | |
| 181 | + SET comment_user_id = ' . ANONYMOUS.' | |
| 182 | 182 |  			WHERE ' . $this->db->sql_in_set('comment_user_id', $user_ids); | 
| 183 | 183 | $this->db->sql_query($sql); | 
| 184 | 184 | |
| 185 | - $sql = 'UPDATE ' . $this->links_table . ' | |
| 186 | - SET link_user_id = ' . ANONYMOUS . ' | |
| 185 | + $sql = 'UPDATE '.$this->links_table.' | |
| 186 | + SET link_user_id = ' . ANONYMOUS.' | |
| 187 | 187 |  			WHERE ' . $this->db->sql_in_set('link_user_id', $user_ids); | 
| 188 | 188 | $this->db->sql_query($sql); | 
| 189 | 189 | |
| 190 | - $sql = 'DELETE FROM ' . $this->watch_table . ' | |
| 190 | + $sql = 'DELETE FROM '.$this->watch_table.' | |
| 191 | 191 |  			WHERE ' . $this->db->sql_in_set('user_id', $user_ids); | 
| 192 | 192 | $this->db->sql_query($sql); | 
| 193 | 193 | } | 
| @@ -60,13 +60,13 @@ discard block | ||
| 60 | 60 | */ | 
| 61 | 61 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\cron\manager $cron) | 
| 62 | 62 |  	{ | 
| 63 | - $this->db = $db; | |
| 64 | - $this->config = $config; | |
| 63 | + $this->db = $db; | |
| 64 | + $this->config = $config; | |
| 65 | 65 | $this->language = $language; | 
| 66 | 66 | $this->template = $template; | 
| 67 | 67 | $this->user = $user; | 
| 68 | - $this->helper = $helper; | |
| 69 | - $this->request = $request; | |
| 68 | + $this->helper = $helper; | |
| 69 | + $this->request = $request; | |
| 70 | 70 | $this->auth = $auth; | 
| 71 | 71 | $this->cron = $cron; | 
| 72 | 72 | } | 
| @@ -90,7 +90,7 @@ discard block | ||
| 90 | 90 | public function make_cat_jumpbox() | 
| 91 | 91 |  	{ | 
| 92 | 92 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id | 
| 93 | - FROM ' . $this->categories_table . ' | |
| 93 | + FROM ' . $this->categories_table.' | |
| 94 | 94 | ORDER BY left_id ASC'; | 
| 95 | 95 | $result = $this->db->sql_query($sql, 600); | 
| 96 | 96 | |
| @@ -151,7 +151,7 @@ discard block | ||
| 151 | 151 | |
| 152 | 152 | // This query is identical to the jumpbox one | 
| 153 | 153 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id | 
| 154 | - FROM ' . $this->categories_table . ' | |
| 154 | + FROM ' . $this->categories_table.' | |
| 155 | 155 | ORDER BY left_id ASC'; | 
| 156 | 156 | $result = $this->db->sql_query($sql, 600); | 
| 157 | 157 | |
| @@ -181,7 +181,7 @@ discard block | ||
| 181 | 181 | } | 
| 182 | 182 | |
| 183 | 183 | $selected = (($row['cat_id'] == $select_id) ? ' selected="selected"' : ''); | 
| 184 | - $cat_list .= '<option value="' . $row['cat_id'] . '"' . (($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected) . '>' . $padding . $row['cat_name'] . '</option>'; | |
| 184 | + $cat_list .= '<option value="'.$row['cat_id'].'"'.(($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected).'>'.$padding.$row['cat_name'].'</option>'; | |
| 185 | 185 | } | 
| 186 | 186 | $this->db->sql_freeresult($result); | 
| 187 | 187 | unset($padding_store); | 
| @@ -196,7 +196,7 @@ discard block | ||
| 196 | 196 | */ | 
| 197 | 197 | public function display() | 
| 198 | 198 |  	{ | 
| 199 | - $cat_rows = $subcats = array(); | |
| 199 | + $cat_rows = $subcats = array(); | |
| 200 | 200 | $parent_id = $visible_cats = 0; | 
| 201 | 201 | |
| 202 | 202 | $sql_array = array( | 
| @@ -214,7 +214,7 @@ discard block | ||
| 214 | 214 | else | 
| 215 | 215 |  		{ | 
| 216 | 216 | $root_data = $this->data; | 
| 217 | - $sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id']; | |
| 217 | + $sql_where = 'left_id > '.$root_data['left_id'].' AND left_id < '.$root_data['right_id']; | |
| 218 | 218 | } | 
| 219 | 219 | |
| 220 | 220 |  		$sql = $this->db->sql_build_query('SELECT', array( | 
| @@ -261,7 +261,7 @@ discard block | ||
| 261 | 261 |  			{ | 
| 262 | 262 | foreach ($subcats[$dir_cat_id] as $subcat_id => $subcat_row) | 
| 263 | 263 |  				{ | 
| 264 | - $row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links']+$subcat_row['links']) : $row['cat_links']; | |
| 264 | + $row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links'] + $subcat_row['links']) : $row['cat_links']; | |
| 265 | 265 | |
| 266 | 266 | if ($subcat_row['display'] && $subcat_row['parent_id'] == $dir_cat_id) | 
| 267 | 267 |  					{ | 
| @@ -316,7 +316,7 @@ discard block | ||
| 316 | 316 | if ($task->is_ready()) | 
| 317 | 317 |  			{ | 
| 318 | 318 | $url = $task->get_url(); | 
| 319 | -				$this->template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="" />'); | |
| 319 | +				$this->template->assign_var('RUN_CRON_TASK', '<img src="'.$url.'" width="1" height="1" alt="" />'); | |
| 320 | 320 | } | 
| 321 | 321 | } | 
| 322 | 322 | } | 
| @@ -338,10 +338,10 @@ discard block | ||
| 338 | 338 | 'LEFT_JOIN' => array( | 
| 339 | 339 | array( | 
| 340 | 340 | 'FROM' => array($this->watch_table => 'w'), | 
| 341 | - 'ON' => 'c.cat_id = w.cat_id AND w.user_id = ' . (int) $this->user->data['user_id'] | |
| 341 | + 'ON' => 'c.cat_id = w.cat_id AND w.user_id = '.(int) $this->user->data['user_id'] | |
| 342 | 342 | ), | 
| 343 | 343 | ), | 
| 344 | - 'WHERE' => 'c.cat_id = ' . (int) $cat_id | |
| 344 | + 'WHERE' => 'c.cat_id = '.(int) $cat_id | |
| 345 | 345 | ); | 
| 346 | 346 |  			$sql = $this->db->sql_build_query('SELECT', $sql_array); | 
| 347 | 347 | $result = $this->db->sql_query($sql); | 
| @@ -378,7 +378,7 @@ discard block | ||
| 378 | 378 |  				$this->template->assign_block_vars('dir_navlinks', array( | 
| 379 | 379 | 'FORUM_NAME' => $parent_data['cat_name'], | 
| 380 | 380 | 'FORUM_ID' => $parent_cat_id, | 
| 381 | - 'MICRODATA' => $microdata_attr . '="' . $parent_cat_id . '"', | |
| 381 | + 'MICRODATA' => $microdata_attr.'="'.$parent_cat_id.'"', | |
| 382 | 382 |  					'U_VIEW_FORUM'	=> $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $parent_cat_id)), | 
| 383 | 383 | )); | 
| 384 | 384 | } | 
| @@ -387,7 +387,7 @@ discard block | ||
| 387 | 387 |  		$this->template->assign_block_vars('dir_navlinks', array( | 
| 388 | 388 | 'FORUM_NAME' => $dir_cat_data['cat_name'], | 
| 389 | 389 | 'FORUM_ID' => $dir_cat_data['cat_id'], | 
| 390 | - 'MICRODATA' => $microdata_attr . '="' . $dir_cat_data['cat_id'] . '"', | |
| 390 | + 'MICRODATA' => $microdata_attr.'="'.$dir_cat_data['cat_id'].'"', | |
| 391 | 391 |  			'U_VIEW_FORUM'	=> $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $dir_cat_data['cat_id'])), | 
| 392 | 392 | )); | 
| 393 | 393 | |
| @@ -444,7 +444,7 @@ discard block | ||
| 444 | 444 |  			{ | 
| 445 | 445 | if ($mode == 'unwatch') | 
| 446 | 446 |  				{ | 
| 447 | - $sql = 'DELETE FROM ' . $this->watch_table . " | |
| 447 | + $sql = 'DELETE FROM '.$this->watch_table." | |
| 448 | 448 | WHERE cat_id = $cat_id | 
| 449 | 449 | AND user_id = $user_id"; | 
| 450 | 450 | $this->db->sql_query($sql); | 
| @@ -454,7 +454,7 @@ discard block | ||
| 454 | 454 | |
| 455 | 455 | if (!$this->request->is_ajax()) | 
| 456 | 456 |  					{ | 
| 457 | -						$message .= '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>'); | |
| 457 | +						$message .= '<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>'); | |
| 458 | 458 | } | 
| 459 | 459 | |
| 460 | 460 | meta_refresh(3, $redirect_url); | 
| @@ -466,8 +466,8 @@ discard block | ||
| 466 | 466 | |
| 467 | 467 | if ($notify_status != NOTIFY_YES) | 
| 468 | 468 |  					{ | 
| 469 | - $sql = 'UPDATE ' . $this->watch_table . ' | |
| 470 | - SET notify_status = ' . NOTIFY_YES . " | |
| 469 | + $sql = 'UPDATE '.$this->watch_table.' | |
| 470 | + SET notify_status = ' . NOTIFY_YES." | |
| 471 | 471 | WHERE cat_id = $cat_id | 
| 472 | 472 | AND user_id = $user_id"; | 
| 473 | 473 | $this->db->sql_query($sql); | 
| @@ -478,8 +478,8 @@ discard block | ||
| 478 | 478 |  			{ | 
| 479 | 479 | if ($mode == 'watch') | 
| 480 | 480 |  				{ | 
| 481 | - $sql = 'INSERT INTO ' . $this->watch_table . " (user_id, cat_id, notify_status) | |
| 482 | - VALUES ($user_id, $cat_id, " . NOTIFY_YES . ')'; | |
| 481 | + $sql = 'INSERT INTO '.$this->watch_table." (user_id, cat_id, notify_status) | |
| 482 | + VALUES ($user_id, $cat_id, ".NOTIFY_YES.')'; | |
| 483 | 483 | $this->db->sql_query($sql); | 
| 484 | 484 | |
| 485 | 485 |  					$redirect_url = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)); | 
| @@ -487,7 +487,7 @@ discard block | ||
| 487 | 487 | |
| 488 | 488 | if (!$this->request->is_ajax()) | 
| 489 | 489 |  					{ | 
| 490 | -						$message .= '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>'); | |
| 490 | +						$message .= '<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>'); | |
| 491 | 491 | } | 
| 492 | 492 | |
| 493 | 493 | meta_refresh(3, $redirect_url); | 
| @@ -507,10 +507,10 @@ discard block | ||
| 507 | 507 | |
| 508 | 508 | if ($can_watch) | 
| 509 | 509 |  		{ | 
| 510 | -			$s_watching['link'] 		= $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch'))); | |
| 510 | +			$s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch'))); | |
| 511 | 511 |  			$s_watching['link_toggle'] 	= $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => ((!$is_watching) ? 'unwatch' : 'watch'))); | 
| 512 | - $s_watching['title'] = $this->language->lang((($is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT'); | |
| 513 | - $s_watching['title_toggle'] = $this->language->lang(((!$is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT'); | |
| 512 | + $s_watching['title'] = $this->language->lang((($is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT'); | |
| 513 | + $s_watching['title_toggle'] = $this->language->lang(((!$is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT'); | |
| 514 | 514 | $s_watching['is_watching'] = $is_watching; | 
| 515 | 515 | } | 
| 516 | 516 | |
| @@ -530,7 +530,7 @@ discard block | ||
| 530 | 530 |  		$categories_table = $phpbb_container->getParameter('tables.dir.categories'); | 
| 531 | 531 | |
| 532 | 532 | $sql = 'SELECT cat_name | 
| 533 | - FROM ' . $categories_table . ' | |
| 533 | + FROM ' . $categories_table.' | |
| 534 | 534 | WHERE cat_id = ' . (int) $cat_id; | 
| 535 | 535 | $result = $db->sql_query($sql); | 
| 536 | 536 | $row = $db->sql_fetchrow($result); |