@@ -66,16 +66,16 @@ discard block |
||
66 | 66 | */ |
67 | 67 | 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) |
68 | 68 | { |
69 | - $this->db = $db; |
|
70 | - $this->config = $config; |
|
69 | + $this->db = $db; |
|
70 | + $this->config = $config; |
|
71 | 71 | $this->language = $language; |
72 | 72 | $this->template = $template; |
73 | 73 | $this->user = $user; |
74 | - $this->helper = $helper; |
|
75 | - $this->request = $request; |
|
74 | + $this->helper = $helper; |
|
75 | + $this->request = $request; |
|
76 | 76 | $this->auth = $auth; |
77 | - $this->pagination = $pagination; |
|
78 | - $this->categorie = $categorie; |
|
77 | + $this->pagination = $pagination; |
|
78 | + $this->categorie = $categorie; |
|
79 | 79 | $this->link = $link; |
80 | 80 | |
81 | 81 | $language->add_lang('directory', 'ernadoo/phpbbdirectory'); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | throw new \phpbb\exception\http_exception(404, 'DIR_ERROR_NO_CATS'); |
116 | 116 | } |
117 | 117 | |
118 | - $url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id, array('page' => $page)); |
|
118 | + $url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id, array('page' => $page)); |
|
119 | 119 | |
120 | 120 | return new RedirectResponse($url, 301); |
121 | 121 | } |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | |
142 | 142 | $start = ($page - 1) * $this->config['dir_show']; |
143 | 143 | |
144 | - $default_sort_days = 0; |
|
144 | + $default_sort_days = 0; |
|
145 | 145 | $default_sort_key = (string) substr($this->config['dir_default_order'], 0, 1); |
146 | 146 | $default_sort_dir = (string) substr($this->config['dir_default_order'], 2); |
147 | 147 | |
148 | 148 | $sort_days = (!$sort_days) ? $this->request->variable('st', $default_sort_days) : $sort_days; |
149 | 149 | $sort_key = (!$sort_key) ? $this->request->variable('sk', $default_sort_key) : $sort_key; |
150 | - $sort_dir = (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir; |
|
150 | + $sort_dir = (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir; |
|
151 | 151 | $link_list = $rowset = array(); |
152 | 152 | |
153 | 153 | // Categorie ordering options |
@@ -185,8 +185,8 @@ discard block |
||
185 | 185 | $min_post_time = time() - ($sort_days * 86400); |
186 | 186 | |
187 | 187 | $sql = 'SELECT COUNT(link_id) AS nb_links |
188 | - FROM ' . $this->links_table . ' |
|
189 | - WHERE link_cat = ' . (int) $cat_id . ' |
|
188 | + FROM ' . $this->links_table.' |
|
189 | + WHERE link_cat = ' . (int) $cat_id.' |
|
190 | 190 | AND link_time >= ' . (int) $min_post_time; |
191 | 191 | $result = $this->db->sql_query($sql); |
192 | 192 | $nb_links = (int) $this->db->sql_fetchfield('nb_links'); |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | else |
202 | 202 | { |
203 | 203 | $sql_limit_time = ''; |
204 | - $nb_links = (int) $this->categorie->data['cat_links']; |
|
204 | + $nb_links = (int) $this->categorie->data['cat_links']; |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | // Make sure $start is set to the last page if it exceeds the amount |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $this->categorie->make_cat_jumpbox(); |
215 | 215 | |
216 | 216 | $base_url = array( |
217 | - 'routes' => 'ernadoo_phpbbdirectory_dynamic_route_' . $cat_id, |
|
217 | + 'routes' => 'ernadoo_phpbbdirectory_dynamic_route_'.$cat_id, |
|
218 | 218 | 'params' => array_merge(array('cat_id' => $cat_id), $u_sort_param), |
219 | 219 | ); |
220 | 220 | |
@@ -227,14 +227,14 @@ discard block |
||
227 | 227 | 'S_SELECT_SORT_KEY' => $s_sort_key, |
228 | 228 | 'S_SELECT_SORT_DAYS' => $s_limit_days, |
229 | 229 | 'S_CATLIST' => $this->categorie->make_cat_select($cat_id), |
230 | - 'S_PAGE_ACTION' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id, array('page' => $page)), |
|
230 | + 'S_PAGE_ACTION' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id, array('page' => $page)), |
|
231 | 231 | 'S_CAT_ID' => $cat_id, |
232 | 232 | |
233 | 233 | 'TOTAL_LINKS' => $this->language->lang('DIR_NB_LINKS', (int) $nb_links), |
234 | 234 | |
235 | 235 | 'U_NEW_SITE' => $this->helper->route('ernadoo_phpbbdirectory_new_controller', array('cat_id' => $cat_id)), |
236 | 236 | |
237 | - 'U_VIEW_CAT' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id), |
|
237 | + 'U_VIEW_CAT' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id), |
|
238 | 238 | 'U_WATCH_CAT' => $s_watching_categorie['link'], |
239 | 239 | 'U_WATCH_CAT_TOGGLE' => $s_watching_categorie['link_toggle'], |
240 | 240 | 'S_WATCH_CAT_TITLE' => $s_watching_categorie['title'], |
@@ -264,11 +264,11 @@ discard block |
||
264 | 264 | |
265 | 265 | if (is_array($sort_by_sql[$sort_key])) |
266 | 266 | { |
267 | - $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; |
|
267 | + $sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction; |
|
268 | 268 | } |
269 | 269 | else |
270 | 270 | { |
271 | - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; |
|
271 | + $sql_sort_order = $sort_by_sql[$sort_key].' '.$direction; |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | // Grab just the sorted link ids |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | ), |
312 | 312 | array( |
313 | 313 | 'FROM' => array($this->votes_table => 'v'), |
314 | - 'ON' => 'l.link_id = v.vote_link_id AND v.vote_user_id = ' . $this->user->data['user_id'] |
|
314 | + 'ON' => 'l.link_id = v.vote_link_id AND v.vote_user_id = '.$this->user->data['user_id'] |
|
315 | 315 | ) |
316 | 316 | ), |
317 | 317 | 'WHERE' => $this->db->sql_in_set('l.link_id', $link_list) |
@@ -328,8 +328,8 @@ discard block |
||
328 | 328 | |
329 | 329 | $link_list = ($store_reverse) ? array_reverse($link_list) : $link_list; |
330 | 330 | |
331 | - $votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false; |
|
332 | - $comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false; |
|
331 | + $votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false; |
|
332 | + $comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false; |
|
333 | 333 | |
334 | 334 | foreach ($link_list as $link_id) |
335 | 335 | { |
@@ -339,10 +339,10 @@ discard block |
||
339 | 339 | $s_note = $this->link->display_note($site['link_note'], $site['link_vote'], $votes_status); |
340 | 340 | $s_thumb = $this->link->display_thumb($site); |
341 | 341 | $s_vote = $this->link->display_vote($site); |
342 | - $s_banner = $this->link->display_bann($site); |
|
343 | - $s_rss = $this->link->display_rss($site); |
|
342 | + $s_banner = $this->link->display_bann($site); |
|
343 | + $s_rss = $this->link->display_rss($site); |
|
344 | 344 | |
345 | - $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')))); |
|
345 | + $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')))); |
|
346 | 346 | $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')))); |
347 | 347 | |
348 | 348 | $this->template->assign_block_vars('site', array( |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | $this->template->assign_block_vars('no_draw_link', array()); |
379 | 379 | } |
380 | 380 | |
381 | - $page_title = $this->language->lang('DIRECTORY') . ' - ' . $this->categorie->data['cat_name']; |
|
381 | + $page_title = $this->language->lang('DIRECTORY').' - '.$this->categorie->data['cat_name']; |
|
382 | 382 | |
383 | 383 | $this->categorie->display(); |
384 | 384 |
@@ -84,23 +84,23 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category) |
86 | 86 | { |
87 | - $this->cache = $cache; |
|
88 | - $this->db = $db; |
|
89 | - $this->helper = $helper; |
|
87 | + $this->cache = $cache; |
|
88 | + $this->db = $db; |
|
89 | + $this->helper = $helper; |
|
90 | 90 | $this->language = $language; |
91 | 91 | $this->phpbb_log = $log; |
92 | - $this->request = $request; |
|
92 | + $this->request = $request; |
|
93 | 93 | $this->template = $template; |
94 | - $this->user = $user; |
|
94 | + $this->user = $user; |
|
95 | 95 | $this->categorie = $categorie; |
96 | - $this->nestedset_category = $nestedset_category; |
|
96 | + $this->nestedset_category = $nestedset_category; |
|
97 | 97 | |
98 | 98 | $this->form_key = 'acp_dir_cat'; |
99 | 99 | add_form_key($this->form_key); |
100 | 100 | |
101 | 101 | $this->action = $this->request->variable('action', ''); |
102 | 102 | $this->cat_id = $request->variable('c', 0); |
103 | - $this->parent_id = $request->variable('parent_id', 0); |
|
103 | + $this->parent_id = $request->variable('parent_id', 0); |
|
104 | 104 | $this->update = ($this->request->is_set_post('update')) ? true : false; |
105 | 105 | } |
106 | 106 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | { |
152 | 152 | if (!$this->cat_id) |
153 | 153 | { |
154 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
154 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | $this->cat_data = $this->_get_cat_info($this->cat_id); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $cat_list = $this->categorie->make_cat_select((int) $this->cat_data['parent_id'], $subcats_id); |
168 | 168 | |
169 | 169 | $sql = 'SELECT cat_id |
170 | - FROM ' . $this->categories_table . ' |
|
170 | + FROM ' . $this->categories_table.' |
|
171 | 171 | WHERE cat_id <> ' . (int) $this->cat_id; |
172 | 172 | $result = $this->db->sql_query_limit($sql, 1); |
173 | 173 | |
@@ -183,8 +183,8 @@ discard block |
||
183 | 183 | |
184 | 184 | $this->template->assign_vars(array( |
185 | 185 | 'S_DELETE_DIR_CAT' => true, |
186 | - 'U_ACTION' => $this->u_action . "&parent_id={$parent_id}&action=delete&c=$this->cat_id", |
|
187 | - 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
186 | + 'U_ACTION' => $this->u_action."&parent_id={$parent_id}&action=delete&c=$this->cat_id", |
|
187 | + 'U_BACK' => $this->u_action.'&parent_id='.$this->parent_id, |
|
188 | 188 | |
189 | 189 | 'DIR_CAT_NAME' => $this->cat_data['cat_name'], |
190 | 190 | 'S_HAS_SUBCATS' => ($this->cat_data['right_id'] - $this->cat_data['left_id'] > 1) ? true : false, |
@@ -235,11 +235,11 @@ discard block |
||
235 | 235 | { |
236 | 236 | if (!$this->cat_id) |
237 | 237 | { |
238 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
238 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
242 | - FROM ' . $this->categories_table . ' |
|
242 | + FROM ' . $this->categories_table.' |
|
243 | 243 | WHERE cat_id = ' . (int) $this->cat_id; |
244 | 244 | $result = $this->db->sql_query($sql); |
245 | 245 | $row = $this->db->sql_fetchrow($result); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | |
248 | 248 | if (!$row) |
249 | 249 | { |
250 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
250 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | try |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | if ($move_cat_name !== false) |
263 | 263 | { |
264 | - $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_' . strtoupper($this->action), time(), array($row['cat_name'], $move_cat_name)); |
|
264 | + $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_'.strtoupper($this->action), time(), array($row['cat_name'], $move_cat_name)); |
|
265 | 265 | $this->cache->destroy('sql', $this->categories_table); |
266 | 266 | } |
267 | 267 | |
@@ -305,13 +305,13 @@ discard block |
||
305 | 305 | { |
306 | 306 | if (!$this->cat_id) |
307 | 307 | { |
308 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
308 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | @set_time_limit(0); |
312 | 312 | |
313 | 313 | $sql = 'SELECT cat_name, cat_links |
314 | - FROM ' . $this->categories_table . ' |
|
314 | + FROM ' . $this->categories_table.' |
|
315 | 315 | WHERE cat_id = ' . (int) $this->cat_id; |
316 | 316 | $result = $this->db->sql_query($sql); |
317 | 317 | $row = $this->db->sql_fetchrow($result); |
@@ -319,12 +319,12 @@ discard block |
||
319 | 319 | |
320 | 320 | if (!$row) |
321 | 321 | { |
322 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
322 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | $sql = 'SELECT MIN(link_id) as min_link_id, MAX(link_id) as max_link_id |
326 | - FROM ' . $this->links_table . ' |
|
327 | - WHERE link_cat = ' . (int) $this->cat_id . ' |
|
326 | + FROM ' . $this->links_table.' |
|
327 | + WHERE link_cat = ' . (int) $this->cat_id.' |
|
328 | 328 | AND link_active = 1'; |
329 | 329 | $result = $this->db->sql_query($sql); |
330 | 330 | $row2 = $this->db->sql_fetchrow($result); |
@@ -346,22 +346,22 @@ discard block |
||
346 | 346 | { |
347 | 347 | // We really need to find a way of showing statistics... no progress here |
348 | 348 | $sql = 'SELECT COUNT(link_id) as num_links |
349 | - FROM ' . $this->links_table . ' |
|
350 | - WHERE link_cat = ' . (int) $this->cat_id . ' |
|
349 | + FROM ' . $this->links_table.' |
|
350 | + WHERE link_cat = ' . (int) $this->cat_id.' |
|
351 | 351 | AND link_active = 1 |
352 | - AND link_id BETWEEN ' . (int) $start . ' AND ' . (int) $end; |
|
352 | + AND link_id BETWEEN ' . (int) $start.' AND '.(int) $end; |
|
353 | 353 | $result = $this->db->sql_query($sql); |
354 | 354 | $links_done = $this->request->variable('links_done', 0) + (int) $this->db->sql_fetchfield('num_links'); |
355 | 355 | $this->db->sql_freeresult($result); |
356 | 356 | |
357 | 357 | $start += $batch_size; |
358 | 358 | |
359 | - $url = $this->u_action . "&parent_id={$this->parent_id}&c=$this->cat_id&action=sync&start=$start&links_done=$links_done&total={$row['cat_links']}"; |
|
359 | + $url = $this->u_action."&parent_id={$this->parent_id}&c=$this->cat_id&action=sync&start=$start&links_done=$links_done&total={$row['cat_links']}"; |
|
360 | 360 | |
361 | 361 | meta_refresh(0, $url); |
362 | 362 | |
363 | 363 | $this->template->assign_vars(array( |
364 | - 'UA_PROGRESS_BAR' => $this->u_action . "&action=progress_bar&start=$links_done&total={$row['cat_links']}", |
|
364 | + 'UA_PROGRESS_BAR' => $this->u_action."&action=progress_bar&start=$links_done&total={$row['cat_links']}", |
|
365 | 365 | 'S_CONTINUE_SYNC' => true, |
366 | 366 | 'L_PROGRESS_EXPLAIN' => $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', $links_done, $row['cat_links'])) |
367 | 367 | ); |
@@ -369,11 +369,11 @@ discard block |
||
369 | 369 | return; |
370 | 370 | } |
371 | 371 | |
372 | - $url = $this->u_action . "&parent_id={$this->parent_id}&c=$this->cat_id&action=sync_cat"; |
|
372 | + $url = $this->u_action."&parent_id={$this->parent_id}&c=$this->cat_id&action=sync_cat"; |
|
373 | 373 | meta_refresh(0, $url); |
374 | 374 | |
375 | 375 | $this->template->assign_vars(array( |
376 | - 'UA_PROGRESS_BAR' => $this->u_action . '&action=progress_bar', |
|
376 | + 'UA_PROGRESS_BAR' => $this->u_action.'&action=progress_bar', |
|
377 | 377 | 'S_CONTINUE_SYNC' => true, |
378 | 378 | 'L_PROGRESS_EXPLAIN' => $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', 0, $row['cat_links'])) |
379 | 379 | ); |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | public function action_sync_cat() |
390 | 390 | { |
391 | 391 | $sql = 'SELECT cat_name |
392 | - FROM ' . $this->categories_table . ' |
|
392 | + FROM ' . $this->categories_table.' |
|
393 | 393 | WHERE cat_id = ' . (int) $this->cat_id; |
394 | 394 | $result = $this->db->sql_query($sql); |
395 | 395 | $row = $this->db->sql_fetchrow($result); |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | |
398 | 398 | if (!$row) |
399 | 399 | { |
400 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
400 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
401 | 401 | } |
402 | 402 | |
403 | 403 | $this->_sync_dir_cat($this->cat_id); |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | } |
423 | 423 | else |
424 | 424 | { |
425 | - $navigation = '<a href="' . $this->u_action . '">' . $this->language->lang('DIR_INDEX') . '</a>'; |
|
425 | + $navigation = '<a href="'.$this->u_action.'">'.$this->language->lang('DIR_INDEX').'</a>'; |
|
426 | 426 | |
427 | 427 | $cats_nav = $this->nestedset_category->get_path_data($this->parent_id); |
428 | 428 | |
@@ -430,11 +430,11 @@ discard block |
||
430 | 430 | { |
431 | 431 | if ($row['cat_id'] == $this->parent_id) |
432 | 432 | { |
433 | - $navigation .= ' -> ' . $row['cat_name']; |
|
433 | + $navigation .= ' -> '.$row['cat_name']; |
|
434 | 434 | } |
435 | 435 | else |
436 | 436 | { |
437 | - $navigation .= ' -> <a href="' . $this->u_action . '&parent_id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a>'; |
|
437 | + $navigation .= ' -> <a href="'.$this->u_action.'&parent_id='.$row['cat_id'].'">'.$row['cat_name'].'</a>'; |
|
438 | 438 | } |
439 | 439 | } |
440 | 440 | } |
@@ -448,8 +448,8 @@ discard block |
||
448 | 448 | } |
449 | 449 | |
450 | 450 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_name, cat_icon, cat_desc_uid, cat_desc_bitfield, cat_desc, cat_desc_options, cat_links |
451 | - FROM ' . $this->categories_table . ' |
|
452 | - WHERE parent_id = ' . (int) $this->parent_id . ' |
|
451 | + FROM ' . $this->categories_table.' |
|
452 | + WHERE parent_id = ' . (int) $this->parent_id.' |
|
453 | 453 | ORDER BY left_id'; |
454 | 454 | $result = $this->db->sql_query($sql); |
455 | 455 | |
@@ -457,23 +457,23 @@ discard block |
||
457 | 457 | { |
458 | 458 | do |
459 | 459 | { |
460 | - $folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="' . $this->language->lang('DIR_SUBCAT') . '" />' : '<img src="images/icon_folder.gif" alt="' . $this->language->lang('FOLDER') . '" />'; |
|
460 | + $folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="'.$this->language->lang('DIR_SUBCAT').'" />' : '<img src="images/icon_folder.gif" alt="'.$this->language->lang('FOLDER').'" />'; |
|
461 | 461 | |
462 | - $url = $this->u_action . "&parent_id=$this->parent_id&c={$row['cat_id']}"; |
|
462 | + $url = $this->u_action."&parent_id=$this->parent_id&c={$row['cat_id']}"; |
|
463 | 463 | |
464 | 464 | $this->template->assign_block_vars('cats', array( |
465 | 465 | 'FOLDER_IMAGE' => $folder_image, |
466 | - 'CAT_IMAGE' => ($row['cat_icon']) ? '<img src="' . $this->get_img_path('icons', $row['cat_icon']) . '" alt="" />' : '', |
|
466 | + 'CAT_IMAGE' => ($row['cat_icon']) ? '<img src="'.$this->get_img_path('icons', $row['cat_icon']).'" alt="" />' : '', |
|
467 | 467 | 'CAT_NAME' => $row['cat_name'], |
468 | 468 | 'CAT_DESCRIPTION' => generate_text_for_display($row['cat_desc'], $row['cat_desc_uid'], $row['cat_desc_bitfield'], $row['cat_desc_options']), |
469 | 469 | 'CAT_LINKS' => $row['cat_links'], |
470 | 470 | |
471 | - 'U_CAT' => $this->u_action . '&parent_id=' . $row['cat_id'], |
|
472 | - 'U_MOVE_UP' => $url . '&action=move_up', |
|
473 | - 'U_MOVE_DOWN' => $url . '&action=move_down', |
|
474 | - 'U_EDIT' => $url . '&action=edit', |
|
475 | - 'U_DELETE' => $url . '&action=delete', |
|
476 | - 'U_SYNC' => $url . '&action=sync') |
|
471 | + 'U_CAT' => $this->u_action.'&parent_id='.$row['cat_id'], |
|
472 | + 'U_MOVE_UP' => $url.'&action=move_up', |
|
473 | + 'U_MOVE_DOWN' => $url.'&action=move_down', |
|
474 | + 'U_EDIT' => $url.'&action=edit', |
|
475 | + 'U_DELETE' => $url.'&action=delete', |
|
476 | + 'U_SYNC' => $url.'&action=sync') |
|
477 | 477 | ); |
478 | 478 | } |
479 | 479 | while ($row = $this->db->sql_fetchrow($result)); |
@@ -482,14 +482,14 @@ discard block |
||
482 | 482 | { |
483 | 483 | $row = $this->_get_cat_info($this->parent_id); |
484 | 484 | |
485 | - $url = $this->u_action . '&parent_id=' . $this->parent_id . '&c=' . $row['cat_id']; |
|
485 | + $url = $this->u_action.'&parent_id='.$this->parent_id.'&c='.$row['cat_id']; |
|
486 | 486 | |
487 | 487 | $this->template->assign_vars(array( |
488 | 488 | 'S_NO_CATS' => true, |
489 | 489 | |
490 | - 'U_EDIT' => $url . '&action=edit', |
|
491 | - 'U_DELETE' => $url . '&action=delete', |
|
492 | - 'U_SYNC' => $url . '&action=sync') |
|
490 | + 'U_EDIT' => $url.'&action=edit', |
|
491 | + 'U_DELETE' => $url.'&action=delete', |
|
492 | + 'U_SYNC' => $url.'&action=sync') |
|
493 | 493 | ); |
494 | 494 | } |
495 | 495 | $this->db->sql_freeresult($result); |
@@ -499,9 +499,9 @@ discard block |
||
499 | 499 | 'NAVIGATION' => $navigation, |
500 | 500 | 'CAT_BOX' => $cat_box, |
501 | 501 | 'U_SEL_ACTION' => $this->u_action, |
502 | - 'U_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
502 | + 'U_ACTION' => $this->u_action.'&parent_id='.$this->parent_id, |
|
503 | 503 | |
504 | - 'UA_PROGRESS_BAR' => $this->u_action . '&action=progress_bar', |
|
504 | + 'UA_PROGRESS_BAR' => $this->u_action.'&action=progress_bar', |
|
505 | 505 | )); |
506 | 506 | } |
507 | 507 | |
@@ -534,10 +534,10 @@ discard block |
||
534 | 534 | switch ($this->action) |
535 | 535 | { |
536 | 536 | case 'delete': |
537 | - $action_subcats = $this->request->variable('action_subcats', ''); |
|
538 | - $subcats_to_id = $this->request->variable('subcats_to_id', 0); |
|
539 | - $action_links = $this->request->variable('action_links', ''); |
|
540 | - $links_to_id = $this->request->variable('links_to_id', 0); |
|
537 | + $action_subcats = $this->request->variable('action_subcats', ''); |
|
538 | + $subcats_to_id = $this->request->variable('subcats_to_id', 0); |
|
539 | + $action_links = $this->request->variable('action_links', ''); |
|
540 | + $links_to_id = $this->request->variable('links_to_id', 0); |
|
541 | 541 | |
542 | 542 | try |
543 | 543 | { |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | // Purge the cache to refresh route collections |
607 | 607 | $this->cache->purge(); |
608 | 608 | |
609 | - trigger_error($this->language->lang($message) . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); |
|
609 | + trigger_error($this->language->lang($message).adm_back_link($this->u_action.'&parent_id='.$this->parent_id)); |
|
610 | 610 | } |
611 | 611 | } |
612 | 612 | |
@@ -634,8 +634,8 @@ discard block |
||
634 | 634 | } |
635 | 635 | |
636 | 636 | $sql = 'SELECT cat_route |
637 | - FROM ' . $this->categories_table . " |
|
638 | - WHERE cat_route = '" . $this->db->sql_escape($route) . "' |
|
637 | + FROM ' . $this->categories_table." |
|
638 | + WHERE cat_route = '" . $this->db->sql_escape($route)."' |
|
639 | 639 | AND cat_id <> " . $this->cat_id; |
640 | 640 | $result = $this->db->sql_query_limit($sql, 1); |
641 | 641 | $row = $this->db->sql_fetchrow($result); |
@@ -685,10 +685,10 @@ discard block |
||
685 | 685 | 'S_CAT_PARENT_ID' => $this->cat_data['parent_id'], |
686 | 686 | 'S_ADD_ACTION' => ($this->action == 'add') ? true : false, |
687 | 687 | |
688 | - 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
689 | - 'U_EDIT_ACTION' => $this->u_action . "&parent_id={$this->parent_id}&action=$this->action&c=$this->cat_id", |
|
688 | + 'U_BACK' => $this->u_action.'&parent_id='.$this->parent_id, |
|
689 | + 'U_EDIT_ACTION' => $this->u_action."&parent_id={$this->parent_id}&action=$this->action&c=$this->cat_id", |
|
690 | 690 | |
691 | - 'L_TITLE' => $this->language->lang('DIR_' . strtoupper($this->action) . '_CAT'), |
|
691 | + 'L_TITLE' => $this->language->lang('DIR_'.strtoupper($this->action).'_CAT'), |
|
692 | 692 | 'ERROR_MSG' => (sizeof($this->errors)) ? implode('<br />', $this->errors) : '', |
693 | 693 | 'ICON_IMAGE' => ($this->cat_data['cat_icon']) ? $this->get_img_path('icons', $this->cat_data['cat_icon']) : 'images/spacer.gif', |
694 | 694 | |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | private function _get_cat_info($cat_id) |
733 | 733 | { |
734 | 734 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, cat_route, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next |
735 | - FROM ' . $this->categories_table . ' |
|
735 | + FROM ' . $this->categories_table.' |
|
736 | 736 | WHERE cat_id = ' . (int) $cat_id; |
737 | 737 | $result = $this->db->sql_query($sql); |
738 | 738 | $row = $this->db->sql_fetchrow($result); |
@@ -797,7 +797,7 @@ discard block |
||
797 | 797 | { |
798 | 798 | if ($cat_data_sql['cat_cron_enable']) |
799 | 799 | { |
800 | - $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400; |
|
800 | + $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400; |
|
801 | 801 | } |
802 | 802 | |
803 | 803 | $this->cat_data = $this->nestedset_category->insert($cat_data_sql); |
@@ -820,13 +820,13 @@ discard block |
||
820 | 820 | |
821 | 821 | if ($cat_data_sql['cat_cron_enable'] && ($row['cat_cron_freq'] != $cat_data_sql['cat_cron_freq'] || !$row['cat_cron_enable'])) |
822 | 822 | { |
823 | - $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400; |
|
823 | + $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400; |
|
824 | 824 | } |
825 | 825 | |
826 | 826 | if ($row['cat_name'] != $cat_data_sql['cat_name']) |
827 | 827 | { |
828 | 828 | // the cat name has changed, clear the parents list of all categories (for safety) |
829 | - $sql = 'UPDATE ' . $this->categories_table . " |
|
829 | + $sql = 'UPDATE '.$this->categories_table." |
|
830 | 830 | SET cat_parents = ''"; |
831 | 831 | $this->db->sql_query($sql); |
832 | 832 | } |
@@ -834,8 +834,8 @@ discard block |
||
834 | 834 | // Setting the cat id to the categorie id is not really received well by some dbs. ;) |
835 | 835 | unset($cat_data_sql['cat_id']); |
836 | 836 | |
837 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
838 | - SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql) . ' |
|
837 | + $sql = 'UPDATE '.$this->categories_table.' |
|
838 | + SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql).' |
|
839 | 839 | WHERE cat_id = ' . (int) $this->cat_id; |
840 | 840 | $this->db->sql_query($sql); |
841 | 841 | |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | $log_action_links = 'MOVE_LINKS'; |
877 | 877 | |
878 | 878 | $sql = 'SELECT cat_name |
879 | - FROM ' . $this->categories_table . ' |
|
879 | + FROM ' . $this->categories_table.' |
|
880 | 880 | WHERE cat_id = ' . (int) $links_to_id; |
881 | 881 | $result = $this->db->sql_query($sql); |
882 | 882 | $row = $this->db->sql_fetchrow($result); |
@@ -976,12 +976,12 @@ discard block |
||
976 | 976 | */ |
977 | 977 | private function _move_cat_content($from_id, $to_id) |
978 | 978 | { |
979 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
980 | - SET link_cat = ' . (int) $to_id . ' |
|
979 | + $sql = 'UPDATE '.$this->links_table.' |
|
980 | + SET link_cat = ' . (int) $to_id.' |
|
981 | 981 | WHERE link_cat = ' . (int) $from_id; |
982 | 982 | $this->db->sql_query($sql); |
983 | 983 | |
984 | - $sql = 'DELETE FROM ' . $this->watch_table . ' |
|
984 | + $sql = 'DELETE FROM '.$this->watch_table.' |
|
985 | 985 | WHERE cat_id = ' . (int) $from_id; |
986 | 986 | $this->db->sql_query($sql); |
987 | 987 | |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | |
1000 | 1000 | // Before we remove anything we make sure we are able to adjust the post counts later. ;) |
1001 | 1001 | $sql = 'SELECT link_id, link_banner |
1002 | - FROM ' . $this->links_table . ' |
|
1002 | + FROM ' . $this->links_table.' |
|
1003 | 1003 | WHERE link_cat = ' . (int) $this->cat_id; |
1004 | 1004 | $result = $this->db->sql_query($sql); |
1005 | 1005 | |
@@ -1030,7 +1030,7 @@ discard block |
||
1030 | 1030 | |
1031 | 1031 | foreach ($link_datas_ary as $table => $field) |
1032 | 1032 | { |
1033 | - $this->db->sql_query("DELETE FROM $table WHERE " . $this->db->sql_in_set($field, $link_ids)); |
|
1033 | + $this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $link_ids)); |
|
1034 | 1034 | } |
1035 | 1035 | } |
1036 | 1036 | |
@@ -1042,7 +1042,7 @@ discard block |
||
1042 | 1042 | |
1043 | 1043 | foreach ($cat_datas_ary as $table => $field) |
1044 | 1044 | { |
1045 | - $this->db->sql_query("DELETE FROM $table WHERE $field = " . (int) $this->cat_id); |
|
1045 | + $this->db->sql_query("DELETE FROM $table WHERE $field = ".(int) $this->cat_id); |
|
1046 | 1046 | } |
1047 | 1047 | |
1048 | 1048 | $this->db->sql_transaction('commit'); |
@@ -1057,15 +1057,15 @@ discard block |
||
1057 | 1057 | private function _sync_dir_cat($cat_id) |
1058 | 1058 | { |
1059 | 1059 | $sql = 'SELECT COUNT(link_id) AS num_links |
1060 | - FROM ' . $this->links_table . ' |
|
1061 | - WHERE link_cat = ' . (int) $cat_id . ' |
|
1060 | + FROM ' . $this->links_table.' |
|
1061 | + WHERE link_cat = ' . (int) $cat_id.' |
|
1062 | 1062 | AND link_active = 1'; |
1063 | 1063 | $result = $this->db->sql_query($sql); |
1064 | 1064 | $total_links = (int) $this->db->sql_fetchfield('num_links'); |
1065 | 1065 | $this->db->sql_freeresult($result); |
1066 | 1066 | |
1067 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
1068 | - SET cat_links = ' . $total_links . ' |
|
1067 | + $sql = 'UPDATE '.$this->categories_table.' |
|
1068 | + SET cat_links = ' . $total_links.' |
|
1069 | 1069 | WHERE cat_id = ' . (int) $cat_id; |
1070 | 1070 | $this->db->sql_query($sql); |
1071 | 1071 | } |
@@ -1085,33 +1085,33 @@ discard block |
||
1085 | 1085 | 'link_vote' => 0, |
1086 | 1086 | ); |
1087 | 1087 | |
1088 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
1089 | - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
1090 | - WHERE link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop; |
|
1088 | + $sql = 'UPDATE '.$this->links_table.' |
|
1089 | + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' |
|
1090 | + WHERE link_id BETWEEN ' . (int) $start.' AND '.(int) $stop; |
|
1091 | 1091 | $this->db->sql_query($sql); |
1092 | 1092 | |
1093 | - $sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM ' . $this->votes_table . ' |
|
1094 | - WHERE vote_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . ' |
|
1093 | + $sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM '.$this->votes_table.' |
|
1094 | + WHERE vote_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.' |
|
1095 | 1095 | GROUP BY vote_link_id'; |
1096 | 1096 | $result = $this->db->sql_query($sql); |
1097 | 1097 | while ($tmp = $this->db->sql_fetchrow($result)) |
1098 | 1098 | { |
1099 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
1100 | - SET link_note = ' . (int) $tmp['total'] . ', link_vote = ' . (int) $tmp['nb_vote'] . ' |
|
1099 | + $sql = 'UPDATE '.$this->links_table.' |
|
1100 | + SET link_note = ' . (int) $tmp['total'].', link_vote = '.(int) $tmp['nb_vote'].' |
|
1101 | 1101 | WHERE link_id = ' . (int) $tmp['vote_link_id']; |
1102 | 1102 | $this->db->sql_query($sql); |
1103 | 1103 | } |
1104 | 1104 | $this->db->sql_freeresult($result); |
1105 | 1105 | |
1106 | 1106 | $sql = 'SELECT comment_link_id, COUNT(comment_id) AS nb_comment |
1107 | - FROM ' . $this->comments_table . ' |
|
1108 | - WHERE comment_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . ' |
|
1107 | + FROM ' . $this->comments_table.' |
|
1108 | + WHERE comment_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.' |
|
1109 | 1109 | GROUP BY comment_link_id'; |
1110 | 1110 | $result = $this->db->sql_query($sql); |
1111 | 1111 | while ($tmp = $this->db->sql_fetchrow($result)) |
1112 | 1112 | { |
1113 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
1114 | - SET link_comment = ' . (int) $tmp['nb_comment'] . ' |
|
1113 | + $sql = 'UPDATE '.$this->links_table.' |
|
1114 | + SET link_comment = ' . (int) $tmp['nb_comment'].' |
|
1115 | 1115 | WHERE link_id = ' . (int) $tmp['comment_link_id']; |
1116 | 1116 | $this->db->sql_query($sql); |
1117 | 1117 | } |
@@ -1136,7 +1136,7 @@ discard block |
||
1136 | 1136 | |
1137 | 1137 | foreach ($img_ary as $img) |
1138 | 1138 | { |
1139 | - $img = $path . $img; |
|
1139 | + $img = $path.$img; |
|
1140 | 1140 | $selected = ''; |
1141 | 1141 | |
1142 | 1142 | if (strlen($img) > 255) |
@@ -1149,7 +1149,7 @@ discard block |
||
1149 | 1149 | $selected = ' selected="selected"'; |
1150 | 1150 | } |
1151 | 1151 | |
1152 | - $filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>'; |
|
1152 | + $filename_list .= '<option value="'.htmlspecialchars($img).'"'.$selected.'>'.$img.'</option>'; |
|
1153 | 1153 | } |
1154 | 1154 | } |
1155 | 1155 |