Completed
Push — master ( 60e479...55df09 )
by Erwan
11:56
created
controller/categories.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
controller/acp/cat.php 1 patch
Spacing   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -84,23 +84,23 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
183 183
 
184 184
 		$this->template->assign_vars(array(
185 185
 			'S_DELETE_DIR_CAT'		=> true,
186
-			'U_ACTION'				=> $this->u_action . "&amp;parent_id={$parent_id}&amp;action=delete&amp;c=$this->cat_id",
187
-			'U_BACK'				=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
186
+			'U_ACTION'				=> $this->u_action."&amp;parent_id={$parent_id}&amp;action=delete&amp;c=$this->cat_id",
187
+			'U_BACK'				=> $this->u_action.'&amp;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
 block discarded – undo
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 . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
238
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;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
 block discarded – undo
247 247
 
248 248
 		if (!$row)
249 249
 		{
250
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
250
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
251 251
 		}
252 252
 
253 253
 		try
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
308
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;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
 block discarded – undo
319 319
 
320 320
 		if (!$row)
321 321
 		{
322
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
322
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;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
 block discarded – undo
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 . "&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync&amp;start=$start&amp;links_done=$links_done&amp;total={$row['cat_links']}";
359
+			$url = $this->u_action."&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync&amp;start=$start&amp;links_done=$links_done&amp;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 . "&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}",
364
+				'UA_PROGRESS_BAR'		=> $this->u_action."&amp;action=progress_bar&amp;start=$links_done&amp;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
 block discarded – undo
369 369
 			return;
370 370
 		}
371 371
 
372
-		$url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync_cat";
372
+		$url = $this->u_action."&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;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 . '&amp;action=progress_bar',
376
+			'UA_PROGRESS_BAR'		=> $this->u_action.'&amp;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
 block discarded – undo
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
 block discarded – undo
397 397
 
398 398
 		if (!$row)
399 399
 		{
400
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
400
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;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
 block discarded – undo
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
 block discarded – undo
430 430
 			{
431 431
 				if ($row['cat_id'] == $this->parent_id)
432 432
 				{
433
-					$navigation .= ' -&gt; ' . $row['cat_name'];
433
+					$navigation .= ' -&gt; '.$row['cat_name'];
434 434
 				}
435 435
 				else
436 436
 				{
437
-					$navigation .= ' -&gt; <a href="' . $this->u_action . '&amp;parent_id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a>';
437
+					$navigation .= ' -&gt; <a href="'.$this->u_action.'&amp;parent_id='.$row['cat_id'].'">'.$row['cat_name'].'</a>';
438 438
 				}
439 439
 			}
440 440
 		}
@@ -448,8 +448,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 . "&amp;parent_id=$this->parent_id&amp;c={$row['cat_id']}";
462
+				$url = $this->u_action."&amp;parent_id=$this->parent_id&amp;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 . '&amp;parent_id=' . $row['cat_id'],
472
-					'U_MOVE_UP'			=> $url . '&amp;action=move_up',
473
-					'U_MOVE_DOWN'		=> $url . '&amp;action=move_down',
474
-					'U_EDIT'			=> $url . '&amp;action=edit',
475
-					'U_DELETE'			=> $url . '&amp;action=delete',
476
-					'U_SYNC'			=> $url . '&amp;action=sync')
471
+					'U_CAT'				=> $this->u_action.'&amp;parent_id='.$row['cat_id'],
472
+					'U_MOVE_UP'			=> $url.'&amp;action=move_up',
473
+					'U_MOVE_DOWN'		=> $url.'&amp;action=move_down',
474
+					'U_EDIT'			=> $url.'&amp;action=edit',
475
+					'U_DELETE'			=> $url.'&amp;action=delete',
476
+					'U_SYNC'			=> $url.'&amp;action=sync')
477 477
 				);
478 478
 			}
479 479
 			while ($row = $this->db->sql_fetchrow($result));
@@ -482,14 +482,14 @@  discard block
 block discarded – undo
