@@ -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,18 +104,18 @@ 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 | |
@@ -164,12 +164,12 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit))); |
| 166 | 166 | |
| 167 | - ($u_hilit) ? $u_search['keywords'] = urlencode(htmlspecialchars_decode($keywords)) : ''; |
|
| 168 | - ($search_terms != 'all') ? $u_search['terms'] = $search_terms : ''; |
|
| 169 | - ($cat_id) ? $u_search['cat_id'] = $cat_id : ''; |
|
| 170 | - ($search_category) ? $u_search['cid'] = $search_category : ''; |
|
| 171 | - (!$search_child) ? $u_search['sc'] = 0 : ''; |
|
| 172 | - ($search_fields != 'all') ? $u_search['sf'] = $search_fields : ''; |
|
| 167 | + ($u_hilit) ? $u_search['keywords'] = urlencode(htmlspecialchars_decode($keywords)) : ''; |
|
| 168 | + ($search_terms != 'all') ? $u_search['terms'] = $search_terms : ''; |
|
| 169 | + ($cat_id) ? $u_search['cat_id'] = $cat_id : ''; |
|
| 170 | + ($search_category) ? $u_search['cid'] = $search_category : ''; |
|
| 171 | + (!$search_child) ? $u_search['sc'] = 0 : ''; |
|
| 172 | + ($search_fields != 'all') ? $u_search['sf'] = $search_fields : ''; |
|
| 173 | 173 | |
| 174 | 174 | $base_url = array( |
| 175 | 175 | 'routes' => 'ernadoo_phpbbdirectory_search_controller', |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | foreach ($rowset as $data) |
| 245 | 245 | { |
| 246 | - $s_banner = $this->link->display_bann($data); |
|
| 246 | + $s_banner = $this->link->display_bann($data); |
|
| 247 | 247 | $s_thumb = $this->link->display_thumb($data); |
| 248 | 248 | $s_flag = $this->link->display_flag($data); |
| 249 | 249 | |
@@ -251,8 +251,8 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | if ($hilit) |
| 253 | 253 | { |
| 254 | - $data['link_name'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_name']); |
|
| 255 | - $data['link_description'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_description']); |
|
| 254 | + $data['link_name'] = preg_replace('#(?!<.*)(?<!\w)('.$hilit.')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_name']); |
|
| 255 | + $data['link_description'] = preg_replace('#(?!<.*)(?<!\w)('.$hilit.')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_description']); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | $this->template->assign_block_vars('results', array( |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | private function _get_exclude_categories(&$search_category, $search_child) |
| 313 | 313 | { |
| 314 | 314 | $sql = 'SELECT cat_id, parent_id, right_id |
| 315 | - FROM ' . $this->categories_table . ' |
|
| 315 | + FROM ' . $this->categories_table.' |
|
| 316 | 316 | ORDER BY left_id'; |
| 317 | 317 | $result = $this->db->sql_query($sql); |
| 318 | 318 | |
@@ -51,12 +51,12 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function __construct(\phpbb\config\config $config, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) |
| 53 | 53 | { |
| 54 | - $this->config = $config; |
|
| 54 | + $this->config = $config; |
|
| 55 | 55 | $this->language = $language; |
| 56 | - $this->log = $log; |
|
| 56 | + $this->log = $log; |
|
| 57 | 57 | $this->template = $template; |
| 58 | - $this->user = $user; |
|
| 59 | - $this->request = $request; |
|
| 58 | + $this->user = $user; |
|
| 59 | + $this->request = $request; |
|
| 60 | 60 | |
| 61 | 61 | $this->_generate_config(); |
| 62 | 62 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | else if ($vars['explain']) |
| 97 | 97 | { |
| 98 | - $l_explain = $this->language->lang($vars['lang'] . '_EXPLAIN'); |
|
| 98 | + $l_explain = $this->language->lang($vars['lang'].'_EXPLAIN'); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | $this->template->assign_block_vars('options', array( |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function process() |
| 119 | 119 | { |
| 120 | - $submit = ($this->request->is_set_post('submit')) ? true : false; |
|
| 120 | + $submit = ($this->request->is_set_post('submit')) ? true : false; |
|
| 121 | 121 | |
| 122 | 122 | $this->new_config = $this->config; |
| 123 | 123 | $cfg_array = ($this->request->is_set('config')) ? $this->request->variable('config', array('' => ''), true) : $this->new_config; |
@@ -158,12 +158,12 @@ discard block |
||
| 158 | 158 | { |
| 159 | 159 | $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'DIR_CONFIG_SETTINGS'); |
| 160 | 160 | |
| 161 | - trigger_error($this->language->lang('CONFIG_UPDATED') . adm_back_link($this->u_action)); |
|
| 161 | + trigger_error($this->language->lang('CONFIG_UPDATED').adm_back_link($this->u_action)); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | $this->template->assign_vars(array( |
| 165 | 165 | 'L_TITLE' => $this->language->lang($this->display_vars['title']), |
| 166 | - 'L_TITLE_EXPLAIN' => $this->language->lang($this->display_vars['title'] . '_EXPLAIN'), |
|
| 166 | + 'L_TITLE_EXPLAIN' => $this->language->lang($this->display_vars['title'].'_EXPLAIN'), |
|
| 167 | 167 | |
| 168 | 168 | 'S_ERROR' => (sizeof($error)) ? true : false, |
| 169 | 169 | 'ERROR_MSG' => implode('<br />', $error), |
@@ -199,44 +199,44 @@ discard block |
||
| 199 | 199 | 'dir_banner_width' => '', |
| 200 | 200 | 'dir_banner_height' => '', |
| 201 | 201 | |
| 202 | - 'dir_mail' => array('lang' => 'DIR_MAIL_VALIDATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 203 | - 'dir_activ_checkurl' => array('lang' => 'DIR_ACTIVE_CHECK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
| 204 | - 'dir_activ_flag' => array('lang' => 'DIR_ACTIV_FLAG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 205 | - 'dir_activ_rss' => array('lang' => 'DIR_ACTIV_RSS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
| 206 | - 'dir_show' => array('lang' => 'DIR_SHOW', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
| 207 | - 'dir_length_describe' => array('lang' => 'DIR_MAX_DESC', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
| 208 | - 'dir_new_time' => array('lang' => 'DIR_NEW_TIME', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
| 209 | - 'dir_default_order' => array('lang' => 'DIR_DEFAULT_ORDER', 'validate' => 'string', 'type' => 'select', 'explain' => false, 'method' => 'get_order_list', 'params' => array('{CONFIG_VALUE}')), |
|
| 202 | + 'dir_mail' => array('lang' => 'DIR_MAIL_VALIDATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 203 | + 'dir_activ_checkurl' => array('lang' => 'DIR_ACTIVE_CHECK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
| 204 | + 'dir_activ_flag' => array('lang' => 'DIR_ACTIV_FLAG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 205 | + 'dir_activ_rss' => array('lang' => 'DIR_ACTIV_RSS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
| 206 | + 'dir_show' => array('lang' => 'DIR_SHOW', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
| 207 | + 'dir_length_describe' => array('lang' => 'DIR_MAX_DESC', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
| 208 | + 'dir_new_time' => array('lang' => 'DIR_NEW_TIME', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
| 209 | + 'dir_default_order' => array('lang' => 'DIR_DEFAULT_ORDER', 'validate' => 'string', 'type' => 'select', 'explain' => false, 'method' => 'get_order_list', 'params' => array('{CONFIG_VALUE}')), |
|
| 210 | 210 | |
| 211 | 211 | 'legend2' => 'DIR_RECENT_GUEST', |
| 212 | - 'dir_recent_block' => array('lang' => 'DIR_RECENT_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
| 213 | - 'dir_recent_rows' => array('lang' => 'DIR_RECENT_ROWS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
| 214 | - 'dir_recent_columns' => array('lang' => 'DIR_RECENT_COLUMNS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
| 215 | - 'dir_recent_exclude' => array('lang' => 'DIR_RECENT_EXCLUDE', 'validate' => 'string', 'type' => 'text:6:99', 'explain' => true), |
|
| 212 | + 'dir_recent_block' => array('lang' => 'DIR_RECENT_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
| 213 | + 'dir_recent_rows' => array('lang' => 'DIR_RECENT_ROWS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
| 214 | + 'dir_recent_columns' => array('lang' => 'DIR_RECENT_COLUMNS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
| 215 | + 'dir_recent_exclude' => array('lang' => 'DIR_RECENT_EXCLUDE', 'validate' => 'string', 'type' => 'text:6:99', 'explain' => true), |
|
| 216 | 216 | |
| 217 | 217 | 'legend3' => 'DIR_ADD_GUEST', |
| 218 | - 'dir_visual_confirm' => array('lang' => 'DIR_VISUAL_CONFIRM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
| 219 | - 'dir_visual_confirm_max_attempts' => array('lang' => 'DIR_MAX_ADD_ATTEMPTS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), |
|
| 218 | + 'dir_visual_confirm' => array('lang' => 'DIR_VISUAL_CONFIRM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
| 219 | + 'dir_visual_confirm_max_attempts' => array('lang' => 'DIR_MAX_ADD_ATTEMPTS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), |
|
| 220 | 220 | |
| 221 | 221 | 'legend4' => 'DIR_THUMB_PARAM', |
| 222 | - 'dir_activ_thumb' => array('lang' => 'DIR_ACTIVE_THUMB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 223 | - 'dir_activ_thumb_remote' => array('lang' => 'DIR_ACTIVE_THUMB_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
| 224 | - 'dir_thumb_service' => array('lang' => 'DIR_THUMB_SERVICE', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_thumb_service_list', 'params' => array('{CONFIG_VALUE}')), |
|
| 225 | - 'dir_thumb_service_reverse' => array('lang' => 'DIR_THUMB_SERVICE_REVERSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
| 222 | + 'dir_activ_thumb' => array('lang' => 'DIR_ACTIVE_THUMB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 223 | + 'dir_activ_thumb_remote' => array('lang' => 'DIR_ACTIVE_THUMB_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
| 224 | + 'dir_thumb_service' => array('lang' => 'DIR_THUMB_SERVICE', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_thumb_service_list', 'params' => array('{CONFIG_VALUE}')), |
|
| 225 | + 'dir_thumb_service_reverse' => array('lang' => 'DIR_THUMB_SERVICE_REVERSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
| 226 | 226 | |
| 227 | 227 | 'legend5' => 'DIR_COMM_PARAM', |
| 228 | - 'dir_allow_bbcode' => array('lang' => 'DIR_ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 229 | - 'dir_allow_flash' => array('lang' => 'DIR_ALLOW_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 230 | - 'dir_allow_links' => array('lang' => 'DIR_ALLOW_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 231 | - 'dir_allow_smilies' => array('lang' => 'DIR_ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 232 | - 'dir_length_comments' => array('lang' => 'DIR_LENGTH_COMMENTS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
| 233 | - 'dir_comments_per_page' => array('lang' => 'DIR_COMM_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
| 228 | + 'dir_allow_bbcode' => array('lang' => 'DIR_ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 229 | + 'dir_allow_flash' => array('lang' => 'DIR_ALLOW_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 230 | + 'dir_allow_links' => array('lang' => 'DIR_ALLOW_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 231 | + 'dir_allow_smilies' => array('lang' => 'DIR_ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 232 | + 'dir_length_comments' => array('lang' => 'DIR_LENGTH_COMMENTS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
| 233 | + 'dir_comments_per_page' => array('lang' => 'DIR_COMM_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
| 234 | 234 | |
| 235 | 235 | 'legend6' => 'DIR_BANN_PARAM', |
| 236 | - 'dir_activ_banner' => array('lang' => 'DIR_ACTIV_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 237 | - 'dir_banner' => array('lang' => 'DIR_MAX_BANN', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' ' . $this->user->lang['PIXEL']), |
|
| 238 | - 'dir_banner_filesize' => array('lang' => 'DIR_MAX_SIZE', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), |
|
| 239 | - 'dir_storage_banner' => array('lang' => 'DIR_STORAGE_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
| 236 | + 'dir_activ_banner' => array('lang' => 'DIR_ACTIV_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
| 237 | + 'dir_banner' => array('lang' => 'DIR_MAX_BANN', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' '.$this->user->lang['PIXEL']), |
|
| 238 | + 'dir_banner_filesize' => array('lang' => 'DIR_MAX_SIZE', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), |
|
| 239 | + 'dir_storage_banner' => array('lang' => 'DIR_STORAGE_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
| 240 | 240 | ) |
| 241 | 241 | ); |
| 242 | 242 | } |
@@ -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,13 +117,13 @@ 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 |
@@ -161,8 +161,8 @@ discard block |
||
| 161 | 161 | $min_post_time = time() - ($sort_days * 86400); |
| 162 | 162 | |
| 163 | 163 | $sql = 'SELECT COUNT(link_id) AS nb_links |
| 164 | - FROM ' . $this->links_table . ' |
|
| 165 | - WHERE link_cat = ' . (int) $cat_id . ' |
|
| 164 | + FROM ' . $this->links_table.' |
|
| 165 | + WHERE link_cat = ' . (int) $cat_id.' |
|
| 166 | 166 | AND link_time >= ' . (int) $min_post_time; |
| 167 | 167 | $result = $this->db->sql_query($sql); |
| 168 | 168 | $nb_links = (int) $this->db->sql_fetchfield('nb_links'); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | else |
| 178 | 178 | { |
| 179 | 179 | $sql_limit_time = ''; |
| 180 | - $nb_links = (int) $this->categorie->data['cat_links']; |
|
| 180 | + $nb_links = (int) $this->categorie->data['cat_links']; |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | // Make sure $start is set to the last page if it exceeds the amount |
@@ -240,11 +240,11 @@ discard block |
||
| 240 | 240 | |
| 241 | 241 | if (is_array($sort_by_sql[$sort_key])) |
| 242 | 242 | { |
| 243 | - $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; |
|
| 243 | + $sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction; |
|
| 244 | 244 | } |
| 245 | 245 | else |
| 246 | 246 | { |
| 247 | - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; |
|
| 247 | + $sql_sort_order = $sort_by_sql[$sort_key].' '.$direction; |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | // Grab just the sorted link ids |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | ), |
| 288 | 288 | array( |
| 289 | 289 | 'FROM' => array($this->votes_table => 'v'), |
| 290 | - 'ON' => 'l.link_id = v.vote_link_id AND v.vote_user_id = ' . $this->user->data['user_id'] |
|
| 290 | + 'ON' => 'l.link_id = v.vote_link_id AND v.vote_user_id = '.$this->user->data['user_id'] |
|
| 291 | 291 | ) |
| 292 | 292 | ), |
| 293 | 293 | 'WHERE' => $this->db->sql_in_set('l.link_id', $link_list) |
@@ -304,8 +304,8 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | $link_list = ($store_reverse) ? array_reverse($link_list) : $link_list; |
| 306 | 306 | |
| 307 | - $votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false; |
|
| 308 | - $comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false; |
|
| 307 | + $votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false; |
|
| 308 | + $comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false; |
|
| 309 | 309 | |
| 310 | 310 | foreach ($link_list as $link_id) |
| 311 | 311 | { |
@@ -315,10 +315,10 @@ discard block |
||
| 315 | 315 | $s_note = $this->link->display_note($site['link_note'], $site['link_vote'], $votes_status); |
| 316 | 316 | $s_thumb = $this->link->display_thumb($site); |
| 317 | 317 | $s_vote = $this->link->display_vote($site); |
| 318 | - $s_banner = $this->link->display_bann($site); |
|
| 319 | - $s_rss = $this->link->display_rss($site); |
|
| 318 | + $s_banner = $this->link->display_bann($site); |
|
| 319 | + $s_rss = $this->link->display_rss($site); |
|
| 320 | 320 | |
| 321 | - $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')))); |
|
| 321 | + $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')))); |
|
| 322 | 322 | $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')))); |
| 323 | 323 | |
| 324 | 324 | $this->template->assign_block_vars('site', array( |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | $this->template->assign_block_vars('no_draw_link', array()); |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | - $page_title = $this->language->lang('DIRECTORY') . ' - ' . $this->categorie->data['cat_name']; |
|
| 357 | + $page_title = $this->language->lang('DIRECTORY').' - '.$this->categorie->data['cat_name']; |
|
| 358 | 358 | |
| 359 | 359 | $this->categorie->display(); |
| 360 | 360 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | return array( |
| 39 | 39 | 'drop_columns' => array( |
| 40 | - $this->table_prefix . 'directory_links' => array( |
|
| 40 | + $this->table_prefix.'directory_links' => array( |
|
| 41 | 41 | 'link_pagerank', |
| 42 | 42 | ), |
| 43 | 43 | ), |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | { |
| 49 | 49 | return array( |
| 50 | 50 | 'add_columns' => array( |
| 51 | - $this->table_prefix . 'directory_links' => array( |
|
| 51 | + $this->table_prefix.'directory_links' => array( |
|
| 52 | 52 | 'link_pagerank' => array('CHAR:2', ''), |
| 53 | 53 | ), |
| 54 | 54 | ), |
@@ -57,23 +57,23 @@ discard block |
||
| 57 | 57 | protected $php_ext; |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | - * Constructor |
|
| 61 | - * |
|
| 62 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 63 | - * @param \phpbb\config\config $config Config object |
|
| 64 | - * @param \phpbb\language\language $language Language object |
|
| 65 | - * @param \phpbb\template\template $template Template object |
|
| 66 | - * @param \phpbb\user $user User object |
|
| 67 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
| 68 | - * @param \phpbb\request\request $request Request object |
|
| 69 | - * @param \phpbb\auth\auth $auth Auth object |
|
| 70 | - * @param \phpbb\notification\manager $notification Notification object |
|
| 71 | - * @param \phpbb\filesystem\filesystem_interface $filesystem phpBB filesystem helper |
|
| 72 | - * @param \FastImageSize\FastImageSize $imagesize FastImageSize class |
|
| 73 | - * @param \phpbb\files\factory $files_factory File classes factory |
|
| 74 | - * @param string $root_path phpBB root path |
|
| 75 | - * @param string $php_ext phpEx |
|
| 76 | - */ |
|
| 60 | + * Constructor |
|
| 61 | + * |
|
| 62 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 63 | + * @param \phpbb\config\config $config Config object |
|
| 64 | + * @param \phpbb\language\language $language Language object |
|
| 65 | + * @param \phpbb\template\template $template Template object |
|
| 66 | + * @param \phpbb\user $user User object |
|
| 67 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
| 68 | + * @param \phpbb\request\request $request Request object |
|
| 69 | + * @param \phpbb\auth\auth $auth Auth object |
|
| 70 | + * @param \phpbb\notification\manager $notification Notification object |
|
| 71 | + * @param \phpbb\filesystem\filesystem_interface $filesystem phpBB filesystem helper |
|
| 72 | + * @param \FastImageSize\FastImageSize $imagesize FastImageSize class |
|
| 73 | + * @param \phpbb\files\factory $files_factory File classes factory |
|
| 74 | + * @param string $root_path phpBB root path |
|
| 75 | + * @param string $php_ext phpEx |
|
| 76 | + */ |
|
| 77 | 77 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\notification\manager $notification, \phpbb\filesystem\filesystem_interface $filesystem, \FastImageSize\FastImageSize $imagesize, \phpbb\files\factory $files_factory, $root_path, $php_ext) |
| 78 | 78 | { |
| 79 | 79 | $this->db = $db; |
@@ -93,12 +93,12 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | - * Add a link into db |
|
| 97 | - * |
|
| 98 | - * @param array $data Contains all data to insert in db |
|
| 99 | - * @param bool $need_approval Links needs to be approved? |
|
| 100 | - * @return null |
|
| 101 | - */ |
|
| 96 | + * Add a link into db |
|
| 97 | + * |
|
| 98 | + * @param array $data Contains all data to insert in db |
|
| 99 | + * @param bool $need_approval Links needs to be approved? |
|
| 100 | + * @return null |
|
| 101 | + */ |
|
| 102 | 102 | public function add($data, $need_approval) |
| 103 | 103 | { |
| 104 | 104 | $notification_data = array(); |
@@ -143,13 +143,13 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
| 146 | - * Edit a link of the db |
|
| 147 | - * |
|
| 148 | - * @param array $data Contains all data to edit in db |
|
| 149 | - * @param int $link_id is link's id, for WHERE clause |
|
| 150 | - * @param bool $need_approval Links needs to be approved? |
|
| 151 | - * @return null |
|
| 152 | - */ |
|
| 146 | + * Edit a link of the db |
|
| 147 | + * |
|
| 148 | + * @param array $data Contains all data to edit in db |
|
| 149 | + * @param int $link_id is link's id, for WHERE clause |
|
| 150 | + * @param bool $need_approval Links needs to be approved? |
|
| 151 | + * @return null |
|
| 152 | + */ |
|
| 153 | 153 | public function edit($data, $link_id, $need_approval) |
| 154 | 154 | { |
| 155 | 155 | $notification_data = array( |
@@ -201,12 +201,12 @@ discard block |
||
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /** |
| 204 | - * Delete a link of the db |
|
| 205 | - * |
|
| 206 | - * @param int $cat_id The category ID |
|
| 207 | - * @param mixed $link_id Link's id, for WHERE clause |
|
| 208 | - * @return null |
|
| 209 | - */ |
|
| 204 | + * Delete a link of the db |
|
| 205 | + * |
|
| 206 | + * @param int $cat_id The category ID |
|
| 207 | + * @param mixed $link_id Link's id, for WHERE clause |
|
| 208 | + * @return null |
|
| 209 | + */ |
|
| 210 | 210 | public function del($cat_id, $link_id) |
| 211 | 211 | { |
| 212 | 212 | $this->db->sql_transaction('begin'); |
@@ -279,12 +279,12 @@ discard block |
||
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | /** |
| 282 | - * Increments link view counter |
|
| 283 | - * |
|
| 284 | - * @param int $link_id Link's id, for WHERE clause |
|
| 285 | - * @return null |
|
| 286 | - * @throws \phpbb\exception\http_exception |
|
| 287 | - */ |
|
| 282 | + * Increments link view counter |
|
| 283 | + * |
|
| 284 | + * @param int $link_id Link's id, for WHERE clause |
|
| 285 | + * @return null |
|
| 286 | + * @throws \phpbb\exception\http_exception |
|
| 287 | + */ |
|
| 288 | 288 | public function view($link_id) |
| 289 | 289 | { |
| 290 | 290 | $sql = 'SELECT link_id, link_url |
@@ -308,11 +308,11 @@ discard block |
||
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | /** |
| 311 | - * Verify that an URL exist before add into db |
|
| 312 | - * |
|
| 313 | - * @param string $url The URL to check |
|
| 314 | - * @return bool True if url is reachable, else false. |
|
| 315 | - */ |
|
| 311 | + * Verify that an URL exist before add into db |
|
| 312 | + * |
|
| 313 | + * @param string $url The URL to check |
|
| 314 | + * @return bool True if url is reachable, else false. |
|
| 315 | + */ |
|
| 316 | 316 | public function checkurl($url) |
| 317 | 317 | { |
| 318 | 318 | $details = parse_url($url); |
@@ -351,11 +351,11 @@ discard block |
||
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | /** |
| 354 | - * Delete the final '/', if no path |
|
| 355 | - * |
|
| 356 | - * @param string $url URL to clean |
|
| 357 | - * @return string $url The correct string. |
|
| 358 | - */ |
|
| 354 | + * Delete the final '/', if no path |
|
| 355 | + * |
|
| 356 | + * @param string $url URL to clean |
|
| 357 | + * @return string $url The correct string. |
|
| 358 | + */ |
|
| 359 | 359 | public function clean_url($url) |
| 360 | 360 | { |
| 361 | 361 | $details = parse_url($url); |
@@ -368,11 +368,11 @@ discard block |
||
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | /** |
| 371 | - * Display a flag |
|
| 372 | - * |
|
| 373 | - * @param array $data Link's data from db |
|
| 374 | - * @return string Flag path. |
|
| 375 | - */ |
|
| 371 | + * Display a flag |
|
| 372 | + * |
|
| 373 | + * @param array $data Link's data from db |
|
| 374 | + * @return string Flag path. |
|
| 375 | + */ |
|
| 376 | 376 | public function display_flag($data) |
| 377 | 377 | { |
| 378 | 378 | global $phpbb_extension_manager; |
@@ -390,13 +390,13 @@ discard block |
||
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | /** |
| 393 | - * Calculate the link's note |
|
| 394 | - * |
|
| 395 | - * @param int $total_note Sum of all link's notes |
|
| 396 | - * @param int $nb_vote Number of votes |
|
| 397 | - * @param bool $votes_status Votes are enable in this category? |
|
| 398 | - * @return string $note The calculated note. |
|
| 399 | - */ |
|
| 393 | + * Calculate the link's note |
|
| 394 | + * |
|
| 395 | + * @param int $total_note Sum of all link's notes |
|
| 396 | + * @param int $nb_vote Number of votes |
|
| 397 | + * @param bool $votes_status Votes are enable in this category? |
|
| 398 | + * @return string $note The calculated note. |
|
| 399 | + */ |
|
| 400 | 400 | public function display_note($total_note, $nb_vote, $votes_status) |
| 401 | 401 | { |
| 402 | 402 | if (!$votes_status) |
@@ -411,11 +411,11 @@ discard block |
||
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | /** |
| 414 | - * Display the vote form for auth users |
|
| 415 | - * |
|
| 416 | - * @param array $data Link's data from db |
|
| 417 | - * @return null|string Html combo list or nothing if votes are not available. |
|
| 418 | - */ |
|
| 414 | + * Display the vote form for auth users |
|
| 415 | + * |
|
| 416 | + * @param array $data Link's data from db |
|
| 417 | + * @return null|string Html combo list or nothing if votes are not available. |
|
| 418 | + */ |
|
| 419 | 419 | public function display_vote($data) |
| 420 | 420 | { |
| 421 | 421 | if ($this->user->data['is_registered'] && $this->auth->acl_get('u_vote_dir') && empty($data['vote_user_id'])) |
@@ -432,11 +432,11 @@ discard block |
||
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | /** |
| 435 | - * Display the RSS icon |
|
| 436 | - * |
|
| 437 | - * @param array $data Link's data from db |
|
| 438 | - * @return null|string RSS feed URL or nothing. |
|
| 439 | - */ |
|
| 435 | + * Display the RSS icon |
|
| 436 | + * |
|
| 437 | + * @param array $data Link's data from db |
|
| 438 | + * @return null|string RSS feed URL or nothing. |
|
| 439 | + */ |
|
| 440 | 440 | public function display_rss($data) |
| 441 | 441 | { |
| 442 | 442 | if ($this->config['dir_activ_rss'] && !empty($data['link_rss'])) |
@@ -446,13 +446,13 @@ discard block |
||
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | /** |
| 449 | - * Display link's thumb if thumb service enabled. |
|
| 450 | - * if thumb don't exists in db or if a new service was choosen in acp |
|
| 451 | - * thumb is research |
|
| 452 | - * |
|
| 453 | - * @param array $data Link's data from db |
|
| 454 | - * @return string|null Thumb or null. |
|
| 455 | - */ |
|
| 449 | + * Display link's thumb if thumb service enabled. |
|
| 450 | + * if thumb don't exists in db or if a new service was choosen in acp |
|
| 451 | + * thumb is research |
|
| 452 | + * |
|
| 453 | + * @param array $data Link's data from db |
|
| 454 | + * @return string|null Thumb or null. |
|
| 455 | + */ |
|
| 456 | 456 | public function display_thumb($data) |
| 457 | 457 | { |
| 458 | 458 | if ($this->config['dir_activ_thumb']) |
@@ -473,11 +473,11 @@ discard block |
||
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | /** |
| 476 | - * Display and resize a banner |
|
| 477 | - * |
|
| 478 | - * @param array $data link's data from db |
|
| 479 | - * @return string $s_banner html code. |
|
| 480 | - */ |
|
| 476 | + * Display and resize a banner |
|
| 477 | + * |
|
| 478 | + * @param array $data link's data from db |
|
| 479 | + * @return string $s_banner html code. |
|
| 480 | + */ |
|
| 481 | 481 | public function display_bann($data) |
| 482 | 482 | { |
| 483 | 483 | if (!empty($data['link_banner'])) |
@@ -515,11 +515,11 @@ discard block |
||
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | /** |
| 518 | - * Add a vote in db, for a specifi link |
|
| 519 | - * |
|
| 520 | - * @param int $link_id Link_id from db |
|
| 521 | - * @return null |
|
| 522 | - */ |
|
| 518 | + * Add a vote in db, for a specifi link |
|
| 519 | + * |
|
| 520 | + * @param int $link_id Link_id from db |
|
| 521 | + * @return null |
|
| 522 | + */ |
|
| 523 | 523 | public function add_vote($link_id) |
| 524 | 524 | { |
| 525 | 525 | $data = array( |
@@ -563,11 +563,11 @@ discard block |
||
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | /** |
| 566 | - * Search an appropriate thumb for url |
|
| 567 | - * |
|
| 568 | - * @param string $url Link's url |
|
| 569 | - * @return string The thumb url |
|
| 570 | - */ |
|
| 566 | + * Search an appropriate thumb for url |
|
| 567 | + * |
|
| 568 | + * @param string $url Link's url |
|
| 569 | + * @return string The thumb url |
|
| 570 | + */ |
|
| 571 | 571 | public function thumb_process($url) |
| 572 | 572 | { |
| 573 | 573 | if (!$this->config['dir_activ_thumb']) |
@@ -588,12 +588,12 @@ discard block |
||
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | /** |
| 591 | - * Check if ascreen thumb exists |
|
| 592 | - * |
|
| 593 | - * @param string $protocol The protocol |
|
| 594 | - * @param string $host The hostname |
|
| 595 | - * @return bool True if ascreen file exixts, else false |
|
| 596 | - */ |
|
| 591 | + * Check if ascreen thumb exists |
|
| 592 | + * |
|
| 593 | + * @param string $protocol The protocol |
|
| 594 | + * @param string $host The hostname |
|
| 595 | + * @return bool True if ascreen file exixts, else false |
|
| 596 | + */ |
|
| 597 | 597 | private function _ascreen_exist($protocol, $host) |
| 598 | 598 | { |
| 599 | 599 | if (($thumb_info = $this->imagesize->getImageSize($protocol.'://'.$host.'/ascreen.jpg')) !== false) |
@@ -608,12 +608,12 @@ discard block |
||
| 608 | 608 | } |
| 609 | 609 | |
| 610 | 610 | /** |
| 611 | - * Primary work on banner, can edit, copy or check a banner |
|
| 612 | - * |
|
| 613 | - * @param string $banner The banner's remote url |
|
| 614 | - * @param array $error The array error, passed by reference |
|
| 615 | - * @return null |
|
| 616 | - */ |
|
| 611 | + * Primary work on banner, can edit, copy or check a banner |
|
| 612 | + * |
|
| 613 | + * @param string $banner The banner's remote url |
|
| 614 | + * @param array $error The array error, passed by reference |
|
| 615 | + * @return null |
|
| 616 | + */ |
|
| 617 | 617 | public function banner_process(&$banner, &$error) |
| 618 | 618 | { |
| 619 | 619 | $old_banner = $this->request->variable('old_banner', ''); |
@@ -649,13 +649,13 @@ discard block |
||
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | /** |
| 652 | - * Copy a remonte banner to server. |
|
| 653 | - * called by banner_process() |
|
| 654 | - * |
|
| 655 | - * @param string $banner The banner's remote url |
|
| 656 | - * @param array $error The array error, passed by reference |
|
| 657 | - * @return false|string String if no errors, else false |
|
| 658 | - */ |
|
| 652 | + * Copy a remonte banner to server. |
|
| 653 | + * called by banner_process() |
|
| 654 | + * |
|
| 655 | + * @param string $banner The banner's remote url |
|
| 656 | + * @param array $error The array error, passed by reference |
|
| 657 | + * @return false|string String if no errors, else false |
|
| 658 | + */ |
|
| 659 | 659 | private function _banner_upload($banner, &$error) |
| 660 | 660 | { |
| 661 | 661 | /** @var \phpbb\files\upload $upload */ |
@@ -687,13 +687,13 @@ discard block |
||
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | /** |
| 690 | - * Check than remote banner exists |
|
| 691 | - * called by banner_process() |
|
| 692 | - * |
|
| 693 | - * @param string $banner The banner's remote url |
|
| 694 | - * @param array $error The array error, passed by reference |
|
| 695 | - * @return false|string String if no errors, else false |
|
| 696 | - */ |
|
| 690 | + * Check than remote banner exists |
|
| 691 | + * called by banner_process() |
|
| 692 | + * |
|
| 693 | + * @param string $banner The banner's remote url |
|
| 694 | + * @param array $error The array error, passed by reference |
|
| 695 | + * @return false|string String if no errors, else false |
|
| 696 | + */ |
|
| 697 | 697 | private function _banner_remote($banner, &$error) |
| 698 | 698 | { |
| 699 | 699 | if (!preg_match('#^(http|https|ftp)://#i', $banner)) |
@@ -801,11 +801,11 @@ discard block |
||
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 | /** |
| 804 | - * Delete a banner from server |
|
| 805 | - * |
|
| 806 | - * @param string $file The file's name |
|
| 807 | - * @return bool True if delete success, else false |
|
| 808 | - */ |
|
| 804 | + * Delete a banner from server |
|
| 805 | + * |
|
| 806 | + * @param string $file The file's name |
|
| 807 | + * @return bool True if delete success, else false |
|
| 808 | + */ |
|
| 809 | 809 | private function _banner_delete($file) |
| 810 | 810 | { |
| 811 | 811 | if (file_exists($this->get_banner_path($file))) |
@@ -818,12 +818,12 @@ discard block |
||
| 818 | 818 | } |
| 819 | 819 | |
| 820 | 820 | /** |
| 821 | - * List flags |
|
| 822 | - * |
|
| 823 | - * @param string $flag_path The flag directory path |
|
| 824 | - * @param string $value Selected flag |
|
| 825 | - * @return string $list Html code |
|
| 826 | - */ |
|
| 821 | + * List flags |
|
| 822 | + * |
|
| 823 | + * @param string $flag_path The flag directory path |
|
| 824 | + * @param string $value Selected flag |
|
| 825 | + * @return string $list Html code |
|
| 826 | + */ |
|
| 827 | 827 | public function get_dir_flag_list($flag_path, $value) |
| 828 | 828 | { |
| 829 | 829 | $list = ''; |
@@ -858,10 +858,10 @@ discard block |
||
| 858 | 858 | } |
| 859 | 859 | |
| 860 | 860 | /** |
| 861 | - * Display recents links added |
|
| 862 | - * |
|
| 863 | - * @return null |
|
| 864 | - */ |
|
| 861 | + * Display recents links added |
|
| 862 | + * |
|
| 863 | + * @return null |
|
| 864 | + */ |
|
| 865 | 865 | public function recents() |
| 866 | 866 | { |
| 867 | 867 | if ($this->config['dir_recent_block']) |
@@ -938,13 +938,13 @@ discard block |
||
| 938 | 938 | } |
| 939 | 939 | |
| 940 | 940 | /** |
| 941 | - * Validate back link |
|
| 942 | - * |
|
| 943 | - * @param string $remote_url Page URL contains the backlink |
|
| 944 | - * @param bool $optional Link back is optional in this category? |
|
| 945 | - * @param bool $cron This methos is called by con process? |
|
| 946 | - * @return false|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) |
|
| 947 | - */ |
|
| 941 | + * Validate back link |
|
| 942 | + * |
|
| 943 | + * @param string $remote_url Page URL contains the backlink |
|
| 944 | + * @param bool $optional Link back is optional in this category? |
|
| 945 | + * @param bool $cron This methos is called by con process? |
|
| 946 | + * @return false|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) |
|
| 947 | + */ |
|
| 948 | 948 | public function validate_link_back($remote_url, $optional, $cron = false) |
| 949 | 949 | { |
| 950 | 950 | if (!$cron) |
@@ -76,20 +76,20 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\notification\manager $notification, \phpbb\filesystem\filesystem_interface $filesystem, \FastImageSize\FastImageSize $imagesize, \phpbb\files\factory $files_factory, $root_path, $php_ext) |
| 78 | 78 | { |
| 79 | - $this->db = $db; |
|
| 80 | - $this->config = $config; |
|
| 79 | + $this->db = $db; |
|
| 80 | + $this->config = $config; |
|
| 81 | 81 | $this->language = $language; |
| 82 | 82 | $this->template = $template; |
| 83 | 83 | $this->user = $user; |
| 84 | - $this->helper = $helper; |
|
| 85 | - $this->request = $request; |
|
| 84 | + $this->helper = $helper; |
|
| 85 | + $this->request = $request; |
|
| 86 | 86 | $this->auth = $auth; |
| 87 | - $this->notification = $notification; |
|
| 88 | - $this->filesystem = $filesystem; |
|
| 87 | + $this->notification = $notification; |
|
| 88 | + $this->filesystem = $filesystem; |
|
| 89 | 89 | $this->imagesize = $imagesize; |
| 90 | - $this->files_factory = $files_factory; |
|
| 90 | + $this->files_factory = $files_factory; |
|
| 91 | 91 | $this->root_path = $root_path; |
| 92 | - $this->php_ext = $php_ext; |
|
| 92 | + $this->php_ext = $php_ext; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -105,13 +105,13 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | $this->db->sql_transaction('begin'); |
| 107 | 107 | |
| 108 | - $sql = 'INSERT INTO ' . $this->links_table . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
| 108 | + $sql = 'INSERT INTO '.$this->links_table.' '.$this->db->sql_build_array('INSERT', $data); |
|
| 109 | 109 | $this->db->sql_query($sql); |
| 110 | 110 | $notification_data['link_id'] = $this->db->sql_nextid(); |
| 111 | 111 | |
| 112 | 112 | if (!$need_approval || $this->auth->acl_get('a_') || $this->auth->acl_get('m_')) |
| 113 | 113 | { |
| 114 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
| 114 | + $sql = 'UPDATE '.$this->categories_table.' |
|
| 115 | 115 | SET cat_links = cat_links + 1 |
| 116 | 116 | WHERE cat_id = ' . (int) $data['link_cat']; |
| 117 | 117 | $this->db->sql_query($sql); |
@@ -169,14 +169,14 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | $this->db->sql_transaction('begin'); |
| 171 | 171 | |
| 172 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
| 172 | + $sql = 'UPDATE '.$this->categories_table.' |
|
| 173 | 173 | SET cat_links = cat_links - 1 |
| 174 | 174 | WHERE cat_id = ' . (int) $old_cat; |
| 175 | 175 | $this->db->sql_query($sql); |
| 176 | 176 | |
| 177 | 177 | if (!$need_approval) |
| 178 | 178 | { |
| 179 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
| 179 | + $sql = 'UPDATE '.$this->categories_table.' |
|
| 180 | 180 | SET cat_links = cat_links + 1 |
| 181 | 181 | WHERE cat_id = ' . (int) $data['link_cat']; |
| 182 | 182 | $this->db->sql_query($sql); |
@@ -194,8 +194,8 @@ discard block |
||
| 194 | 194 | $this->notification->add_notifications($notification_type, $notification_data); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 198 | - SET ' . $this->db->sql_build_array('UPDATE', $data) . ' |
|
| 197 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 198 | + SET ' . $this->db->sql_build_array('UPDATE', $data).' |
|
| 199 | 199 | WHERE link_id = ' . (int) $link_id; |
| 200 | 200 | $this->db->sql_query($sql); |
| 201 | 201 | } |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | ); |
| 222 | 222 | |
| 223 | 223 | $sql = 'SELECT link_banner |
| 224 | - FROM ' . $this->links_table . ' |
|
| 224 | + FROM ' . $this->links_table.' |
|
| 225 | 225 | WHERE '. $this->db->sql_in_set('link_id', $url_array); |
| 226 | 226 | $result = $this->db->sql_query($sql); |
| 227 | 227 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | $this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $url_array)); |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
| 246 | + $sql = 'UPDATE '.$this->categories_table.' |
|
| 247 | 247 | SET cat_links = cat_links - '.sizeof($url_array).' |
| 248 | 248 | WHERE cat_id = ' . (int) $cat_id; |
| 249 | 249 | $this->db->sql_query($sql); |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | if ($this->request->is_ajax()) |
| 262 | 262 | { |
| 263 | 263 | $sql = 'SELECT cat_links |
| 264 | - FROM ' . $this->categories_table . ' |
|
| 264 | + FROM ' . $this->categories_table.' |
|
| 265 | 265 | WHERE cat_id = ' . (int) $cat_id; |
| 266 | 266 | $result = $this->db->sql_query($sql); |
| 267 | 267 | $data = $this->db->sql_fetchrow($result); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | public function view($link_id) |
| 289 | 289 | { |
| 290 | 290 | $sql = 'SELECT link_id, link_url |
| 291 | - FROM ' . $this->links_table . ' |
|
| 291 | + FROM ' . $this->links_table.' |
|
| 292 | 292 | WHERE link_id = ' . (int) $link_id; |
| 293 | 293 | $result = $this->db->sql_query($sql); |
| 294 | 294 | $data = $this->db->sql_fetchrow($result); |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | throw new \phpbb\exception\http_exception(404, 'DIR_ERROR_NO_LINKS'); |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 301 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 302 | 302 | SET link_view = link_view + 1 |
| 303 | 303 | WHERE link_id = ' . (int) $link_id; |
| 304 | 304 | $this->db->sql_query($sql); |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | if ($details['scheme'] == 'https') |
| 324 | 324 | { |
| 325 | 325 | $default_port = 443; |
| 326 | - $hostname = 'tls://' . $details['host']; |
|
| 326 | + $hostname = 'tls://'.$details['host']; |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | if (!isset($details['path'])) |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | $flag_path = $ext_path.'images/flags/'; |
| 382 | 382 | $img_flag = 'no_flag.png'; |
| 383 | 383 | |
| 384 | - if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path . $data['link_flag'])) |
|
| 384 | + if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path.$data['link_flag'])) |
|
| 385 | 385 | { |
| 386 | 386 | $img_flag = $data['link_flag']; |
| 387 | 387 | } |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $list = '<select name="vote">'; |
| 424 | 424 | for ($i = 0; $i <= 10; $i++) |
| 425 | 425 | { |
| 426 | - $list .= '<option value="' . $i . '"' . (($i == 5) ? ' selected="selected"' : '') . '>' . $i . '</option>'; |
|
| 426 | + $list .= '<option value="'.$i.'"'.(($i == 5) ? ' selected="selected"' : '').'>'.$i.'</option>'; |
|
| 427 | 427 | } |
| 428 | 428 | $list .= '</select>'; |
| 429 | 429 | |
@@ -461,8 +461,8 @@ discard block |
||
| 461 | 461 | { |
| 462 | 462 | $thumb = $this->thumb_process($data['link_url']); |
| 463 | 463 | |
| 464 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 465 | - SET link_thumb = "' . $this->db->sql_escape($thumb) . '" |
|
| 464 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 465 | + SET link_thumb = "' . $this->db->sql_escape($thumb).'" |
|
| 466 | 466 | WHERE link_id = ' . (int) $data['link_id']; |
| 467 | 467 | $this->db->sql_query($sql); |
| 468 | 468 | |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | $height /= $coef_max; |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | - return '<img src="' . $img_src . '" width="' . $width . '" height="' . $height . '" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />'; |
|
| 512 | + return '<img src="'.$img_src.'" width="'.$width.'" height="'.$height.'" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />'; |
|
| 513 | 513 | } |
| 514 | 514 | return ''; |
| 515 | 515 | } |
@@ -530,12 +530,12 @@ discard block |
||
| 530 | 530 | |
| 531 | 531 | $this->db->sql_transaction('begin'); |
| 532 | 532 | |
| 533 | - $sql = 'INSERT INTO ' . $this->votes_table . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
| 533 | + $sql = 'INSERT INTO '.$this->votes_table.' '.$this->db->sql_build_array('INSERT', $data); |
|
| 534 | 534 | $this->db->sql_query($sql); |
| 535 | 535 | |
| 536 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 536 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 537 | 537 | SET link_vote = link_vote + 1, |
| 538 | - link_note = link_note + ' . (int) $data['vote_note'] . ' |
|
| 538 | + link_note = link_note + ' . (int) $data['vote_note'].' |
|
| 539 | 539 | WHERE link_id = ' . (int) $link_id; |
| 540 | 540 | $this->db->sql_query($sql); |
| 541 | 541 | |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | |
| 544 | 544 | if ($this->request->is_ajax()) |
| 545 | 545 | { |
| 546 | - $sql= 'SELECT link_vote, link_note FROM ' . $this->links_table . ' WHERE link_id = ' . (int) $link_id; |
|
| 546 | + $sql = 'SELECT link_vote, link_note FROM '.$this->links_table.' WHERE link_id = '.(int) $link_id; |
|
| 547 | 547 | $result = $this->db->sql_query($sql); |
| 548 | 548 | $data = $this->db->sql_fetchrow($result); |
| 549 | 549 | |
@@ -577,8 +577,8 @@ discard block |
||
| 577 | 577 | |
| 578 | 578 | $details = parse_url($url); |
| 579 | 579 | |
| 580 | - $root_url = $details['scheme'].'://'.$details['host']; |
|
| 581 | - $absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url; |
|
| 580 | + $root_url = $details['scheme'].'://'.$details['host']; |
|
| 581 | + $absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url; |
|
| 582 | 582 | |
| 583 | 583 | if ($this->config['dir_activ_thumb_remote'] && $this->_ascreen_exist($details['scheme'], $details['host'])) |
| 584 | 584 | { |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | $destination = $this->get_banner_path(); |
| 622 | 622 | |
| 623 | 623 | // Can we upload? |
| 624 | - $can_upload = ($this->config['dir_storage_banner'] && $this->filesystem->exists($this->root_path . $destination) && $this->filesystem->is_writable($this->root_path . $destination) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false; |
|
| 624 | + $can_upload = ($this->config['dir_storage_banner'] && $this->filesystem->exists($this->root_path.$destination) && $this->filesystem->is_writable($this->root_path.$destination) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false; |
|
| 625 | 625 | |
| 626 | 626 | if ($banner && $can_upload) |
| 627 | 627 | { |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | |
| 668 | 668 | $file = $upload->handle_upload('files.types.remote', $banner); |
| 669 | 669 | |
| 670 | - $prefix = unique_id() . '_'; |
|
| 670 | + $prefix = unique_id().'_'; |
|
| 671 | 671 | $file->clean_filename('real', $prefix); |
| 672 | 672 | |
| 673 | 673 | if (sizeof($file->error)) |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | { |
| 699 | 699 | if (!preg_match('#^(http|https|ftp)://#i', $banner)) |
| 700 | 700 | { |
| 701 | - $banner = 'http://' . $banner; |
|
| 701 | + $banner = 'http://'.$banner; |
|
| 702 | 702 | } |
| 703 | 703 | if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.(gif|jpg|jpeg|png)$#i', $banner)) |
| 704 | 704 | { |
@@ -729,8 +729,8 @@ discard block |
||
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | // Check image type |
| 732 | - $types = \phpbb\files\upload::image_types(); |
|
| 733 | - $extension = strtolower(\phpbb\files\filespec::get_extension($banner)); |
|
| 732 | + $types = \phpbb\files\upload::image_types(); |
|
| 733 | + $extension = strtolower(\phpbb\files\filespec::get_extension($banner)); |
|
| 734 | 734 | |
| 735 | 735 | // Check if this is actually an image |
| 736 | 736 | if ($file_stream = @fopen($banner, 'r')) |
@@ -850,7 +850,7 @@ discard block |
||
| 850 | 850 | |
| 851 | 851 | if (file_exists($flag_path.$img_file)) |
| 852 | 852 | { |
| 853 | - $list .= '<option value="' . $img_file . '" ' . (($img_file == $value) ? 'selected="selected"' : '') . '>' . $name . '</option>'; |
|
| 853 | + $list .= '<option value="'.$img_file.'" '.(($img_file == $value) ? 'selected="selected"' : '').'>'.$name.'</option>'; |
|
| 854 | 854 | } |
| 855 | 855 | } |
| 856 | 856 | |
@@ -866,8 +866,8 @@ discard block |
||
| 866 | 866 | { |
| 867 | 867 | if ($this->config['dir_recent_block']) |
| 868 | 868 | { |
| 869 | - $limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns']; |
|
| 870 | - $exclude_array = explode(',', str_replace(' ', '', $this->config['dir_recent_exclude'])); |
|
| 869 | + $limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns']; |
|
| 870 | + $exclude_array = explode(',', str_replace(' ', '', $this->config['dir_recent_exclude'])); |
|
| 871 | 871 | |
| 872 | 872 | $sql_array = array( |
| 873 | 873 | 'SELECT' => 'l.link_id, l.link_cat, l.link_url, l.link_user_id, l.link_comment, l. link_description, l.link_vote, l.link_note, l.link_view, l.link_time, l.link_name, l.link_thumb, u.user_id, u.username, u.user_colour, c.cat_name', |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | if (sizeof($rowset)) |
| 901 | 901 | { |
| 902 | 902 | $this->template->assign_block_vars('block', array( |
| 903 | - 'S_COL_WIDTH' => (100 / $this->config['dir_recent_columns']) . '%', |
|
| 903 | + 'S_COL_WIDTH' => (100 / $this->config['dir_recent_columns']).'%', |
|
| 904 | 904 | )); |
| 905 | 905 | |
| 906 | 906 | foreach ($rowset as $row) |