@@ -18,11 +18,11 @@ |
||
| 18 | 18 | 'filename' => '\ernadoo\phpbbdirectory\acp\phpbbdirectory_module', |
| 19 | 19 | 'title' => 'ACP_DIRECTORY', |
| 20 | 20 | 'modes' => array( |
| 21 | - '' => array('title' => 'ACP_DIRECTORY', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('')), |
|
| 22 | - 'main' => array('title' => 'ACP_DIRECTORY_MAIN', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
| 23 | - 'settings' => array('title' => 'ACP_DIRECTORY_SETTINGS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
| 24 | - 'cat' => array('title' => 'ACP_DIRECTORY_CATS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
| 25 | - 'val' => array('title' => 'ACP_DIRECTORY_VAL', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
| 21 | + '' => array('title' => 'ACP_DIRECTORY', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('')), |
|
| 22 | + 'main' => array('title' => 'ACP_DIRECTORY_MAIN', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
| 23 | + 'settings' => array('title' => 'ACP_DIRECTORY_SETTINGS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
| 24 | + 'cat' => array('title' => 'ACP_DIRECTORY_CATS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
| 25 | + 'val' => array('title' => 'ACP_DIRECTORY_VAL', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
| 26 | 26 | ), |
| 27 | 27 | ); |
| 28 | 28 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | return array( |
| 25 | 25 | 'add_tables' => array( |
| 26 | - $this->table_prefix . 'directory_cats' => array( |
|
| 26 | + $this->table_prefix.'directory_cats' => array( |
|
| 27 | 27 | 'COLUMNS' => array( |
| 28 | 28 | 'cat_id' => array('UINT', null, 'auto_increment'), |
| 29 | 29 | 'parent_id' => array('UINT', 0), |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | ), |
| 58 | 58 | ), |
| 59 | 59 | |
| 60 | - $this->table_prefix . 'directory_comments' => array( |
|
| 60 | + $this->table_prefix.'directory_comments' => array( |
|
| 61 | 61 | 'COLUMNS' => array( |
| 62 | 62 | 'comment_id' => array('UINT', null, 'auto_increment'), |
| 63 | 63 | 'comment_date' => array('TIMESTAMP', 0), |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | 'PRIMARY_KEY' => array('comment_id'), |
| 74 | 74 | ), |
| 75 | 75 | |
| 76 | - $this->table_prefix . 'directory_links' => array( |
|
| 76 | + $this->table_prefix.'directory_links' => array( |
|
| 77 | 77 | 'COLUMNS' => array( |
| 78 | 78 | 'link_id' => array('UINT', null, 'auto_increment'), |
| 79 | 79 | 'link_time' => array('TIMESTAMP', 0), |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | ), |
| 111 | 111 | ), |
| 112 | 112 | |
| 113 | - $this->table_prefix . 'directory_watch' => array( |
|
| 113 | + $this->table_prefix.'directory_watch' => array( |
|
| 114 | 114 | 'COLUMNS' => array( |
| 115 | 115 | 'cat_id' => array('UINT', 0), |
| 116 | 116 | 'user_id' => array('UINT', 0), |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | ), |
| 127 | 127 | |
| 128 | - $this->table_prefix . 'directory_votes' => array( |
|
| 128 | + $this->table_prefix.'directory_votes' => array( |
|
| 129 | 129 | 'COLUMNS' => array( |
| 130 | 130 | 'vote_id' => array('UINT', null, 'auto_increment'), |
| 131 | 131 | 'vote_link_id' => array('UINT', 0), |
@@ -148,11 +148,11 @@ discard block |
||
| 148 | 148 | { |
| 149 | 149 | return array( |
| 150 | 150 | 'drop_tables' => array( |
| 151 | - $this->table_prefix . 'directory_cats', |
|
| 152 | - $this->table_prefix . 'directory_comments', |
|
| 153 | - $this->table_prefix . 'directory_links', |
|
| 154 | - $this->table_prefix . 'directory_votes', |
|
| 155 | - $this->table_prefix . 'directory_watch', |
|
| 151 | + $this->table_prefix.'directory_cats', |
|
| 152 | + $this->table_prefix.'directory_comments', |
|
| 153 | + $this->table_prefix.'directory_links', |
|
| 154 | + $this->table_prefix.'directory_votes', |
|
| 155 | + $this->table_prefix.'directory_watch', |
|
| 156 | 156 | ), |
| 157 | 157 | ); |
| 158 | 158 | } |
@@ -272,10 +272,10 @@ discard block |
||
| 272 | 272 | |
| 273 | 273 | foreach ($directories as $dir) |
| 274 | 274 | { |
| 275 | - if (!file_exists($this->phpbb_root_path . $dir)) |
|
| 275 | + if (!file_exists($this->phpbb_root_path.$dir)) |
|
| 276 | 276 | { |
| 277 | - @mkdir($this->phpbb_root_path . $dir, 0777, true); |
|
| 278 | - phpbb_chmod($this->phpbb_root_path . $dir, CHMOD_READ | CHMOD_WRITE); |
|
| 277 | + @mkdir($this->phpbb_root_path.$dir, 0777, true); |
|
| 278 | + phpbb_chmod($this->phpbb_root_path.$dir, CHMOD_READ | CHMOD_WRITE); |
|
| 279 | 279 | } |
| 280 | 280 | } |
| 281 | 281 | } |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | */ |
| 288 | 288 | public function remove_directories() |
| 289 | 289 | { |
| 290 | - $dir = $this->phpbb_root_path . 'files/ext/ernadoo/phpbbdirectory/'; |
|
| 290 | + $dir = $this->phpbb_root_path.'files/ext/ernadoo/phpbbdirectory/'; |
|
| 291 | 291 | |
| 292 | 292 | $this->_recursive_rmdir($dir); |
| 293 | 293 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | public function effectively_installed() |
| 25 | 25 | { |
| 26 | 26 | $sql = 'SELECT module_id |
| 27 | - FROM ' . $this->table_prefix . "modules |
|
| 27 | + FROM ' . $this->table_prefix."modules |
|
| 28 | 28 | WHERE module_class = 'acp' |
| 29 | 29 | AND module_basename = 'acp_directory' |
| 30 | 30 | AND module_mode = 'main'"; |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | 'module_auth' => 'ext_ernadoo/phpbbdirectory' |
| 57 | 57 | ); |
| 58 | 58 | |
| 59 | - $sql = 'UPDATE ' . $this->table_prefix . 'modules |
|
| 60 | - SET ' . $this->db->sql_build_array('UPDATE', $module_data) . " |
|
| 59 | + $sql = 'UPDATE '.$this->table_prefix.'modules |
|
| 60 | + SET ' . $this->db->sql_build_array('UPDATE', $module_data)." |
|
| 61 | 61 | WHERE module_basename = 'acp_directory' |
| 62 | 62 | AND module_mode IN ('main', 'settings', 'cat', 'val')"; |
| 63 | 63 | $this->db->sql_query($sql); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function effectively_installed() |
| 25 | 25 | { |
| 26 | - return !$this->db_tools->sql_table_exists($this->table_prefix . 'directory_notifications'); |
|
| 26 | + return !$this->db_tools->sql_table_exists($this->table_prefix.'directory_notifications'); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | static public function depends_on() |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | public function copy_from_notifications() |
| 55 | 55 | { |
| 56 | 56 | $sql = 'SELECT n_user_id, n_cat_id |
| 57 | - FROM ' . $this->table_prefix . 'directory_notifications'; |
|
| 57 | + FROM ' . $this->table_prefix.'directory_notifications'; |
|
| 58 | 58 | $result = $this->db->sql_query($sql); |
| 59 | 59 | |
| 60 | 60 | while ($row = $this->db->sql_fetchrow($result)) |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | 'notify_status' => 1, |
| 66 | 66 | ); |
| 67 | 67 | |
| 68 | - $sql = 'INSERT INTO ' . $this->table_prefix . 'directory_watch ' . $this->db->sql_build_array('INSERT', $data); |
|
| 68 | + $sql = 'INSERT INTO '.$this->table_prefix.'directory_watch '.$this->db->sql_build_array('INSERT', $data); |
|
| 69 | 69 | $this->db->sql_query($sql); |
| 70 | 70 | } |
| 71 | 71 | $this->db->sql_freeresult($result); |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function __construct(\phpbb\extension\manager $phpbb_extension_manager, \phpbb\path_helper $path_helper) |
| 31 | 31 | { |
| 32 | - $this->extension_manager = $phpbb_extension_manager; |
|
| 33 | - $this->path_helper = $path_helper; |
|
| 32 | + $this->extension_manager = $phpbb_extension_manager; |
|
| 33 | + $this->path_helper = $path_helper; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function get_ext_name($web_root_path = false) |
| 43 | 43 | { |
| 44 | - return (($web_root_path) ? $this->path_helper->get_web_root_path() : '') . $this->extension_manager->get_extension_path($this->ext_name); |
|
| 44 | + return (($web_root_path) ? $this->path_helper->get_web_root_path() : '').$this->extension_manager->get_extension_path($this->ext_name); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function get_img_path($type, $image = '') |
| 55 | 55 | { |
| 56 | - return $this->get_ext_name(true) . 'images/' . $type . '/' . $image; |
|
| 56 | + return $this->get_ext_name(true).'images/'.$type.'/'.$image; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function get_banner_path($banner = '') |
| 66 | 66 | { |
| 67 | - return 'files/' . $this->get_ext_name() . 'banners/' . $banner; |
|
| 67 | + return 'files/'.$this->get_ext_name().'banners/'.$banner; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \ernadoo\phpbbdirectory\core\link $directory_cron, $php_ext) |
| 39 | 39 | { |
| 40 | - $this->db = $db; |
|
| 41 | - $this->config = $config; |
|
| 40 | + $this->db = $db; |
|
| 41 | + $this->config = $config; |
|
| 42 | 42 | $this->dir_cron = $directory_cron; |
| 43 | 43 | $this->php_ext = $php_ext; |
| 44 | 44 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $cat_id = $request->variable('c', 0); |
| 114 | 114 | |
| 115 | 115 | $sql = 'SELECT cat_id, cat_cron_enable, cat_cron_next, cat_cron_freq, cat_cron_nb_check |
| 116 | - FROM ' . DIR_CAT_TABLE . " |
|
| 116 | + FROM ' . DIR_CAT_TABLE." |
|
| 117 | 117 | WHERE cat_id = $cat_id"; |
| 118 | 118 | $result = $this->db->sql_query($sql); |
| 119 | 119 | $row = $this->db->sql_fetchrow($result); |
@@ -155,7 +155,7 @@ |
||
| 155 | 155 | |
| 156 | 156 | foreach ($notification_types as $notification_type) |
| 157 | 157 | { |
| 158 | - call_user_func(array($phpbb_notifications, $step . '_notifications'), $notification_type); |
|
| 158 | + call_user_func(array($phpbb_notifications, $step.'_notifications'), $notification_type); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | return 'notifications'; |
@@ -67,20 +67,20 @@ discard block |
||
| 67 | 67 | $match_search_query = ''; |
| 68 | 68 | foreach ($matches as $match) |
| 69 | 69 | { |
| 70 | - $match_search_query .= (($match_search_query) ? ' OR ' : '') . 'LOWER('. $match . ') '; |
|
| 71 | - $match_search_query .= $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), $this->db->get_any_char() . strtolower($word) . $this->db->get_any_char())); |
|
| 70 | + $match_search_query .= (($match_search_query) ? ' OR ' : '').'LOWER('.$match.') '; |
|
| 71 | + $match_search_query .= $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), $this->db->get_any_char().strtolower($word).$this->db->get_any_char())); |
|
| 72 | 72 | } |
| 73 | - $search_query .= ((!$search_query) ? '' : (($terms == 'all') ? ' AND ' : ' OR ')) . '(' . $match_search_query . ')'; |
|
| 73 | + $search_query .= ((!$search_query) ? '' : (($terms == 'all') ? ' AND ' : ' OR ')).'('.$match_search_query.')'; |
|
| 74 | 74 | } |
| 75 | 75 | $direction = (($sort_dir == 'd') ? 'DESC' : 'ASC'); |
| 76 | 76 | |
| 77 | 77 | if (is_array($sort_by_sql[$sort_key])) |
| 78 | 78 | { |
| 79 | - $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; |
|
| 79 | + $sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction; |
|
| 80 | 80 | } |
| 81 | 81 | else |
| 82 | 82 | { |
| 83 | - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; |
|
| 83 | + $sql_sort_order = $sort_by_sql[$sort_key].' '.$direction; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | $sql_array = array( |
@@ -88,10 +88,10 @@ discard block |
||
| 88 | 88 | 'FROM' => array( |
| 89 | 89 | DIR_LINK_TABLE => 'l'), |
| 90 | 90 | 'WHERE' => 'l.link_active = 1 |
| 91 | - ' . (($search_query) ? 'AND (' . $search_query . ')' : '') . ' |
|
| 92 | - ' . (sizeof($ex_cid_ary) ? ' AND ' . $this->db->sql_in_set('l.link_cat', $ex_cid_ary, true) : '') . ' |
|
| 93 | - ' . (($cat_id) ? ' AND ' . $this->db->sql_in_set('l.link_cat', $cat_id) : '') . ' |
|
| 94 | - ' . (($sort_days) ? ' AND l.link_time >= ' . (time() - ($sort_days * 86400)) : ''), |
|
| 91 | + ' . (($search_query) ? 'AND ('.$search_query.')' : '').' |
|
| 92 | + ' . (sizeof($ex_cid_ary) ? ' AND '.$this->db->sql_in_set('l.link_cat', $ex_cid_ary, true) : '').' |
|
| 93 | + ' . (($cat_id) ? ' AND '.$this->db->sql_in_set('l.link_cat', $cat_id) : '').' |
|
| 94 | + ' . (($sort_days) ? ' AND l.link_time >= '.(time() - ($sort_days * 86400)) : ''), |
|
| 95 | 95 | 'ORDER_BY' => $sql_sort_order |
| 96 | 96 | ); |
| 97 | 97 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | { |
| 205 | 205 | $selected = ($url == $url_selected) ? 'selected="selected"' : ''; |
| 206 | 206 | |
| 207 | - $select_options .= '<option value="' . $url . '" ' . $selected . '>' . parse_url($url, PHP_URL_HOST) . '</option>'; |
|
| 207 | + $select_options .= '<option value="'.$url.'" '.$selected.'>'.parse_url($url, PHP_URL_HOST).'</option>'; |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | return $select_options; |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | { |
| 238 | 238 | $selected = ($i == $order_selected) ? 'selected="selected"' : ''; |
| 239 | 239 | $order_substr = trim(str_replace(' ', '_', $i)); |
| 240 | - $tpl .= '<option value="' . $i . '" ' . $selected . '>' . $user->lang['DIR_ORDER_' . strtoupper($order_substr)] . '</option>'; |
|
| 240 | + $tpl .= '<option value="'.$i.'" '.$selected.'>'.$user->lang['DIR_ORDER_'.strtoupper($order_substr)].'</option>'; |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | return ($tpl); |
@@ -254,6 +254,6 @@ discard block |
||
| 254 | 254 | $value = $filesize['value']; |
| 255 | 255 | |
| 256 | 256 | // size and maxlength must not be specified for input of type number |
| 257 | - return '<input type="number" id="' . $key . '" min="0" max="999999999999999" step="any" name="config[' . $key . ']" value="' . $value . '" /> <select name="' . $key . '">' . size_select_options($size_var) . '</select>'; |
|
| 257 | + return '<input type="number" id="'.$key.'" min="0" max="999999999999999" step="any" name="config['.$key.']" value="'.$value.'" /> <select name="'.$key.'">'.size_select_options($size_var).'</select>'; |
|
| 258 | 258 | } |
| 259 | 259 | } |