482 482
 		{
483 483
 			$row = $this->_get_cat_info($this->parent_id);
484 484
 
485
-			$url = $this->u_action . '&amp;parent_id=' . $this->parent_id . '&amp;c=' . $row['cat_id'];
485
+			$url = $this->u_action.'&amp;parent_id='.$this->parent_id.'&amp;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 . '&amp;action=edit',
491
-				'U_DELETE'			=> $url . '&amp;action=delete',
492
-				'U_SYNC'			=> $url . '&amp;action=sync')
490
+				'U_EDIT'			=> $url.'&amp;action=edit',
491
+				'U_DELETE'			=> $url.'&amp;action=delete',
492
+				'U_SYNC'			=> $url.'&amp;action=sync')
493 493
 			);
494 494
 		}
495 495
 		$this->db->sql_freeresult($result);
@@ -499,9 +499,9 @@  discard block
 block discarded – undo
499 499
 			'NAVIGATION'	=> $navigation,
500 500
 			'CAT_BOX'		=> $cat_box,
501 501
 			'U_SEL_ACTION'	=> $this->u_action,
502
-			'U_ACTION'		=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
502
+			'U_ACTION'		=> $this->u_action.'&amp;parent_id='.$this->parent_id,
503 503
 
504
-			'UA_PROGRESS_BAR'	=> $this->u_action . '&amp;action=progress_bar',
504
+			'UA_PROGRESS_BAR'	=> $this->u_action.'&amp;action=progress_bar',
505 505
 		));
506 506
 	}
507 507
 
@@ -534,10 +534,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 . '&amp;parent_id=' . $this->parent_id));
609
+			trigger_error($this->language->lang($message).adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id));
610 610
 		}
611 611
 	}
612 612
 
@@ -634,8 +634,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 . '&amp;parent_id=' . $this->parent_id,
689
-			'U_EDIT_ACTION'		=> $this->u_action . "&amp;parent_id={$this->parent_id}&amp;action=$this->action&amp;c=$this->cat_id",
688
+			'U_BACK'			=> $this->u_action.'&amp;parent_id='.$this->parent_id,
689
+			'U_EDIT_ACTION'		=> $this->u_action."&amp;parent_id={$this->parent_id}&amp;action=$this->action&amp;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'					=> (count($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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
controller/links.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -87,19 +87,19 @@  discard block
 block discarded – undo
87 87
 	*/
88 88
 	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\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext)
