@@ -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 | } |
@@ -52,13 +52,13 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\helper $dir_helper, $table_prefix, $php_ext) |
54 | 54 | { |
55 | - $this->db = $db; |
|
56 | - $this->helper = $helper; |
|
57 | - $this->template = $template; |
|
58 | - $this->user = $user; |
|
59 | - $this->dir_helper = $dir_helper; |
|
55 | + $this->db = $db; |
|
56 | + $this->helper = $helper; |
|
57 | + $this->template = $template; |
|
58 | + $this->user = $user; |
|
59 | + $this->dir_helper = $dir_helper; |
|
60 | 60 | $this->table_prefix = $table_prefix; |
61 | - $this->php_ext = $php_ext; |
|
61 | + $this->php_ext = $php_ext; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function add_page_header_variables() |
103 | 103 | { |
104 | - $ext_theme_path = $this->dir_helper->get_ext_name() . '/styles/prosilver/theme/'; |
|
104 | + $ext_theme_path = $this->dir_helper->get_ext_name().'/styles/prosilver/theme/'; |
|
105 | 105 | $theme_lang_path = $this->user->lang_name; |
106 | 106 | |
107 | 107 | // Prevent 'Twig_Error_Loader' if user's lang directory doesn't exist |
108 | - if (!file_exists($ext_theme_path . $theme_lang_path . '/directory.css')) |
|
108 | + if (!file_exists($ext_theme_path.$theme_lang_path.'/directory.css')) |
|
109 | 109 | { |
110 | 110 | // Fallback to English language. |
111 | 111 | $theme_lang_path = 'en'; |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function add_page_viewonline($event) |
127 | 127 | { |
128 | - if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/directory') === 0) |
|
128 | + if (strrpos($event['row']['session_page'], 'app.'.$this->php_ext.'/directory') === 0) |
|
129 | 129 | { |
130 | - $event['location'] = $this->user->lang['DIRECTORY']; |
|
131 | - $event['location_url'] = $this->helper->route('ernadoo_phpbbdirectory_base_controller'); |
|
130 | + $event['location'] = $this->user->lang['DIRECTORY']; |
|
131 | + $event['location_url'] = $this->helper->route('ernadoo_phpbbdirectory_base_controller'); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | |
@@ -158,24 +158,24 @@ discard block |
||
158 | 158 | { |
159 | 159 | $categories = $event['categories']; |
160 | 160 | $categories = array_merge($categories, array('dir' => 'ACL_CAT_DIRECTORY')); |
161 | - $event['categories'] = $categories; |
|
161 | + $event['categories'] = $categories; |
|
162 | 162 | |
163 | 163 | $permissions = $event['permissions']; |
164 | 164 | |
165 | 165 | $permissions = array_merge($permissions, array( |
166 | - 'm_delete_dir' => array('lang' => 'ACL_M_DELETE_DIR', 'cat' => 'dir'), |
|
167 | - 'm_delete_comment_dir' => array('lang' => 'ACL_M_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
168 | - 'm_edit_dir' => array('lang' => 'ACL_M_EDIT_DIR', 'cat' => 'dir'), |
|
169 | - 'm_edit_comment_dir' => array('lang' => 'ACL_M_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
170 | - |
|
171 | - 'u_comment_dir' => array('lang' => 'ACL_U_COMMENT_DIR', 'cat' => 'dir'), |
|
172 | - 'u_delete_dir' => array('lang' => 'ACL_U_DELETE_DIR', 'cat' => 'dir'), |
|
173 | - 'u_delete_comment_dir' => array('lang' => 'ACL_U_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
174 | - 'u_edit_dir' => array('lang' => 'ACL_U_EDIT_DIR', 'cat' => 'dir'), |
|
175 | - 'u_edit_comment_dir' => array('lang' => 'ACL_U_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
176 | - 'u_search_dir' => array('lang' => 'ACL_U_SEARCH_DIR', 'cat' => 'dir'), |
|
177 | - 'u_submit_dir' => array('lang' => 'ACL_U_SUBMIT_DIR', 'cat' => 'dir'), |
|
178 | - 'u_vote_dir' => array('lang' => 'ACL_U_VOTE_DIR', 'cat' => 'dir'), |
|
166 | + 'm_delete_dir' => array('lang' => 'ACL_M_DELETE_DIR', 'cat' => 'dir'), |
|
167 | + 'm_delete_comment_dir' => array('lang' => 'ACL_M_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
168 | + 'm_edit_dir' => array('lang' => 'ACL_M_EDIT_DIR', 'cat' => 'dir'), |
|
169 | + 'm_edit_comment_dir' => array('lang' => 'ACL_M_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
170 | + |
|
171 | + 'u_comment_dir' => array('lang' => 'ACL_U_COMMENT_DIR', 'cat' => 'dir'), |
|
172 | + 'u_delete_dir' => array('lang' => 'ACL_U_DELETE_DIR', 'cat' => 'dir'), |
|
173 | + 'u_delete_comment_dir' => array('lang' => 'ACL_U_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
174 | + 'u_edit_dir' => array('lang' => 'ACL_U_EDIT_DIR', 'cat' => 'dir'), |
|
175 | + 'u_edit_comment_dir' => array('lang' => 'ACL_U_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
176 | + 'u_search_dir' => array('lang' => 'ACL_U_SEARCH_DIR', 'cat' => 'dir'), |
|
177 | + 'u_submit_dir' => array('lang' => 'ACL_U_SUBMIT_DIR', 'cat' => 'dir'), |
|
178 | + 'u_vote_dir' => array('lang' => 'ACL_U_VOTE_DIR', 'cat' => 'dir'), |
|
179 | 179 | )); |
180 | 180 | |
181 | 181 | $event['permissions'] = $permissions; |
@@ -196,17 +196,17 @@ discard block |
||
196 | 196 | $user_ids = array($user_ids); |
197 | 197 | } |
198 | 198 | |
199 | - $sql = 'UPDATE ' . DIR_COMMENT_TABLE . ' |
|
200 | - SET comment_user_id = ' . ANONYMOUS . ' |
|
199 | + $sql = 'UPDATE '.DIR_COMMENT_TABLE.' |
|
200 | + SET comment_user_id = ' . ANONYMOUS.' |
|
201 | 201 | WHERE ' . $this->db->sql_in_set('comment_user_id', $user_ids); |
202 | 202 | $this->db->sql_query($sql); |
203 | 203 | |
204 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
205 | - SET link_user_id = ' . ANONYMOUS . ' |
|
204 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
205 | + SET link_user_id = ' . ANONYMOUS.' |
|
206 | 206 | WHERE ' . $this->db->sql_in_set('link_user_id', $user_ids); |
207 | 207 | $this->db->sql_query($sql); |
208 | 208 | |
209 | - $sql = 'DELETE FROM ' . DIR_WATCH_TABLE . ' |
|
209 | + $sql = 'DELETE FROM '.DIR_WATCH_TABLE.' |
|
210 | 210 | WHERE ' . $this->db->sql_in_set('user_id', $user_ids); |
211 | 211 | $this->db->sql_query($sql); |
212 | 212 | } |
@@ -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 | /** |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\cron\manager $cron, \ernadoo\phpbbdirectory\core\helper $dir_helper) |
60 | 60 | { |
61 | - $this->db = $db; |
|
61 | + $this->db = $db; |
|
62 | 62 | $this->config = $config; |
63 | - $this->template = $template; |
|
63 | + $this->template = $template; |
|
64 | 64 | $this->user = $user; |
65 | 65 | $this->helper = $helper; |
66 | - $this->request = $request; |
|
66 | + $this->request = $request; |
|
67 | 67 | $this->auth = $auth; |
68 | 68 | $this->cron = $cron; |
69 | - $this->dir_helper = $dir_helper; |
|
69 | + $this->dir_helper = $dir_helper; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public function make_cat_jumpbox() |
89 | 89 | { |
90 | 90 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
91 | - FROM ' . DIR_CAT_TABLE . ' |
|
91 | + FROM ' . DIR_CAT_TABLE.' |
|
92 | 92 | ORDER BY left_id ASC'; |
93 | 93 | $result = $this->db->sql_query($sql, 600); |
94 | 94 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | // This query is identical to the jumpbox one |
151 | 151 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
152 | - FROM ' . DIR_CAT_TABLE . ' |
|
152 | + FROM ' . DIR_CAT_TABLE.' |
|
153 | 153 | ORDER BY left_id ASC'; |
154 | 154 | $result = $this->db->sql_query($sql, 600); |
155 | 155 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | } |
180 | 180 | |
181 | 181 | $selected = (($row['cat_id'] == $select_id) ? ' selected="selected"' : ''); |
182 | - $cat_list .= '<option value="' . $row['cat_id'] . '"' . (($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected) . '>' . $padding . $row['cat_name'] . '</option>'; |
|
182 | + $cat_list .= '<option value="'.$row['cat_id'].'"'.(($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected).'>'.$padding.$row['cat_name'].'</option>'; |
|
183 | 183 | } |
184 | 184 | $this->db->sql_freeresult($result); |
185 | 185 | unset($padding_store); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | */ |
195 | 195 | public function display() |
196 | 196 | { |
197 | - $cat_rows = $subcats = array(); |
|
197 | + $cat_rows = $subcats = array(); |
|
198 | 198 | $parent_id = $visible_cats = 0; |
199 | 199 | |
200 | 200 | $sql_array = array( |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | else |
213 | 213 | { |
214 | 214 | $root_data = $this->data; |
215 | - $sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id']; |
|
215 | + $sql_where = 'left_id > '.$root_data['left_id'].' AND left_id < '.$root_data['right_id']; |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | $sql = $this->db->sql_build_query('SELECT', array( |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | { |
260 | 260 | foreach ($subcats[$dir_cat_id] as $subcat_id => $subcat_row) |
261 | 261 | { |
262 | - $row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links']+$subcat_row['links']) : $row['cat_links']; |
|
262 | + $row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links'] + $subcat_row['links']) : $row['cat_links']; |
|
263 | 263 | |
264 | 264 | if ($subcat_row['display'] && $subcat_row['parent_id'] == $dir_cat_id) |
265 | 265 | { |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | if ($task->is_ready()) |
315 | 315 | { |
316 | 316 | $url = $task->get_url(); |
317 | - $this->template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="" />'); |
|
317 | + $this->template->assign_var('RUN_CRON_TASK', '<img src="'.$url.'" width="1" height="1" alt="" />'); |
|
318 | 318 | } |
319 | 319 | } |
320 | 320 | } |
@@ -336,10 +336,10 @@ discard block |
||
336 | 336 | 'LEFT_JOIN' => array( |
337 | 337 | array( |
338 | 338 | 'FROM' => array(DIR_WATCH_TABLE => 'w'), |
339 | - 'ON' => 'c.cat_id = w.cat_id AND w.user_id = ' . (int) $this->user->data['user_id'] |
|
339 | + 'ON' => 'c.cat_id = w.cat_id AND w.user_id = '.(int) $this->user->data['user_id'] |
|
340 | 340 | ), |
341 | 341 | ), |
342 | - 'WHERE' => 'c.cat_id = ' . (int) $cat_id |
|
342 | + 'WHERE' => 'c.cat_id = '.(int) $cat_id |
|
343 | 343 | ); |
344 | 344 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
345 | 345 | $result = $this->db->sql_query($sql); |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | $this->template->assign_block_vars('dir_navlinks', array( |
377 | 377 | 'FORUM_NAME' => $parent_data['cat_name'], |
378 | 378 | 'FORUM_ID' => $parent_cat_id, |
379 | - 'MICRODATA' => $microdata_attr . '="' . $parent_cat_id . '"', |
|
379 | + 'MICRODATA' => $microdata_attr.'="'.$parent_cat_id.'"', |
|
380 | 380 | 'U_VIEW_FORUM' => $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $parent_cat_id)), |
381 | 381 | )); |
382 | 382 | } |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | $this->template->assign_block_vars('dir_navlinks', array( |
386 | 386 | 'FORUM_NAME' => $dir_cat_data['cat_name'], |
387 | 387 | 'FORUM_ID' => $dir_cat_data['cat_id'], |
388 | - 'MICRODATA' => $microdata_attr . '="' . $dir_cat_data['cat_id'] . '"', |
|
388 | + 'MICRODATA' => $microdata_attr.'="'.$dir_cat_data['cat_id'].'"', |
|
389 | 389 | 'U_VIEW_FORUM' => $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $dir_cat_data['cat_id'])), |
390 | 390 | )); |
391 | 391 | |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | { |
443 | 443 | if ($mode == 'unwatch') |
444 | 444 | { |
445 | - $sql = 'DELETE FROM ' . DIR_WATCH_TABLE . " |
|
445 | + $sql = 'DELETE FROM '.DIR_WATCH_TABLE." |
|
446 | 446 | WHERE cat_id = $cat_id |
447 | 447 | AND user_id = $user_id"; |
448 | 448 | $this->db->sql_query($sql); |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | |
453 | 453 | if (!$this->request->is_ajax()) |
454 | 454 | { |
455 | - $message .= '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>'); |
|
455 | + $message .= '<br /><br />'.$this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>'); |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | meta_refresh(3, $redirect_url); |
@@ -464,8 +464,8 @@ discard block |
||
464 | 464 | |
465 | 465 | if ($notify_status != NOTIFY_YES) |
466 | 466 | { |
467 | - $sql = 'UPDATE ' . DIR_WATCH_TABLE . ' |
|
468 | - SET notify_status = ' . NOTIFY_YES . " |
|
467 | + $sql = 'UPDATE '.DIR_WATCH_TABLE.' |
|
468 | + SET notify_status = ' . NOTIFY_YES." |
|
469 | 469 | WHERE cat_id = $cat_id |
470 | 470 | AND user_id = $user_id"; |
471 | 471 | $this->db->sql_query($sql); |
@@ -476,8 +476,8 @@ discard block |
||
476 | 476 | { |
477 | 477 | if ($mode == 'watch') |
478 | 478 | { |
479 | - $sql = 'INSERT INTO ' . DIR_WATCH_TABLE . " (user_id, cat_id, notify_status) |
|
480 | - VALUES ($user_id, $cat_id, " . NOTIFY_YES . ')'; |
|
479 | + $sql = 'INSERT INTO '.DIR_WATCH_TABLE." (user_id, cat_id, notify_status) |
|
480 | + VALUES ($user_id, $cat_id, ".NOTIFY_YES.')'; |
|
481 | 481 | $this->db->sql_query($sql); |
482 | 482 | |
483 | 483 | $redirect_url = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)); |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | |
486 | 486 | if (!$this->request->is_ajax()) |
487 | 487 | { |
488 | - $message .= '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>'); |
|
488 | + $message .= '<br /><br />'.$this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>'); |
|
489 | 489 | } |
490 | 490 | |
491 | 491 | meta_refresh(3, $redirect_url); |
@@ -505,10 +505,10 @@ discard block |
||
505 | 505 | |
506 | 506 | if ($can_watch) |
507 | 507 | { |
508 | - $s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch'))); |
|
508 | + $s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch'))); |
|
509 | 509 | $s_watching['link_toggle'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => ((!$is_watching) ? 'unwatch' : 'watch'))); |
510 | - $s_watching['title'] = $this->user->lang[(($is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT']; |
|
511 | - $s_watching['title_toggle'] = $this->user->lang[((!$is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT']; |
|
510 | + $s_watching['title'] = $this->user->lang[(($is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT']; |
|
511 | + $s_watching['title_toggle'] = $this->user->lang[((!$is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT']; |
|
512 | 512 | $s_watching['is_watching'] = $is_watching; |
513 | 513 | } |
514 | 514 | |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | global $db; |
527 | 527 | |
528 | 528 | $sql = 'SELECT cat_name |
529 | - FROM ' . DIR_CAT_TABLE . ' |
|
529 | + FROM ' . DIR_CAT_TABLE.' |
|
530 | 530 | WHERE cat_id = ' . (int) $cat_id; |
531 | 531 | $result = $db->sql_query($sql); |
532 | 532 | $row = $db->sql_fetchrow($result); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user) |
31 | 31 | { |
32 | - $this->db = $db; |
|
32 | + $this->db = $db; |
|
33 | 33 | $this->user = $user; |
34 | 34 | } |
35 | 35 | |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | { |
44 | 44 | $this->db->sql_transaction('begin'); |
45 | 45 | |
46 | - $sql = 'INSERT INTO ' . DIR_COMMENT_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
46 | + $sql = 'INSERT INTO '.DIR_COMMENT_TABLE.' '.$this->db->sql_build_array('INSERT', $data); |
|
47 | 47 | $this->db->sql_query($sql); |
48 | 48 | |
49 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
49 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
50 | 50 | SET link_comment = link_comment + 1 |
51 | 51 | WHERE link_id = ' . (int) $data['comment_link_id']; |
52 | 52 | $this->db->sql_query($sql); |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function edit($data, $comment_id) |
65 | 65 | { |
66 | - $sql = 'UPDATE ' . DIR_COMMENT_TABLE . ' |
|
67 | - SET ' . $this->db->sql_build_array('UPDATE', $data) . ' |
|
66 | + $sql = 'UPDATE '.DIR_COMMENT_TABLE.' |
|
67 | + SET ' . $this->db->sql_build_array('UPDATE', $data).' |
|
68 | 68 | WHERE comment_id = ' . (int) $comment_id; |
69 | 69 | $this->db->sql_query($sql); |
70 | 70 | } |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | |
83 | 83 | $this->db->sql_transaction('begin'); |
84 | 84 | |
85 | - $sql = 'DELETE FROM ' . DIR_COMMENT_TABLE . ' WHERE comment_id = ' . (int) $comment_id; |
|
85 | + $sql = 'DELETE FROM '.DIR_COMMENT_TABLE.' WHERE comment_id = '.(int) $comment_id; |
|
86 | 86 | $this->db->sql_query($sql); |
87 | 87 | |
88 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
88 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
89 | 89 | SET link_comment = link_comment - 1 |
90 | 90 | WHERE link_id = ' . (int) $link_id; |
91 | 91 | $this->db->sql_query($sql); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | if ($request->is_ajax()) |
96 | 96 | { |
97 | 97 | $sql = 'SELECT COUNT(comment_id) AS nb_comments |
98 | - FROM ' . DIR_COMMENT_TABLE . ' |
|
98 | + FROM ' . DIR_COMMENT_TABLE.' |
|
99 | 99 | WHERE comment_link_id = ' . (int) $link_id; |
100 | 100 | $result = $this->db->sql_query($sql); |
101 | 101 | $nb_comments = (int) $this->db->sql_fetchfield('nb_comments'); |
@@ -62,17 +62,17 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\notification\manager $notification, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext) |
64 | 64 | { |
65 | - $this->db = $db; |
|
65 | + $this->db = $db; |
|
66 | 66 | $this->config = $config; |
67 | - $this->template = $template; |
|
67 | + $this->template = $template; |
|
68 | 68 | $this->user = $user; |
69 | 69 | $this->helper = $helper; |
70 | - $this->request = $request; |
|
70 | + $this->request = $request; |
|
71 | 71 | $this->auth = $auth; |
72 | - $this->notification = $notification; |
|
73 | - $this->dir_helper = $dir_helper; |
|
74 | - $this->root_path = $root_path; |
|
75 | - $this->php_ext = $php_ext; |
|
72 | + $this->notification = $notification; |
|
73 | + $this->dir_helper = $dir_helper; |
|
74 | + $this->root_path = $root_path; |
|
75 | + $this->php_ext = $php_ext; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -88,13 +88,13 @@ discard block |
||
88 | 88 | |
89 | 89 | $this->db->sql_transaction('begin'); |
90 | 90 | |
91 | - $sql = 'INSERT INTO ' . DIR_LINK_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
91 | + $sql = 'INSERT INTO '.DIR_LINK_TABLE.' '.$this->db->sql_build_array('INSERT', $data); |
|
92 | 92 | $this->db->sql_query($sql); |
93 | 93 | $notification_data['link_id'] = $this->db->sql_nextid(); |
94 | 94 | |
95 | 95 | if (!$need_approval || $this->auth->acl_get('a_') || $this->auth->acl_get('m_')) |
96 | 96 | { |
97 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
97 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
98 | 98 | SET cat_links = cat_links + 1 |
99 | 99 | WHERE cat_id = ' . (int) $data['link_cat']; |
100 | 100 | $this->db->sql_query($sql); |
@@ -152,14 +152,14 @@ discard block |
||
152 | 152 | |
153 | 153 | $this->db->sql_transaction('begin'); |
154 | 154 | |
155 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
155 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
156 | 156 | SET cat_links = cat_links - 1 |
157 | 157 | WHERE cat_id = ' . (int) $old_cat; |
158 | 158 | $this->db->sql_query($sql); |
159 | 159 | |
160 | 160 | if (!$need_approval) |
161 | 161 | { |
162 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
162 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
163 | 163 | SET cat_links = cat_links + 1 |
164 | 164 | WHERE cat_id = ' . (int) $data['link_cat']; |
165 | 165 | $this->db->sql_query($sql); |
@@ -177,8 +177,8 @@ discard block |
||
177 | 177 | $this->notification->add_notifications($notification_type, $notification_data); |
178 | 178 | } |
179 | 179 | |
180 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
181 | - SET ' . $this->db->sql_build_array('UPDATE', $data) . ' |
|
180 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
181 | + SET ' . $this->db->sql_build_array('UPDATE', $data).' |
|
182 | 182 | WHERE link_id = ' . (int) $link_id; |
183 | 183 | $this->db->sql_query($sql); |
184 | 184 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | ); |
205 | 205 | |
206 | 206 | $sql = 'SELECT link_banner |
207 | - FROM ' . DIR_LINK_TABLE . ' |
|
207 | + FROM ' . DIR_LINK_TABLE.' |
|
208 | 208 | WHERE '. $this->db->sql_in_set('link_id', $url_array); |
209 | 209 | $result = $this->db->sql_query($sql); |
210 | 210 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $url_array)); |
227 | 227 | } |
228 | 228 | |
229 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
229 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
230 | 230 | SET cat_links = cat_links - '.sizeof($url_array).' |
231 | 231 | WHERE cat_id = ' . (int) $cat_id; |
232 | 232 | $this->db->sql_query($sql); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | if ($this->request->is_ajax()) |
245 | 245 | { |
246 | 246 | $sql = 'SELECT cat_links |
247 | - FROM ' . DIR_CAT_TABLE . ' |
|
247 | + FROM ' . DIR_CAT_TABLE.' |
|
248 | 248 | WHERE cat_id = ' . (int) $cat_id; |
249 | 249 | $result = $this->db->sql_query($sql); |
250 | 250 | $data = $this->db->sql_fetchrow($result); |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | public function view($link_id) |
272 | 272 | { |
273 | 273 | $sql = 'SELECT link_id, link_url |
274 | - FROM ' . DIR_LINK_TABLE . ' |
|
274 | + FROM ' . DIR_LINK_TABLE.' |
|
275 | 275 | WHERE link_id = ' . (int) $link_id; |
276 | 276 | $result = $this->db->sql_query($sql); |
277 | 277 | $data = $this->db->sql_fetchrow($result); |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | throw new \phpbb\exception\http_exception(404, 'DIR_ERROR_NO_LINKS'); |
282 | 282 | } |
283 | 283 | |
284 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
284 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
285 | 285 | SET link_view = link_view + 1 |
286 | 286 | WHERE link_id = ' . (int) $link_id; |
287 | 287 | $this->db->sql_query($sql); |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | if ($details['scheme'] == 'https') |
307 | 307 | { |
308 | 308 | $default_port = 443; |
309 | - $hostname = 'tls://' . $details['host']; |
|
309 | + $hostname = 'tls://'.$details['host']; |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | if (!isset($details['path'])) |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | $flag_path = $ext_path.'images/flags/'; |
365 | 365 | $img_flag = 'no_flag.png'; |
366 | 366 | |
367 | - if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path . $data['link_flag'])) |
|
367 | + if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path.$data['link_flag'])) |
|
368 | 368 | { |
369 | 369 | $img_flag = $data['link_flag']; |
370 | 370 | } |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | $list = '<select name="vote">'; |
407 | 407 | for ($i = 0; $i <= 10; $i++) |
408 | 408 | { |
409 | - $list .= '<option value="' . $i . '"' . (($i == 5) ? ' selected="selected"' : '') . '>' . $i . '</option>'; |
|
409 | + $list .= '<option value="'.$i.'"'.(($i == 5) ? ' selected="selected"' : '').'>'.$i.'</option>'; |
|
410 | 410 | } |
411 | 411 | $list .= '</select>'; |
412 | 412 | |
@@ -444,8 +444,8 @@ discard block |
||
444 | 444 | { |
445 | 445 | $thumb = $this->thumb_process($data['link_url']); |
446 | 446 | |
447 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
448 | - SET link_thumb = "' . $this->db->sql_escape($thumb) . '" |
|
447 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
448 | + SET link_thumb = "' . $this->db->sql_escape($thumb).'" |
|
449 | 449 | WHERE link_id = ' . (int) $data['link_id']; |
450 | 450 | $this->db->sql_query($sql); |
451 | 451 | |
@@ -469,8 +469,8 @@ discard block |
||
469 | 469 | { |
470 | 470 | $pagerank = $this->pagerank_process($data['link_url']); |
471 | 471 | |
472 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
473 | - SET link_pagerank = ' . (int) $pagerank . ' |
|
472 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
473 | + SET link_pagerank = ' . (int) $pagerank.' |
|
474 | 474 | WHERE link_id = ' . (int) $data['link_id']; |
475 | 475 | $this->db->sql_query($sql); |
476 | 476 | } |
@@ -479,9 +479,9 @@ discard block |
||
479 | 479 | $pagerank = (int) $data['link_pagerank']; |
480 | 480 | } |
481 | 481 | |
482 | - $prpos=40*$pagerank/10; |
|
483 | - $prneg=40-$prpos; |
|
484 | - $html='<img src="http://www.google.com/images/pos.gif" width="'.$prpos.'" height="4" alt="'.$pagerank.'" /><img src="http://www.google.com/images/neg.gif" width="'.$prneg.'" height="4" alt="'.$pagerank.'" /> '; |
|
482 | + $prpos = 40 * $pagerank / 10; |
|
483 | + $prneg = 40 - $prpos; |
|
484 | + $html = '<img src="http://www.google.com/images/pos.gif" width="'.$prpos.'" height="4" alt="'.$pagerank.'" /><img src="http://www.google.com/images/neg.gif" width="'.$prneg.'" height="4" alt="'.$pagerank.'" /> '; |
|
485 | 485 | |
486 | 486 | $pagerank = $pagerank == '-1' ? $this->user->lang['DIR_PAGERANK_NOT_AVAILABLE'] : $this->user->lang('DIR_FROM_TEN', $pagerank); |
487 | 487 | return $html.$pagerank; |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | $height /= $coef_max; |
522 | 522 | } |
523 | 523 | |
524 | - $s_banner = '<img src="' . $img_src . '" width="' . $width . '" height="' . $height . '" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />'; |
|
524 | + $s_banner = '<img src="'.$img_src.'" width="'.$width.'" height="'.$height.'" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />'; |
|
525 | 525 | } |
526 | 526 | |
527 | 527 | return $s_banner; |
@@ -543,12 +543,12 @@ discard block |
||
543 | 543 | |
544 | 544 | $this->db->sql_transaction('begin'); |
545 | 545 | |
546 | - $sql = 'INSERT INTO ' . DIR_VOTE_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
546 | + $sql = 'INSERT INTO '.DIR_VOTE_TABLE.' '.$this->db->sql_build_array('INSERT', $data); |
|
547 | 547 | $this->db->sql_query($sql); |
548 | 548 | |
549 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
549 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
550 | 550 | SET link_vote = link_vote + 1, |
551 | - link_note = link_note + ' . (int) $data['vote_note'] . ' |
|
551 | + link_note = link_note + ' . (int) $data['vote_note'].' |
|
552 | 552 | WHERE link_id = ' . (int) $link_id; |
553 | 553 | $this->db->sql_query($sql); |
554 | 554 | |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | |
557 | 557 | if ($this->request->is_ajax()) |
558 | 558 | { |
559 | - $sql= 'SELECT link_vote, link_note FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int) $link_id; |
|
559 | + $sql = 'SELECT link_vote, link_note FROM '.DIR_LINK_TABLE.' WHERE link_id = '.(int) $link_id; |
|
560 | 560 | $result = $this->db->sql_query($sql); |
561 | 561 | $data = $this->db->sql_fetchrow($result); |
562 | 562 | |
@@ -590,8 +590,8 @@ discard block |
||
590 | 590 | |
591 | 591 | $details = parse_url($url); |
592 | 592 | |
593 | - $root_url = $details['scheme'].'://'.$details['host']; |
|
594 | - $absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url; |
|
593 | + $root_url = $details['scheme'].'://'.$details['host']; |
|
594 | + $absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url; |
|
595 | 595 | |
596 | 596 | if ($this->config['dir_activ_thumb_remote'] && $this->_ascreen_exist($details['scheme'], $details['host'])) |
597 | 597 | { |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | $destination = $this->dir_helper->get_banner_path(); |
635 | 635 | |
636 | 636 | // Can we upload? |
637 | - $can_upload = ($this->config['dir_storage_banner'] && file_exists($this->root_path . $destination) && phpbb_is_writable($this->root_path . $destination) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false; |
|
637 | + $can_upload = ($this->config['dir_storage_banner'] && file_exists($this->root_path.$destination) && phpbb_is_writable($this->root_path.$destination) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false; |
|
638 | 638 | |
639 | 639 | if ($banner && $can_upload) |
640 | 640 | { |
@@ -674,13 +674,13 @@ discard block |
||
674 | 674 | // Init upload class |
675 | 675 | if (!class_exists('fileupload')) |
676 | 676 | { |
677 | - include($this->root_path . 'includes/functions_upload.' . $this->php_ext); |
|
677 | + include($this->root_path.'includes/functions_upload.'.$this->php_ext); |
|
678 | 678 | } |
679 | 679 | $upload = new \fileupload('DIR_BANNER_', array('jpg', 'jpeg', 'gif', 'png'), $this->config['dir_banner_filesize']); |
680 | 680 | |
681 | 681 | $file = $upload->remote_upload($banner); |
682 | 682 | |
683 | - $prefix = unique_id() . '_'; |
|
683 | + $prefix = unique_id().'_'; |
|
684 | 684 | $file->clean_filename('real', $prefix); |
685 | 685 | |
686 | 686 | $destination = $this->dir_helper->get_banner_path(); |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | return false; |
696 | 696 | } |
697 | 697 | |
698 | - return $prefix .strtolower($file->uploadname); |
|
698 | + return $prefix.strtolower($file->uploadname); |
|
699 | 699 | } |
700 | 700 | |
701 | 701 | /** |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | { |
711 | 711 | if (!preg_match('#^(http|https|ftp)://#i', $banner)) |
712 | 712 | { |
713 | - $banner = 'http://' . $banner; |
|
713 | + $banner = 'http://'.$banner; |
|
714 | 714 | } |
715 | 715 | if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.(gif|jpg|jpeg|png)$#i', $banner)) |
716 | 716 | { |
@@ -737,11 +737,11 @@ discard block |
||
737 | 737 | // Check image type |
738 | 738 | if (!class_exists('fileupload')) |
739 | 739 | { |
740 | - include($this->root_path . 'includes/functions_upload.' . $this->php_ext); |
|
740 | + include($this->root_path.'includes/functions_upload.'.$this->php_ext); |
|
741 | 741 | } |
742 | 742 | |
743 | - $types = \fileupload::image_types(); |
|
744 | - $extension = strtolower(\filespec::get_extension($banner)); |
|
743 | + $types = \fileupload::image_types(); |
|
744 | + $extension = strtolower(\filespec::get_extension($banner)); |
|
745 | 745 | |
746 | 746 | // Check if this is actually an image |
747 | 747 | if ($file_stream = @fopen($banner, 'r')) |
@@ -843,14 +843,14 @@ discard block |
||
843 | 843 | */ |
844 | 844 | public function pagerank_process($q) |
845 | 845 | { |
846 | - $googleDomains = array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch'); |
|
847 | - $seed = $this->user->lang['SEED']; |
|
848 | - $result = 0x01020345; |
|
846 | + $googleDomains = array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch'); |
|
847 | + $seed = $this->user->lang['SEED']; |
|
848 | + $result = 0x01020345; |
|
849 | 849 | $len = strlen($q); |
850 | 850 | |
851 | - for ($i=0; $i<$len; $i++) |
|
851 | + for ($i = 0; $i < $len; $i++) |
|
852 | 852 | { |
853 | - $result ^= ord($seed{$i%strlen($seed)}) ^ ord($q{$i}); |
|
853 | + $result ^= ord($seed{$i % strlen($seed)}) ^ ord($q{$i}); |
|
854 | 854 | $result = (($result >> 23) & 0x1ff) | $result << 9; |
855 | 855 | } |
856 | 856 | |
@@ -861,10 +861,10 @@ discard block |
||
861 | 861 | |
862 | 862 | $ch = sprintf('8%x', $result); |
863 | 863 | $url = 'http://%s/tbr?client=navclient-auto&ch=%s&features=Rank&q=info:%s'; |
864 | - $host = 'toolbarqueries.google'.$googleDomains[mt_rand(0,count($googleDomains)-1)]; |
|
864 | + $host = 'toolbarqueries.google'.$googleDomains[mt_rand(0, count($googleDomains) - 1)]; |
|
865 | 865 | |
866 | - $url = sprintf($url,$host,$ch,$q); |
|
867 | - @$pr = trim(file_get_contents($url,false)); |
|
866 | + $url = sprintf($url, $host, $ch, $q); |
|
867 | + @$pr = trim(file_get_contents($url, false)); |
|
868 | 868 | |
869 | 869 | if (is_numeric(substr(strrchr($pr, ':'), 1))) |
870 | 870 | { |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | |
907 | 907 | if (file_exists($flag_path.$img_file)) |
908 | 908 | { |
909 | - $list .= '<option value="' . $img_file . '" ' . (($img_file == $value) ? 'selected="selected"' : '') . '>' . $name . '</option>'; |
|
909 | + $list .= '<option value="'.$img_file.'" '.(($img_file == $value) ? 'selected="selected"' : '').'>'.$name.'</option>'; |
|
910 | 910 | } |
911 | 911 | } |
912 | 912 | |
@@ -922,8 +922,8 @@ discard block |
||
922 | 922 | { |
923 | 923 | if ($this->config['dir_recent_block']) |
924 | 924 | { |
925 | - $limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns']; |
|
926 | - $exclude_array = explode(',', str_replace(' ', '', $this->config['dir_recent_exclude'])); |
|
925 | + $limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns']; |
|
926 | + $exclude_array = explode(',', str_replace(' ', '', $this->config['dir_recent_exclude'])); |
|
927 | 927 | |
928 | 928 | $sql_array = array( |
929 | 929 | 'SELECT' => 'l.link_id, l.link_cat, l.link_url, l.link_user_id, l.link_comment, l. link_description, l.link_vote, l.link_note, l.link_view, l.link_time, l.link_name, l.link_thumb, u.user_id, u.username, u.user_colour, c.cat_name', |
@@ -956,7 +956,7 @@ discard block |
||
956 | 956 | if (sizeof($rowset)) |
957 | 957 | { |
958 | 958 | $this->template->assign_block_vars('block', array( |
959 | - 'S_COL_WIDTH' => (100 / $this->config['dir_recent_columns']) . '%', |
|
959 | + 'S_COL_WIDTH' => (100 / $this->config['dir_recent_columns']).'%', |
|
960 | 960 | )); |
961 | 961 | |
962 | 962 | foreach ($rowset as $row) |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | 'ON' => 'l.link_user_id = u.user_id' |
1063 | 1063 | ) |
1064 | 1064 | ), |
1065 | - 'WHERE' => 'l.link_back <> "" AND l.link_active = 1 AND l.link_cat = ' . (int) $cat_id); |
|
1065 | + 'WHERE' => 'l.link_back <> "" AND l.link_active = 1 AND l.link_cat = '.(int) $cat_id); |
|
1066 | 1066 | |
1067 | 1067 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
1068 | 1068 | $result = $this->db->sql_query($sql); |
@@ -1071,7 +1071,7 @@ discard block |
||
1071 | 1071 | { |
1072 | 1072 | if ($this->validate_link_back($row['link_back'], false, true) !== false) |
1073 | 1073 | { |
1074 | - if (!$nb_check || ($row['link_nb_check']+1) >= $nb_check) |
|
1074 | + if (!$nb_check || ($row['link_nb_check'] + 1) >= $nb_check) |
|
1075 | 1075 | { |
1076 | 1076 | $del_array[] = $row['link_id']; |
1077 | 1077 | } |
@@ -1105,7 +1105,7 @@ discard block |
||
1105 | 1105 | global $phpbb_log; |
1106 | 1106 | |
1107 | 1107 | $sql = 'SELECT cat_name |
1108 | - FROM ' . DIR_CAT_TABLE . ' |
|
1108 | + FROM ' . DIR_CAT_TABLE.' |
|
1109 | 1109 | WHERE cat_id = ' . (int) $cat_data['cat_id']; |
1110 | 1110 | $result = $this->db->sql_query($sql); |
1111 | 1111 | $row = $this->db->sql_fetchrow($result); |
@@ -1117,9 +1117,9 @@ discard block |
||
1117 | 1117 | |
1118 | 1118 | $this->_check($cat_data['cat_id'], $cat_data['cat_cron_nb_check'], $next_prune); |
1119 | 1119 | |
1120 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . " |
|
1120 | + $sql = 'UPDATE '.DIR_CAT_TABLE." |
|
1121 | 1121 | SET cat_cron_next = $next_prune |
1122 | - WHERE cat_id = " . (int) $cat_data['cat_id']; |
|
1122 | + WHERE cat_id = ".(int) $cat_data['cat_id']; |
|
1123 | 1123 | $this->db->sql_query($sql); |
1124 | 1124 | |
1125 | 1125 | $phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_AUTO_PRUNE', time(), array($row['cat_name'])); |
@@ -1139,7 +1139,7 @@ discard block |
||
1139 | 1139 | { |
1140 | 1140 | if (!class_exists('messenger')) |
1141 | 1141 | { |
1142 | - include($this->root_path . 'includes/functions_messenger.' . $this->php_ext); |
|
1142 | + include($this->root_path.'includes/functions_messenger.'.$this->php_ext); |
|
1143 | 1143 | } |
1144 | 1144 | |
1145 | 1145 | $messenger = new \messenger(false); |
@@ -1148,7 +1148,7 @@ discard block |
||
1148 | 1148 | // We need to define it, because we use user->format_date below |
1149 | 1149 | $this->user->timezone = new \DateTimeZone($this->config['board_timezone']); |
1150 | 1150 | |
1151 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
1151 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
1152 | 1152 | SET link_nb_check = link_nb_check + 1 |
1153 | 1153 | WHERE ' . $this->db->sql_in_set('link_id', array_keys($u_array)); |
1154 | 1154 | $this->db->sql_query($sql); |