@@ -64,16 +64,16 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
66 | 66 | { |
67 | - $this->db = $db; |
|
68 | - $this->config = $config; |
|
67 | + $this->db = $db; |
|
68 | + $this->config = $config; |
|
69 | 69 | $this->language = $language; |
70 | 70 | $this->template = $template; |
71 | 71 | $this->user = $user; |
72 | - $this->helper = $helper; |
|
73 | - $this->request = $request; |
|
72 | + $this->helper = $helper; |
|
73 | + $this->request = $request; |
|
74 | 74 | $this->auth = $auth; |
75 | - $this->pagination = $pagination; |
|
76 | - $this->categorie = $categorie; |
|
75 | + $this->pagination = $pagination; |
|
76 | + $this->categorie = $categorie; |
|
77 | 77 | $this->link = $link; |
78 | 78 | |
79 | 79 | $language->add_lang('directory', 'ernadoo/phpbbdirectory'); |
@@ -117,18 +117,18 @@ discard block |
||
117 | 117 | |
118 | 118 | $start = ($page - 1) * $this->config['dir_show']; |
119 | 119 | |
120 | - $default_sort_days = 0; |
|
120 | + $default_sort_days = 0; |
|
121 | 121 | $default_sort_key = (string) substr($this->config['dir_default_order'], 0, 1); |
122 | 122 | $default_sort_dir = (string) substr($this->config['dir_default_order'], 2); |
123 | 123 | |
124 | 124 | $sort_days = (!$sort_days) ? $this->request->variable('st', $default_sort_days) : $sort_days; |
125 | 125 | $sort_key = (!$sort_key) ? $this->request->variable('sk', $default_sort_key) : $sort_key; |
126 | - $sort_dir = (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir; |
|
126 | + $sort_dir = (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir; |
|
127 | 127 | $link_list = $rowset = array(); |
128 | 128 | |
129 | 129 | // Categorie ordering options |
130 | 130 | $limit_days = array(0 => $this->language->lang('SEE_ALL'), 1 => $this->language->lang('1_DAY'), 7 => $this->language->lang('7_DAYS'), 14 => $this->language->lang('2_WEEKS'), 30 => $this->language->lang('1_MONTH'), 90 => $this->language->lang('3_MONTHS'), 180 => $this->language->lang('6_MONTHS'), 365 => $this->language->lang('1_YEAR')); |
131 | - $sort_by_text = array('a' => $this->language->lang('AUTHOR'), 't' => $this->language->lang('POST_TIME'), 'r' => $this->language->lang('DIR_COMMENTS_ORDER'), 's' => $this->language->lang('DIR_NAME_ORDER'), 'v' => $this->language->lang('DIR_NB_CLICKS_ORDER')); |
|
131 | + $sort_by_text = array('a' => $this->language->lang('AUTHOR'), 't' => $this->language->lang('POST_TIME'), 'r' => $this->language->lang('DIR_COMMENTS_ORDER'), 's' => $this->language->lang('DIR_NAME_ORDER'), 'v' => $this->language->lang('DIR_NB_CLICKS_ORDER')); |
|
132 | 132 | $sort_by_sql = array('a' => 'u.username_clean', 't' => array('l.link_time', 'l.link_id'), 'r' => 'l.link_comment', 's' => 'LOWER(l.link_name)', 'v' => 'l.link_view'); |
133 | 133 | |
134 | 134 | if ($this->config['dir_activ_pagerank']) |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | $min_post_time = time() - ($sort_days * 86400); |
168 | 168 | |
169 | 169 | $sql = 'SELECT COUNT(link_id) AS nb_links |
170 | - FROM ' . $this->links_table . ' |
|
171 | - WHERE link_cat = ' . (int) $cat_id . ' |
|
170 | + FROM ' . $this->links_table.' |
|
171 | + WHERE link_cat = ' . (int) $cat_id.' |
|
172 | 172 | AND link_time >= ' . (int) $min_post_time; |
173 | 173 | $result = $this->db->sql_query($sql); |
174 | 174 | $nb_links = (int) $this->db->sql_fetchfield('nb_links'); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | else |
184 | 184 | { |
185 | 185 | $sql_limit_time = ''; |
186 | - $nb_links = (int) $this->categorie->data['cat_links']; |
|
186 | + $nb_links = (int) $this->categorie->data['cat_links']; |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | // Make sure $start is set to the last page if it exceeds the amount |
@@ -246,11 +246,11 @@ discard block |
||
246 | 246 | |
247 | 247 | if (is_array($sort_by_sql[$sort_key])) |
248 | 248 | { |
249 | - $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; |
|
249 | + $sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction; |
|
250 | 250 | } |
251 | 251 | else |
252 | 252 | { |
253 | - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; |
|
253 | + $sql_sort_order = $sort_by_sql[$sort_key].' '.$direction; |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | // Grab just the sorted link ids |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | ), |
294 | 294 | array( |
295 | 295 | 'FROM' => array($this->votes_table => 'v'), |
296 | - 'ON' => 'l.link_id = v.vote_link_id AND v.vote_user_id = ' . $this->user->data['user_id'] |
|
296 | + 'ON' => 'l.link_id = v.vote_link_id AND v.vote_user_id = '.$this->user->data['user_id'] |
|
297 | 297 | ) |
298 | 298 | ), |
299 | 299 | 'WHERE' => $this->db->sql_in_set('l.link_id', $link_list) |
@@ -310,8 +310,8 @@ discard block |
||
310 | 310 | |
311 | 311 | $link_list = ($store_reverse) ? array_reverse($link_list) : $link_list; |
312 | 312 | |
313 | - $votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false; |
|
314 | - $comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false; |
|
313 | + $votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false; |
|
314 | + $comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false; |
|
315 | 315 | |
316 | 316 | foreach ($link_list as $link_id) |
317 | 317 | { |
@@ -321,11 +321,11 @@ discard block |
||
321 | 321 | $s_note = $this->link->display_note($site['link_note'], $site['link_vote'], $votes_status); |
322 | 322 | $s_thumb = $this->link->display_thumb($site); |
323 | 323 | $s_vote = $this->link->display_vote($site); |
324 | - $s_banner = $this->link->display_bann($site); |
|
325 | - $s_pr = $this->link->display_pagerank($site); |
|
326 | - $s_rss = $this->link->display_rss($site); |
|
324 | + $s_banner = $this->link->display_bann($site); |
|
325 | + $s_pr = $this->link->display_pagerank($site); |
|
326 | + $s_rss = $this->link->display_rss($site); |
|
327 | 327 | |
328 | - $edit_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_edit_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_edit_dir')))); |
|
328 | + $edit_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_edit_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_edit_dir')))); |
|
329 | 329 | $delete_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_delete_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_delete_dir')))); |
330 | 330 | |
331 | 331 | $this->template->assign_block_vars('site', array( |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | $this->template->assign_block_vars('no_draw_link', array()); |
363 | 363 | } |
364 | 364 | |
365 | - $page_title = $this->language->lang('DIRECTORY') . ' - ' . $this->categorie->data['cat_name']; |
|
365 | + $page_title = $this->language->lang('DIRECTORY').' - '.$this->categorie->data['cat_name']; |
|
366 | 366 | |
367 | 367 | $this->categorie->display(); |
368 | 368 |
@@ -84,23 +84,23 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category) |
86 | 86 | { |
87 | - $this->cache = $cache; |
|
88 | - $this->db = $db; |
|
89 | - $this->helper = $helper; |
|
87 | + $this->cache = $cache; |
|
88 | + $this->db = $db; |
|
89 | + $this->helper = $helper; |
|
90 | 90 | $this->language = $language; |
91 | 91 | $this->phpbb_log = $log; |
92 | - $this->request = $request; |
|
92 | + $this->request = $request; |
|
93 | 93 | $this->template = $template; |
94 | - $this->user = $user; |
|
94 | + $this->user = $user; |
|
95 | 95 | $this->categorie = $categorie; |
96 | - $this->nestedset_category = $nestedset_category; |
|
96 | + $this->nestedset_category = $nestedset_category; |
|
97 | 97 | |
98 | 98 | $this->form_key = 'acp_dir_cat'; |
99 | 99 | add_form_key($this->form_key); |
100 | 100 | |
101 | 101 | $this->action = $this->request->variable('action', ''); |
102 | 102 | $this->cat_id = $request->variable('c', 0); |
103 | - $this->parent_id = $request->variable('parent_id', 0); |
|
103 | + $this->parent_id = $request->variable('parent_id', 0); |
|
104 | 104 | $this->update = ($this->request->is_set_post('update')) ? true : false; |
105 | 105 | } |
106 | 106 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | { |
151 | 151 | if (!$this->cat_id) |
152 | 152 | { |
153 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
153 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | $this->cat_data = $this->_get_cat_info($this->cat_id); |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $cat_list = $this->categorie->make_cat_select((int) $this->cat_data['parent_id'], $subcats_id); |
167 | 167 | |
168 | 168 | $sql = 'SELECT cat_id |
169 | - FROM ' . $this->categories_table . ' |
|
169 | + FROM ' . $this->categories_table.' |
|
170 | 170 | WHERE cat_id <> ' . (int) $this->cat_id; |
171 | 171 | $result = $this->db->sql_query_limit($sql, 1); |
172 | 172 | |
@@ -182,8 +182,8 @@ discard block |
||
182 | 182 | |
183 | 183 | $this->template->assign_vars(array( |
184 | 184 | 'S_DELETE_DIR_CAT' => true, |
185 | - 'U_ACTION' => $this->u_action . "&parent_id={$parent_id}&action=delete&c=$this->cat_id", |
|
186 | - 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
185 | + 'U_ACTION' => $this->u_action."&parent_id={$parent_id}&action=delete&c=$this->cat_id", |
|
186 | + 'U_BACK' => $this->u_action.'&parent_id='.$this->parent_id, |
|
187 | 187 | |
188 | 188 | 'DIR_CAT_NAME' => $this->cat_data['cat_name'], |
189 | 189 | 'S_HAS_SUBCATS' => ($this->cat_data['right_id'] - $this->cat_data['left_id'] > 1) ? true : false, |
@@ -234,11 +234,11 @@ discard block |
||
234 | 234 | { |
235 | 235 | if (!$this->cat_id) |
236 | 236 | { |
237 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
237 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
241 | - FROM ' . $this->categories_table . ' |
|
241 | + FROM ' . $this->categories_table.' |
|
242 | 242 | WHERE cat_id = ' . (int) $this->cat_id; |
243 | 243 | $result = $this->db->sql_query($sql); |
244 | 244 | $row = $this->db->sql_fetchrow($result); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | |
247 | 247 | if (!$row) |
248 | 248 | { |
249 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
249 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | try |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | |
261 | 261 | if ($move_cat_name !== false) |
262 | 262 | { |
263 | - $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_' . strtoupper($this->action), time(), array($row['cat_name'], $move_cat_name)); |
|
263 | + $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_'.strtoupper($this->action), time(), array($row['cat_name'], $move_cat_name)); |
|
264 | 264 | $this->cache->destroy('sql', $this->categories_table); |
265 | 265 | } |
266 | 266 | |
@@ -304,13 +304,13 @@ discard block |
||
304 | 304 | { |
305 | 305 | if (!$this->cat_id) |
306 | 306 | { |
307 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
307 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | @set_time_limit(0); |
311 | 311 | |
312 | 312 | $sql = 'SELECT cat_name, cat_links |
313 | - FROM ' . $this->categories_table . ' |
|
313 | + FROM ' . $this->categories_table.' |
|
314 | 314 | WHERE cat_id = ' . (int) $this->cat_id; |
315 | 315 | $result = $this->db->sql_query($sql); |
316 | 316 | $row = $this->db->sql_fetchrow($result); |
@@ -318,12 +318,12 @@ discard block |
||
318 | 318 | |
319 | 319 | if (!$row) |
320 | 320 | { |
321 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
321 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | $sql = 'SELECT MIN(link_id) as min_link_id, MAX(link_id) as max_link_id |
325 | - FROM ' . $this->links_table . ' |
|
326 | - WHERE link_cat = ' . (int) $this->cat_id . ' |
|
325 | + FROM ' . $this->links_table.' |
|
326 | + WHERE link_cat = ' . (int) $this->cat_id.' |
|
327 | 327 | AND link_active = 1'; |
328 | 328 | $result = $this->db->sql_query($sql); |
329 | 329 | $row2 = $this->db->sql_fetchrow($result); |
@@ -345,22 +345,22 @@ discard block |
||
345 | 345 | { |
346 | 346 | // We really need to find a way of showing statistics... no progress here |
347 | 347 | $sql = 'SELECT COUNT(link_id) as num_links |
348 | - FROM ' . $this->links_table . ' |
|
349 | - WHERE link_cat = ' . (int) $this->cat_id . ' |
|
348 | + FROM ' . $this->links_table.' |
|
349 | + WHERE link_cat = ' . (int) $this->cat_id.' |
|
350 | 350 | AND link_active = 1 |
351 | - AND link_id BETWEEN ' . (int) $start . ' AND ' . (int) $end; |
|
351 | + AND link_id BETWEEN ' . (int) $start.' AND '.(int) $end; |
|
352 | 352 | $result = $this->db->sql_query($sql); |
353 | 353 | $links_done = $this->request->variable('links_done', 0) + (int) $this->db->sql_fetchfield('num_links'); |
354 | 354 | $this->db->sql_freeresult($result); |
355 | 355 | |
356 | 356 | $start += $batch_size; |
357 | 357 | |
358 | - $url = $this->u_action . "&parent_id={$this->parent_id}&c=$this->cat_id&action=sync&start=$start&links_done=$links_done&total={$row['cat_links']}"; |
|
358 | + $url = $this->u_action."&parent_id={$this->parent_id}&c=$this->cat_id&action=sync&start=$start&links_done=$links_done&total={$row['cat_links']}"; |
|
359 | 359 | |
360 | 360 | meta_refresh(0, $url); |
361 | 361 | |
362 | 362 | $this->template->assign_vars(array( |
363 | - 'UA_PROGRESS_BAR' => $this->u_action . "&action=progress_bar&start=$links_done&total={$row['cat_links']}", |
|
363 | + 'UA_PROGRESS_BAR' => $this->u_action."&action=progress_bar&start=$links_done&total={$row['cat_links']}", |
|
364 | 364 | 'S_CONTINUE_SYNC' => true, |
365 | 365 | 'L_PROGRESS_EXPLAIN' => $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', $links_done, $row['cat_links'])) |
366 | 366 | ); |
@@ -368,11 +368,11 @@ discard block |
||
368 | 368 | return; |
369 | 369 | } |
370 | 370 | |
371 | - $url = $this->u_action . "&parent_id={$this->parent_id}&c=$this->cat_id&action=sync_cat"; |
|
371 | + $url = $this->u_action."&parent_id={$this->parent_id}&c=$this->cat_id&action=sync_cat"; |
|
372 | 372 | meta_refresh(0, $url); |
373 | 373 | |
374 | 374 | $this->template->assign_vars(array( |
375 | - 'UA_PROGRESS_BAR' => $this->u_action . '&action=progress_bar', |
|
375 | + 'UA_PROGRESS_BAR' => $this->u_action.'&action=progress_bar', |
|
376 | 376 | 'S_CONTINUE_SYNC' => true, |
377 | 377 | 'L_PROGRESS_EXPLAIN' => $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', 0, $row['cat_links'])) |
378 | 378 | ); |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | public function action_sync_cat() |
389 | 389 | { |
390 | 390 | $sql = 'SELECT cat_name |
391 | - FROM ' . $this->categories_table . ' |
|
391 | + FROM ' . $this->categories_table.' |
|
392 | 392 | WHERE cat_id = ' . (int) $this->cat_id; |
393 | 393 | $result = $this->db->sql_query($sql); |
394 | 394 | $row = $this->db->sql_fetchrow($result); |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | |
397 | 397 | if (!$row) |
398 | 398 | { |
399 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
399 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | $this->_sync_dir_cat($this->cat_id); |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | } |
422 | 422 | else |
423 | 423 | { |
424 | - $navigation = '<a href="' . $this->u_action . '">' . $this->language->lang('DIR_INDEX') . '</a>'; |
|
424 | + $navigation = '<a href="'.$this->u_action.'">'.$this->language->lang('DIR_INDEX').'</a>'; |
|
425 | 425 | |
426 | 426 | $cats_nav = $this->nestedset_category->get_path_data($this->parent_id); |
427 | 427 | |
@@ -429,11 +429,11 @@ discard block |
||
429 | 429 | { |
430 | 430 | if ($row['cat_id'] == $this->parent_id) |
431 | 431 | { |
432 | - $navigation .= ' -> ' . $row['cat_name']; |
|
432 | + $navigation .= ' -> '.$row['cat_name']; |
|
433 | 433 | } |
434 | 434 | else |
435 | 435 | { |
436 | - $navigation .= ' -> <a href="' . $this->u_action . '&parent_id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a>'; |
|
436 | + $navigation .= ' -> <a href="'.$this->u_action.'&parent_id='.$row['cat_id'].'">'.$row['cat_name'].'</a>'; |
|
437 | 437 | } |
438 | 438 | } |
439 | 439 | } |
@@ -447,8 +447,8 @@ discard block |
||
447 | 447 | } |
448 | 448 | |
449 | 449 | $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 |
450 | - FROM ' . $this->categories_table . ' |
|
451 | - WHERE parent_id = ' . (int) $this->parent_id . ' |
|
450 | + FROM ' . $this->categories_table.' |
|
451 | + WHERE parent_id = ' . (int) $this->parent_id.' |
|
452 | 452 | ORDER BY left_id'; |
453 | 453 | $result = $this->db->sql_query($sql); |
454 | 454 | |
@@ -456,23 +456,23 @@ discard block |
||
456 | 456 | { |
457 | 457 | do |
458 | 458 | { |
459 | - $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') . '" />'; |
|
459 | + $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 | 460 | |
461 | - $url = $this->u_action . "&parent_id=$this->parent_id&c={$row['cat_id']}"; |
|
461 | + $url = $this->u_action."&parent_id=$this->parent_id&c={$row['cat_id']}"; |
|
462 | 462 | |
463 | 463 | $this->template->assign_block_vars('cats', array( |
464 | 464 | 'FOLDER_IMAGE' => $folder_image, |
465 | - 'CAT_IMAGE' => ($row['cat_icon']) ? '<img src="' . $this->get_img_path('icons', $row['cat_icon']) . '" alt="" />' : '', |
|
465 | + 'CAT_IMAGE' => ($row['cat_icon']) ? '<img src="'.$this->get_img_path('icons', $row['cat_icon']).'" alt="" />' : '', |
|
466 | 466 | 'CAT_NAME' => $row['cat_name'], |
467 | 467 | 'CAT_DESCRIPTION' => generate_text_for_display($row['cat_desc'], $row['cat_desc_uid'], $row['cat_desc_bitfield'], $row['cat_desc_options']), |
468 | 468 | 'CAT_LINKS' => $row['cat_links'], |
469 | 469 | |
470 | - 'U_CAT' => $this->u_action . '&parent_id=' . $row['cat_id'], |
|
471 | - 'U_MOVE_UP' => $url . '&action=move_up', |
|
472 | - 'U_MOVE_DOWN' => $url . '&action=move_down', |
|
473 | - 'U_EDIT' => $url . '&action=edit', |
|
474 | - 'U_DELETE' => $url . '&action=delete', |
|
475 | - 'U_SYNC' => $url . '&action=sync') |
|
470 | + 'U_CAT' => $this->u_action.'&parent_id='.$row['cat_id'], |
|
471 | + 'U_MOVE_UP' => $url.'&action=move_up', |
|
472 | + 'U_MOVE_DOWN' => $url.'&action=move_down', |
|
473 | + 'U_EDIT' => $url.'&action=edit', |
|
474 | + 'U_DELETE' => $url.'&action=delete', |
|
475 | + 'U_SYNC' => $url.'&action=sync') |
|
476 | 476 | ); |
477 | 477 | } |
478 | 478 | while ($row = $this->db->sql_fetchrow($result)); |
@@ -481,14 +481,14 @@ discard block |
||
481 | 481 | { |
482 | 482 | $row = $this->_get_cat_info($this->parent_id); |
483 | 483 | |
484 | - $url = $this->u_action . '&parent_id=' . $this->parent_id . '&c=' . $row['cat_id']; |
|
484 | + $url = $this->u_action.'&parent_id='.$this->parent_id.'&c='.$row['cat_id']; |
|
485 | 485 | |
486 | 486 | $this->template->assign_vars(array( |
487 | 487 | 'S_NO_CATS' => true, |
488 | 488 | |
489 | - 'U_EDIT' => $url . '&action=edit', |
|
490 | - 'U_DELETE' => $url . '&action=delete', |
|
491 | - 'U_SYNC' => $url . '&action=sync') |
|
489 | + 'U_EDIT' => $url.'&action=edit', |
|
490 | + 'U_DELETE' => $url.'&action=delete', |
|
491 | + 'U_SYNC' => $url.'&action=sync') |
|
492 | 492 | ); |
493 | 493 | } |
494 | 494 | $this->db->sql_freeresult($result); |
@@ -498,9 +498,9 @@ discard block |
||
498 | 498 | 'NAVIGATION' => $navigation, |
499 | 499 | 'CAT_BOX' => $cat_box, |
500 | 500 | 'U_SEL_ACTION' => $this->u_action, |
501 | - 'U_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
501 | + 'U_ACTION' => $this->u_action.'&parent_id='.$this->parent_id, |
|
502 | 502 | |
503 | - 'UA_PROGRESS_BAR' => $this->u_action . '&action=progress_bar', |
|
503 | + 'UA_PROGRESS_BAR' => $this->u_action.'&action=progress_bar', |
|
504 | 504 | )); |
505 | 505 | } |
506 | 506 | |
@@ -532,10 +532,10 @@ discard block |
||
532 | 532 | switch ($this->action) |
533 | 533 | { |
534 | 534 | case 'delete': |
535 | - $action_subcats = $this->request->variable('action_subcats', ''); |
|
536 | - $subcats_to_id = $this->request->variable('subcats_to_id', 0); |
|
537 | - $action_links = $this->request->variable('action_links', ''); |
|
538 | - $links_to_id = $this->request->variable('links_to_id', 0); |
|
535 | + $action_subcats = $this->request->variable('action_subcats', ''); |
|
536 | + $subcats_to_id = $this->request->variable('subcats_to_id', 0); |
|
537 | + $action_links = $this->request->variable('action_links', ''); |
|
538 | + $links_to_id = $this->request->variable('links_to_id', 0); |
|
539 | 539 | |
540 | 540 | try |
541 | 541 | { |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | |
554 | 554 | $this->cache->destroy('sql', $this->categories_table); |
555 | 555 | |
556 | - trigger_error($this->language->lang('DIR_CAT_DELETED') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); |
|
556 | + trigger_error($this->language->lang('DIR_CAT_DELETED').adm_back_link($this->u_action.'&parent_id='.$this->parent_id)); |
|
557 | 557 | |
558 | 558 | break; |
559 | 559 | |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | |
607 | 607 | $message = ($this->action == 'add') ? $this->language->lang('DIR_CAT_CREATED') : $this->language->lang('DIR_CAT_UPDATED'); |
608 | 608 | |
609 | - trigger_error($message . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); |
|
609 | + trigger_error($message.adm_back_link($this->u_action.'&parent_id='.$this->parent_id)); |
|
610 | 610 | } |
611 | 611 | |
612 | 612 | break; |
@@ -651,10 +651,10 @@ discard block |
||
651 | 651 | 'S_CAT_PARENT_ID' => $this->cat_data['parent_id'], |
652 | 652 | 'S_ADD_ACTION' => ($this->action == 'add') ? true : false, |
653 | 653 | |
654 | - 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
655 | - 'U_EDIT_ACTION' => $this->u_action . "&parent_id={$this->parent_id}&action=$this->action&c=$this->cat_id", |
|
654 | + 'U_BACK' => $this->u_action.'&parent_id='.$this->parent_id, |
|
655 | + 'U_EDIT_ACTION' => $this->u_action."&parent_id={$this->parent_id}&action=$this->action&c=$this->cat_id", |
|
656 | 656 | |
657 | - 'L_TITLE' => $this->language->lang('DIR_' . strtoupper($this->action) . '_CAT'), |
|
657 | + 'L_TITLE' => $this->language->lang('DIR_'.strtoupper($this->action).'_CAT'), |
|
658 | 658 | 'ERROR_MSG' => (sizeof($this->errors)) ? implode('<br />', $this->errors) : '', |
659 | 659 | 'ICON_IMAGE' => ($this->cat_data['cat_icon']) ? $this->get_img_path('icons', $this->cat_data['cat_icon']) : 'images/spacer.gif', |
660 | 660 | |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | private function _get_cat_info($cat_id) |
697 | 697 | { |
698 | 698 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next |
699 | - FROM ' . $this->categories_table . ' |
|
699 | + FROM ' . $this->categories_table.' |
|
700 | 700 | WHERE cat_id = ' . (int) $cat_id; |
701 | 701 | $result = $this->db->sql_query($sql); |
702 | 702 | $row = $this->db->sql_fetchrow($result); |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | { |
760 | 760 | if ($cat_data_sql['cat_cron_enable']) |
761 | 761 | { |
762 | - $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400; |
|
762 | + $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400; |
|
763 | 763 | } |
764 | 764 | |
765 | 765 | $this->cat_data = $this->nestedset_category->insert($cat_data_sql); |
@@ -782,13 +782,13 @@ discard block |
||
782 | 782 | |
783 | 783 | if ($cat_data_sql['cat_cron_enable'] && ($row['cat_cron_freq'] != $cat_data_sql['cat_cron_freq'] || !$row['cat_cron_enable'])) |
784 | 784 | { |
785 | - $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400; |
|
785 | + $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400; |
|
786 | 786 | } |
787 | 787 | |
788 | 788 | if ($row['cat_name'] != $cat_data_sql['cat_name']) |
789 | 789 | { |
790 | 790 | // the cat name has changed, clear the parents list of all categories (for safety) |
791 | - $sql = 'UPDATE ' . $this->categories_table . " |
|
791 | + $sql = 'UPDATE '.$this->categories_table." |
|
792 | 792 | SET cat_parents = ''"; |
793 | 793 | $this->db->sql_query($sql); |
794 | 794 | } |
@@ -796,8 +796,8 @@ discard block |
||
796 | 796 | // Setting the cat id to the categorie id is not really received well by some dbs. ;) |
797 | 797 | unset($cat_data_sql['cat_id']); |
798 | 798 | |
799 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
800 | - SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql) . ' |
|
799 | + $sql = 'UPDATE '.$this->categories_table.' |
|
800 | + SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql).' |
|
801 | 801 | WHERE cat_id = ' . (int) $this->cat_id; |
802 | 802 | $this->db->sql_query($sql); |
803 | 803 | |
@@ -838,7 +838,7 @@ discard block |
||
838 | 838 | $log_action_links = 'MOVE_LINKS'; |
839 | 839 | |
840 | 840 | $sql = 'SELECT cat_name |
841 | - FROM ' . $this->categories_table . ' |
|
841 | + FROM ' . $this->categories_table.' |
|
842 | 842 | WHERE cat_id = ' . (int) $links_to_id; |
843 | 843 | $result = $this->db->sql_query($sql); |
844 | 844 | $row = $this->db->sql_fetchrow($result); |
@@ -940,12 +940,12 @@ discard block |
||
940 | 940 | */ |
941 | 941 | private function _move_cat_content($from_id, $to_id) |
942 | 942 | { |
943 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
944 | - SET link_cat = ' . (int) $to_id . ' |
|
943 | + $sql = 'UPDATE '.$this->links_table.' |
|
944 | + SET link_cat = ' . (int) $to_id.' |
|
945 | 945 | WHERE link_cat = ' . (int) $from_id; |
946 | 946 | $this->db->sql_query($sql); |
947 | 947 | |
948 | - $sql = 'DELETE FROM ' . $this->watch_table . ' |
|
948 | + $sql = 'DELETE FROM '.$this->watch_table.' |
|
949 | 949 | WHERE cat_id = ' . (int) $from_id; |
950 | 950 | $this->db->sql_query($sql); |
951 | 951 | |
@@ -963,7 +963,7 @@ discard block |
||
963 | 963 | |
964 | 964 | // Before we remove anything we make sure we are able to adjust the post counts later. ;) |
965 | 965 | $sql = 'SELECT link_id, link_banner |
966 | - FROM ' . $this->links_table . ' |
|
966 | + FROM ' . $this->links_table.' |
|
967 | 967 | WHERE link_cat = ' . (int) $this->cat_id; |
968 | 968 | $result = $this->db->sql_query($sql); |
969 | 969 | |
@@ -994,7 +994,7 @@ discard block |
||
994 | 994 | |
995 | 995 | foreach ($link_datas_ary as $table => $field) |
996 | 996 | { |
997 | - $this->db->sql_query("DELETE FROM $table WHERE " . $this->db->sql_in_set($field, $link_ids)); |
|
997 | + $this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $link_ids)); |
|
998 | 998 | } |
999 | 999 | } |
1000 | 1000 | |
@@ -1006,7 +1006,7 @@ discard block |
||
1006 | 1006 | |
1007 | 1007 | foreach ($cat_datas_ary as $table => $field) |
1008 | 1008 | { |
1009 | - $this->db->sql_query("DELETE FROM $table WHERE $field = " . (int) $this->cat_id); |
|
1009 | + $this->db->sql_query("DELETE FROM $table WHERE $field = ".(int) $this->cat_id); |
|
1010 | 1010 | } |
1011 | 1011 | |
1012 | 1012 | $this->db->sql_transaction('commit'); |
@@ -1023,15 +1023,15 @@ discard block |
||
1023 | 1023 | private function _sync_dir_cat($cat_id) |
1024 | 1024 | { |
1025 | 1025 | $sql = 'SELECT COUNT(link_id) AS num_links |
1026 | - FROM ' . $this->links_table . ' |
|
1027 | - WHERE link_cat = ' . (int) $cat_id . ' |
|
1026 | + FROM ' . $this->links_table.' |
|
1027 | + WHERE link_cat = ' . (int) $cat_id.' |
|
1028 | 1028 | AND link_active = 1'; |
1029 | 1029 | $result = $this->db->sql_query($sql); |
1030 | 1030 | $total_links = (int) $this->db->sql_fetchfield('num_links'); |
1031 | 1031 | $this->db->sql_freeresult($result); |
1032 | 1032 | |
1033 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
1034 | - SET cat_links = ' . $total_links . ' |
|
1033 | + $sql = 'UPDATE '.$this->categories_table.' |
|
1034 | + SET cat_links = ' . $total_links.' |
|
1035 | 1035 | WHERE cat_id = ' . (int) $cat_id; |
1036 | 1036 | $this->db->sql_query($sql); |
1037 | 1037 | } |
@@ -1051,33 +1051,33 @@ discard block |
||
1051 | 1051 | 'link_vote' => 0, |
1052 | 1052 | ); |
1053 | 1053 | |
1054 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
1055 | - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
1056 | - WHERE link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop; |
|
1054 | + $sql = 'UPDATE '.$this->links_table.' |
|
1055 | + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' |
|
1056 | + WHERE link_id BETWEEN ' . (int) $start.' AND '.(int) $stop; |
|
1057 | 1057 | $this->db->sql_query($sql); |
1058 | 1058 | |
1059 | - $sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM ' . $this->votes_table . ' |
|
1060 | - WHERE vote_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . ' |
|
1059 | + $sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM '.$this->votes_table.' |
|
1060 | + WHERE vote_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.' |
|
1061 | 1061 | GROUP BY vote_link_id'; |
1062 | 1062 | $result = $this->db->sql_query($sql); |
1063 | 1063 | while ($tmp = $this->db->sql_fetchrow($result)) |
1064 | 1064 | { |
1065 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
1066 | - SET link_note = ' . (int) $tmp['total'] . ', link_vote = ' . (int) $tmp['nb_vote'] . ' |
|
1065 | + $sql = 'UPDATE '.$this->links_table.' |
|
1066 | + SET link_note = ' . (int) $tmp['total'].', link_vote = '.(int) $tmp['nb_vote'].' |
|
1067 | 1067 | WHERE link_id = ' . (int) $tmp['vote_link_id']; |
1068 | 1068 | $this->db->sql_query($sql); |
1069 | 1069 | } |
1070 | 1070 | $this->db->sql_freeresult($result); |
1071 | 1071 | |
1072 | 1072 | $sql = 'SELECT comment_link_id, COUNT(comment_id) AS nb_comment |
1073 | - FROM ' . $this->comments_table . ' |
|
1074 | - WHERE comment_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . ' |
|
1073 | + FROM ' . $this->comments_table.' |
|
1074 | + WHERE comment_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.' |
|
1075 | 1075 | GROUP BY comment_link_id'; |
1076 | 1076 | $result = $this->db->sql_query($sql); |
1077 | 1077 | while ($tmp = $this->db->sql_fetchrow($result)) |
1078 | 1078 | { |
1079 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
1080 | - SET link_comment = ' . (int) $tmp['nb_comment'] . ' |
|
1079 | + $sql = 'UPDATE '.$this->links_table.' |
|
1080 | + SET link_comment = ' . (int) $tmp['nb_comment'].' |
|
1081 | 1081 | WHERE link_id = ' . (int) $tmp['comment_link_id']; |
1082 | 1082 | $this->db->sql_query($sql); |
1083 | 1083 | } |
@@ -1102,7 +1102,7 @@ discard block |
||
1102 | 1102 | |
1103 | 1103 | foreach ($img_ary as $img) |
1104 | 1104 | { |
1105 | - $img = $path . $img; |
|
1105 | + $img = $path.$img; |
|
1106 | 1106 | $selected = ''; |
1107 | 1107 | |
1108 | 1108 | if (strlen($img) > 255) |
@@ -1115,7 +1115,7 @@ discard block |
||
1115 | 1115 | $selected = ' selected="selected"'; |
1116 | 1116 | } |
1117 | 1117 | |
1118 | - $filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>'; |
|
1118 | + $filename_list .= '<option value="'.htmlspecialchars($img).'"'.$selected.'>'.$img.'</option>'; |
|
1119 | 1119 | } |
1120 | 1120 | } |
1121 | 1121 |