89 89
 	{
90
-		$this->db				= $db;
91
-		$this->config			= $config;
90
+		$this->db = $db;
91
+		$this->config = $config;
92 92
 		$this->language			= $language;
93 93
 		$this->template			= $template;
94 94
 		$this->user				= $user;
95
-		$this->helper			= $helper;
96
-		$this->request			= $request;
95
+		$this->helper = $helper;
96
+		$this->request = $request;
97 97
 		$this->auth				= $auth;
98
-		$this->captcha_factory 	= $captcha_factory;
98
+		$this->captcha_factory = $captcha_factory;
99 99
 		$this->categorie		= $categorie;
100 100
 		$this->link				= $link;
101 101
 		$this->root_path		= $root_path;
102
-		$this->php_ext			= $php_ext;
102
+		$this->php_ext = $php_ext;
103 103
 
104 104
 		$language->add_lang('directory', 'ernadoo/phpbbdirectory');
105 105
 
@@ -119,12 +119,12 @@  discard block
 block discarded – undo
119 119
 	{
120 120
 		if ($this->request->is_set_post('cancel'))
121 121
 		{
122
-			$redirect = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
122
+			$redirect = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
123 123
 			redirect($redirect);
124 124
 		}
125 125
 
126 126
 		$sql = 'SELECT link_user_id
127
-			FROM ' . $this->links_table . '
127
+			FROM ' . $this->links_table.'
128 128
 			WHERE link_id = ' . (int) $link_id;
129 129
 		$result = $this->db->sql_query($sql);
130 130
 		$link_data = $this->db->sql_fetchrow($result);
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
 		{
146 146
 			$this->link->del($cat_id, $link_id);
147 147
 
148
-			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
148
+			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
149 149
 			meta_refresh(3, $meta_info);
150
-			$message = $this->language->lang('DIR_DELETE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id) . '">', '</a>');
150
+			$message = $this->language->lang('DIR_DELETE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id).'">', '</a>');
151 151
 			return $this->helper->message($message);
152 152
 		}
153 153
 		else
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	public function edit_link($cat_id, $link_id)
168 168
 	{
169 169
 		$sql = 'SELECT link_id, link_uid, link_user_id, link_flags, link_bitfield, link_cat, link_url, link_description, link_guest_email, link_name, link_rss, link_back, link_banner, link_flag, link_cat, link_time
170
-			FROM ' . $this->links_table . '
170
+			FROM ' . $this->links_table.'
171 171
 			WHERE link_id = ' . (int) $link_id;
172 172
 		$result = $this->db->sql_query($sql);
173 173
 		$link_data = $this->db->sql_fetchrow($result);
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 		$cat_id		= $this->request->variable('id', $cat_id);
189 189
 		$submit		= $this->request->is_set_post('submit') ? true : false;
190 190
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
191
-		$title		= $this->language->lang('DIR_EDIT_SITE');
191
+		$title = $this->language->lang('DIR_EDIT_SITE');
192 192
 
193 193
 		$this->template->assign_block_vars('dir_navlinks', array(
194 194
 			'BREADCRUMB_NAME'	=> $title,
@@ -212,15 +212,15 @@  discard block
 block discarded – undo
212 212
 				'old_banner'	=> $link_data['link_banner'],
213 213
 			);
214 214
 
215
-			$site_description			= generate_text_for_edit($link_data['link_description'], $link_data['link_uid'], $link_data['link_flags']);
216
-			$link_data['link_banner'] 	= (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $link_data['link_banner'])) ? $link_data['link_banner'] : '';
215
+			$site_description = generate_text_for_edit($link_data['link_description'], $link_data['link_uid'], $link_data['link_flags']);
216
+			$link_data['link_banner'] = (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $link_data['link_banner'])) ? $link_data['link_banner'] : '';
217 217
 
218
-			$this->url			= $link_data['link_url'];
219
-			$this->site_name	= $link_data['link_name'];
218
+			$this->url = $link_data['link_url'];
219
+			$this->site_name = $link_data['link_name'];
220 220
 			$this->description	= $site_description['text'];
221 221
 			$this->guest_email	= $link_data['link_guest_email'];
222
-			$this->rss			= $link_data['link_rss'];
223
-			$this->banner 		= $link_data['link_banner'];
222
+			$this->rss = $link_data['link_rss'];
223
+			$this->banner = $link_data['link_banner'];
224 224
 			$this->back			= $link_data['link_back'];
225 225
 			$this->flag 		= $link_data['link_flag'];
226 226
 		}
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 		$cat_id		= $this->request->variable('id', $cat_id);
248 248
 		$submit		= $this->request->is_set_post('submit') ? true : false;
249 249
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
250
-		$title		= $this->language->lang('DIR_NEW_SITE');
250
+		$title = $this->language->lang('DIR_NEW_SITE');
251 251
 
252 252
 		$this->template->assign_block_vars('dir_navlinks', array(
253 253
 			'BREADCRUMB_NAME'	=> $title,
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 
312 312
 		// We check if user had already vot for this website.
313 313
 		$sql = 'SELECT vote_link_id
314
-			FROM ' . $this->votes_table . '
314
+			FROM ' . $this->votes_table.'
315 315
 			WHERE ' . $this->db->sql_build_array('SELECT', $data);
316 316
 		$result = $this->db->sql_query($sql);
317 317
 		$data = $this->db->sql_fetchrow($result);
@@ -323,9 +323,9 @@  discard block
 block discarded – undo
323 323
 
324 324
 		$this->link->add_vote($link_id, $this->request->variable('vote', 0));
325 325
 
326
-		$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
326
+		$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
327 327
 		meta_refresh(3, $meta_info);
328
-		$message = $this->language->lang('DIR_VOTE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $meta_info . '">', '</a>');
328
+		$message = $this->language->lang('DIR_VOTE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$meta_info.'">', '</a>');
329 329
 		return $this->helper->message($message);
330 330
 	}
331 331
 
@@ -350,18 +350,18 @@  discard block
 block discarded – undo
350 350
 			return $this->helper->message('FORM_INVALID');
351 351
 		}
352 352
 
353
-		$this->url			= $this->request->variable('url', '');
354
-		$this->site_name	= $this->request->variable('site_name', '', true);
353
+		$this->url = $this->request->variable('url', '');
354
+		$this->site_name = $this->request->variable('site_name', '', true);
355 355
 		$this->description	= $this->request->variable('description', '', true);
356 356
 		$this->guest_email	= $this->request->variable('guest_email', '');
357
-		$this->rss			= $this->request->variable('rss', '');
358
-		$this->banner 		= $this->request->variable('banner', '');
357
+		$this->rss = $this->request->variable('rss', '');
358
+		$this->banner = $this->request->variable('banner', '');
359 359
 		$this->back			= $this->request->variable('back', '');
360 360
 		$this->flag 		= $this->request->variable('flag', '');
361 361
 
362 362
 		if (!function_exists('validate_data'))
363 363
 		{
364
-			include($this->root_path . 'includes/functions_user.' . $this->php_ext);
364
+			include($this->root_path.'includes/functions_user.'.$this->php_ext);
365 365
 		}
366 366
 
367 367
 		// We define variables to check
@@ -384,17 +384,17 @@  discard block
 block discarded – undo
384 384
 			'site_name' =>			array(
385 385
 				array('string', false, 1, 100)),
386 386
 			'website'		=>		array(
387
-				array('string',	false, 12, 255),
388
-				array('match',	true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
387
+				array('string', false, 12, 255),
388
+				array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
389 389
 			'description'	=>		array(
390 390
 				array('string', !$this->categorie->data['cat_must_describe'], 1, $this->config['dir_length_describe'])),
391 391
 			'rss'			=>		array(
392 392
 				array('string', true, 12, 255),
393
-				array('match',	empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
393
+				array('match', empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
394 394
 			'banner'		=>		array(
395 395
 				array('string', true, 5, 255)),
396 396
 			'back'			=>		array(
397
-				array('string',	!$this->categorie->data['cat_link_back'], 12, 255),
397
+				array('string', !$this->categorie->data['cat_link_back'], 12, 255),
398 398
 				array(array($this->link, 'link_back'), true)),
399 399
 			'cat'			=>		array(
400 400
 				array('num', '', 1))
@@ -440,8 +440,8 @@  discard block
 block discarded – undo
440 440
 		// Still no errors?? So let's go!
441 441
 		if (!$error)
442 442
 		{
443
-			$this->banner	= (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
444
-			$this->url		= $this->link->clean_url($this->url);
443
+			$this->banner = (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
444
+			$this->url = $this->link->clean_url($this->url);
445 445
 
446 446
 			$data_edit = array(
447 447
 				'link_user_id'		=> $this->link_user_id,
@@ -486,10 +486,10 @@  discard block
 block discarded – undo
486 486
 				$this->link->add($data_add, $need_approval);
487 487
 			}
488 488
 
489
-			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
489
+			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
490 490
 			meta_refresh(3, $meta_info);
491 491
 			$message	= ($need_approval) ? $this->language->lang('DIR_'.strtoupper($mode).'_SITE_ACTIVE') : $this->language->lang('DIR_'.strtoupper($mode).'_SITE_OK');
492
-			$message	= $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id) . '">', '</a>');
492
+			$message	= $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id).'">', '</a>');
493 493
 			return $this->helper->message($message);
494 494
 		}
495 495
 		else
@@ -518,10 +518,10 @@  discard block
 block discarded – undo
518 518
 	{
519 519
 		if (!function_exists('file_gc'))
520 520
 		{
521
-			include($this->root_path . 'includes/functions_download.' . $this->php_ext);
521
+			include($this->root_path.'includes/functions_download.'.$this->php_ext);
522 522
 		}
523 523
 
524
-		$file_path = $this->root_path . $this->get_banner_path($banner_img);
524
+		$file_path = $this->root_path.$this->get_banner_path($banner_img);
525 525
 
526 526
 		if ((@file_exists($file_path) && @is_readable($file_path)))
527 527
 		{
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 
574 574
 		if (!function_exists('display_custom_bbcodes'))
575 575
 		{
576
-			include($this->root_path . 'includes/functions_display.' . $this->php_ext);
576
+			include($this->root_path.'includes/functions_display.'.$this->php_ext);
577 577
 		}
578 578
 		display_custom_bbcodes();
579 579
 		add_form_key('dir_form');
@@ -582,17 +582,17 @@  discard block
 block discarded – undo
582 582
 		$flag_path = $ext_path.'images/flags/';
583 583
 
584 584
 		$s_guest	= (!$this->user->data['is_registered'] || !empty($this->guest_email));
585
-		$s_rss		= $this->config['dir_activ_rss'];
586
-		$s_banner	= $this->config['dir_activ_banner'];
585
+		$s_rss = $this->config['dir_activ_rss'];
586
+		$s_banner = $this->config['dir_activ_banner'];
587 587
 		$s_back		= $this->categorie->data['cat_link_back'];
588 588
 		$s_flag		= $this->config['dir_activ_flag'];
589 589
 
590 590
 		$this->template->assign_vars(array(
591
-			'BBCODE_STATUS'			=> ($this->config['allow_bbcode']) 	? $this->language->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'),
592
-			'IMG_STATUS'			=> ($this->config['allow_bbcode'])	? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
591
+			'BBCODE_STATUS'			=> ($this->config['allow_bbcode']) ? $this->language->lang('BBCODE_IS_ON', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>'),
592
+			'IMG_STATUS'			=> ($this->config['allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
593 593
 			'SMILIES_STATUS'		=> ($this->config['allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'),
594 594
 			'URL_STATUS'			=> ($this->config['allow_post_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'),
595
-			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash'])	? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
595
+			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
596 596
 
597 597
 			'L_TITLE'				=> $title,
598 598
 			'L_DIR_DESCRIPTION_EXP'	=> $this->language->lang('DIR_DESCRIPTION_EXP', $this->config['dir_length_describe']),
Please login to merge, or discard this patch.
core/categorie.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
 	*/
61 61
 	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\cron\manager $cron)
62 62
 	{
63
-		$this->db			= $db;
64
-		$this->config		= $config;
63
+		$this->db = $db;
64
+		$this->config = $config;
65 65
 		$this->language		= $language;
66 66
 		$this->template		= $template;
67 67
 		$this->user			= $user;
68
-		$this->helper		= $helper;
69
-		$this->request		= $request;
68
+		$this->helper = $helper;
69
+		$this->request = $request;
70 70
 		$this->auth			= $auth;
71 71
 		$this->cron 		= $cron;
72 72
 	}
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	public function make_cat_jumpbox()
91 91
 	{
92 92
 		$sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id
93
-			FROM ' . $this->categories_table . '
93
+			FROM ' . $this->categories_table.'
94 94
 			ORDER BY left_id ASC';
95 95
 		$result = $this->db->sql_query($sql);
96 96
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 				'FORUM_ID'			=> $row['cat_id'],
120 120
 				'FORUM_NAME'		=> $row['cat_name'],
121 121
 				'S_FORUM_COUNT'		=> $iteration,
122
-				'LINK'				=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $row['cat_id']),
122
+				'LINK'				=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$row['cat_id']),
123 123
 			));
124 124
 
125 125
 			for ($i = 0; $i < $padding; $i++)
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
 		// This query is identical to the jumpbox one
153 153
 		$sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id
154
-			FROM ' . $this->categories_table . '
154
+			FROM ' . $this->categories_table.'
155 155
 			ORDER BY left_id ASC';
156 156
 		$result = $this->db->sql_query($sql);
157 157
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 			}
182 182
 
183 183
 			$selected = (($row['cat_id'] == $select_id) ? ' selected="selected"' : '');
184
-			$cat_list .= '<option value="' . $row['cat_id'] . '"' . (($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected) . '>' . $padding . $row['cat_name'] . '</option>';
184
+			$cat_list .= '<option value="'.$row['cat_id'].'"'.(($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected).'>'.$padding.$row['cat_name'].'</option>';
185 185
 		}
186 186
 		$this->db->sql_freeresult($result);
187 187
 		unset($padding_store);
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	*/
197 197
 	public function display()
198 198
 	{
199
-		$cat_rows	= $subcats = array();
199
+		$cat_rows = $subcats = array();
200 200
 		$parent_id	= $visible_cats = 0;
201 201
 
202 202
 		$sql_array = array(
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		else
215 215
 		{
216 216
 			$root_data = $this->data;
217
-			$sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id'];
217
+			$sql_where = 'left_id > '.$root_data['left_id'].' AND left_id < '.$root_data['right_id'];
218 218
 		}
219 219
 
220 220
 		$sql = $this->db->sql_build_query('SELECT', array(
@@ -261,12 +261,12 @@  discard block
 block discarded – undo
261 261
 			{
262 262
 				foreach ($subcats[$dir_cat_id] as $subcat_id => $subcat_row)
263 263
 				{
264
-					$row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links']+$subcat_row['links']) : $row['cat_links'];
264
+					$row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links'] + $subcat_row['links']) : $row['cat_links'];
265 265
 
266 266
 					if ($subcat_row['display'] && $subcat_row['parent_id'] == $dir_cat_id)
267 267
 					{
268 268
 						$subcats_list[] = array(
269
-							'link'		=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $subcat_id),
269
+							'link'		=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$subcat_id),
270 270
 							'name'		=> $subcat_row['name'],
271 271
 							'links'		=> $subcat_row['links']
272 272
 						);
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 				'CAT_LINKS'				=> $row['cat_links'],
285 285
 				'CAT_IMG'				=> $this->get_img_path('icons', $row['cat_icon']),
286 286
 
287
-				'U_CAT'					=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $row['cat_id']),
287
+				'U_CAT'					=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$row['cat_id']),
288 288
 			));
289 289
 
290 290
 			// Assign subcats loop for style authors
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 			if ($task->is_ready())
317 317
 			{
318 318
 				$url = $task->get_url();
319
-				$this->template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="" />');
319
+				$this->template->assign_var('RUN_CRON_TASK', '<img src="'.$url.'" width="1" height="1" alt="" />');
320 320
 			}
321 321
 		}
322 322
 	}
@@ -338,10 +338,10 @@  discard block
 block discarded – undo
338 338
 				'LEFT_JOIN'	=> array(
339 339
 						array(
340 340
 							'FROM'	=> array($this->watch_table	=> 'w'),
341
-							'ON'	=> 'c.cat_id = w.cat_id AND w.user_id = ' . (int) $this->user->data['user_id']
341
+							'ON'	=> 'c.cat_id = w.cat_id AND w.user_id = '.(int) $this->user->data['user_id']
342 342
 						),
343 343
 				),
344
-				'WHERE'		=> 'c.cat_id = ' . (int) $cat_id
344
+				'WHERE'		=> 'c.cat_id = '.(int) $cat_id
345 345
 			);
346 346
 			$sql = $this->db->sql_build_query('SELECT', $sql_array);
347 347
 			$result = $this->db->sql_query($sql);
@@ -378,8 +378,8 @@  discard block
 block discarded – undo
378 378
 				$this->template->assign_block_vars('dir_navlinks', array(
379 379
 					'BREADCRUMB_NAME'	=> $parent_data['cat_name'],
380 380
 					'FORUM_ID'			=> $parent_cat_id,
381
-					'MICRODATA'			=> $microdata_attr . '="' . $parent_cat_id . '"',
382
-					'U_BREADCRUMB'		=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $parent_cat_id),
381
+					'MICRODATA'			=> $microdata_attr.'="'.$parent_cat_id.'"',
382
+					'U_BREADCRUMB'		=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$parent_cat_id),
383 383
 				));
384 384
 			}
385 385
 		}
@@ -387,8 +387,8 @@  discard block
 block discarded – undo
387 387
 		$this->template->assign_block_vars('dir_navlinks', array(
388 388
 			'BREADCRUMB_NAME'	=> $dir_cat_data['cat_name'],
389 389
 			'FORUM_ID'			=> $dir_cat_data['cat_id'],
390
-			'MICRODATA'			=> $microdata_attr . '="' . $dir_cat_data['cat_id'] . '"',
391
-			'U_BREADCRUMB'		=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $dir_cat_data['cat_id']),
390
+			'MICRODATA'			=> $microdata_attr.'="'.$dir_cat_data['cat_id'].'"',
391
+			'U_BREADCRUMB'		=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$dir_cat_data['cat_id']),
392 392
 		));
393 393
 
394 394
 		return;
@@ -441,17 +441,17 @@  discard block
 block discarded – undo
441 441
 			{
442 442
 				if ($mode == 'unwatch')
443 443
 				{
444
-					$sql = 'DELETE FROM ' . $this->watch_table . "
444
+					$sql = 'DELETE FROM '.$this->watch_table."
445 445
 						WHERE cat_id = $cat_id
446 446
 							AND user_id = $user_id";
447 447
 					$this->db->sql_query($sql);
448 448
 
449
-					$redirect_url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
449
+					$redirect_url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
450 450
 					$message = $this->language->lang('DIR_NOT_WATCHING_CAT');
451 451
 
452 452
 					if (!$this->request->is_ajax())
453 453
 					{
454
-						$message .= '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>');
454
+						$message .= '<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>');
455 455
 					}
456 456
 
457 457
 					meta_refresh(3, $redirect_url);
@@ -463,8 +463,8 @@  discard block
 block discarded – undo
463 463
 
464 464
 					if ($notify_status != NOTIFY_YES)
465 465
 					{
466
-						$sql = 'UPDATE ' . $this->watch_table . '
467
-							SET notify_status = ' . NOTIFY_YES . "
466
+						$sql = 'UPDATE '.$this->watch_table.'
467
+							SET notify_status = ' . NOTIFY_YES."
468 468
 							WHERE cat_id = $cat_id
469 469
 								AND user_id = $user_id";
470 470
 						$this->db->sql_query($sql);
@@ -475,16 +475,16 @@  discard block
 block discarded – undo
475 475
 			{
476 476
 				if ($mode == 'watch')
477 477
 				{
478
-					$sql = 'INSERT INTO ' . $this->watch_table . " (user_id, cat_id, notify_status)
479
-						VALUES ($user_id, $cat_id, " . NOTIFY_YES . ')';
478
+					$sql = 'INSERT INTO '.$this->watch_table." (user_id, cat_id, notify_status)
479
+						VALUES ($user_id, $cat_id, ".NOTIFY_YES.')';
480 480
 					$this->db->sql_query($sql);
481 481
 
482
-					$redirect_url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
482
+					$redirect_url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
483 483
 					$message = $this->language->lang('DIR_ARE_WATCHING_CAT');
484 484
 
485 485
 					if (!$this->request->is_ajax())
486 486
 					{
487
-						$message .= '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>');
487
+						$message .= '<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>');
488 488
 					}
489 489
 
490 490
 					meta_refresh(3, $redirect_url);
@@ -504,10 +504,10 @@  discard block
 block discarded – undo
504 504
 
505 505
 		if ($can_watch)
506 506
 		{
507
-			$s_watching['link'] 		= $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch')));
507
+			$s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch')));
508 508
 			$s_watching['link_toggle'] 	= $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => ((!$is_watching) ? 'unwatch' : 'watch')));
509
-			$s_watching['title'] 		= $this->language->lang((($is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT');
510
-			$s_watching['title_toggle'] = $this->language->lang(((!$is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT');
509
+			$s_watching['title'] = $this->language->lang((($is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT');
510
+			$s_watching['title_toggle'] = $this->language->lang(((!$is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT');
511 511
 			$s_watching['is_watching'] 	= $is_watching;
512 512
 		}
513 513
 
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 		$categories_table = $phpbb_container->getParameter('tables.dir.categories');
528 528
 
529 529
 		$sql = 'SELECT cat_name
530
-			FROM ' . $categories_table . '
530
+			FROM ' . $categories_table.'
531 531
 			WHERE cat_id = ' . (int) $cat_id;
532 532
 		$result = $db->sql_query($sql);
533 533
 		$row = $db->sql_fetchrow($result);
Please login to merge, or discard this patch.