Completed
Branch master (2172af)
by Erwan
02:42
created
root/includes/acp/acp_directory.php 3 patches
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -1521,6 +1521,9 @@  discard block
 block discarded – undo
1521 1521
 		adm_page_footer();
1522 1522
 	}
1523 1523
 
1524
+	/**
1525
+	 * @return string
1526
+	 */
1524 1527
 	function move_cat_by($dir_cat_row, $action = 'move_up', $steps = 1)
1525 1528
 	{
1526 1529
 		global $db;
@@ -1790,6 +1793,9 @@  discard block
 block discarded – undo
1790 1793
 		return $errors;
1791 1794
 	}
1792 1795
 
1796
+	/**
1797
+	 * @param integer $to_id
1798
+	 */
1793 1799
 	function move_cat_content($from_id, $to_id)
1794 1800
 	{
1795 1801
 		global $db;
@@ -1972,6 +1978,10 @@  discard block
 block discarded – undo
1972 1978
 	return;
1973 1979
 }
1974 1980
 
1981
+/**
1982
+ * @param integer $start
1983
+ * @param integer $stop
1984
+ */
1975 1985
 function sync_dir_links($start, $stop)
1976 1986
 {
1977 1987
 	global $db;
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1526,11 +1526,11 @@  discard block
 block discarded – undo
1526 1526
 		global $db;
1527 1527
 
1528 1528
 		/**
1529
-		* Fetch all the siblings between the module's current spot
1530
-		* and where we want to move it to. If there are less than $steps
1531
-		* siblings between the current spot and the target then the
1532
-		* module will move as far as possible
1533
-		*/
1529
+		 * Fetch all the siblings between the module's current spot
1530
+		 * and where we want to move it to. If there are less than $steps
1531
+		 * siblings between the current spot and the target then the
1532
+		 * module will move as far as possible
1533
+		 */
1534 1534
 		$sql = 'SELECT cat_id, cat_name, left_id, right_id
1535 1535
 			FROM ' . DIR_CAT_TABLE . '
1536 1536
 			WHERE parent_id = ' . (int)$dir_cat_row['parent_id'] . '
@@ -1551,12 +1551,12 @@  discard block
 block discarded – undo
1551 1551
 		}
1552 1552
 
1553 1553
 		/**
1554
-		* $left_id and $right_id define the scope of the nodes that are affected by the move.
1555
-		* $diff_up and $diff_down are the values to substract or add to each node's left_id
1556
-		* and right_id in order to move them up or down.
1557
-		* $move_up_left and $move_up_right define the scope of the nodes that are moving
1558
-		* up. Other nodes in the scope of ($left_id, $right_id) are considered to move down.
1559
-		*/
1554
+		 * $left_id and $right_id define the scope of the nodes that are affected by the move.
1555
+		 * $diff_up and $diff_down are the values to substract or add to each node's left_id
1556
+		 * and right_id in order to move them up or down.
1557
+		 * $move_up_left and $move_up_right define the scope of the nodes that are moving
1558
+		 * up. Other nodes in the scope of ($left_id, $right_id) are considered to move down.
1559
+		 */
1560 1560
 		if ($action == 'move_up')
1561 1561
 		{
1562 1562
 			$left_id = $target['left_id'];
Please login to merge, or discard this patch.
Spacing   +239 added lines, -239 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
33 33
 
34 34
 		$action		= request_var('action', '');
35
-		$start		= request_var('start', 0);
35
+		$start = request_var('start', 0);
36 36
 		$submit		= (isset($_POST['submit'])) ? true : false;
37 37
 		$update		= (isset($_POST['update'])) ? true : false;
38 38
 		$cat_id		= request_var('c', 0);
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		$form_key = 'acp_dir_cat';
42 42
 		add_form_key($form_key);
43 43
 
44
-		$this->parent_id	= request_var('parent_id', 0);
44
+		$this->parent_id = request_var('parent_id', 0);
45 45
 		$cat_data = $errors = array();
46 46
 		if ($update && !check_form_key($form_key))
47 47
 		{
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 			$errors[] = $user->lang['FORM_INVALID'];
50 50
 		}
51 51
 
52
-		switch($mode)
52
+		switch ($mode)
53 53
 		{
54 54
 			case 'main':
55 55
 				$this->page_title = 'ACP_DIRECTORY';
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
 								{
106 106
 									case 'sqlite':
107 107
 									case 'firebird':
108
-										$db->sql_query('DELETE FROM ' . DIR_VOTE_TABLE);
108
+										$db->sql_query('DELETE FROM '.DIR_VOTE_TABLE);
109 109
 									break;
110 110
 
111 111
 									default:
112
-										$db->sql_query('TRUNCATE TABLE ' . DIR_VOTE_TABLE);
112
+										$db->sql_query('TRUNCATE TABLE '.DIR_VOTE_TABLE);
113 113
 									break;
114 114
 								}
115 115
 
116
-								$sql = 'UPDATE ' . DIR_LINK_TABLE . ' SET
116
+								$sql = 'UPDATE '.DIR_LINK_TABLE.' SET
117 117
 									link_vote = 0,
118 118
 									link_note = 0';
119 119
 								$db->sql_query($sql);
@@ -124,21 +124,21 @@  discard block
 block discarded – undo
124 124
 								{
125 125
 									case 'sqlite':
126 126
 									case 'firebird':
127
-										$db->sql_query('DELETE FROM ' . DIR_COMMENT_TABLE);
127
+										$db->sql_query('DELETE FROM '.DIR_COMMENT_TABLE);
128 128
 									break;
129 129
 
130 130
 									default:
131
-										$db->sql_query('TRUNCATE TABLE ' . DIR_COMMENT_TABLE);
131
+										$db->sql_query('TRUNCATE TABLE '.DIR_COMMENT_TABLE);
132 132
 									break;
133 133
 								}
134 134
 
135
-								$sql = 'UPDATE ' . DIR_LINK_TABLE . ' SET
135
+								$sql = 'UPDATE '.DIR_LINK_TABLE.' SET
136 136
 									link_comment = 0';
137 137
 								$db->sql_query($sql);
138 138
 							break;
139 139
 
140 140
 							case 'clicks':
141
-								$sql = 'UPDATE ' . DIR_LINK_TABLE . ' SET
141
+								$sql = 'UPDATE '.DIR_LINK_TABLE.' SET
142 142
 									link_view = 0';
143 143
 								$db->sql_query($sql);
144 144
 							break;
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 					FROM ' . DIR_LINK_TABLE;
183 183
 				$result = $db->sql_query($sql);
184 184
 				$total_links = $waiting_links = 0;
185
-				while($row = $db->sql_fetchrow($result))
185
+				while ($row = $db->sql_fetchrow($result))
186 186
 				{
187 187
 					$total_links++;
188 188
 					if (!$row['link_active'])
@@ -215,13 +215,13 @@  discard block
 block discarded – undo
215 215
 
216 216
 				$banners_dir_size = 0;
217 217
 
218
-				if ($banners_dir = @opendir($phpbb_root_path . 'images/directory/banners/'))
218
+				if ($banners_dir = @opendir($phpbb_root_path.'images/directory/banners/'))
219 219
 				{
220 220
 					while (($file = readdir($banners_dir)) !== false)
221 221
 					{
222 222
 						if ($file[0] != '.' && $file[0] != '..' && strpos($file, 'index.') === false && strpos($file, '.db') === false)
223 223
 						{
224
-							$banners_dir_size += filesize($phpbb_root_path . 'images/directory/banners/' . $file);
224
+							$banners_dir_size += filesize($phpbb_root_path.'images/directory/banners/'.$file);
225 225
 						}
226 226
 					}
227 227
 					closedir($banners_dir);
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 					'U_DOWNLOAD'		=> $download_link,
248 248
 
249 249
 					'TOTAL_CATS'		=> $total_cats,
250
-					'TOTAL_LINKS'		=> $total_links-$waiting_links,
250
+					'TOTAL_LINKS'		=> $total_links - $waiting_links,
251 251
 					'WAITING_LINKS'		=> $waiting_links,
252 252
 					'TOTAL_COMMENTS'	=> $total_comments,
253 253
 					'TOTAL_VOTES'		=> $total_votes,
@@ -266,44 +266,44 @@  discard block
 block discarded – undo
266 266
 						'dir_banner_width'					=> '',
267 267
 						'dir_banner_height'					=> '',
268 268
 
269
-						'dir_mail'							=> array('lang' => 'DIR_MAIL_VALIDATION',	'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => false),
270
-						'dir_activ_checkurl'				=> array('lang' => 'DIR_ACTIVE_CHECK',		'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
271
-						'dir_activ_flag'					=> array('lang' => 'DIR_ACTIV_FLAG',		'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => false),
272
-						'dir_activ_rss'						=> array('lang' => 'DIR_ACTIV_RSS',			'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
273
-						'dir_activ_pagerank'				=> array('lang' => 'DIR_ACTIV_PAGERANK',	'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
274
-						'dir_show'							=> array('lang' => 'DIR_SHOW',				'validate' => 'int:1', 	'type' => 'text:3:3',		'explain' => false),
275
-						'dir_length_describe'				=> array('lang' => 'DIR_MAX_DESC',			'validate' => 'int:1', 	'type' => 'text:3:3',		'explain' => false),
276
-						'dir_new_time'						=> array('lang' => 'DIR_NEW_TIME',			'validate' => 'int', 	'type' => 'text:3:3',		'explain' => true),
277
-						'dir_default_order'					=> array('lang' => 'DIR_DEFAULT_ORDER',		'validate' => 'string', 'type' => 'select',			'explain' => true, 'method' => 'get_order_list', 'params' => array('{CONFIG_VALUE}')),
269
+						'dir_mail'							=> array('lang' => 'DIR_MAIL_VALIDATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
270
+						'dir_activ_checkurl'				=> array('lang' => 'DIR_ACTIVE_CHECK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
271
+						'dir_activ_flag'					=> array('lang' => 'DIR_ACTIV_FLAG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
272
+						'dir_activ_rss'						=> array('lang' => 'DIR_ACTIV_RSS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
273
+						'dir_activ_pagerank'				=> array('lang' => 'DIR_ACTIV_PAGERANK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
274
+						'dir_show'							=> array('lang' => 'DIR_SHOW', 'validate' => 'int:1', 'type' => 'text:3:3', 'explain' => false),
275
+						'dir_length_describe'				=> array('lang' => 'DIR_MAX_DESC', 'validate' => 'int:1', 'type' => 'text:3:3', 'explain' => false),
276
+						'dir_new_time'						=> array('lang' => 'DIR_NEW_TIME', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
277
+						'dir_default_order'					=> array('lang' => 'DIR_DEFAULT_ORDER', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_order_list', 'params' => array('{CONFIG_VALUE}')),
278 278
 
279 279
 						'legend2'							=> 'DIR_RECENT_GUEST',
280
-						'dir_recent_block'					=> array('lang' => 'DIR_RECENT_ENABLE',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
281
-						'dir_recent_rows'					=> array('lang' => 'DIR_RECENT_ROWS',		'validate' => 'int:1',		'type' => 'text:3:3',		'explain' => false),
282
-						'dir_recent_columns'				=> array('lang' => 'DIR_RECENT_COLUMNS',	'validate' => 'int:1',		'type' => 'text:3:3',		'explain' => false),
283
-						'dir_recent_exclude'				=> array('lang' => 'DIR_RECENT_EXCLUDE',	'validate' => 'string',		'type' => 'text:6:99',			'explain' => true),
280
+						'dir_recent_block'					=> array('lang' => 'DIR_RECENT_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
281
+						'dir_recent_rows'					=> array('lang' => 'DIR_RECENT_ROWS', 'validate' => 'int:1', 'type' => 'text:3:3', 'explain' => false),
282
+						'dir_recent_columns'				=> array('lang' => 'DIR_RECENT_COLUMNS', 'validate' => 'int:1', 'type' => 'text:3:3', 'explain' => false),
283
+						'dir_recent_exclude'				=> array('lang' => 'DIR_RECENT_EXCLUDE', 'validate' => 'string', 'type' => 'text:6:99', 'explain' => true),
284 284
 
285 285
 						'legend3'							=> 'DIR_ADD_GUEST',
286
-						'dir_visual_confirm'				=> array('lang' => 'DIR_VISUAL_CONFIRM',	'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
287
-						'dir_visual_confirm_max_attempts'	=> array('lang' => 'DIR_MAX_ADD_ATTEMPTS',	'validate' => 'int:1:10',	'type' => 'text:3:3',		'explain' => true),
286
+						'dir_visual_confirm'				=> array('lang' => 'DIR_VISUAL_CONFIRM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
287
+						'dir_visual_confirm_max_attempts'	=> array('lang' => 'DIR_MAX_ADD_ATTEMPTS', 'validate' => 'int:1:10', 'type' => 'text:3:3', 'explain' => true),
288 288
 
289 289
 						'legend4'							=> 'DIR_THUMB_PARAM',
290
-						'dir_activ_thumb'					=> array('lang' => 'DIR_ACTIVE_THUMB',			'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => false),
291
-						'dir_activ_thumb_remote'			=> array('lang' => 'DIR_ACTIVE_THUMB_REMOTE',	'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
292
-						'dir_thumb_service'					=> array('lang' => 'DIR_THUMB_SERVICE',			'validate' => 'string', 'type' => 'select',			'explain' => true, 'method' => 'get_thumb_service_list', 'params' => array('{CONFIG_VALUE}')),
293
-						'dir_thumb_service_reverse'			=> array('lang' => 'DIR_THUMB_SERVICE_REVERSE',	'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
290
+						'dir_activ_thumb'					=> array('lang' => 'DIR_ACTIVE_THUMB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
291
+						'dir_activ_thumb_remote'			=> array('lang' => 'DIR_ACTIVE_THUMB_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
292
+						'dir_thumb_service'					=> array('lang' => 'DIR_THUMB_SERVICE', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_thumb_service_list', 'params' => array('{CONFIG_VALUE}')),
293
+						'dir_thumb_service_reverse'			=> array('lang' => 'DIR_THUMB_SERVICE_REVERSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
294 294
 
295 295
 						'legend5'							=> 'DIR_COMM_PARAM',
296
-						'dir_allow_bbcode'					=> array('lang' => 'DIR_ALLOW_BBCODE',		'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => false),
297
-						'dir_allow_links'					=> array('lang' => 'DIR_ALLOW_LINKS',		'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => false),
298
-						'dir_allow_smilies'					=> array('lang' => 'DIR_ALLOW_SMILIES',		'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => false),
299
-						'dir_length_comments'				=> array('lang' => 'DIR_LENGTH_COMMENTS',	'validate' => 'int:2',	'type' => 'text:3:3',		'explain' => true),
300
-						'dir_comments_per_page'				=> array('lang' => 'DIR_COMM_PER_PAGE',		'validate' => 'int:1',	'type' => 'text:3:3',		'explain' => false),
296
+						'dir_allow_bbcode'					=> array('lang' => 'DIR_ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
297
+						'dir_allow_links'					=> array('lang' => 'DIR_ALLOW_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
298
+						'dir_allow_smilies'					=> array('lang' => 'DIR_ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
299
+						'dir_length_comments'				=> array('lang' => 'DIR_LENGTH_COMMENTS', 'validate' => 'int:2', 'type' => 'text:3:3', 'explain' => true),
300
+						'dir_comments_per_page'				=> array('lang' => 'DIR_COMM_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:3', 'explain' => false),
301 301
 
302 302
 						'legend6'							=> 'DIR_BANN_PARAM',
303
-						'dir_activ_banner'					=> array('lang' => 'DIR_ACTIV_BANNER',		'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => false),
304
-						'dir_banner'						=> array('lang' => 'DIR_MAX_BANN',			'validate' => 'int',	'type' => 'dimension:3:4',	'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
305
-						'dir_banner_filesize'				=> array('lang' => 'DIR_MAX_SIZE',			'validate' => 'int:0',	'type' => 'text:5:10',		'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
306
-						'dir_storage_banner'				=> array('lang' => 'DIR_STORAGE_BANNER',	'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
303
+						'dir_activ_banner'					=> array('lang' => 'DIR_ACTIV_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
304
+						'dir_banner'						=> array('lang' => 'DIR_MAX_BANN', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' '.$user->lang['PIXEL']),
305
+						'dir_banner_filesize'				=> array('lang' => 'DIR_MAX_SIZE', 'validate' => 'int:0', 'type' => 'text:5:10', 'explain' => true, 'append' => ' '.$user->lang['BYTES']),
306
+						'dir_storage_banner'				=> array('lang' => 'DIR_STORAGE_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
307 307
 					)
308 308
 				);
309 309
 
@@ -311,11 +311,11 @@  discard block
 block discarded – undo
311 311
 				if (!empty($phpbb_seo))
312 312
 				{
313 313
 					// Rewrite enable, and patch installed
314
-					if($phpbb_seo->cache_config['settings']['url_rewrite'] && method_exists($phpbb_seo,'directory'))
314
+					if ($phpbb_seo->cache_config['settings']['url_rewrite'] && method_exists($phpbb_seo, 'directory'))
315 315
 					{
316 316
 						$display_vars['vars'] += array(
317 317
 							'legend7'					=> 'DIR_REWRITE_PARAM',
318
-							'dir_activ_rewrite'			=> array('lang' => 'DIR_ACTIV_REWRITE',	'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
318
+							'dir_activ_rewrite'			=> array('lang' => 'DIR_ACTIV_REWRITE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
319 319
 							//'dir_urlR'						=> array('lang' => 'DIR_RELATIVE_PATH',	'validate' => 'string',	'type' => 'text:10:99',		'explain' => true, 'append' => '/'),
320 320
 						);
321 321
 					}
@@ -362,9 +362,9 @@  discard block
 block discarded – undo
362 362
 
363 363
 				if ($submit)
364 364
 				{
365
-					add_log('admin', 'DIR_CONFIG_' . strtoupper($mode));
365
+					add_log('admin', 'DIR_CONFIG_'.strtoupper($mode));
366 366
 
367
-					trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
367
+					trigger_error($user->lang['CONFIG_UPDATED'].adm_back_link($this->u_action));
368 368
 				}
369 369
 
370 370
 				$this->tpl_name = 'acp_board';
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 
373 373
 				$template->assign_vars(array(
374 374
 					'L_TITLE'			=> $user->lang[$display_vars['title']],
375
-					'L_TITLE_EXPLAIN'	=> $user->lang[$display_vars['title'] . '_EXPLAIN'],
375
+					'L_TITLE_EXPLAIN'	=> $user->lang[$display_vars['title'].'_EXPLAIN'],
376 376
 
377 377
 					'S_ERROR'			=> (sizeof($error)) ? true : false,
378 378
 					'ERROR_MSG'			=> implode('<br />', $error),
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 					}
408 408
 					else if ($vars['explain'])
409 409
 					{
410
-						$l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
410
+						$l_explain = (isset($user->lang[$vars['lang'].'_EXPLAIN'])) ? $user->lang[$vars['lang'].'_EXPLAIN'] : '';
411 411
 					}
412 412
 
413 413
 					$template->assign_block_vars('options', array(
@@ -431,10 +431,10 @@  discard block
 block discarded – undo
431 431
 					switch ($action)
432 432
 					{
433 433
 						case 'delete':
434
-							$action_subcats		= request_var('action_subcats', '');
435
-							$subcats_to_id		= request_var('subcats_to_id', 0);
436
-							$action_links		= request_var('action_links', '');
437
-							$links_to_id		= request_var('links_to_id', 0);
434
+							$action_subcats = request_var('action_subcats', '');
435
+							$subcats_to_id = request_var('subcats_to_id', 0);
436
+							$action_links = request_var('action_links', '');
437
+							$links_to_id = request_var('links_to_id', 0);
438 438
 
439 439
 							$errors = $this->delete_cat($cat_id, $action_links, $action_subcats, $links_to_id, $subcats_to_id);
440 440
 
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 
446 446
 							$cache->destroy('sql', DIR_CAT_TABLE);
447 447
 
448
-							trigger_error($user->lang['DIR_CAT_DELETED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
448
+							trigger_error($user->lang['DIR_CAT_DELETED'].adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id));
449 449
 
450 450
 						break;
451 451
 
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 						case 'add':
458 458
 
459 459
 							$cat_data += array(
460
-								'parent_id'				=> request_var('cat_parent_id', (int)$this->parent_id),
460
+								'parent_id'				=> request_var('cat_parent_id', (int) $this->parent_id),
461 461
 								'cat_parents'			=> '',
462 462
 								'cat_name'				=> utf8_normalize_nfc(request_var('cat_name', '', true)),
463 463
 								'cat_desc'				=> utf8_normalize_nfc(request_var('cat_desc', '', true)),
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 
493 493
 								$message = ($action == 'add') ? $user->lang['DIR_CAT_CREATED'] : $user->lang['DIR_CAT_UPDATED'];
494 494
 
495
-								trigger_error($message . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
495
+								trigger_error($message.adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id));
496 496
 							}
497 497
 						break;
498 498
 					}
@@ -513,28 +513,28 @@  discard block
 block discarded – undo
513 513
 
514 514
 						if (!$cat_id)
515 515
 						{
516
-							trigger_error($user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
516
+							trigger_error($user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
517 517
 						}
518 518
 
519 519
 						@set_time_limit(0);
520 520
 
521 521
 						$sql = 'SELECT cat_name, cat_links
522
-							FROM ' . DIR_CAT_TABLE . '
523
-							WHERE cat_id = ' . (int)$cat_id;
522
+							FROM ' . DIR_CAT_TABLE.'
523
+							WHERE cat_id = ' . (int) $cat_id;
524 524
 						$result = $db->sql_query($sql);
525 525
 						$row = $db->sql_fetchrow($result);
526 526
 						$db->sql_freeresult($result);
527 527
 
528 528
 						if (!$row)
529 529
 						{
530
-							trigger_error($user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
530
+							trigger_error($user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
531 531
 						}
532 532
 
533 533
 						if ($row['cat_links'])
534 534
 						{
535 535
 							$sql = 'SELECT MIN(link_id) as min_link_id, MAX(link_id) as max_link_id
536
-								FROM ' . DIR_LINK_TABLE . '
537
-								WHERE link_cat = ' . (int)$cat_id . '
536
+								FROM ' . DIR_LINK_TABLE.'
537
+								WHERE link_cat = ' . (int) $cat_id.'
538 538
 									AND link_active = 1';
539 539
 							$result = $db->sql_query($sql);
540 540
 							$row2 = $db->sql_fetchrow($result);
@@ -556,23 +556,23 @@  discard block
 block discarded – undo
556 556
 							{
557 557
 								// We really need to find a way of showing statistics... no progress here
558 558
 								$sql = 'SELECT COUNT(link_id) as num_links
559
-									FROM ' . DIR_LINK_TABLE . '
560
-									WHERE link_cat = ' . (int)$cat_id . '
559
+									FROM ' . DIR_LINK_TABLE.'
560
+									WHERE link_cat = ' . (int) $cat_id.'
561 561
 										AND link_active = 1
562
-										AND link_id BETWEEN ' . $start . ' AND ' . $end;
562
+										AND link_id BETWEEN ' . $start.' AND '.$end;
563 563
 								$result = $db->sql_query($sql);
564 564
 								$links_done = request_var('links_done', 0) + (int) $db->sql_fetchfield('num_links');
565 565
 								$db->sql_freeresult($result);
566 566
 
567 567
 								$start += $batch_size;
568 568
 
569
-								$url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;c=$cat_id&amp;action=sync&amp;start=$start&amp;links_done=$links_done&amp;total={$row['cat_links']}";
569
+								$url = $this->u_action."&amp;parent_id={$this->parent_id}&amp;c=$cat_id&amp;action=sync&amp;start=$start&amp;links_done=$links_done&amp;total={$row['cat_links']}";
570 570
 
571 571
 								meta_refresh(0, $url);
572 572
 
573 573
 								$template->assign_vars(array(
574
-									'U_PROGRESS_BAR'		=> $this->u_action . "&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}",
575
-									'UA_PROGRESS_BAR'		=> addslashes($this->u_action . "&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}"),
574
+									'U_PROGRESS_BAR'		=> $this->u_action."&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}",
575
+									'UA_PROGRESS_BAR'		=> addslashes($this->u_action."&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}"),
576 576
 									'S_CONTINUE_SYNC'		=> true,
577 577
 									'L_PROGRESS_EXPLAIN'	=> sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], $links_done, $row['cat_links']))
578 578
 								);
@@ -581,12 +581,12 @@  discard block
 block discarded – undo
581 581
 							}
582 582
 						}
583 583
 
584
-						$url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;c=$cat_id&amp;action=sync_cat";
584
+						$url = $this->u_action."&amp;parent_id={$this->parent_id}&amp;c=$cat_id&amp;action=sync_cat";
585 585
 						meta_refresh(0, $url);
586 586
 
587 587
 						$template->assign_vars(array(
588
-							'U_PROGRESS_BAR'		=> $this->u_action . '&amp;action=progress_bar',
589
-							'UA_PROGRESS_BAR'		=> addslashes($this->u_action . '&amp;action=progress_bar'),
588
+							'U_PROGRESS_BAR'		=> $this->u_action.'&amp;action=progress_bar',
589
+							'UA_PROGRESS_BAR'		=> addslashes($this->u_action.'&amp;action=progress_bar'),
590 590
 							'S_CONTINUE_SYNC'		=> true,
591 591
 							'L_PROGRESS_EXPLAIN'	=> sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], 0, $row['cat_links']))
592 592
 						);
@@ -597,15 +597,15 @@  discard block
 block discarded – undo
597 597
 					case 'sync_cat':
598 598
 
599 599
 						$sql = 'SELECT cat_name
600
-							FROM ' . DIR_CAT_TABLE . '
601
-							WHERE cat_id = ' . (int)$cat_id;
600
+							FROM ' . DIR_CAT_TABLE.'
601
+							WHERE cat_id = ' . (int) $cat_id;
602 602
 						$result = $db->sql_query($sql);
603 603
 						$row = $db->sql_fetchrow($result);
604 604
 						$db->sql_freeresult($result);
605 605
 
606 606
 						if (!$row)
607 607
 						{
608
-							trigger_error($user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
608
+							trigger_error($user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
609 609
 						}
610 610
 
611 611
 						sync_dir_cat($cat_id);
@@ -622,26 +622,26 @@  discard block
 block discarded – undo
622 622
 
623 623
 						if (!$cat_id)
624 624
 						{
625
-							trigger_error($user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
625
+							trigger_error($user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
626 626
 						}
627 627
 
628 628
 						$sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id
629
-							FROM ' . DIR_CAT_TABLE . '
630
-							WHERE cat_id = ' . (int)$cat_id;
629
+							FROM ' . DIR_CAT_TABLE.'
630
+							WHERE cat_id = ' . (int) $cat_id;
631 631
 						$result = $db->sql_query($sql);
632 632
 						$row = $db->sql_fetchrow($result);
633 633
 						$db->sql_freeresult($result);
634 634
 
635 635
 						if (!$row)
636 636
 						{
637
-							trigger_error($user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
637
+							trigger_error($user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
638 638
 						}
639 639
 
640 640
 						$move_cat_name = $this->move_cat_by($row, $action, 1);
641 641
 
642 642
 						if ($move_cat_name !== false)
643 643
 						{
644
-							add_log('admin', 'LOG_DIR_CAT_' . strtoupper($action), $row['cat_name'], $move_cat_name);
644
+							add_log('admin', 'LOG_DIR_CAT_'.strtoupper($action), $row['cat_name'], $move_cat_name);
645 645
 							$cache->destroy('sql', DIR_CAT_TABLE);
646 646
 						}
647 647
 
@@ -731,8 +731,8 @@  discard block
 block discarded – undo
731 731
 						}
732 732
 
733 733
 						$sql = 'SELECT cat_id
734
-							FROM ' . DIR_CAT_TABLE . '
735
-							WHERE cat_id <> ' . (int)$cat_id;
734
+							FROM ' . DIR_CAT_TABLE.'
735
+							WHERE cat_id <> ' . (int) $cat_id;
736 736
 						$result = $db->sql_query_limit($sql, 1);
737 737
 
738 738
 						if ($db->sql_fetchrow($result))
@@ -749,14 +749,14 @@  discard block
 block discarded – undo
749 749
 							'S_CAT_PARENT_ID'	=> $cat_data['parent_id'],
750 750
 							'S_ADD_ACTION'		=> ($action == 'add') ? true : false,
751 751
 
752
-							'U_BACK'			=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
753
-							'U_EDIT_ACTION'		=> $this->u_action . "&amp;parent_id={$this->parent_id}&amp;action=$action&amp;c=$cat_id",
752
+							'U_BACK'			=> $this->u_action.'&amp;parent_id='.$this->parent_id,
753
+							'U_EDIT_ACTION'		=> $this->u_action."&amp;parent_id={$this->parent_id}&amp;action=$action&amp;c=$cat_id",
754 754
 
755 755
 							'L_TITLE'					=> $user->lang[$this->page_title],
756 756
 							'ERROR_MSG'					=> (sizeof($errors)) ? implode('<br />', $errors) : '',
757
-							'ICON_IMAGE'				=> ($cat_data['cat_icon']) ? $phpbb_root_path . 'images/directory/icons/' . $cat_data['cat_icon'] : $phpbb_admin_path . 'images/spacer.gif',
757
+							'ICON_IMAGE'				=> ($cat_data['cat_icon']) ? $phpbb_root_path.'images/directory/icons/'.$cat_data['cat_icon'] : $phpbb_admin_path.'images/spacer.gif',
758 758
 
759
-							'DIR_ICON_PATH'				=> $phpbb_root_path . 'images/directory/icons',
759
+							'DIR_ICON_PATH'				=> $phpbb_root_path.'images/directory/icons',
760 760
 							'DIR_CAT_NAME'				=> $cat_data['cat_name'],
761 761
 							'DIR_CAT_DESC'				=> $dir_cat_desc_data['text'],
762 762
 
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
 
790 790
 						if (!$cat_id)
791 791
 						{
792
-							trigger_error($user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
792
+							trigger_error($user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
793 793
 						}
794 794
 
795 795
 						$cat_data = $this->get_cat_info($cat_id);
@@ -805,8 +805,8 @@  discard block
 block discarded – undo
805 805
 						$cat_list = make_cat_select($cat_data['parent_id'], $subcats_id);
806 806
 
807 807
 						$sql = 'SELECT cat_id
808
-							FROM ' . DIR_CAT_TABLE . '
809
-							WHERE cat_id <> ' . (int)$cat_id;
808
+							FROM ' . DIR_CAT_TABLE.'
809
+							WHERE cat_id <> ' . (int) $cat_id;
810 810
 						$result = $db->sql_query_limit($sql, 1);
811 811
 
812 812
 						if ($db->sql_fetchrow($result))
@@ -821,8 +821,8 @@  discard block
 block discarded – undo
821 821
 
822 822
 						$template->assign_vars(array(
823 823
 							'S_DELETE_DIR_CAT'		=> true,
824
-							'U_ACTION'				=> $this->u_action . "&amp;parent_id={$parent_id}&amp;action=delete&amp;c=$cat_id",
825
-							'U_BACK'				=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
824
+							'U_ACTION'				=> $this->u_action."&amp;parent_id={$parent_id}&amp;action=delete&amp;c=$cat_id",
825
+							'U_BACK'				=> $this->u_action.'&amp;parent_id='.$this->parent_id,
826 826
 
827 827
 							'DIR_CAT_NAME'			=> $cat_data['cat_name'],
828 828
 							'S_HAS_SUBCATS'		=> ($cat_data['right_id'] - $cat_data['left_id'] > 1) ? true : false,
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
 				}
843 843
 				else
844 844
 				{
845
-					$navigation = '<a href="' . $this->u_action . '">' . $user->lang['DIR_INDEX'] . '</a>';
845
+					$navigation = '<a href="'.$this->u_action.'">'.$user->lang['DIR_INDEX'].'</a>';
846 846
 
847 847
 					$cats_nav = get_dir_cat_branch($this->parent_id, 'parents', 'descending');
848 848
 
@@ -850,11 +850,11 @@  discard block
 block discarded – undo
850 850
 					{
851 851
 						if ($row['cat_id'] == $this->parent_id)
852 852
 						{
853
-							$navigation .= ' -&gt; ' . $row['cat_name'];
853
+							$navigation .= ' -&gt; '.$row['cat_name'];
854 854
 						}
855 855
 						else
856 856
 						{
857
-							$navigation .= ' -&gt; <a href="' . $this->u_action . '&amp;parent_id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a>';
857
+							$navigation .= ' -&gt; <a href="'.$this->u_action.'&amp;parent_id='.$row['cat_id'].'">'.$row['cat_name'].'</a>';
858 858
 						}
859 859
 					}
860 860
 				}
@@ -868,8 +868,8 @@  discard block
 block discarded – undo
868 868
 				}
869 869
 
870 870
 				$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
871
-					FROM ' . DIR_CAT_TABLE . '
872
-					WHERE parent_id = ' . (int)$this->parent_id . '
871
+					FROM ' . DIR_CAT_TABLE.'
872
+					WHERE parent_id = ' . (int) $this->parent_id.'
873 873
 					ORDER BY left_id';
874 874
 				$result = $db->sql_query($sql);
875 875
 
@@ -877,23 +877,23 @@  discard block
 block discarded – undo
877 877
 				{
878 878
 					do
879 879
 					{
880
-						$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="' . $user->lang['DIR_SUBCAT'] . '" />' : '<img src="images/icon_folder.gif" alt="' . $user->lang['FOLDER'] . '" />';
880
+						$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="'.$user->lang['DIR_SUBCAT'].'" />' : '<img src="images/icon_folder.gif" alt="'.$user->lang['FOLDER'].'" />';
881 881
 
882
-						$url = $this->u_action . "&amp;parent_id=$this->parent_id&amp;c={$row['cat_id']}";
882
+						$url = $this->u_action."&amp;parent_id=$this->parent_id&amp;c={$row['cat_id']}";
883 883
 
884 884
 						$template->assign_block_vars('cats', array(
885 885
 							'FOLDER_IMAGE'		=> $folder_image,
886
-							'CAT_IMAGE'			=> ($row['cat_icon']) ? '<img src="' . $phpbb_root_path . 'images/directory/icons/' . $row['cat_icon'] . '" alt="" />' : '',
886
+							'CAT_IMAGE'			=> ($row['cat_icon']) ? '<img src="'.$phpbb_root_path.'images/directory/icons/'.$row['cat_icon'].'" alt="" />' : '',
887 887
 							'CAT_NAME'			=> $row['cat_name'],
888 888
 							'CAT_DESCRIPTION'	=> generate_text_for_display($row['cat_desc'], $row['cat_desc_uid'], $row['cat_desc_bitfield'], $row['cat_desc_options']),
889 889
 							'CAT_LINKS'			=> $row['cat_links'],
890 890
 
891
-							'U_CAT'				=> $this->u_action . '&amp;parent_id=' . $row['cat_id'],
892
-							'U_MOVE_UP'			=> $url . '&amp;action=move_up',
893
-							'U_MOVE_DOWN'		=> $url . '&amp;action=move_down',
894
-							'U_EDIT'			=> $url . '&amp;action=edit',
895
-							'U_DELETE'			=> $url . '&amp;action=delete',
896
-							'U_SYNC'			=> $url . '&amp;action=sync')
891
+							'U_CAT'				=> $this->u_action.'&amp;parent_id='.$row['cat_id'],
892
+							'U_MOVE_UP'			=> $url.'&amp;action=move_up',
893
+							'U_MOVE_DOWN'		=> $url.'&amp;action=move_down',
894
+							'U_EDIT'			=> $url.'&amp;action=edit',
895
+							'U_DELETE'			=> $url.'&amp;action=delete',
896
+							'U_SYNC'			=> $url.'&amp;action=sync')
897 897
 						);
898 898
 					}
899 899
 					while ($row = $db->sql_fetchrow($result));
@@ -902,14 +902,14 @@  discard block
 block discarded – undo
902 902
 				{
903 903
 					$row = $this->get_cat_info($this->parent_id);
904 904
 
905
-					$url = $this->u_action . '&amp;parent_id=' . $this->parent_id . '&amp;c=' . $row['cat_id'];
905
+					$url = $this->u_action.'&amp;parent_id='.$this->parent_id.'&amp;c='.$row['cat_id'];
906 906
 
907 907
 					$template->assign_vars(array(
908 908
 						'S_NO_CATS'			=> true,
909 909
 
910
-						'U_EDIT'			=> $url . '&amp;action=edit',
911
-						'U_DELETE'			=> $url . '&amp;action=delete',
912
-						'U_SYNC'			=> $url . '&amp;action=sync')
910
+						'U_EDIT'			=> $url.'&amp;action=edit',
911
+						'U_DELETE'			=> $url.'&amp;action=delete',
912
+						'U_SYNC'			=> $url.'&amp;action=sync')
913 913
 					);
914 914
 				}
915 915
 				$db->sql_freeresult($result);
@@ -919,10 +919,10 @@  discard block
 block discarded – undo
919 919
 					'NAVIGATION'	=> $navigation,
920 920
 					'CAT_BOX'		=> $cat_box,
921 921
 					'U_SEL_ACTION'	=> $this->u_action,
922
-					'U_ACTION'		=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
922
+					'U_ACTION'		=> $this->u_action.'&amp;parent_id='.$this->parent_id,
923 923
 
924
-					'U_PROGRESS_BAR'	=> $this->u_action . '&amp;action=progress_bar',
925
-					'UA_PROGRESS_BAR'	=> addslashes($this->u_action . '&amp;action=progress_bar'),
924
+					'U_PROGRESS_BAR'	=> $this->u_action.'&amp;action=progress_bar',
925
+					'UA_PROGRESS_BAR'	=> addslashes($this->u_action.'&amp;action=progress_bar'),
926 926
 				));
927 927
 
928 928
 			break;
@@ -931,8 +931,8 @@  discard block
 block discarded – undo
931 931
 				$this->page_title = 'ACP_DIRECTORY';
932 932
 				$this->tpl_name = 'acp_dir_val';
933 933
 
934
-				$mark	= (isset($_POST['link_id'])) ? request_var('link_id', array(0)) : array();
935
-				$start	= request_var('start', 0);
934
+				$mark = (isset($_POST['link_id'])) ? request_var('link_id', array(0)) : array();
935
+				$start = request_var('start', 0);
936 936
 				$submit = isset($_POST['submit']);
937 937
 
938 938
 				$form_key = 'acp_dir_val';
@@ -941,15 +941,15 @@  discard block
 block discarded – undo
941 941
 
942 942
 				if (!class_exists('messenger'))
943 943
 				{
944
-					include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
944
+					include($phpbb_root_path.'includes/functions_messenger.'.$phpEx);
945 945
 				}
946
-				$messenger	= new messenger(false);
946
+				$messenger = new messenger(false);
947 947
 
948 948
 				if ($submit && sizeof($mark))
949 949
 				{
950 950
 					if ($action !== 'delete' && !check_form_key($form_key))
951 951
 					{
952
-						trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
952
+						trigger_error($user->lang['FORM_INVALID'].adm_back_link($this->u_action), E_USER_WARNING);
953 953
 					}
954 954
 
955 955
 					$sql_array = array(
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
 											'ON'	=> 'an.n_user_id = u.user_id'
995 995
 										)
996 996
 									),
997
-									'WHERE'		=> 'an.n_cat_id = ' . (int)$row['link_cat']);
997
+									'WHERE'		=> 'an.n_cat_id = '.(int) $row['link_cat']);
998 998
 								$sql = $db->sql_build_query('SELECT', $sql_array);
999 999
 								$result2 = $db->sql_query($sql);
1000 1000
 
@@ -1010,15 +1010,15 @@  discard block
 block discarded – undo
1010 1010
 								$db->sql_freeresult($result2);
1011 1011
 							}
1012 1012
 
1013
-							if(isset($subscibed_cat[$row['link_cat']]))
1013
+							if (isset($subscibed_cat[$row['link_cat']]))
1014 1014
 							{
1015 1015
 								$messenger->replyto($config['board_email']);
1016 1016
 
1017 1017
 								$cat_data2 = $subscibed_cat[$row['link_cat']];
1018 1018
 
1019
-								$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
1020
-								$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
1021
-								$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
1019
+								$messenger->headers('X-AntiAbuse: Board servername - '.$config['server_name']);
1020
+								$messenger->headers('X-AntiAbuse: User_id - '.$user->data['user_id']);
1021
+								$messenger->headers('X-AntiAbuse: Username - '.$user->data['username']);
1022 1022
 
1023 1023
 								foreach ($cat_data2 as $user_id => $user_data)
1024 1024
 								{
@@ -1039,15 +1039,15 @@  discard block
 block discarded – undo
1039 1039
 
1040 1040
 							}
1041 1041
 
1042
-							$sql = 'UPDATE ' . DIR_LINK_TABLE . ' SET link_active = 1, link_time = '. time() .', link_cat = '.request_var('c'.$row['link_id'], 0).'
1043
-								WHERE link_id = ' . (int)$row['link_id'];
1042
+							$sql = 'UPDATE '.DIR_LINK_TABLE.' SET link_active = 1, link_time = '.time().', link_cat = '.request_var('c'.$row['link_id'], 0).'
1043
+								WHERE link_id = ' . (int) $row['link_id'];
1044 1044
 							$db->sql_query($sql);
1045 1045
 						}
1046
-						elseif($row['link_banner'] && !preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner']))
1046
+						elseif ($row['link_banner'] && !preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner']))
1047 1047
 						{
1048
-							if (file_exists($phpbb_root_path . 'images/directory/banners' .'/'. basename($row['link_banner'])))
1048
+							if (file_exists($phpbb_root_path.'images/directory/banners'.'/'.basename($row['link_banner'])))
1049 1049
 							{
1050
-								@unlink($phpbb_root_path . 'images/directory/banners' .'/'. basename($row['link_banner']));
1050
+								@unlink($phpbb_root_path.'images/directory/banners'.'/'.basename($row['link_banner']));
1051 1051
 							}
1052 1052
 						}
1053 1053
 					}
@@ -1059,8 +1059,8 @@  discard block
 block discarded – undo
1059 1059
 
1060 1060
 							foreach ($cat_data as $cat_id => $count)
1061 1061
 							{
1062
-								$sql = 'UPDATE ' . DIR_CAT_TABLE . ' SET cat_links = cat_links + '.$count.'
1063
-									WHERE cat_id = ' . (int)$cat_id;
1062
+								$sql = 'UPDATE '.DIR_CAT_TABLE.' SET cat_links = cat_links + '.$count.'
1063
+									WHERE cat_id = ' . (int) $cat_id;
1064 1064
 								$db->sql_query($sql);
1065 1065
 							}
1066 1066
 
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
 							{
1075 1075
 								foreach ($mark as $link_id)
1076 1076
 								{
1077
-									$sql = 'DELETE FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int)$link_id;
1077
+									$sql = 'DELETE FROM '.DIR_LINK_TABLE.' WHERE link_id = '.(int) $link_id;
1078 1078
 									$db->sql_query($sql);
1079 1079
 								}
1080 1080
 
@@ -1096,9 +1096,9 @@  discard block
 block discarded – undo
1096 1096
 
1097 1097
 					$messenger->reset();
1098 1098
 
1099
-					$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
1100
-					$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
1101
-					$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
1099
+					$messenger->headers('X-AntiAbuse: Board servername - '.$config['server_name']);
1100
+					$messenger->headers('X-AntiAbuse: User_id - '.$user->data['user_id']);
1101
+					$messenger->headers('X-AntiAbuse: Username - '.$user->data['username']);
1102 1102
 
1103 1103
 					foreach ($link_data as $id => $row)
1104 1104
 					{
@@ -1106,12 +1106,12 @@  discard block
 block discarded – undo
1106 1106
 						$email = ($row['link_user_id'] == ANONYMOUS) ? $row['link_guest_email'] : $row['user_email'];
1107 1107
 
1108 1108
 						$messenger->template('mods/directory/user_validation', $row['user_lang']);
1109
-						$messenger->subject($user->lang['EMAIL_SUBJECT_' . strtoupper($action)]);
1109
+						$messenger->subject($user->lang['EMAIL_SUBJECT_'.strtoupper($action)]);
1110 1110
 						$messenger->to($email, $username);
1111 1111
 
1112 1112
 						$messenger->assign_vars(array(
1113 1113
 							'USERNAME'	=> htmlspecialchars_decode($username),
1114
-							'TEXT'		=> sprintf($user->lang['EMAIL_TEXT_' . strtoupper($action)], $row['link_name'], htmlspecialchars_decode($config['sitename']), generate_board_url())
1114
+							'TEXT'		=> sprintf($user->lang['EMAIL_TEXT_'.strtoupper($action)], $row['link_name'], htmlspecialchars_decode($config['sitename']), generate_board_url())
1115 1115
 						));
1116 1116
 
1117 1117
 						$messenger->send($row['user_notify_type']);
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
 				}
1120 1120
 
1121 1121
 				$sql = 'SELECT COUNT(1) AS total_links
1122
-					FROM ' . DIR_LINK_TABLE . '
1122
+					FROM ' . DIR_LINK_TABLE.'
1123 1123
 					WHERE link_active = 0';
1124 1124
 				$result = $db->sql_query($sql);
1125 1125
 				$total_links = (int) $db->sql_fetchfield('total_links');
@@ -1157,7 +1157,7 @@  discard block
 block discarded – undo
1157 1157
 					{
1158 1158
 						if (!preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner']))
1159 1159
 						{
1160
-							$u_banner = $phpbb_root_path.'images/directory/banners/' . basename($row['link_banner']);
1160
+							$u_banner = $phpbb_root_path.'images/directory/banners/'.basename($row['link_banner']);
1161 1161
 						}
1162 1162
 						else
1163 1163
 						{
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
 							$height /= $coef_max;
1176 1176
 						}
1177 1177
 
1178
-						$s_banner = '<img src="' . $u_banner . '" width="' . $width . '" height="' . $height . '" border="0" alt="" />';
1178
+						$s_banner = '<img src="'.$u_banner.'" width="'.$width.'" height="'.$height.'" border="0" alt="" />';
1179 1179
 					}
1180 1180
 
1181 1181
 					$username = ($row['link_user_id'] == ANONYMOUS) ? $row['link_guest_email'] : $row['username'];
@@ -1196,9 +1196,9 @@  discard block
 block discarded – undo
1196 1196
 				$option_ary = array('activate' => 'DIR_LINK_ACTIVATE', 'delete' => 'DIR_LINK_DELETE');
1197 1197
 
1198 1198
 				$template->assign_vars(array(
1199
-					'PAGINATION'			=> generate_pagination($this->u_action . "&amp;i=$id&amp;action=$action&amp;mode=$mode", $total_links, 10, $start),
1199
+					'PAGINATION'			=> generate_pagination($this->u_action."&amp;i=$id&amp;action=$action&amp;mode=$mode", $total_links, 10, $start),
1200 1200
 					'PAGE_NUMBER'			=> on_page($total_links, 10, $start),
1201
-					'U_ACTION'				=> $this->u_action . '&amp;start=' . $start,
1201
+					'U_ACTION'				=> $this->u_action.'&amp;start='.$start,
1202 1202
 					'S_LINKS_OPTIONS'		=> build_select($option_ary),
1203 1203
 				));
1204 1204
 
@@ -1219,7 +1219,7 @@  discard block
 block discarded – undo
1219 1219
 		{
1220 1220
 			$selected = ($url == $value) ? 'selected="selected"' : '';
1221 1221
 
1222
-			$tpl .= '<option value="' . $url . '" ' . $selected . '>' . $service . '</option>';
1222
+			$tpl .= '<option value="'.$url.'" '.$selected.'>'.$service.'</option>';
1223 1223
 		}
1224 1224
 		$tpl .= '</select>';
1225 1225
 
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
 		{
1248 1248
 			$selected = ($i == $value) ? 'selected="selected"' : '';
1249 1249
 			$order_substr = trim(str_replace(' ', '_', $i));
1250
-			$tpl .= '<option value="' . $i . '" ' . $selected . '>' . $user->lang['DIR_ORDER_' . strtoupper($order_substr)] . '</option>';
1250
+			$tpl .= '<option value="'.$i.'" '.$selected.'>'.$user->lang['DIR_ORDER_'.strtoupper($order_substr)].'</option>';
1251 1251
 		}
1252 1252
 		$tpl .= '</select>';
1253 1253
 
@@ -1259,8 +1259,8 @@  discard block
 block discarded – undo
1259 1259
 		global $db;
1260 1260
 
1261 1261
 		$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
1262
-			FROM ' . DIR_CAT_TABLE . '
1263
-			WHERE cat_id = ' . (int)$dir_cat_id;
1262
+			FROM ' . DIR_CAT_TABLE.'
1263
+			WHERE cat_id = ' . (int) $dir_cat_id;
1264 1264
 		$result = $db->sql_query($sql);
1265 1265
 		$row = $db->sql_fetchrow($result);
1266 1266
 		$db->sql_freeresult($result);
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
 			$cat_data_sql['cat_cron_enable'] = 0;
1311 1311
 		}
1312 1312
 
1313
-		if(!$cat_data_sql['cat_cron_enable'])
1313
+		if (!$cat_data_sql['cat_cron_enable'])
1314 1314
 		{
1315 1315
 			$cat_data_sql['cat_cron_next'] = 0;
1316 1316
 		}
@@ -1326,25 +1326,25 @@  discard block
 block discarded – undo
1326 1326
 			if ($cat_data_sql['parent_id'])
1327 1327
 			{
1328 1328
 				$sql = 'SELECT left_id, right_id
1329
-					FROM ' . DIR_CAT_TABLE . '
1330
-					WHERE cat_id = ' . (int)$cat_data_sql['parent_id'];
1329
+					FROM ' . DIR_CAT_TABLE.'
1330
+					WHERE cat_id = ' . (int) $cat_data_sql['parent_id'];
1331 1331
 				$result = $db->sql_query($sql);
1332 1332
 				$row = $db->sql_fetchrow($result);
1333 1333
 				$db->sql_freeresult($result);
1334 1334
 
1335 1335
 				if (!$row)
1336 1336
 				{
1337
-					trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&amp;' . $this->parent_id), E_USER_WARNING);
1337
+					trigger_error($user->lang['PARENT_NOT_EXIST'].adm_back_link($this->u_action.'&amp;'.$this->parent_id), E_USER_WARNING);
1338 1338
 				}
1339 1339
 
1340
-				$sql = 'UPDATE ' . DIR_CAT_TABLE . '
1340
+				$sql = 'UPDATE '.DIR_CAT_TABLE.'
1341 1341
 					SET left_id = left_id + 2, right_id = right_id + 2
1342
-					WHERE left_id > ' . (int)$row['right_id'];
1342
+					WHERE left_id > ' . (int) $row['right_id'];
1343 1343
 				$db->sql_query($sql);
1344 1344
 
1345
-				$sql = 'UPDATE ' . DIR_CAT_TABLE . '
1345
+				$sql = 'UPDATE '.DIR_CAT_TABLE.'
1346 1346
 					SET right_id = right_id + 2
1347
-					WHERE ' . (int)$row['left_id'] . ' BETWEEN left_id AND right_id';
1347
+					WHERE ' . (int) $row['left_id'].' BETWEEN left_id AND right_id';
1348 1348
 				$db->sql_query($sql);
1349 1349
 
1350 1350
 				$cat_data_sql['left_id'] = $row['right_id'];
@@ -1364,10 +1364,10 @@  discard block
 block discarded – undo
1364 1364
 
1365 1365
 			if ($cat_data_sql['cat_cron_enable'])
1366 1366
 			{
1367
-				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400;
1367
+				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400;
1368 1368
 			}
1369 1369
 
1370
-			$sql = 'INSERT INTO ' . DIR_CAT_TABLE . ' ' . $db->sql_build_array('INSERT', $cat_data_sql);
1370
+			$sql = 'INSERT INTO '.DIR_CAT_TABLE.' '.$db->sql_build_array('INSERT', $cat_data_sql);
1371 1371
 			$db->sql_query($sql);
1372 1372
 
1373 1373
 			$cat_data['cat_id'] = $db->sql_nextid();
@@ -1389,18 +1389,18 @@  discard block
 block discarded – undo
1389 1389
 				return $errors;
1390 1390
 			}
1391 1391
 
1392
-			if($cat_data_sql['cat_cron_enable'])
1392
+			if ($cat_data_sql['cat_cron_enable'])
1393 1393
 			{
1394
-				if($row['cat_cron_freq'] != $cat_data_sql['cat_cron_freq'] || !$row['cat_cron_enable'])
1394
+				if ($row['cat_cron_freq'] != $cat_data_sql['cat_cron_freq'] || !$row['cat_cron_enable'])
1395 1395
 				{
1396
-					$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400;
1396
+					$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400;
1397 1397
 				}
1398 1398
 			}
1399 1399
 
1400 1400
 			if ($row['cat_name'] != $cat_data_sql['cat_name'])
1401 1401
 			{
1402 1402
 				// the cat name has changed, clear the parents list of all categories (for safety)
1403
-				$sql = 'UPDATE ' . DIR_CAT_TABLE . "
1403
+				$sql = 'UPDATE '.DIR_CAT_TABLE."
1404 1404
 					SET cat_parents = ''";
1405 1405
 				$db->sql_query($sql);
1406 1406
 			}
@@ -1409,9 +1409,9 @@  discard block
 block discarded – undo
1409 1409
 			$cat_id = $cat_data_sql['cat_id'];
1410 1410
 			unset($cat_data_sql['cat_id']);
1411 1411
 
1412
-			$sql = 'UPDATE ' . DIR_CAT_TABLE . '
1413
-				SET ' . $db->sql_build_array('UPDATE', $cat_data_sql) . '
1414
-				WHERE cat_id = ' . (int)$cat_id;
1412
+			$sql = 'UPDATE '.DIR_CAT_TABLE.'
1413
+				SET ' . $db->sql_build_array('UPDATE', $cat_data_sql).'
1414
+				WHERE cat_id = ' . (int) $cat_id;
1415 1415
 			$db->sql_query($sql);
1416 1416
 
1417 1417
 			// Add it back
@@ -1440,16 +1440,16 @@  discard block
 block discarded – undo
1440 1440
 		}
1441 1441
 
1442 1442
 		// Resync parents
1443
-		$sql = 'UPDATE ' . DIR_CAT_TABLE . "
1443
+		$sql = 'UPDATE '.DIR_CAT_TABLE."
1444 1444
 			SET right_id = right_id - $diff, cat_parents = ''
1445
-			WHERE left_id < " . (int)$from_data['right_id'] . "
1446
-				AND right_id > " . (int)$from_data['right_id'];
1445
+			WHERE left_id < ".(int) $from_data['right_id']."
1446
+				AND right_id > " . (int) $from_data['right_id'];
1447 1447
 		$db->sql_query($sql);
1448 1448
 
1449 1449
 		// Resync righthand side of tree
1450
-		$sql = 'UPDATE ' . DIR_CAT_TABLE . "
1450
+		$sql = 'UPDATE '.DIR_CAT_TABLE."
1451 1451
 			SET left_id = left_id - $diff, right_id = right_id - $diff, cat_parents = ''
1452
-			WHERE left_id > " . (int)$from_data['right_id'];
1452
+			WHERE left_id > ".(int) $from_data['right_id'];
1453 1453
 		$db->sql_query($sql);
1454 1454
 
1455 1455
 		if ($to_id > 0)
@@ -1458,16 +1458,16 @@  discard block
 block discarded – undo
1458 1458
 			$to_data = $this->get_cat_info($to_id);
1459 1459
 
1460 1460
 			// Resync new parents
1461
-			$sql = 'UPDATE ' . DIR_CAT_TABLE . "
1461
+			$sql = 'UPDATE '.DIR_CAT_TABLE."
1462 1462
 				SET right_id = right_id + $diff, cat_parents = ''
1463
-				WHERE " . (int)$to_data['right_id'] . ' BETWEEN left_id AND right_id
1463
+				WHERE ".(int) $to_data['right_id'].' BETWEEN left_id AND right_id
1464 1464
 					AND ' . $db->sql_in_set('cat_id', $moved_ids, true);
1465 1465
 			$db->sql_query($sql);
1466 1466
 
1467 1467
 			// Resync the righthand side of the tree
1468
-			$sql = 'UPDATE ' . DIR_CAT_TABLE . "
1468
+			$sql = 'UPDATE '.DIR_CAT_TABLE."
1469 1469
 				SET left_id = left_id + $diff, right_id = right_id + $diff, cat_parents = ''
1470
-				WHERE left_id > " . (int)$to_data['right_id'] . '
1470
+				WHERE left_id > ".(int) $to_data['right_id'].'
1471 1471
 					AND ' . $db->sql_in_set('cat_id', $moved_ids, true);
1472 1472
 			$db->sql_query($sql);
1473 1473
 
@@ -1476,28 +1476,28 @@  discard block
 block discarded – undo
1476 1476
 
1477 1477
 			if ($to_data['right_id'] > $from_data['right_id'])
1478 1478
 			{
1479
-				$diff = '+ ' . ($to_data['right_id'] - $from_data['right_id'] - 1);
1479
+				$diff = '+ '.($to_data['right_id'] - $from_data['right_id'] - 1);
1480 1480
 			}
1481 1481
 			else
1482 1482
 			{
1483
-				$diff = '- ' . abs($to_data['right_id'] - $from_data['right_id'] - 1);
1483
+				$diff = '- '.abs($to_data['right_id'] - $from_data['right_id'] - 1);
1484 1484
 			}
1485 1485
 		}
1486 1486
 		else
1487 1487
 		{
1488 1488
 			$sql = 'SELECT MAX(right_id) AS right_id
1489
-				FROM ' . DIR_CAT_TABLE . '
1489
+				FROM ' . DIR_CAT_TABLE.'
1490 1490
 				WHERE ' . $db->sql_in_set('cat_id', $moved_ids, true);
1491 1491
 			$result = $db->sql_query($sql);
1492 1492
 			$row = $db->sql_fetchrow($result);
1493 1493
 			$db->sql_freeresult($result);
1494 1494
 
1495
-			$diff = '+ ' . ($row['right_id'] - $from_data['left_id'] + 1);
1495
+			$diff = '+ '.($row['right_id'] - $from_data['left_id'] + 1);
1496 1496
 		}
1497 1497
 
1498
-		$sql = 'UPDATE ' . DIR_CAT_TABLE . "
1498
+		$sql = 'UPDATE '.DIR_CAT_TABLE."
1499 1499
 			SET left_id = left_id $diff, right_id = right_id $diff, cat_parents = ''
1500
-			WHERE " . $db->sql_in_set('cat_id', $moved_ids);
1500
+			WHERE ".$db->sql_in_set('cat_id', $moved_ids);
1501 1501
 		$db->sql_query($sql);
1502 1502
 
1503 1503
 		return $errors;
@@ -1532,9 +1532,9 @@  discard block
 block discarded – undo
1532 1532
 		* module will move as far as possible
1533 1533
 		*/
1534 1534
 		$sql = 'SELECT cat_id, cat_name, left_id, right_id
1535
-			FROM ' . DIR_CAT_TABLE . '
1536
-			WHERE parent_id = ' . (int)$dir_cat_row['parent_id'] . '
1537
-				AND ' . (($action == 'move_up') ? 'right_id < ' . (int)$dir_cat_row['right_id'] . ' ORDER BY right_id DESC' : 'left_id > ' . (int)$dir_cat_row['left_id'] . ' ORDER BY left_id ASC');
1535
+			FROM ' . DIR_CAT_TABLE.'
1536
+			WHERE parent_id = ' . (int) $dir_cat_row['parent_id'].'
1537
+				AND ' . (($action == 'move_up') ? 'right_id < '.(int) $dir_cat_row['right_id'].' ORDER BY right_id DESC' : 'left_id > '.(int) $dir_cat_row['left_id'].' ORDER BY left_id ASC');
1538 1538
 		$result = $db->sql_query_limit($sql, $steps);
1539 1539
 
1540 1540
 		$target = array();
@@ -1581,7 +1581,7 @@  discard block
 block discarded – undo
1581 1581
 		}
1582 1582
 
1583 1583
 		// Now do the dirty job
1584
-		$sql = 'UPDATE ' . DIR_CAT_TABLE . "
1584
+		$sql = 'UPDATE '.DIR_CAT_TABLE."
1585 1585
 			SET left_id = left_id + CASE
1586 1586
 				WHEN left_id BETWEEN {$move_up_left} AND {$move_up_right} THEN -{$diff_up}
1587 1587
 				ELSE {$diff_down}
@@ -1625,8 +1625,8 @@  discard block
 block discarded – undo
1625 1625
 				$log_action_posts = 'MOVE_LINKS';
1626 1626
 
1627 1627
 				$sql = 'SELECT cat_name
1628
-					FROM ' . DIR_CAT_TABLE . '
1629
-					WHERE cat_id = ' . (int)$links_to_id;
1628
+					FROM ' . DIR_CAT_TABLE.'
1629
+					WHERE cat_id = ' . (int) $links_to_id;
1630 1630
 				$result = $db->sql_query($sql);
1631 1631
 				$row = $db->sql_fetchrow($result);
1632 1632
 				$db->sql_freeresult($result);
@@ -1666,7 +1666,7 @@  discard block
 block discarded – undo
1666 1666
 
1667 1667
 			$diff = sizeof($cat_ids) * 2;
1668 1668
 
1669
-			$sql = 'DELETE FROM ' . DIR_CAT_TABLE . '
1669
+			$sql = 'DELETE FROM '.DIR_CAT_TABLE.'
1670 1670
 				WHERE ' . $db->sql_in_set('cat_id', $cat_ids);
1671 1671
 			$db->sql_query($sql);
1672 1672
 
@@ -1682,8 +1682,8 @@  discard block
 block discarded – undo
1682 1682
 				$log_action_cats = 'MOVE_CATS';
1683 1683
 
1684 1684
 				$sql = 'SELECT cat_name
1685
-					FROM ' . DIR_CAT_TABLE . '
1686
-					WHERE cat_id = ' . (int)$subcats_to_id;
1685
+					FROM ' . DIR_CAT_TABLE.'
1686
+					WHERE cat_id = ' . (int) $subcats_to_id;
1687 1687
 				$result = $db->sql_query($sql);
1688 1688
 				$row = $db->sql_fetchrow($result);
1689 1689
 				$db->sql_freeresult($result);
@@ -1697,8 +1697,8 @@  discard block
 block discarded – undo
1697 1697
 					$subcats_to_name = $row['cat_name'];
1698 1698
 
1699 1699
 					$sql = 'SELECT cat_id
1700
-						FROM ' . DIR_CAT_TABLE . '
1701
-						WHERE parent_id = ' . (int)$cat_id;
1700
+						FROM ' . DIR_CAT_TABLE.'
1701
+						WHERE parent_id = ' . (int) $cat_id;
1702 1702
 					$result = $db->sql_query($sql);
1703 1703
 
1704 1704
 					while ($row = $db->sql_fetchrow($result))
@@ -1710,14 +1710,14 @@  discard block
 block discarded – undo
1710 1710
 					// Grab new cat data for correct tree updating later
1711 1711
 					$cat_data = $this->get_cat_info($cat_id);
1712 1712
 
1713
-					$sql = 'UPDATE ' . DIR_CAT_TABLE . '
1714
-						SET parent_id = ' . (int)$subcats_to_id . '
1715
-							WHERE parent_id = ' . (int)$cat_id;
1713
+					$sql = 'UPDATE '.DIR_CAT_TABLE.'
1714
+						SET parent_id = ' . (int) $subcats_to_id.'
1715
+							WHERE parent_id = ' . (int) $cat_id;
1716 1716
 					$db->sql_query($sql);
1717 1717
 
1718 1718
 					$diff = 2;
1719
-					$sql = 'DELETE FROM ' . DIR_CAT_TABLE . '
1720
-						WHERE cat_id = ' . (int)$cat_id;
1719
+					$sql = 'DELETE FROM '.DIR_CAT_TABLE.'
1720
+						WHERE cat_id = ' . (int) $cat_id;
1721 1721
 					$db->sql_query($sql);
1722 1722
 				}
1723 1723
 			}
@@ -1730,18 +1730,18 @@  discard block
 block discarded – undo
1730 1730
 		else
1731 1731
 		{
1732 1732
 			$diff = 2;
1733
-			$sql = 'DELETE FROM ' . DIR_CAT_TABLE . '
1734
-				WHERE cat_id = ' . (int)$cat_id;
1733
+			$sql = 'DELETE FROM '.DIR_CAT_TABLE.'
1734
+				WHERE cat_id = ' . (int) $cat_id;
1735 1735
 			$db->sql_query($sql);
1736 1736
 		}
1737 1737
 
1738 1738
 		// Resync tree
1739
-		$sql = 'UPDATE ' . DIR_CAT_TABLE . "
1739
+		$sql = 'UPDATE '.DIR_CAT_TABLE."
1740 1740
 			SET right_id = right_id - $diff
1741 1741
 			WHERE left_id < {$cat_data['right_id']} AND right_id > {$cat_data['right_id']}";
1742 1742
 		$db->sql_query($sql);
1743 1743
 
1744
-		$sql = 'UPDATE ' . DIR_CAT_TABLE . "
1744
+		$sql = 'UPDATE '.DIR_CAT_TABLE."
1745 1745
 			SET left_id = left_id - $diff, right_id = right_id - $diff
1746 1746
 			WHERE left_id > {$cat_data['right_id']}";
1747 1747
 		$db->sql_query($sql);
@@ -1794,13 +1794,13 @@  discard block
 block discarded – undo
1794 1794
 	{
1795 1795
 		global $db;
1796 1796
 
1797
-		$sql = 'UPDATE ' . DIR_LINK_TABLE . '
1798
-			SET link_cat = ' . (int)$to_id . '
1799
-			WHERE link_cat = ' . (int)$from_id;
1797
+		$sql = 'UPDATE '.DIR_LINK_TABLE.'
1798
+			SET link_cat = ' . (int) $to_id.'
1799
+			WHERE link_cat = ' . (int) $from_id;
1800 1800
 		$db->sql_query($sql);
1801 1801
 
1802
-		$sql = 'DELETE FROM ' . DIR_NOTIFICATION_TABLE . '
1803
-			WHERE n_cat_id = ' . (int)$from_id;
1802
+		$sql = 'DELETE FROM '.DIR_NOTIFICATION_TABLE.'
1803
+			WHERE n_cat_id = ' . (int) $from_id;
1804 1804
 		$db->sql_query($sql);
1805 1805
 
1806 1806
 		sync_dir_cat($to_id);
@@ -1816,8 +1816,8 @@  discard block
 block discarded – undo
1816 1816
 
1817 1817
 		// Before we remove anything we make sure we are able to adjust the post counts later. ;)
1818 1818
 		$sql = 'SELECT link_id, link_banner
1819
-			FROM ' . DIR_LINK_TABLE . '
1820
-			WHERE link_cat = ' . (int)$cat_id;
1819
+			FROM ' . DIR_LINK_TABLE.'
1820
+			WHERE link_cat = ' . (int) $cat_id;
1821 1821
 		$result = $db->sql_query($sql);
1822 1822
 
1823 1823
 		$link_ids = array();
@@ -1825,11 +1825,11 @@  discard block
 block discarded – undo
1825 1825
 		{
1826 1826
 			$link_ids[] = $row['link_id'];
1827 1827
 
1828
-			if($row['link_banner'] && !preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner']))
1828
+			if ($row['link_banner'] && !preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner']))
1829 1829
 			{
1830
-				if (file_exists($phpbb_root_path . 'images/directory/banners' .'/'. basename($row['link_banner'])))
1830
+				if (file_exists($phpbb_root_path.'images/directory/banners'.'/'.basename($row['link_banner'])))
1831 1831
 				{
1832
-					@unlink($phpbb_root_path . 'images/directory/banners' .'/'. basename($row['link_banner']));
1832
+					@unlink($phpbb_root_path.'images/directory/banners'.'/'.basename($row['link_banner']));
1833 1833
 				}
1834 1834
 			}
1835 1835
 		}
@@ -1845,7 +1845,7 @@  discard block
 block discarded – undo
1845 1845
 
1846 1846
 			foreach ($link_datas_ary as $table => $field)
1847 1847
 			{
1848
-				$db->sql_query("DELETE FROM $table WHERE " . $db->sql_in_set($field, $link_ids));
1848
+				$db->sql_query("DELETE FROM $table WHERE ".$db->sql_in_set($field, $link_ids));
1849 1849
 			}
1850 1850
 		}
1851 1851
 
@@ -1857,7 +1857,7 @@  discard block
 block discarded – undo
1857 1857
 
1858 1858
 		foreach ($cat_datas_ary as $table => $field)
1859 1859
 		{
1860
-			$db->sql_query("DELETE FROM $table WHERE $field = " . (int)$cat_id);
1860
+			$db->sql_query("DELETE FROM $table WHERE $field = ".(int) $cat_id);
1861 1861
 		}
1862 1862
 
1863 1863
 		$db->sql_transaction('commit');
@@ -1888,9 +1888,9 @@  discard block
 block discarded – undo
1888 1888
 	$rows = array();
1889 1889
 
1890 1890
 	$sql = 'SELECT f2.cat_id, f2.cat_name, f2.left_id, f2.right_id
1891
-		FROM ' . DIR_CAT_TABLE . ' f1
1892
-		LEFT JOIN ' . DIR_CAT_TABLE . " f2 ON ($condition)
1893
-		WHERE f1.cat_id = " . (int)$dir_cat_id . "
1891
+		FROM ' . DIR_CAT_TABLE.' f1
1892
+		LEFT JOIN ' . DIR_CAT_TABLE." f2 ON ($condition)
1893
+		WHERE f1.cat_id = ".(int) $dir_cat_id."
1894 1894
 		ORDER BY f2.left_id " . (($order == 'descending') ? 'ASC' : 'DESC');
1895 1895
 	$result = $db->sql_query($sql);
1896 1896
 
@@ -1914,7 +1914,7 @@  discard block
 block discarded – undo
1914 1914
 
1915 1915
 	// This query is identical to the jumpbox one
1916 1916
 	$sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id
1917
-		FROM ' . DIR_CAT_TABLE . '
1917
+		FROM ' . DIR_CAT_TABLE.'
1918 1918
 		ORDER BY left_id ASC';
1919 1919
 	$result = $db->sql_query($sql);
1920 1920
 
@@ -1944,7 +1944,7 @@  discard block
 block discarded – undo
1944 1944
 		}
1945 1945
 
1946 1946
 		$selected = (($row['cat_id'] == $select_id) ? ' selected="selected"' : '');
1947
-		$cat_list .= '<option value="' . $row['cat_id'] . '"' . (($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected) . '>' . $padding . $row['cat_name'] . '</option>';
1947
+		$cat_list .= '<option value="'.$row['cat_id'].'"'.(($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected).'>'.$padding.$row['cat_name'].'</option>';
1948 1948
 	}
1949 1949
 	$db->sql_freeresult($result);
1950 1950
 	unset($padding_store);
@@ -1957,16 +1957,16 @@  discard block
 block discarded – undo
1957 1957
 	global $db;
1958 1958
 
1959 1959
 	$sql = 'SELECT COUNT(link_id) AS num_links
1960
-		FROM ' . DIR_LINK_TABLE . '
1961
-		WHERE link_cat = ' . (int)$cat_id . '
1960
+		FROM ' . DIR_LINK_TABLE.'
1961
+		WHERE link_cat = ' . (int) $cat_id.'
1962 1962
 		AND link_active = 1';
1963 1963
 	$result = $db->sql_query($sql);
1964 1964
 	$total_links = (int) $db->sql_fetchfield('num_links');
1965 1965
 	$db->sql_freeresult($result);
1966 1966
 
1967
-	$sql = 'UPDATE ' . DIR_CAT_TABLE . '
1968
-		SET cat_links = ' . $total_links . '
1969
-		WHERE cat_id = ' . (int)$cat_id;
1967
+	$sql = 'UPDATE '.DIR_CAT_TABLE.'
1968
+		SET cat_links = ' . $total_links.'
1969
+		WHERE cat_id = ' . (int) $cat_id;
1970 1970
 	$db->sql_query($sql);
1971 1971
 
1972 1972
 	return;
@@ -1976,36 +1976,36 @@  discard block
 block discarded – undo
1976 1976
 {
1977 1977
 	global $db;
1978 1978
 
1979
-	$sql = 'UPDATE ' . DIR_LINK_TABLE . '
1979
+	$sql = 'UPDATE '.DIR_LINK_TABLE.'
1980 1980
 		SET	link_comment = 0,
1981 1981
 			link_note = 0,
1982 1982
 			link_vote = 0
1983
-		WHERE link_id BETWEEN ' . (int)$start . ' AND ' . (int)$stop;
1983
+		WHERE link_id BETWEEN ' . (int) $start.' AND '.(int) $stop;
1984 1984
 	$db->sql_query($sql);
1985 1985
 
1986
-	$sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM ' . DIR_VOTE_TABLE . '
1987
-		WHERE vote_link_id BETWEEN ' . (int)$start . ' AND ' . (int)$stop . '
1986
+	$sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM '.DIR_VOTE_TABLE.'
1987
+		WHERE vote_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.'
1988 1988
 		GROUP BY vote_link_id';
1989 1989
 	$result = $db->sql_query($sql);
1990 1990
 	while ($tmp = $db->sql_fetchrow($result))
1991 1991
 	{
1992
-		$sql = 'UPDATE ' . DIR_LINK_TABLE . ' SET
1993
-			link_note = ' . (int)$tmp['total'] . ',
1994
-			link_vote = ' . (int)$tmp['nb_vote'] . '
1995
-			WHERE link_id = ' . (int)$tmp['vote_link_id'];
1992
+		$sql = 'UPDATE '.DIR_LINK_TABLE.' SET
1993
+			link_note = ' . (int) $tmp['total'].',
1994
+			link_vote = ' . (int) $tmp['nb_vote'].'
1995
+			WHERE link_id = ' . (int) $tmp['vote_link_id'];
1996 1996
 		$db->sql_query($sql);
1997 1997
 	}
1998 1998
 	$db->sql_freeresult($result);
1999 1999
 
2000
-	$sql = 'SELECT 	comment_link_id, COUNT(comment_id) AS nb_comment FROM ' . DIR_COMMENT_TABLE . '
2001
-		WHERE comment_link_id BETWEEN ' . (int)$start . ' AND ' . (int)$stop . '
2000
+	$sql = 'SELECT 	comment_link_id, COUNT(comment_id) AS nb_comment FROM '.DIR_COMMENT_TABLE.'
2001
+		WHERE comment_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.'
2002 2002
 		GROUP BY comment_link_id';
2003 2003
 	$result = $db->sql_query($sql);
2004 2004
 	while ($tmp = $db->sql_fetchrow($result))
2005 2005
 	{
2006
-		$sql = 'UPDATE ' . DIR_LINK_TABLE . ' SET
2007
-			link_comment = ' . (int)$tmp['nb_comment'] . '
2008
-			WHERE link_id = ' . (int)$tmp['comment_link_id'];
2006
+		$sql = 'UPDATE '.DIR_LINK_TABLE.' SET
2007
+			link_comment = ' . (int) $tmp['nb_comment'].'
2008
+			WHERE link_id = ' . (int) $tmp['comment_link_id'];
2009 2009
 		$db->sql_query($sql);
2010 2010
 	}
2011 2011
 	$db->sql_freeresult($result);
@@ -2017,7 +2017,7 @@  discard block
 block discarded – undo
2017 2017
 {
2018 2018
 	global $phpbb_root_path;
2019 2019
 
2020
-	$imglist = filelist($phpbb_root_path . 'images/directory/icons', '');
2020
+	$imglist = filelist($phpbb_root_path.'images/directory/icons', '');
2021 2021
 	$edit_img = $filename_list = '';
2022 2022
 	$ranks = $existing_imgs = array();
2023 2023
 
@@ -2027,7 +2027,7 @@  discard block
 block discarded – undo
2027 2027
 
2028 2028
 		foreach ($img_ary as $img)
2029 2029
 		{
2030
-			$img = $path . $img;
2030
+			$img = $path.$img;
2031 2031
 
2032 2032
 			if (!in_array($img, $existing_imgs) || $action == 'edit')
2033 2033
 			{
@@ -2046,11 +2046,11 @@  discard block
 block discarded – undo
2046 2046
 					continue;
2047 2047
 				}
2048 2048
 
2049
-				$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
2049
+				$filename_list .= '<option value="'.htmlspecialchars($img).'"'.$selected.'>'.$img.'</option>';
2050 2050
 			}
2051 2051
 		}
2052 2052
 	}
2053
-	$filename_list = '<option value=""' . (($edit_img == '') ? ' selected="selected"' : '') . '>----------</option>' . $filename_list;
2053
+	$filename_list = '<option value=""'.(($edit_img == '') ? ' selected="selected"' : '').'>----------</option>'.$filename_list;
2054 2054
 	return ($filename_list);
2055 2055
 }
2056 2056
 
@@ -2059,7 +2059,7 @@  discard block
 block discarded – undo
2059 2059
 	global $db, $phpbb_root_path;
2060 2060
 
2061 2061
 	$banner_path = 'images/directory/banners/';
2062
-	$imglist = filelist($phpbb_root_path . $banner_path);
2062
+	$imglist = filelist($phpbb_root_path.$banner_path);
2063 2063
 	$physical_files = $logical_files = $orphan_files = array();
2064 2064
 
2065 2065
 	if (!empty($imglist['']))
@@ -2067,15 +2067,15 @@  discard block
 block discarded – undo
2067 2067
 		$imglist = array_values($imglist);
2068 2068
 		$imglist = $imglist[0];
2069 2069
 
2070
-		foreach($imglist as $key => $img)
2070
+		foreach ($imglist as $key => $img)
2071 2071
 		{
2072 2072
 			$physical_files[] = $img;
2073 2073
 		}
2074
-		$sql = 'SELECT link_banner FROM ' . DIR_LINK_TABLE . '
2074
+		$sql = 'SELECT link_banner FROM '.DIR_LINK_TABLE.'
2075 2075
 		WHERE link_banner <> \'\'';
2076 2076
 		$result = $db->sql_query($sql);
2077 2077
 
2078
-		while($row = $db->sql_fetchrow($result))
2078
+		while ($row = $db->sql_fetchrow($result))
2079 2079
 		{
2080 2080
 			if (!preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner']))
2081 2081
 			{
@@ -2087,7 +2087,7 @@  discard block
 block discarded – undo
2087 2087
 		$orphan_files = array_diff($physical_files, $logical_files);
2088 2088
 	}
2089 2089
 
2090
-	if(!$delete)
2090
+	if (!$delete)
2091 2091
 	{
2092 2092
 		return sizeof($orphan_files);
2093 2093
 	}
@@ -2099,7 +2099,7 @@  discard block
 block discarded – undo
2099 2099
 	{
2100 2100
 		if (in_array($file, $orphan_files))
2101 2101
 		{
2102
-			@unlink($directory .'/'.$file);
2102
+			@unlink($directory.'/'.$file);
2103 2103
 		}
2104 2104
 	}
2105 2105
 }
Please login to merge, or discard this patch.
root/includes/mods/directory/functions.php 5 patches
Doc Comments   +15 added lines, -19 removed lines patch added patch discarded remove patch
@@ -55,7 +55,6 @@  discard block
 block discarded – undo
55 55
 	* Edit a link of the db
56 56
 	*
57 57
 	* @param array $data contains all datas to edit in db
58
-	* @param int $u is link's id, for WHERE clause
59 58
 	*/
60 59
 	function edit($data, $url_id, $need_approval)
61 60
 	{
@@ -95,7 +94,6 @@  discard block
 block discarded – undo
95 94
 	/**
96 95
 	* Del a link of the db
97 96
 	*
98
-	* @param int $u is link's id, for WHERE clause
99 97
 	*/
100 98
 	function del($url_id, $cat_id, $cron = false)
101 99
 	{
@@ -168,7 +166,6 @@  discard block
 block discarded – undo
168 166
 	/**
169 167
 	* Increments link view counter
170 168
 	*
171
-	* @param int $u is link's id, for WHERE clause
172 169
 	*/
173 170
 	function view($url_id)
174 171
 	{
@@ -198,7 +195,7 @@  discard block
 block discarded – undo
198 195
 	*
199 196
 	* @param string $url
200 197
 	*
201
-	* @return true if ok, else false.
198
+	* @return boolean if ok, else false.
202 199
 	*/
203 200
 	function checkurl($url)
204 201
 	{
@@ -242,7 +239,7 @@  discard block
 block discarded – undo
242 239
 	*
243 240
 	* @param string $url to clean
244 241
 	*
245
-	* @return the correct string.
242
+	* @return string correct string.
246 243
 	*/
247 244
 	function clean_url($url)
248 245
 	{
@@ -260,7 +257,7 @@  discard block
 block discarded – undo
260 257
 	 *
261 258
 	 * @param array $data link's data from db
262 259
 	 *
263
-	 * @return flag image.
260
+	 * @return string image.
264 261
 	 */
265 262
 	function display_flag($data)
266 263
 	{
@@ -319,7 +316,7 @@  discard block
 block discarded – undo
319 316
 	*
320 317
 	* @param array $data link's data from db
321 318
 	*
322
-	* @return the html code.
319
+	* @return null|string html code.
323 320
 	*/
324 321
 	function display_vote($data, $votes_status)
325 322
 	{
@@ -392,7 +389,7 @@  discard block
 block discarded – undo
392 389
 	*
393 390
 	* @param array $data link's data from db
394 391
 	*
395
-	* @return pr image, false or 'n/a'.
392
+	* @return string|false image, false or 'n/a'.
396 393
 	*/
397 394
 	function display_pagerank($data)
398 395
 	{
@@ -427,9 +424,7 @@  discard block
 block discarded – undo
427 424
 	* Display and resize a banner
428 425
 	*
429 426
 	* @param array $data link's data from db
430
-	* @param bool $have_banner
431
-	*
432
-	* @return banner image.
427
+	* @return string
433 428
 	*/
434 429
 	function display_bann($data)
435 430
 	{
@@ -465,9 +460,9 @@  discard block
 block discarded – undo
465 460
 	* Display number of comments and link for posting
466 461
 	*
467 462
 	* @param int $u is link_id from db
468
-	* @param int $nb_comments si number of comments for this link
463
+	* @param int $nb_comment si number of comments for this link
469 464
 	*
470
-	* @return html code (counter + link).
465
+	* @return null|string code (counter + link).
471 466
 	*/
472 467
 	function display_comm($u, $nb_comment, $comments_status)
473 468
 	{
@@ -598,7 +593,6 @@  discard block
 block discarded – undo
598 593
 	/**
599 594
 	 * Send a email to user who want be notify of a new publication link
600 595
 	 *
601
-	 * @param array $data link's data from db
602 596
 	 */
603 597
 	function notify_member($site)
604 598
 	{
@@ -661,7 +655,7 @@  discard block
 block discarded – undo
661 655
 	*
662 656
 	* @param string $url is link's url
663 657
 	*
664
-	* @return the thumb url
658
+	* @return string thumb url
665 659
 	*/
666 660
 	function thumb_process($url)
667 661
 	{
@@ -794,7 +788,7 @@  discard block
 block discarded – undo
794 788
 	*
795 789
 	* @param string $banner is banner's remote url
796 790
 	*
797
-	* @return false if error, true for ok
791
+	* @return false|string if error, true for ok
798 792
 	*/
799 793
 	function banner_remote($banner, &$error)
800 794
 	{
@@ -865,7 +859,7 @@  discard block
 block discarded – undo
865 859
 	* @param string $destination path to banner directory
866 860
 	* @param string $file is file's name
867 861
 	*
868
-	* @return true if delete success, else false
862
+	* @return boolean if delete success, else false
869 863
 	*/
870 864
 	function banner_delete($destination, $file)
871 865
 	{
@@ -1423,10 +1417,9 @@  discard block
 block discarded – undo
1423 1417
 /**
1424 1418
  * List flags
1425 1419
  *
1426
- * @param string $dir is flag directory path
1427 1420
  * @param $value selected flag
1428 1421
  *
1429
- * @return html code
1422
+ * @return string code
1430 1423
  */
1431 1424
 function get_dir_flag_list($value)
1432 1425
 {
@@ -1638,6 +1631,9 @@  discard block
 block discarded – undo
1638 1631
 	}
1639 1632
 }
1640 1633
 
1634
+/**
1635
+ * @param boolean $optional
1636
+ */
1641 1637
 function validate_link_back($remote_url, $optional, $cron = false)
1642 1638
 {
1643 1639
 	global $config;
Please login to merge, or discard this patch.
Indentation   +138 added lines, -138 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
 class link
25 25
 {
26 26
 	/**
27
-	* Add a link into db
28
-	*
29
-	* @param array $data contains all datas to insert in db
30
-	*/
27
+	 * Add a link into db
28
+	 *
29
+	 * @param array $data contains all datas to insert in db
30
+	 */
31 31
 	function add($data)
32 32
 	{
33 33
 		global $db, $auth, $config, $categorie;
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
 	}
53 53
 
54 54
 	/**
55
-	* Edit a link of the db
56
-	*
57
-	* @param array $data contains all datas to edit in db
58
-	* @param int $u is link's id, for WHERE clause
59
-	*/
55
+	 * Edit a link of the db
56
+	 *
57
+	 * @param array $data contains all datas to edit in db
58
+	 * @param int $u is link's id, for WHERE clause
59
+	 */
60 60
 	function edit($data, $url_id, $need_approval)
61 61
 	{
62 62
 		global $db, $cache;
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
 	}
94 94
 
95 95
 	/**
96
-	* Del a link of the db
97
-	*
98
-	* @param int $u is link's id, for WHERE clause
99
-	*/
96
+	 * Del a link of the db
97
+	 *
98
+	 * @param int $u is link's id, for WHERE clause
99
+	 */
100 100
 	function del($url_id, $cat_id, $cron = false)
101 101
 	{
102 102
 		global $db, $mode, $phpEx, $phpbb_root_path, $user;
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
 	}
167 167
 
168 168
 	/**
169
-	* Increments link view counter
170
-	*
171
-	* @param int $u is link's id, for WHERE clause
172
-	*/
169
+	 * Increments link view counter
170
+	 *
171
+	 * @param int $u is link's id, for WHERE clause
172
+	 */
173 173
 	function view($url_id)
174 174
 	{
175 175
 		global $db, $user;
@@ -194,12 +194,12 @@  discard block
 block discarded – undo
194 194
 	}
195 195
 
196 196
 	/**
197
-	* Verify that an URL exist before add into db
198
-	*
199
-	* @param string $url
200
-	*
201
-	* @return true if ok, else false.
202
-	*/
197
+	 * Verify that an URL exist before add into db
198
+	 *
199
+	 * @param string $url
200
+	 *
201
+	 * @return true if ok, else false.
202
+	 */
203 203
 	function checkurl($url)
204 204
 	{
205 205
 		$details = parse_url($url);
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
 	}
239 239
 
240 240
 	/**
241
-	* Delete the final '/', if no path
242
-	*
243
-	* @param string $url to clean
244
-	*
245
-	* @return the correct string.
246
-	*/
241
+	 * Delete the final '/', if no path
242
+	 *
243
+	 * @param string $url to clean
244
+	 *
245
+	 * @return the correct string.
246
+	 */
247 247
 	function clean_url($url)
248 248
 	{
249 249
 		$details = parse_url($url);
@@ -291,13 +291,13 @@  discard block
 block discarded – undo
291 291
 	}
292 292
 
293 293
 	/**
294
-	* Calculate the link's note
295
-	*
296
-	* @param int $total_note is sum of all link's notes
297
-	* @param int $nb_vote is nb of votes
298
-	*
299
-	* @return the calculated note.
300
-	*/
294
+	 * Calculate the link's note
295
+	 *
296
+	 * @param int $total_note is sum of all link's notes
297
+	 * @param int $nb_vote is nb of votes
298
+	 *
299
+	 * @return the calculated note.
300
+	 */
301 301
 	function display_note($total_note, $nb_vote, $votes_status)
302 302
 	{
303 303
 		if(!$votes_status)
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
 	}
316 316
 
317 317
 	/**
318
-	* Display the vote form for auth users
319
-	*
320
-	* @param array $data link's data from db
321
-	*
322
-	* @return the html code.
323
-	*/
318
+	 * Display the vote form for auth users
319
+	 *
320
+	 * @param array $data link's data from db
321
+	 *
322
+	 * @return the html code.
323
+	 */
324 324
 	function display_vote($data, $votes_status)
325 325
 	{
326 326
 		if(!$votes_status)
@@ -359,14 +359,14 @@  discard block
 block discarded – undo
359 359
 	}
360 360
 
361 361
 	/**
362
-	* Display link's thumb if thumb service enabled.
363
-	* if thumb don't exists in db or if a new service was choosen in acp
364
-	* thumb is research
365
-	*
366
-	* @param array $data link's data from db
367
-	*
368
-	* @return thumb or nothing.
369
-	*/
362
+	 * Display link's thumb if thumb service enabled.
363
+	 * if thumb don't exists in db or if a new service was choosen in acp
364
+	 * thumb is research
365
+	 *
366
+	 * @param array $data link's data from db
367
+	 *
368
+	 * @return thumb or nothing.
369
+	 */
370 370
 	function display_thumb($data)
371 371
 	{
372 372
 		global $config, $db;
@@ -388,12 +388,12 @@  discard block
 block discarded – undo
388 388
 	}
389 389
 
390 390
 	/**
391
-	* Display and calculate PageRank if needed
392
-	*
393
-	* @param array $data link's data from db
394
-	*
395
-	* @return pr image, false or 'n/a'.
396
-	*/
391
+	 * Display and calculate PageRank if needed
392
+	 *
393
+	 * @param array $data link's data from db
394
+	 *
395
+	 * @return pr image, false or 'n/a'.
396
+	 */
397 397
 	function display_pagerank($data)
398 398
 	{
399 399
 		global $config, $db, $user;
@@ -424,13 +424,13 @@  discard block
 block discarded – undo
424 424
 	}
425 425
 
426 426
 	/**
427
-	* Display and resize a banner
428
-	*
429
-	* @param array $data link's data from db
430
-	* @param bool $have_banner
431
-	*
432
-	* @return banner image.
433
-	*/
427
+	 * Display and resize a banner
428
+	 *
429
+	 * @param array $data link's data from db
430
+	 * @param bool $have_banner
431
+	 *
432
+	 * @return banner image.
433
+	 */
434 434
 	function display_bann($data)
435 435
 	{
436 436
 		global $config, $phpbb_root_path;
@@ -462,13 +462,13 @@  discard block
 block discarded – undo
462 462
 	}
463 463
 
464 464
 	/**
465
-	* Display number of comments and link for posting
466
-	*
467
-	* @param int $u is link_id from db
468
-	* @param int $nb_comments si number of comments for this link
469
-	*
470
-	* @return html code (counter + link).
471
-	*/
465
+	 * Display number of comments and link for posting
466
+	 *
467
+	 * @param int $u is link_id from db
468
+	 * @param int $nb_comments si number of comments for this link
469
+	 *
470
+	 * @return html code (counter + link).
471
+	 */
472 472
 	function display_comm($u, $nb_comment, $comments_status)
473 473
 	{
474 474
 		if(!$comments_status)
@@ -486,10 +486,10 @@  discard block
 block discarded – undo
486 486
 	}
487 487
 
488 488
 	/**
489
-	* Add a vote in db, for a specifi link
490
-	*
491
-	* @param int $u is link_id from db
492
-	*/
489
+	 * Add a vote in db, for a specifi link
490
+	 *
491
+	 * @param int $u is link_id from db
492
+	 */
493 493
 	function add_vote($u)
494 494
 	{
495 495
 		global $user, $db, $id, $start, $phpEx;
@@ -546,9 +546,9 @@  discard block
 block discarded – undo
546 546
 	}
547 547
 
548 548
 	/**
549
-	* Send a email to administrator for notify a new link
550
-	* when approbation enabled
551
-	*/
549
+	 * Send a email to administrator for notify a new link
550
+	 * when approbation enabled
551
+	 */
552 552
 	function notify_admin()
553 553
 	{
554 554
 		global $config, $db, $user;
@@ -657,12 +657,12 @@  discard block
 block discarded – undo
657 657
 	}
658 658
 
659 659
 	/**
660
-	* Search an appropriate thumb for url
661
-	*
662
-	* @param string $url is link's url
663
-	*
664
-	* @return the thumb url
665
-	*/
660
+	 * Search an appropriate thumb for url
661
+	 *
662
+	 * @param string $url is link's url
663
+	 *
664
+	 * @return the thumb url
665
+	 */
666 666
 	function thumb_process($url)
667 667
 	{
668 668
 		global $config, $phpbb_root_path;
@@ -704,10 +704,10 @@  discard block
 block discarded – undo
704 704
 	}
705 705
 
706 706
 	/**
707
-	* primary work on banner, can edit, copy or check a banner
708
-	*
709
-	* @param string $banner is banner's remote url
710
-	*/
707
+	 * primary work on banner, can edit, copy or check a banner
708
+	 *
709
+	 * @param string $banner is banner's remote url
710
+	 */
711 711
 	function banner_process(&$banner, &$error)
712 712
 	{
713 713
 		global $config, $phpbb_root_path;
@@ -750,13 +750,13 @@  discard block
 block discarded – undo
750 750
 	}
751 751
 
752 752
 	/**
753
-	* Copy a remonte banner to server.
754
-	* called by banner_process()
755
-	*
756
-	* @param string $banner is banner's remote url
757
-	*
758
-	* @return file's name of the local banner
759
-	*/
753
+	 * Copy a remonte banner to server.
754
+	 * called by banner_process()
755
+	 *
756
+	 * @param string $banner is banner's remote url
757
+	 *
758
+	 * @return file's name of the local banner
759
+	 */
760 760
 	function banner_upload($banner, &$error)
761 761
 	{
762 762
 		global $phpbb_root_path, $config, $db, $user, $phpEx;
@@ -789,13 +789,13 @@  discard block
 block discarded – undo
789 789
 	}
790 790
 
791 791
 	/**
792
-	* Check than remote banner exists
793
-	* called by banner_process()
794
-	*
795
-	* @param string $banner is banner's remote url
796
-	*
797
-	* @return false if error, true for ok
798
-	*/
792
+	 * Check than remote banner exists
793
+	 * called by banner_process()
794
+	 *
795
+	 * @param string $banner is banner's remote url
796
+	 *
797
+	 * @return false if error, true for ok
798
+	 */
799 799
 	function banner_remote($banner, &$error)
800 800
 	{
801 801
 		global $config, $db, $user, $phpbb_root_path, $phpEx;
@@ -860,13 +860,13 @@  discard block
 block discarded – undo
860 860
 	}
861 861
 
862 862
 	/**
863
-	* Delete a banner from server
864
-	*
865
-	* @param string $destination path to banner directory
866
-	* @param string $file is file's name
867
-	*
868
-	* @return true if delete success, else false
869
-	*/
863
+	 * Delete a banner from server
864
+	 *
865
+	 * @param string $destination path to banner directory
866
+	 * @param string $file is file's name
867
+	 *
868
+	 * @return true if delete success, else false
869
+	 */
870 870
 	function banner_delete($destination, $file)
871 871
 	{
872 872
 		global $phpbb_root_path;
@@ -886,15 +886,15 @@  discard block
 block discarded – undo
886 886
 	}
887 887
 
888 888
 	/**
889
-	* PageRank Lookup (Based on Google Toolbar for Mozilla Firefox)
890
-	*
891
-	* @copyright 2012 HM2K <[email protected]>
892
-	* @link http://pagerank.phurix.net/
893
-	* @author James Wade <[email protected]>
894
-	* @version $Revision: 2.1 $
895
-	* @require PHP 4.3.0 (file_get_contents)
896
-	* @updated 06/10/11
897
-	*/
889
+	 * PageRank Lookup (Based on Google Toolbar for Mozilla Firefox)
890
+	 *
891
+	 * @copyright 2012 HM2K <[email protected]>
892
+	 * @link http://pagerank.phurix.net/
893
+	 * @author James Wade <[email protected]>
894
+	 * @version $Revision: 2.1 $
895
+	 * @require PHP 4.3.0 (file_get_contents)
896
+	 * @updated 06/10/11
897
+	 */
898 898
 	function pagerank_process($q)
899 899
 	{
900 900
 		global $user;
@@ -934,10 +934,10 @@  discard block
 block discarded – undo
934 934
 class comment
935 935
 {
936 936
 	/**
937
-	* Add a comment
938
-	*
939
-	* @param array $data is link's data from db
940
-	*/
937
+	 * Add a comment
938
+	 *
939
+	 * @param array $data is link's data from db
940
+	 */
941 941
 	function add($data)
942 942
 	{
943 943
 		global $db, $config;
@@ -956,12 +956,12 @@  discard block
 block discarded – undo
956 956
 	}
957 957
 
958 958
 	/**
959
-	* Edit a comment
960
-	*
961
-	* @param array $data is datas to edit
962
-	* @param $id comment_id from db
963
-	*
964
-	*/
959
+	 * Edit a comment
960
+	 *
961
+	 * @param array $data is datas to edit
962
+	 * @param $id comment_id from db
963
+	 *
964
+	 */
965 965
 	function edit($data, $id)
966 966
 	{
967 967
 		global $db;
@@ -972,11 +972,11 @@  discard block
 block discarded – undo
972 972
 	}
973 973
 
974 974
 	/**
975
-	* Delete a comment
976
-	*
977
-	* @param string $id is comment_id from db
978
-	* @param string $u is link_db
979
-	*/
975
+	 * Delete a comment
976
+	 *
977
+	 * @param string $id is comment_id from db
978
+	 * @param string $u is link_db
979
+	 */
980 980
 	function del($id, $u)
981 981
 	{
982 982
 		global $user, $db, $phpEx;
@@ -1019,8 +1019,8 @@  discard block
 block discarded – undo
1019 1019
 	var $data = array();
1020 1020
 
1021 1021
 	/**
1022
-	* Get somes categorie infos
1023
-	*/
1022
+	 * Get somes categorie infos
1023
+	 */
1024 1024
 	function categorie($id = 0)
1025 1025
 	{
1026 1026
 		global $db;
@@ -1104,8 +1104,8 @@  discard block
 block discarded – undo
1104 1104
 	}
1105 1105
 
1106 1106
 	/**
1107
-	* Display cat or subcat
1108
-	*/
1107
+	 * Display cat or subcat
1108
+	 */
1109 1109
 	function display()
1110 1110
 	{
1111 1111
 		global $db, $template, $phpbb_root_path;
@@ -1252,8 +1252,8 @@  discard block
 block discarded – undo
1252 1252
 	var $categorie	= array();
1253 1253
 
1254 1254
 	/**
1255
-	* Constructor
1256
-	*/
1255
+	 * Constructor
1256
+	 */
1257 1257
 	function directory_cron($catrow)
1258 1258
 	{
1259 1259
 		$this->categorie = $catrow;
Please login to merge, or discard this patch.
Spacing   +160 added lines, -160 removed lines patch added patch discarded remove patch
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
 
35 35
 		$db->sql_transaction('begin');
36 36
 
37
-		$sql = 'INSERT INTO ' . DIR_LINK_TABLE . ' ' . $db->sql_build_array('INSERT', $data);
37
+		$sql = 'INSERT INTO '.DIR_LINK_TABLE.' '.$db->sql_build_array('INSERT', $data);
38 38
 		$db->sql_query($sql);
39 39
 
40 40
 		if (!$categorie->data['cat_validate'] || $auth->acl_get('a_') || $auth->acl_get('m_'))
41 41
 		{
42
-			$sql = 'UPDATE ' . DIR_CAT_TABLE . '
42
+			$sql = 'UPDATE '.DIR_CAT_TABLE.'
43 43
 				SET cat_links = cat_links + 1
44
-				WHERE cat_id = ' . (int)$data['link_cat'];
44
+				WHERE cat_id = ' . (int) $data['link_cat'];
45 45
 			$db->sql_query($sql);
46 46
 		}
47 47
 		elseif ($config['dir_mail'] && $config['email_enable'])
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
 		{
68 68
 			$db->sql_transaction('begin');
69 69
 
70
-			$sql = 'UPDATE ' . DIR_CAT_TABLE . ' SET cat_links = cat_links - 1
71
-				WHERE cat_id = ' . (int)$old_cat;
70
+			$sql = 'UPDATE '.DIR_CAT_TABLE.' SET cat_links = cat_links - 1
71
+				WHERE cat_id = ' . (int) $old_cat;
72 72
 			$db->sql_query($sql);
73 73
 
74
-			if(!$need_approval)
74
+			if (!$need_approval)
75 75
 			{
76
-				$sql = 'UPDATE ' . DIR_CAT_TABLE . ' SET cat_links = cat_links + 1
77
-					WHERE cat_id = ' . (int)$data['link_cat'];
76
+				$sql = 'UPDATE '.DIR_CAT_TABLE.' SET cat_links = cat_links + 1
77
+					WHERE cat_id = ' . (int) $data['link_cat'];
78 78
 				$db->sql_query($sql);
79 79
 			}
80 80
 			else
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 			$db->sql_transaction('commit');
86 86
 		}
87 87
 
88
-		$sql = 'UPDATE ' . DIR_LINK_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $data) . '
89
-			WHERE link_id = ' . (int)$url_id;
88
+		$sql = 'UPDATE '.DIR_LINK_TABLE.' SET '.$db->sql_build_array('UPDATE', $data).'
89
+			WHERE link_id = ' . (int) $url_id;
90 90
 		$db->sql_query($sql);
91 91
 
92 92
 		$cache->destroy('sql', DIR_LINK_TABLE);
@@ -114,16 +114,16 @@  discard block
 block discarded – undo
114 114
 				DIR_VOTE_TABLE		=> 'vote_link_id',
115 115
 			);
116 116
 
117
-			$sql = 'SELECT link_banner FROM ' . DIR_LINK_TABLE . ' WHERE '. $db->sql_in_set('link_id', $url_array);
117
+			$sql = 'SELECT link_banner FROM '.DIR_LINK_TABLE.' WHERE '.$db->sql_in_set('link_id', $url_array);
118 118
 			$result = $db->sql_query($sql);
119 119
 
120 120
 			while ($row = $db->sql_fetchrow($result))
121 121
 			{
122
-				if($row['link_banner'] && !preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner']))
122
+				if ($row['link_banner'] && !preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner']))
123 123
 				{
124
-					if (file_exists($phpbb_root_path . 'images/directory/banners' .'/'. basename($row['link_banner'])))
124
+					if (file_exists($phpbb_root_path.'images/directory/banners'.'/'.basename($row['link_banner'])))
125 125
 					{
126
-						@unlink($phpbb_root_path . 'images/directory/banners' .'/'. basename($row['link_banner']));
126
+						@unlink($phpbb_root_path.'images/directory/banners'.'/'.basename($row['link_banner']));
127 127
 					}
128 128
 				}
129 129
 			}
@@ -133,14 +133,14 @@  discard block
 block discarded – undo
133 133
 				$db->sql_query("DELETE FROM $table WHERE ".$db->sql_in_set($field, $url_array));
134 134
 			}
135 135
 
136
-			$sql = 'UPDATE ' . DIR_CAT_TABLE . '
136
+			$sql = 'UPDATE '.DIR_CAT_TABLE.'
137 137
 				SET cat_links = cat_links - '.sizeof($url_array).'
138
-			WHERE cat_id = ' . (int)$cat_id;
138
+			WHERE cat_id = ' . (int) $cat_id;
139 139
 			$db->sql_query($sql);
140 140
 
141 141
 			$db->sql_transaction('commit');
142 142
 
143
-			if($cron)
143
+			if ($cron)
144 144
 			{
145 145
 				include($phpbb_root_path.'includes/acp/acp_directory.'.$phpEx);
146 146
 				sync_dir_cat($this->categorie['cat_id']);
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 			{
150 150
 				$meta_info = append_sid("{$phpbb_root_path}directory.$phpEx", "mode=cat&amp;id=$cat_id");
151 151
 				meta_refresh(3, $meta_info);
152
-				$message = $user->lang['DIR_DELETE_OK'] . "<br /><br />" . $user->lang('DIR_CLICK_RETURN_DIR', '<a href="' . append_sid("{$phpbb_root_path}directory.$phpEx") . '">', '</a>') . '<br /><br />' . $user->lang('DIR_CLICK_RETURN_CAT', '<a href="' . append_sid("{$phpbb_root_path}directory.$phpEx", "mode=cat&amp;id=$cat_id") . '">', '</a>');
152
+				$message = $user->lang['DIR_DELETE_OK']."<br /><br />".$user->lang('DIR_CLICK_RETURN_DIR', '<a href="'.append_sid("{$phpbb_root_path}directory.$phpEx").'">', '</a>').'<br /><br />'.$user->lang('DIR_CLICK_RETURN_CAT', '<a href="'.append_sid("{$phpbb_root_path}directory.$phpEx", "mode=cat&amp;id=$cat_id").'">', '</a>');
153 153
 				trigger_error($message);
154 154
 			}
155 155
 		}
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
 		{
158 158
 			$s_hidden_fields = build_hidden_fields(array(
159 159
 				'mode'	=> $mode,
160
-				'id'	=> (int)$cat_id,
161
-				'u'		=> (int)$url_id,
160
+				'id'	=> (int) $cat_id,
161
+				'u'		=> (int) $url_id,
162 162
 			));
163 163
 
164 164
 			confirm_box(false, 'DIR_DELETE_SITE', $s_hidden_fields);
@@ -174,8 +174,8 @@  discard block
 block discarded – undo
174 174
 	{
175 175
 		global $db, $user;
176 176
 
177
-		$sql = 'SELECT link_id, link_url FROM ' . DIR_LINK_TABLE . '
178
-					WHERE link_id = ' . (int)$url_id;
177
+		$sql = 'SELECT link_id, link_url FROM '.DIR_LINK_TABLE.'
178
+					WHERE link_id = ' . (int) $url_id;
179 179
 		$result = $db->sql_query($sql);
180 180
 		$data = $db->sql_fetchrow($result);
181 181
 
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
 			trigger_error($user->lang['DIR_ERROR_NO_LINKS'], E_USER_ERROR);
185 185
 		}
186 186
 
187
-		$sql = 'UPDATE ' . DIR_LINK_TABLE . '
187
+		$sql = 'UPDATE '.DIR_LINK_TABLE.'
188 188
 			SET link_view = link_view + 1
189
-			WHERE link_id = ' . (int)$url_id;
189
+			WHERE link_id = ' . (int) $url_id;
190 190
 		$db->sql_query($sql);
191 191
 
192 192
 		redirect($data['link_url'], false, true);
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	{
249 249
 		$details = parse_url($url);
250 250
 
251
-		if(isset($details['path']) && $details['path'] == '/' && !isset($details['query']))
251
+		if (isset($details['path']) && $details['path'] == '/' && !isset($details['query']))
252 252
 		{
253 253
 			return substr($url, 0, -1);
254 254
 		}
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 
269 269
 		$extra = '';
270 270
 
271
-		if(!empty($data['link_flag']))
271
+		if (!empty($data['link_flag']))
272 272
 		{
273 273
 			if (file_exists('images/directory/flags/'.$data['link_flag']))
274 274
 			{
@@ -282,11 +282,11 @@  discard block
 block discarded – undo
282 282
 					$extra = 'alt = "'.$country.'" title = "'.$country.'"';
283 283
 				}
284 284
 
285
-				return '<img src="' . $phpbb_root_path . 'images/directory/flags/' . $data['link_flag'] . '" '.$extra.' />&nbsp;';
285
+				return '<img src="'.$phpbb_root_path.'images/directory/flags/'.$data['link_flag'].'" '.$extra.' />&nbsp;';
286 286
 			}
287 287
 		}
288 288
 
289
-		return '<img src="' . $phpbb_root_path . 'images/directory/flags/no_flag.png" />&nbsp;';
289
+		return '<img src="'.$phpbb_root_path.'images/directory/flags/no_flag.png" />&nbsp;';
290 290
 
291 291
 	}
292 292
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 	*/
301 301
 	function display_note($total_note, $nb_vote, $votes_status)
302 302
 	{
303
-		if(!$votes_status)
303
+		if (!$votes_status)
304 304
 		{
305 305
 			return;
306 306
 		}
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 
310 310
 		$note = ($nb_vote < 1) ? '' : $total_note / $nb_vote;
311 311
 		$note = (strlen($note) > 2) ? number_format($note, 1) : $note;
312
-		$note = ($nb_vote) ? '<b>' . $user->lang('DIR_FROM_TEN', $note) . '</b>' : $user->lang['DIR_NO_NOTE'];
312
+		$note = ($nb_vote) ? '<b>'.$user->lang('DIR_FROM_TEN', $note).'</b>' : $user->lang['DIR_NO_NOTE'];
313 313
 
314 314
 		return $note;
315 315
 	}
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 	*/
324 324
 	function display_vote($data, $votes_status)
325 325
 	{
326
-		if(!$votes_status)
326
+		if (!$votes_status)
327 327
 		{
328 328
 			return;
329 329
 		}
@@ -338,20 +338,20 @@  discard block
 block discarded – undo
338 338
 				if (empty($data['vote_user_id']))
339 339
 				{
340 340
 					$list = '<select name="vote">';
341
-					for ( $i = 0; $i <= 10; $i++ )
341
+					for ($i = 0; $i <= 10; $i++)
342 342
 					{
343
-						$list .= '<option value="' . $i . '"' . (($i == 5) ? ' selected="selected"' : '') . '>' . $i . '</option>';
343
+						$list .= '<option value="'.$i.'"'.(($i == 5) ? ' selected="selected"' : '').'>'.$i.'</option>';
344 344
 					}
345 345
 					$list .= '</select>';
346 346
 
347 347
 					$params = array(
348 348
 						'mode'	=> 'cat',
349
-						'id'	=> (int)$data['link_cat'],
349
+						'id'	=> (int) $data['link_cat'],
350 350
 						'start'	=> $start,
351
-						'u'		=> (int)$data['link_id'],
351
+						'u'		=> (int) $data['link_id'],
352 352
 						'order'	=> $order);
353 353
 
354
-					return '<br /><form action="' . append_sid("{$directory_root_path}directory.$phpEx", $params, true) . '" method="post"><div>' . $list . '&nbsp;<input type="submit" name="submit_vote" value="' . $user->lang['DIR_VOTE'] . '" class="mainoption" /></div></form>';
354
+					return '<br /><form action="'.append_sid("{$directory_root_path}directory.$phpEx", $params, true).'" method="post"><div>'.$list.'&nbsp;<input type="submit" name="submit_vote" value="'.$user->lang['DIR_VOTE'].'" class="mainoption" /></div></form>';
355 355
 				}
356 356
 			}
357 357
 		}
@@ -371,14 +371,14 @@  discard block
 block discarded – undo
371 371
 	{
372 372
 		global $config, $db;
373 373
 
374
-		if($config['dir_activ_thumb'])
374
+		if ($config['dir_activ_thumb'])
375 375
 		{
376 376
 			if (!$data['link_thumb'] || ($config['dir_thumb_service_reverse'] && (!strstr($data['link_thumb'], 'ascreen.jpg') && (!strstr($data['link_thumb'], $config['dir_thumb_service'])))))
377 377
 			{
378 378
 				$thumb = $this->thumb_process($data['link_url']);
379 379
 
380
-				$sql = 'UPDATE ' . DIR_LINK_TABLE . ' SET link_thumb = "' . $db->sql_escape($thumb) . '"
381
-					WHERE link_id = ' . (int)$data['link_id'];
380
+				$sql = 'UPDATE '.DIR_LINK_TABLE.' SET link_thumb = "'.$db->sql_escape($thumb).'"
381
+					WHERE link_id = ' . (int) $data['link_id'];
382 382
 				$db->sql_query($sql);
383 383
 
384 384
 				return $thumb;
@@ -398,24 +398,24 @@  discard block
 block discarded – undo
398 398
 	{
399 399
 		global $config, $db, $user;
400 400
 
401
-		if($config['dir_activ_pagerank'])
401
+		if ($config['dir_activ_pagerank'])
402 402
 		{
403 403
 			if ($data['link_pagerank'] == '')
404 404
 			{
405 405
 				$pagerank = $this->pagerank_process($data['link_url']);
406 406
 
407
-				$sql = 'UPDATE ' . DIR_LINK_TABLE . ' SET link_pagerank = ' . (int)$pagerank . '
408
-					WHERE link_id = ' . (int)$data['link_id'];
407
+				$sql = 'UPDATE '.DIR_LINK_TABLE.' SET link_pagerank = '.(int) $pagerank.'
408
+					WHERE link_id = ' . (int) $data['link_id'];
409 409
 				$db->sql_query($sql);
410 410
 			}
411 411
 			else
412 412
 			{
413
-				$pagerank = (int)$data['link_pagerank'];
413
+				$pagerank = (int) $data['link_pagerank'];
414 414
 			}
415 415
 
416
-			$prpos=40*$pagerank/10;
417
-			$prneg=40-$prpos;
418
-			$html='<img src="http://www.google.com/images/pos.gif" width="'.$prpos.'" height="4" alt="'.$pagerank.'" /><img src="http://www.google.com/images/neg.gif" width="'.$prneg.'" height="4" alt="'.$pagerank.'" /> ';
416
+			$prpos = 40 * $pagerank / 10;
417
+			$prneg = 40 - $prpos;
418
+			$html = '<img src="http://www.google.com/images/pos.gif" width="'.$prpos.'" height="4" alt="'.$pagerank.'" /><img src="http://www.google.com/images/neg.gif" width="'.$prneg.'" height="4" alt="'.$pagerank.'" /> ';
419 419
 
420 420
 			$pagerank = $pagerank == '-1' ? $user->lang['DIR_PAGERANK_NOT_AVAILABLE'] : $user->lang('DIR_FROM_TEN', $pagerank);
421 421
 			return $html.$pagerank;
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 				$height /= $coef_max;
456 456
 			}
457 457
 
458
-			$s_banner = '<img src="' . $path . '" width="' . $width . '" height="' . $height . '" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />';
458
+			$s_banner = '<img src="'.$path.'" width="'.$width.'" height="'.$height.'" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />';
459 459
 		}
460 460
 
461 461
 		return $s_banner;
@@ -471,16 +471,16 @@  discard block
 block discarded – undo
471 471
 	*/
472 472
 	function display_comm($u, $nb_comment, $comments_status)
473 473
 	{
474
-		if(!$comments_status)
474
+		if (!$comments_status)
475 475
 		{
476 476
 			return;
477 477
 		}
478 478
 
479 479
 		global $user, $directory_root_path, $phpEx;
480 480
 
481
-		$comment_url = append_sid("{$directory_root_path}directory_comment.$phpEx", array('u' => (int)$u));
482
-		$l_nb_comment = ($nb_comment > 1) ? $user->lang['DIR_COMMENTS']: $user->lang['DIR_COMMENT'];
483
-		$s_comment = '&nbsp;&nbsp;&nbsp;<a href="' . $comment_url . '" onclick="window.open(\'' . $comment_url . '\', \'phpBB_dir_comment\', \'HEIGHT=600, resizable=yes, scrollbars=yes, WIDTH=905\');return false;" class="gen"><b>' . $nb_comment . '</b> ' . $l_nb_comment . '</a>';
481
+		$comment_url = append_sid("{$directory_root_path}directory_comment.$phpEx", array('u' => (int) $u));
482
+		$l_nb_comment = ($nb_comment > 1) ? $user->lang['DIR_COMMENTS'] : $user->lang['DIR_COMMENT'];
483
+		$s_comment = '&nbsp;&nbsp;&nbsp;<a href="'.$comment_url.'" onclick="window.open(\''.$comment_url.'\', \'phpBB_dir_comment\', \'HEIGHT=600, resizable=yes, scrollbars=yes, WIDTH=905\');return false;" class="gen"><b>'.$nb_comment.'</b> '.$l_nb_comment.'</a>';
484 484
 
485 485
 		return $s_comment;
486 486
 	}
@@ -501,12 +501,12 @@  discard block
 block discarded – undo
501 501
 		}
502 502
 
503 503
 		$data = array(
504
-			'vote_link_id' 		=> (int)$u,
505
-			'vote_user_id' 		=> (int)$user->data['user_id'],
504
+			'vote_link_id' 		=> (int) $u,
505
+			'vote_user_id' 		=> (int) $user->data['user_id'],
506 506
 		);
507 507
 
508 508
 		// We check if user had already vot for this website.
509
-		$sql = 'SELECT vote_link_id FROM ' . DIR_VOTE_TABLE . ' WHERE ' . $db->sql_build_array('SELECT', $data);
509
+		$sql = 'SELECT vote_link_id FROM '.DIR_VOTE_TABLE.' WHERE '.$db->sql_build_array('SELECT', $data);
510 510
 		$result = $db->sql_query($sql);
511 511
 		$data = $db->sql_fetchrow($result);
512 512
 
@@ -516,19 +516,19 @@  discard block
 block discarded – undo
516 516
 		}
517 517
 
518 518
 		$data = array(
519
-			'vote_link_id' 		=> (int)$u,
519
+			'vote_link_id' 		=> (int) $u,
520 520
 			'vote_user_id' 		=> $user->data['user_id'],
521 521
 			'vote_note'			=> request_var('vote', 0),
522 522
 		);
523 523
 
524 524
 		$db->sql_transaction('begin');
525 525
 
526
-		$sql = 'INSERT INTO ' . DIR_VOTE_TABLE . ' ' . $db->sql_build_array('INSERT', $data);
526
+		$sql = 'INSERT INTO '.DIR_VOTE_TABLE.' '.$db->sql_build_array('INSERT', $data);
527 527
 		$db->sql_query($sql);
528 528
 
529
-		$sql = 'UPDATE ' . DIR_LINK_TABLE . ' SET link_vote = link_vote + 1,
530
-			link_note = link_note + ' . (int)$data['vote_note'] . '
531
-		WHERE link_id = ' . (int)$u;
529
+		$sql = 'UPDATE '.DIR_LINK_TABLE.' SET link_vote = link_vote + 1,
530
+			link_note = link_note + ' . (int) $data['vote_note'].'
531
+		WHERE link_id = ' . (int) $u;
532 532
 		$db->sql_query($sql);
533 533
 
534 534
 		$db->sql_transaction('commit');
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 
542 542
 		$meta_info = append_sid("{$directory_root_path}directory.$phpEx", $params, true);
543 543
 		meta_refresh(3, $meta_info);
544
-		$message = $user->lang['DIR_VOTE_OK'] . '<br /><br />' . sprintf($user->lang['DIR_CLICK_RETURN_LIEN'], '<a href="' . append_sid("{$directory_root_path}directory.$phpEx", $params, true) . '">', '</a>');
544
+		$message = $user->lang['DIR_VOTE_OK'].'<br /><br />'.sprintf($user->lang['DIR_CLICK_RETURN_LIEN'], '<a href="'.append_sid("{$directory_root_path}directory.$phpEx", $params, true).'">', '</a>');
545 545
 		trigger_error($message);
546 546
 	}
547 547
 
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 		{
559 559
 			// Get the appropriate username, etc.
560 560
 			$sql = 'SELECT username, user_email, user_lang, user_jabber, user_notify_type
561
-				FROM ' . USERS_TABLE . ' u, '. GROUPS_TABLE .' g, ' . USER_GROUP_TABLE . ' ug
561
+				FROM ' . USERS_TABLE.' u, '.GROUPS_TABLE.' g, '.USER_GROUP_TABLE.' ug
562 562
 				WHERE ug.user_id = u.user_id
563 563
 					AND ug.user_pending = 0
564 564
 					AND ug.group_id = g.group_id
@@ -567,9 +567,9 @@  discard block
 block discarded – undo
567 567
 
568 568
 			if (!class_exists('messenger'))
569 569
 			{
570
-				include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
570
+				include($phpbb_root_path.'includes/functions_messenger.'.$phpEx);
571 571
 			}
572
-			$messenger	= new messenger(false);
572
+			$messenger = new messenger(false);
573 573
 
574 574
 			while ($row = $db->sql_fetchrow($result))
575 575
 			{
@@ -580,10 +580,10 @@  discard block
 block discarded – undo
580 580
 				$messenger->im($row['user_jabber'], $row['username']);
581 581
 				$notify_type = $row['user_notify_type'];
582 582
 
583
-				$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
584
-				$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
585
-				$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
586
-				$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
583
+				$messenger->headers('X-AntiAbuse: Board servername - '.$config['server_name']);
584
+				$messenger->headers('X-AntiAbuse: User_id - '.$user->data['user_id']);
585
+				$messenger->headers('X-AntiAbuse: Username - '.$user->data['username']);
586
+				$messenger->headers('X-AntiAbuse: User IP - '.$user->ip);
587 587
 
588 588
 				$messenger->assign_vars(array(
589 589
 					'USERNAME'		=> htmlspecialchars_decode($row['username']),
@@ -615,21 +615,21 @@  discard block
 block discarded – undo
615 615
 					'ON'	=> 'an.n_user_id = u.user_id'
616 616
 				)
617 617
 			),
618
-			'WHERE'		=> 'an.n_cat_id = ' . (int)$site['link_cat']);
618
+			'WHERE'		=> 'an.n_cat_id = '.(int) $site['link_cat']);
619 619
 		$sql = $db->sql_build_query('SELECT', $sql_array);
620 620
 		$result = $db->sql_query($sql);
621 621
 
622 622
 		if (!class_exists('messenger'))
623 623
 		{
624
-			include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
624
+			include($phpbb_root_path.'includes/functions_messenger.'.$phpEx);
625 625
 		}
626
-		$messenger	= new messenger(false);
626
+		$messenger = new messenger(false);
627 627
 
628 628
 		$row = array();
629 629
 		while ($row = $db->sql_fetchrow($result))
630 630
 		{
631
-			$username	= $row['username'];
632
-			$email		= $row['user_email'];
631
+			$username = $row['username'];
632
+			$email = $row['user_email'];
633 633
 			strip_bbcode($site['link_description']);
634 634
 
635 635
 			$messenger->template('mods/directory/notification', $row['user_lang']);
@@ -638,10 +638,10 @@  discard block
 block discarded – undo
638 638
 
639 639
 			$messenger->im($row['user_jabber'], $row['username']);
640 640
 
641
-			$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
642
-			$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
643
-			$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
644
-			$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
641
+			$messenger->headers('X-AntiAbuse: Board servername - '.$config['server_name']);
642
+			$messenger->headers('X-AntiAbuse: User_id - '.$user->data['user_id']);
643
+			$messenger->headers('X-AntiAbuse: Username - '.$user->data['username']);
644
+			$messenger->headers('X-AntiAbuse: User IP - '.$user->ip);
645 645
 
646 646
 			$messenger->assign_vars(array(
647 647
 				'USERNAME'			=> $row['username'],
@@ -667,17 +667,17 @@  discard block
 block discarded – undo
667 667
 	{
668 668
 		global $config, $phpbb_root_path;
669 669
 
670
-		if(!$config['dir_activ_thumb'])
670
+		if (!$config['dir_activ_thumb'])
671 671
 		{
672 672
 			return $phpbb_root_path.'images/directory/nothumb.gif';
673 673
 		}
674 674
 
675 675
 		$details = parse_url($url);
676 676
 
677
-		$root_url		= $details['scheme'].'://'.$details['host'];
678
-		$absolute_url	= isset($details['path']) ? $root_url.$details['path'] : $root_url;
677
+		$root_url = $details['scheme'].'://'.$details['host'];
678
+		$absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url;
679 679
 
680
-		if($config['dir_activ_thumb_remote'])
680
+		if ($config['dir_activ_thumb_remote'])
681 681
 		{
682 682
 			if ($this->ascreen_exist($details['scheme'], $details['host']))
683 683
 			{
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 		$destination = 'images/directory/banners';
718 718
 
719 719
 		// Can we upload?
720
-		$can_upload = ($config['dir_storage_banner'] && file_exists($phpbb_root_path . $destination) && phpbb_is_writable($phpbb_root_path . $destination) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
720
+		$can_upload = ($config['dir_storage_banner'] && file_exists($phpbb_root_path.$destination) && phpbb_is_writable($phpbb_root_path.$destination) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
721 721
 
722 722
 		if ($banner && $can_upload)
723 723
 		{
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
 
744 744
 			$banner = isset($file) ? $file : '';
745 745
 		}
746
-		elseif(isset($file))
746
+		elseif (isset($file))
747 747
 		{
748 748
 			$this->banner_delete($destination, $file);
749 749
 		}
@@ -762,15 +762,15 @@  discard block
 block discarded – undo
762 762
 		global $phpbb_root_path, $config, $db, $user, $phpEx;
763 763
 
764 764
 		// Init upload class
765
-		if(!class_exists('fileupload'))
765
+		if (!class_exists('fileupload'))
766 766
 		{
767
-			include($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
767
+			include($phpbb_root_path.'includes/functions_upload.'.$phpEx);
768 768
 		}
769 769
 		$upload = new fileupload('DIR_BANNER_', array('jpg', 'jpeg', 'gif', 'png'), $config['dir_banner_filesize']);
770 770
 
771 771
 		$file = $upload->remote_upload($banner);
772 772
 
773
-		$prefix = unique_id() . '_';
773
+		$prefix = unique_id().'_';
774 774
 		$file->clean_filename('real', $prefix);
775 775
 
776 776
 		$destination = 'images/directory/banners';
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 		}
786 786
 		@chmod($file->destination_file, 0644);
787 787
 
788
-		return $prefix .strtolower($file->uploadname);
788
+		return $prefix.strtolower($file->uploadname);
789 789
 	}
790 790
 
791 791
 	/**
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
 
803 803
 		if (!preg_match('#^(http|https|ftp)://#i', $banner))
804 804
 		{
805
-			$banner = 'http://' . $banner;
805
+			$banner = 'http://'.$banner;
806 806
 		}
807 807
 		if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.(gif|jpg|jpeg|png)$#i', $banner))
808 808
 		{
@@ -827,12 +827,12 @@  discard block
 block discarded – undo
827 827
 		$height = $image_data[1];
828 828
 
829 829
 		// Check image type
830
-		if(!class_exists('fileupload'))
830
+		if (!class_exists('fileupload'))
831 831
 		{
832
-			include($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
832
+			include($phpbb_root_path.'includes/functions_upload.'.$phpEx);
833 833
 		}
834
-		$types		= fileupload::image_types();
835
-		$extension	= strtolower(filespec::get_extension($banner));
834
+		$types = fileupload::image_types();
835
+		$extension = strtolower(filespec::get_extension($banner));
836 836
 
837 837
 		if (!empty($image_data) && (!isset($types[$image_data[2]]) || !in_array($extension, $types[$image_data[2]])))
838 838
 		{
@@ -876,9 +876,9 @@  discard block
 block discarded – undo
876 876
 			$destination = substr($destination, 0, -1);
877 877
 		}
878 878
 
879
-		if (file_exists($phpbb_root_path . $destination .'/'.$file))
879
+		if (file_exists($phpbb_root_path.$destination.'/'.$file))
880 880
 		{
881
-			@unlink($phpbb_root_path . $destination .'/'.$file);
881
+			@unlink($phpbb_root_path.$destination.'/'.$file);
882 882
 			return true;
883 883
 		}
884 884
 
@@ -903,23 +903,23 @@  discard block
 block discarded – undo
903 903
 		$seed = $user->lang['SEED'];
904 904
 		$result = 0x01020345;
905 905
 		$len = strlen($q);
906
-		for ($i=0; $i<$len; $i++)
906
+		for ($i = 0; $i < $len; $i++)
907 907
 		{
908
-			$result ^= ord($seed{$i%strlen($seed)}) ^ ord($q{$i});
908
+			$result ^= ord($seed{$i % strlen($seed)}) ^ ord($q{$i});
909 909
 			$result = (($result >> 23) & 0x1ff) | $result << 9;
910 910
 		}
911 911
 		if (PHP_INT_MAX != 2147483647)
912 912
 		{
913 913
 			$result = -(~($result & 0xFFFFFFFF) + 1);
914 914
 		}
915
-		$ch=sprintf('8%x', $result);
916
-		$url='http://%s/tbr?client=navclient-auto&ch=%s&features=Rank&q=info:%s';
917
-		$host = 'toolbarqueries.google'.$googleDomains[mt_rand(0,count($googleDomains)-1)];
915
+		$ch = sprintf('8%x', $result);
916
+		$url = 'http://%s/tbr?client=navclient-auto&ch=%s&features=Rank&q=info:%s';
917
+		$host = 'toolbarqueries.google'.$googleDomains[mt_rand(0, count($googleDomains) - 1)];
918 918
 
919
-		$url=sprintf($url,$host,$ch,$q);
920
-		@$pr=trim(file_get_contents($url,false,$context));
919
+		$url = sprintf($url, $host, $ch, $q);
920
+		@$pr = trim(file_get_contents($url, false, $context));
921 921
 
922
-		if(is_numeric(substr(strrchr($pr, ':'), 1)))
922
+		if (is_numeric(substr(strrchr($pr, ':'), 1)))
923 923
 		{
924 924
 			return substr(strrchr($pr, ':'), 1);
925 925
 		}
@@ -944,12 +944,12 @@  discard block
 block discarded – undo
944 944
 
945 945
 		$db->sql_transaction('begin');
946 946
 
947
-		$sql = 'INSERT INTO ' . DIR_COMMENT_TABLE . ' ' . $db->sql_build_array('INSERT', $data);
947
+		$sql = 'INSERT INTO '.DIR_COMMENT_TABLE.' '.$db->sql_build_array('INSERT', $data);
948 948
 		$db->sql_query($sql);
949 949
 
950
-		$sql = 'UPDATE ' . DIR_LINK_TABLE . '
950
+		$sql = 'UPDATE '.DIR_LINK_TABLE.'
951 951
 			SET link_comment = link_comment + 1
952
-		WHERE link_id = ' . (int)$data['comment_link_id'];
952
+		WHERE link_id = ' . (int) $data['comment_link_id'];
953 953
 		$db->sql_query($sql);
954 954
 
955 955
 		$db->sql_transaction('commit');
@@ -966,8 +966,8 @@  discard block
 block discarded – undo
966 966
 	{
967 967
 		global $db;
968 968
 
969
-		$sql = 'UPDATE ' . DIR_COMMENT_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $data) . '
970
-			WHERE comment_id = ' . (int)$id;
969
+		$sql = 'UPDATE '.DIR_COMMENT_TABLE.' SET '.$db->sql_build_array('UPDATE', $data).'
970
+			WHERE comment_id = ' . (int) $id;
971 971
 		$db->sql_query($sql);
972 972
 	}
973 973
 
@@ -986,18 +986,18 @@  discard block
 block discarded – undo
986 986
 		{
987 987
 			$db->sql_transaction('begin');
988 988
 
989
-			$requete = 'DELETE FROM ' . DIR_COMMENT_TABLE . '
990
-				WHERE comment_id = ' . (int)$id;
989
+			$requete = 'DELETE FROM '.DIR_COMMENT_TABLE.'
990
+				WHERE comment_id = ' . (int) $id;
991 991
 			$db->sql_query($requete);
992 992
 
993
-			$sql = 'UPDATE ' . DIR_LINK_TABLE . '
993
+			$sql = 'UPDATE '.DIR_LINK_TABLE.'
994 994
 				SET link_comment = link_comment - 1
995
-			WHERE link_id = ' . (int)$u;
995
+			WHERE link_id = ' . (int) $u;
996 996
 			$db->sql_query($sql);
997 997
 
998 998
 			$db->sql_transaction('commit');
999 999
 
1000
-			$redirect_url = append_sid("{$directory_root_path}directory_comment.$phpEx", array('u' => (int)$u));
1000
+			$redirect_url = append_sid("{$directory_root_path}directory_comment.$phpEx", array('u' => (int) $u));
1001 1001
 			redirect($redirect_url);
1002 1002
 			//meta_refresh(3, $redirect_url);
1003 1003
 			//$message = $user->lang['DIR_COMMENT_DELETE_OK'];
@@ -1028,10 +1028,10 @@  discard block
 block discarded – undo
1028 1028
 		if ($id)
1029 1029
 		{
1030 1030
 			$sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id, cat_parents, cat_must_describe, cat_allow_votes, cat_allow_comments, cat_links, cat_validate, cat_link_back, cat_cron_enable, cat_cron_next, cat_cron_freq, cat_cron_enable, cat_cron_nb_check
1031
-				FROM ' . DIR_CAT_TABLE . '
1032
-				WHERE cat_id = ' . (int)$id;
1031
+				FROM ' . DIR_CAT_TABLE.'
1032
+				WHERE cat_id = ' . (int) $id;
1033 1033
 			$result = $db->sql_query($sql);
1034
-			if(!$this->data = $db->sql_fetchrow($result))
1034
+			if (!$this->data = $db->sql_fetchrow($result))
1035 1035
 			{
1036 1036
 				send_status_line(410, 'Gone');
1037 1037
 
@@ -1050,12 +1050,12 @@  discard block
 block discarded – undo
1050 1050
 		global $db;
1051 1051
 
1052 1052
 		$sql = 'SELECT cat_validate
1053
-				FROM ' . DIR_CAT_TABLE . '
1054
-				WHERE cat_id = ' . (int)$id;
1053
+				FROM ' . DIR_CAT_TABLE.'
1054
+				WHERE cat_id = ' . (int) $id;
1055 1055
 		$result = $db->sql_query($sql);
1056 1056
 		$row = $db->sql_fetchrow($result);
1057 1057
 
1058
-		return (int)$row['cat_validate'];
1058
+		return (int) $row['cat_validate'];
1059 1059
 	}
1060 1060
 
1061 1061
 	/**
@@ -1071,14 +1071,14 @@  discard block
 block discarded – undo
1071 1071
 
1072 1072
 		// This query is identical to the jumpbox one
1073 1073
 		$sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id
1074
-			FROM ' . DIR_CAT_TABLE . '
1074
+			FROM ' . DIR_CAT_TABLE.'
1075 1075
 			ORDER BY left_id ASC';
1076 1076
 		$result = $db->sql_query($sql, 600);
1077 1077
 
1078 1078
 		$right = 0;
1079 1079
 		$padding_store = array('0' => '');
1080 1080
 		$padding = '';
1081
-		$cat_list = ($select_id) ? '' : '<option value="0" selected="selected" style="font-weight:bold;">'.$user->lang['DIR_NONE']. '</option>';
1081
+		$cat_list = ($select_id) ? '' : '<option value="0" selected="selected" style="font-weight:bold;">'.$user->lang['DIR_NONE'].'</option>';
1082 1082
 
1083 1083
 		while ($row = $db->sql_fetchrow($result))
1084 1084
 		{
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
 			$right = $row['right_id'];
1096 1096
 
1097 1097
 			$selected = (($row['cat_id'] == $select_id) ? ' selected="selected"' : '');
1098
-			$cat_list .= '<option value="' . $row['cat_id'] . '"' . $selected . '>' . $padding . $row['cat_name'] . '</option>';
1098
+			$cat_list .= '<option value="'.$row['cat_id'].'"'.$selected.'>'.$padding.$row['cat_name'].'</option>';
1099 1099
 		}
1100 1100
 		$db->sql_freeresult($result);
1101 1101
 		unset($padding_store);
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
 		global $directory_root_path, $auth, $phpEx;
1113 1113
 
1114 1114
 		$cat_rows	= $subcats = array();
1115
-		$parent_id	= $visible_cats = 0;
1115
+		$parent_id = $visible_cats = 0;
1116 1116
 		$sql_from	= '';
1117 1117
 
1118 1118
 		$body = ($this->data) ? 'mods/directory/view_cat.html' : 'mods/directory/body.html';
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
 		else
1133 1133
 		{
1134 1134
 			$root_data = $this->data;
1135
-			$sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id'];
1135
+			$sql_where = 'left_id > '.$root_data['left_id'].' AND left_id < '.$root_data['right_id'];
1136 1136
 		}
1137 1137
 
1138 1138
 		$sql = $db->sql_build_query('SELECT', array(
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
 			{
1184 1184
 				foreach ($subcats[$dir_cat_id] as $subcat_id => $subcat_row)
1185 1185
 				{
1186
-					$row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links']+$subcat_row['links']) : $row['cat_links'];
1186
+					$row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links'] + $subcat_row['links']) : $row['cat_links'];
1187 1187
 
1188 1188
 					if ($subcat_row['display'] && $subcat_row['parent_id'] == $dir_cat_id)
1189 1189
 					{
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 				'CAT_NAME'				=> $row['cat_name'],
1205 1205
 				'CAT_DESC'				=> generate_text_for_display($row['cat_desc'], $row['cat_desc_uid'], $row['cat_desc_bitfield'], $row['cat_desc_options']),
1206 1206
 				'CAT_LINKS'				=> $row['cat_links'],
1207
-				'CAT_IMG'				=> $phpbb_root_path . 'images/directory/icons/'.$row['cat_icon'],
1207
+				'CAT_IMG'				=> $phpbb_root_path.'images/directory/icons/'.$row['cat_icon'],
1208 1208
 
1209 1209
 				'U_CAT'					=> append_sid("{$directory_root_path}directory.$phpEx", array('mode' => 'cat', 'id' => $row['cat_id']))
1210 1210
 			));
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
 			'S_HAS_SUBCAT'		=> ($visible_cats) ? true : false,
1235 1235
 
1236 1236
 			'U_MAKE_SEARCH'		=> append_sid("{$directory_root_path}directory_search.$phpEx"),
1237
-			'U_NEW_SITE' 		=> append_sid("{$directory_root_path}directory.$phpEx", "mode=new" . $param, true),
1237
+			'U_NEW_SITE' 		=> append_sid("{$directory_root_path}directory.$phpEx", "mode=new".$param, true),
1238 1238
 		));
1239 1239
 
1240 1240
 		$template->set_filenames(array('body' => $body));
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
  */
1250 1250
 class directory_cron extends link {
1251 1251
 
1252
-	var $categorie	= array();
1252
+	var $categorie = array();
1253 1253
 
1254 1254
 	/**
1255 1255
 	* Constructor
@@ -1277,16 +1277,16 @@  discard block
 block discarded – undo
1277 1277
 		),
1278 1278
 		'WHERE'		=> "l.link_back <> ''
1279 1279
 			AND l.link_active = 1
1280
-				AND link_cat = " . (int)$this->categorie['cat_id']
1280
+				AND link_cat = " . (int) $this->categorie['cat_id']
1281 1281
 		);
1282 1282
 		$sql = $db->sql_build_query('SELECT', $sql_array);
1283 1283
 		$result = $db->sql_query($sql);
1284 1284
 
1285 1285
 		while ($row = $db->sql_fetchrow($result))
1286 1286
 		{
1287
-			if(validate_link_back($row['link_back'], false, true) !== false)
1287
+			if (validate_link_back($row['link_back'], false, true) !== false)
1288 1288
 			{
1289
-				if(!$this->categorie['cat_cron_nb_check'] || ($row['link_nb_check']+1) >= $this->categorie['cat_cron_nb_check'])
1289
+				if (!$this->categorie['cat_cron_nb_check'] || ($row['link_nb_check'] + 1) >= $this->categorie['cat_cron_nb_check'])
1290 1290
 				{
1291 1291
 					$del_array[] = $row['link_id'];
1292 1292
 				}
@@ -1316,8 +1316,8 @@  discard block
 block discarded – undo
1316 1316
 		global $db;
1317 1317
 
1318 1318
 		$sql = 'SELECT cat_name
1319
-			FROM ' . DIR_CAT_TABLE . '
1320
-			WHERE cat_id = ' . (int)$this->categorie['cat_id'];
1319
+			FROM ' . DIR_CAT_TABLE.'
1320
+			WHERE cat_id = ' . (int) $this->categorie['cat_id'];
1321 1321
 		$result = $db->sql_query($sql, 3600);
1322 1322
 		$row = $db->sql_fetchrow($result);
1323 1323
 		$db->sql_freeresult($result);
@@ -1328,9 +1328,9 @@  discard block
 block discarded – undo
1328 1328
 
1329 1329
 			$this->check();
1330 1330
 
1331
-			$sql = 'UPDATE ' . DIR_CAT_TABLE . "
1331
+			$sql = 'UPDATE '.DIR_CAT_TABLE."
1332 1332
 			SET cat_cron_next = $next_prune
1333
-			WHERE cat_id = " . (int)$this->categorie['cat_id'];
1333
+			WHERE cat_id = ".(int) $this->categorie['cat_id'];
1334 1334
 			$db->sql_query($sql);
1335 1335
 
1336 1336
 			add_log('admin', 'LOG_DIR_AUTO_PRUNE', $row['cat_name']);
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
 		global $db, $phpbb_root_path;
1345 1345
 
1346 1346
 
1347
-		$sql = 'UPDATE ' . DIR_LINK_TABLE . '
1347
+		$sql = 'UPDATE '.DIR_LINK_TABLE.'
1348 1348
 			SET link_nb_check = link_nb_check + 1
1349 1349
 				WHERE ' . $db->sql_in_set('link_id', $u_array);
1350 1350
 		$db->sql_query($sql);
@@ -1358,15 +1358,15 @@  discard block
 block discarded – undo
1358 1358
 
1359 1359
 		$user->add_lang(array('common', 'mods/directory'));
1360 1360
 
1361
-		if(!class_exists('messenger'))
1361
+		if (!class_exists('messenger'))
1362 1362
 		{
1363
-			include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
1363
+			include($phpbb_root_path.'includes/functions_messenger.'.$phpEx);
1364 1364
 		}
1365
-		$messenger	= new messenger(false);
1365
+		$messenger = new messenger(false);
1366 1366
 
1367 1367
 		$row = array();
1368 1368
 		$next = (time() + ($this->categorie['cat_cron_freq'] * 86400));
1369
-		foreach($m_array as $row)
1369
+		foreach ($m_array as $row)
1370 1370
 		{
1371 1371
 			strip_bbcode($row['link_description']);
1372 1372
 
@@ -1376,10 +1376,10 @@  discard block
 block discarded – undo
1376 1376
 
1377 1377
 			$messenger->im($row['user_jabber'], $row['username']);
1378 1378
 
1379
-			$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
1380
-			$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
1381
-			$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
1382
-			$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
1379
+			$messenger->headers('X-AntiAbuse: Board servername - '.$config['server_name']);
1380
+			$messenger->headers('X-AntiAbuse: User_id - '.$user->data['user_id']);
1381
+			$messenger->headers('X-AntiAbuse: Username - '.$user->data['username']);
1382
+			$messenger->headers('X-AntiAbuse: User IP - '.$user->ip);
1383 1383
 
1384 1384
 			$messenger->assign_vars(array(
1385 1385
 				'USERNAME'			=> $row['username'],
@@ -1448,7 +1448,7 @@  discard block
 block discarded – undo
1448 1448
 		$img_file = strtolower($file).'.png';
1449 1449
 		if (file_exists('images/directory/flags/'.$img_file))
1450 1450
 		{
1451
-			$list .= '<option value="' . $img_file . '" ' . (($img_file == $value) ? 'selected="selected"' : '') . '>' . $name . '</option>';
1451
+			$list .= '<option value="'.$img_file.'" '.(($img_file == $value) ? 'selected="selected"' : '').'>'.$name.'</option>';
1452 1452
 		}
1453 1453
 	}
1454 1454
 
@@ -1532,9 +1532,9 @@  discard block
 block discarded – undo
1532 1532
 		if ($dir_cat_data['cat_parents'] == '')
1533 1533
 		{
1534 1534
 			$sql = 'SELECT cat_id, cat_name
1535
-				FROM ' . DIR_CAT_TABLE . '
1536
-				WHERE left_id < ' . (int)$dir_cat_data['left_id'] . '
1537
-					AND right_id > ' . (int)$dir_cat_data['right_id'] . '
1535
+				FROM ' . DIR_CAT_TABLE.'
1536
+				WHERE left_id < ' . (int) $dir_cat_data['left_id'].'
1537
+					AND right_id > ' . (int) $dir_cat_data['right_id'].'
1538 1538
 				ORDER BY left_id ASC';
1539 1539
 			$result = $db->sql_query($sql);
1540 1540
 
@@ -1546,9 +1546,9 @@  discard block
 block discarded – undo
1546 1546
 
1547 1547
 			$dir_cat_data['cat_parents'] = serialize($dir_cat_parents);
1548 1548
 
1549
-			$sql = 'UPDATE ' . DIR_CAT_TABLE . "
1550
-				SET cat_parents = '" . $db->sql_escape($dir_cat_data['cat_parents']) . "'
1551
-				WHERE parent_id = " . (int)$dir_cat_data['parent_id'];
1549
+			$sql = 'UPDATE '.DIR_CAT_TABLE."
1550
+				SET cat_parents = '" . $db->sql_escape($dir_cat_data['cat_parents'])."'
1551
+				WHERE parent_id = " . (int) $dir_cat_data['parent_id'];
1552 1552
 			$db->sql_query($sql);
1553 1553
 		}
1554 1554
 		else
@@ -1565,10 +1565,10 @@  discard block
 block discarded – undo
1565 1565
 	global $config, $db, $template, $user;
1566 1566
 	global $directory_root_path, $phpEx;
1567 1567
 
1568
-	if($config['dir_recent_block'])
1568
+	if ($config['dir_recent_block'])
1569 1569
 	{
1570
-		$limit_sql		= $config['dir_recent_rows'] * $config['dir_recent_columns'];
1571
-		$exclude_array	= explode(',', str_replace(' ', '', $config['dir_recent_exclude']));
1570
+		$limit_sql = $config['dir_recent_rows'] * $config['dir_recent_columns'];
1571
+		$exclude_array = explode(',', str_replace(' ', '', $config['dir_recent_exclude']));
1572 1572
 
1573 1573
 		$sql_array = array(
1574 1574
 			'SELECT'	=> 'l.link_id, l.link_cat, l.link_url, l.link_user_id, l.link_comment, l. link_description, l.link_vote, l.link_note, l.link_view, l.link_time, l.link_name, l.link_thumb, u.user_id, u.username, u.user_colour, c.cat_name',
@@ -1598,13 +1598,13 @@  discard block
 block discarded – undo
1598 1598
 		}
1599 1599
 		$db->sql_freeresult($result);
1600 1600
 
1601
-		if(sizeof($rowset))
1601
+		if (sizeof($rowset))
1602 1602
 		{
1603 1603
 			$template->assign_block_vars('block', array(
1604
-				'S_COL_WIDTH'			=> (100 / $config['dir_recent_columns']) . '%',
1604
+				'S_COL_WIDTH'			=> (100 / $config['dir_recent_columns']).'%',
1605 1605
 			));
1606 1606
 
1607
-			foreach($rowset as $row)
1607
+			foreach ($rowset as $row)
1608 1608
 			{
1609 1609
 				if (($num % $config['dir_recent_columns']) == 0)
1610 1610
 				{
@@ -1620,11 +1620,11 @@  discard block
 block discarded – undo
1620 1620
 					'COUNT'					=> $row['link_view'],
1621 1621
 					'COMMENT'				=> $row['link_comment'],
1622 1622
 
1623
-					'U_CAT'					=> append_sid("{$directory_root_path}directory.$phpEx", array('mode' => 'cat', 'id' => (int)$row['link_cat'])),
1624
-					'U_COMMENT'				=> append_sid("{$directory_root_path}directory_comment.$phpEx", array('u' => (int)$row['link_id'])),
1623
+					'U_CAT'					=> append_sid("{$directory_root_path}directory.$phpEx", array('mode' => 'cat', 'id' => (int) $row['link_cat'])),
1624
+					'U_COMMENT'				=> append_sid("{$directory_root_path}directory_comment.$phpEx", array('u' => (int) $row['link_id'])),
1625 1625
 
1626 1626
 					'L_DIR_SEARCH_NB_CLIC'	=> ($row['link_view'] > 1) ? $user->lang['DIR_SEARCH_NB_CLICS'] : $user->lang['DIR_SEARCH_NB_CLIC'],
1627
-					'L_DIR_SEARCH_NB_COMM'	=> ($row['link_comment'] > 1) ? $user->lang['L_DIR_SEARCH_NB_COMMS']: $user->lang['L_DIR_SEARCH_NB_COMM'],
1627
+					'L_DIR_SEARCH_NB_COMM'	=> ($row['link_comment'] > 1) ? $user->lang['L_DIR_SEARCH_NB_COMMS'] : $user->lang['L_DIR_SEARCH_NB_COMM'],
1628 1628
 				));
1629 1629
 				$num++;
1630 1630
 			}
@@ -1642,7 +1642,7 @@  discard block
 block discarded – undo
1642 1642
 {
1643 1643
 	global $config;
1644 1644
 
1645
-	if(!$cron)
1645
+	if (!$cron)
1646 1646
 	{
1647 1647
 		if (empty($remote_url) && $optional)
1648 1648
 		{
@@ -1667,7 +1667,7 @@  discard block
 block discarded – undo
1667 1667
 	{
1668 1668
 		$buff .= fgets($handle, 256);
1669 1669
 
1670
-		if(stristr($buff, $config['server_name']))
1670
+		if (stristr($buff, $config['server_name']))
1671 1671
 		{
1672 1672
 			@fclose($handle);
1673 1673
 			return false;
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1247,7 +1247,8 @@
 block discarded – undo
1247 1247
  * directory_cron class
1248 1248
  * @package phpBB3
1249 1249
  */
1250
-class directory_cron extends link {
1250
+class directory_cron extends link
1251
+{
1251 1252
 
1252 1253
 	var $categorie	= array();
1253 1254
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -899,7 +899,7 @@
 block discarded – undo
899 899
 	{
900 900
 		global $user;
901 901
 
902
-		$googleDomains = Array(".com", ".com.tr", ".de", ".fr", ".be", ".ca", ".ro", ".ch");
902
+		$googleDomains = array(".com", ".com.tr", ".de", ".fr", ".be", ".ca", ".ro", ".ch");
903 903
 		$seed = $user->lang['SEED'];
904 904
 		$result = 0x01020345;
905 905
 		$len = strlen($q);
Please login to merge, or discard this patch.
root/directory.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -188,8 +188,8 @@
 block discarded – undo
188 188
 	if(!$error)
189 189
 	{
190 190
 		/**
191
-		* No errrors, we execute heavy tasks wich need a valid url
192
-		*/
191
+		 * No errrors, we execute heavy tasks wich need a valid url
192
+		 */
193 193
 
194 194
 		// Banner
195 195
 		$link->banner_process($banner, $error);
Please login to merge, or discard this patch.
Spacing   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 define('IN_PHPBB', true);
19 19
 $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
20 20
 $phpEx = substr(strrchr(__FILE__, '.'), 1);
21
-include($phpbb_root_path . 'common.' . $phpEx);
22
-include($phpbb_root_path . 'includes/mods/directory/functions.' . $phpEx);
23
-include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
21
+include($phpbb_root_path.'common.'.$phpEx);
22
+include($phpbb_root_path.'includes/mods/directory/functions.'.$phpEx);
23
+include($phpbb_root_path.'includes/functions_display.'.$phpEx);
24 24
 $directory_root_path = $config['dir_root_path'];
25 25
 
26 26
 // Start session management
@@ -29,23 +29,23 @@  discard block
 block discarded – undo
29 29
 $user->setup('mods/directory');
30 30
 
31 31
 $mode 			= request_var('mode', '');
32
-$id				= request_var('id', 0);
33
-$u				= request_var('u', 0);
32
+$id = request_var('id', 0);
33
+$u = request_var('u', 0);
34 34
 $start			= request_var('start', 0);
35 35
 $submit			= (isset($_POST['submit'])) ? true : false;
36 36
 $refresh		= (isset($_POST['refresh_vc'])) ? true : false;
37
-$timestamp		= request_var('timestamp', 0);
37
+$timestamp = request_var('timestamp', 0);
38 38
 
39
-if($timestamp)
39
+if ($timestamp)
40 40
 {
41
-	echo $user->format_date((int)$timestamp);
41
+	echo $user->format_date((int) $timestamp);
42 42
 
43 43
 	garbage_collection();
44 44
 	exit_handler();
45 45
 }
46 46
 
47
-$categorie	= new categorie($id);
48
-$title		= $user->lang['DIRECTORY'];
47
+$categorie = new categorie($id);
48
+$title = $user->lang['DIRECTORY'];
49 49
 $s_hidden_fields = array();
50 50
 
51 51
 $template->assign_block_vars('navlinks', array(
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 	'U_VIEW_FORUM'	=> append_sid("{$directory_root_path}directory.$phpEx"))
54 54
 );
55 55
 
56
-if($submit || $refresh || $mode == 'new')
56
+if ($submit || $refresh || $mode == 'new')
57 57
 {
58 58
 	// The CAPTCHA kicks in here. We can't help that the information gets lost on language change.
59
-	if(!$user->data['is_registered'] && $config['dir_visual_confirm'])
59
+	if (!$user->data['is_registered'] && $config['dir_visual_confirm'])
60 60
 	{
61
-		include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
62
-		$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
61
+		include($phpbb_root_path.'includes/captcha/captcha_factory.'.$phpEx);
62
+		$captcha = & phpbb_captcha_factory::get_instance($config['captcha_plugin']);
63 63
 		$captcha->init(CONFIRM_POST);
64 64
 	}
65 65
 }
@@ -73,18 +73,18 @@  discard block
 block discarded – undo
73 73
 		redirect($redirect);
74 74
 	}
75 75
 
76
-	$sql = 'SELECT link_user_id FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int)$u;
76
+	$sql = 'SELECT link_user_id FROM '.DIR_LINK_TABLE.' WHERE link_id = '.(int) $u;
77 77
 	$result = $db->sql_query($sql);
78 78
 	$link_data = $db->sql_fetchrow($result);
79 79
 
80
-	if(empty($link_data))
80
+	if (empty($link_data))
81 81
 	{
82 82
 		trigger_error('DIR_ERROR_NO_LINKS');
83 83
 	}
84 84
 
85 85
 	$delete_allowed = $user->data['is_registered'] && ($auth->acl_get('m_delete_dir') || ($user->data['user_id'] == $link_data['link_user_id'] && $auth->acl_get('u_delete_dir')));
86 86
 
87
-	if(!$delete_allowed)
87
+	if (!$delete_allowed)
88 88
 	{
89 89
 		trigger_error('DIR_ERROR_NOT_AUTH');
90 90
 	}
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	$link->del($u, $id);
93 93
 }
94 94
 
95
-if (isset($_POST['submit_vote']) )
95
+if (isset($_POST['submit_vote']))
96 96
 {
97 97
 	if (!$auth->acl_get('u_vote_dir') || !$categorie->data['cat_allow_votes'])
98 98
 	{
@@ -114,16 +114,16 @@  discard block
 block discarded – undo
114 114
 		trigger_error('FORM_INVALID');
115 115
 	}
116 116
 
117
-	$url			= request_var('url', '');
118
-	$site_name		= utf8_normalize_nfc(request_var('site_name', '', true));
117
+	$url = request_var('url', '');
118
+	$site_name = utf8_normalize_nfc(request_var('site_name', '', true));
119 119
 	$description	= utf8_normalize_nfc(request_var('description', '', true));
120 120
 	$guest_email	= request_var('guest_email', '');
121
-	$rss			= request_var('rss', '');
122
-	$banner 		= request_var('banner', '');
123
-	$back			= request_var('back', '');
124
-	$flag 			= request_var('flag', '');
121
+	$rss = request_var('rss', '');
122
+	$banner = request_var('banner', '');
123
+	$back = request_var('back', '');
124
+	$flag = request_var('flag', '');
125 125
 
126
-	include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
126
+	include($phpbb_root_path.'includes/functions_user.'.$phpEx);
127 127
 
128 128
 	// We define variables to check
129 129
 	$data = array(
@@ -145,17 +145,17 @@  discard block
 block discarded – undo
145 145
 		'site_name' =>			array(
146 146
 			array('string', false, 1, 100)),
147 147
 		'website'		=>		array(
148
-			array('string',	false, 12, 255),
149
-			array('match',	true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
148
+			array('string', false, 12, 255),
149
+			array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
150 150
 		'description'	=>		array(
151 151
 			array('string', !$categorie->data['cat_must_describe'], 1, $config['dir_length_describe'])),
152 152
 		'rss'			=>		array(
153 153
 			array('string', true, 12, 255),
154
-			array('match',	empty($rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
154
+			array('match', empty($rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
155 155
 		'banner'		=>		array(
156 156
 			array('string', true, 5, 255)),
157 157
 		'back'			=>		array(
158
-			array('string',	!$categorie->data['cat_link_back'], 12, 255),
158
+			array('string', !$categorie->data['cat_link_back'], 12, 255),
159 159
 			array('link_back', true)),
160 160
 		'cat'			=>		array(
161 161
 			array('num', '', 1)));
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
166 166
 
167 167
 	// We check that url have good format
168
-	if(preg_match('/^(http|https):\/\//si', $url) && $config['dir_activ_checkurl'] && !$link->checkurl($url))
168
+	if (preg_match('/^(http|https):\/\//si', $url) && $config['dir_activ_checkurl'] && !$link->checkurl($url))
169 169
 	{
170 170
 		$error[] = $user->lang['DIR_ERROR_CHECK_URL'];
171 171
 	}
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 		}
186 186
 	}
187 187
 
188
-	if(!$error)
188
+	if (!$error)
189 189
 	{
190 190
 		/**
191 191
 		* No errrors, we execute heavy tasks wich need a valid url
@@ -204,19 +204,19 @@  discard block
 block discarded – undo
204 204
 	// Still no errors?? So let's go baby!
205 205
 	if (!$error)
206 206
 	{
207
-		$poll			= $uid			= $bitfield			= $options	= '';
208
-		$allow_bbcode	= $allow_urls	= $allow_smilies	= true;
207
+		$poll = $uid = $bitfield = $options = '';
208
+		$allow_bbcode = $allow_urls = $allow_smilies = true;
209 209
 		generate_text_for_storage($description, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies);
210 210
 
211
-		$banner	= (!$banner && !isset($_POST['delete_banner'])) ? request_var('old_banner', '') : $banner;
212
-		$url	= $link->clean_url($url);
211
+		$banner = (!$banner && !isset($_POST['delete_banner'])) ? request_var('old_banner', '') : $banner;
212
+		$url = $link->clean_url($url);
213 213
 
214 214
 		$data_edit = array(
215 215
 			'link_guest_email'	=> $guest_email,
216 216
 			'link_name'			=> $site_name,
217 217
 			'link_url'			=> $url,
218 218
 			'link_description'	=> $description,
219
-			'link_cat'			=> (int)$id,
219
+			'link_cat'			=> (int) $id,
220 220
 			'link_rss'			=> $rss,
221 221
 			'link_banner'		=> $banner,
222 222
 			'link_back'			=> $back,
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 			'link_flags'		=> $options,
225 225
 			'link_flag'			=> $flag,
226 226
 			'link_bitfield'		=> $bitfield,
227
-			'link_pagerank'		=> (int)$pagerank,
227
+			'link_pagerank'		=> (int) $pagerank,
228 228
 			'link_thumb'		=> $thumb,
229 229
 		);
230 230
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 				'link_time'			=> time(),
242 242
 				'link_view'			=> 0,
243 243
 				'link_active'		=> $need_approval ? false : true,
244
-				'link_user_id'		=> (int)$user->data['user_id'],
244
+				'link_user_id'		=> (int) $user->data['user_id'],
245 245
 			);
246 246
 
247 247
 			$data_add = array_merge($data_edit, $data_add);
@@ -259,13 +259,13 @@  discard block
 block discarded – undo
259 259
 		$meta_info = append_sid("{$directory_root_path}directory.$phpEx", "mode=cat&amp;id=$id");
260 260
 		meta_refresh(3, $meta_info);
261 261
 		$message	= ($need_approval) ? $user->lang['DIR_'.strtoupper($mode).'_SITE_ACTIVE'] : $user->lang['DIR_'.strtoupper($mode).'_SITE_OK'];
262
-		$message	= $message . "<br /><br />" . sprintf($user->lang['DIR_CLICK_RETURN_DIR'], '<a href="' . append_sid("{$directory_root_path}directory.$phpEx") . '">', '</a>') . '<br /><br />' . sprintf($user->lang['DIR_CLICK_RETURN_CAT'], '<a href="' . append_sid("{$directory_root_path}directory.$phpEx", "mode=cat&amp;id=$id") . '">', '</a>');
262
+		$message	= $message."<br /><br />".sprintf($user->lang['DIR_CLICK_RETURN_DIR'], '<a href="'.append_sid("{$directory_root_path}directory.$phpEx").'">', '</a>').'<br /><br />'.sprintf($user->lang['DIR_CLICK_RETURN_CAT'], '<a href="'.append_sid("{$directory_root_path}directory.$phpEx", "mode=cat&amp;id=$id").'">', '</a>');
263 263
 		trigger_error($message);
264 264
 
265 265
 	}
266 266
 	else
267 267
 	{
268
-		if($mode == 'edit')
268
+		if ($mode == 'edit')
269 269
 		{
270 270
 			$s_hidden_fields = array(
271 271
 				'old_cat_id'	=> request_var('old_cat_id', 0),
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 			);
274 274
 		}
275 275
 
276
-		$template->assign_vars( array(
276
+		$template->assign_vars(array(
277 277
 			'ERROR'	=> (isset($error)) ? implode('<br />', $error) : ''
278 278
 		));
279 279
 	}
@@ -287,18 +287,18 @@  discard block
 block discarded – undo
287 287
 		if (request_var('notif', 0))
288 288
 		{
289 289
 			$data = array(
290
-				'n_user_id' => (int)$user->data['user_id'],
291
-				'n_cat_id' 	=> (int)$id,
290
+				'n_user_id' => (int) $user->data['user_id'],
291
+				'n_cat_id' 	=> (int) $id,
292 292
 			);
293 293
 
294
-			$sql = 'INSERT INTO ' . DIR_NOTIFICATION_TABLE . ' ' . $db->sql_build_array('INSERT', $data);
294
+			$sql = 'INSERT INTO '.DIR_NOTIFICATION_TABLE.' '.$db->sql_build_array('INSERT', $data);
295 295
 			$db->sql_query($sql);
296 296
 		}
297 297
 		else
298 298
 		{
299
-			$sql = 'DELETE FROM ' . DIR_NOTIFICATION_TABLE . '
300
-						WHERE n_user_id = ' . (int)$user->data['user_id'] . '
301
-							AND n_cat_id = ' . (int)$id;
299
+			$sql = 'DELETE FROM '.DIR_NOTIFICATION_TABLE.'
300
+						WHERE n_user_id = ' . (int) $user->data['user_id'].'
301
+							AND n_cat_id = ' . (int) $id;
302 302
 			$db->sql_query($sql);
303 303
 		}
304 304
 	}
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 
314 314
 	if ($mode == 'edit')
315 315
 	{
316
-		$sql = 'SELECT link_user_id FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int)$u;
316
+		$sql = 'SELECT link_user_id FROM '.DIR_LINK_TABLE.' WHERE link_id = '.(int) $u;
317 317
 		$result = $db->sql_query($sql);
318 318
 		$link_data = $db->sql_fetchrow($result);
319 319
 
@@ -335,8 +335,8 @@  discard block
 block discarded – undo
335 335
 
336 336
 	if (!$submit && ($mode == 'edit'))
337 337
 	{
338
-		$sql = 'SELECT link_id, link_uid, 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 FROM ' . DIR_LINK_TABLE . '
339
-				WHERE link_id = ' . (int)$u;
338
+		$sql = 'SELECT link_id, link_uid, 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 FROM '.DIR_LINK_TABLE.'
339
+				WHERE link_id = ' . (int) $u;
340 340
 		$result = $db->sql_query($sql);
341 341
 
342 342
 		$site = $db->sql_fetchrow($result);
@@ -354,15 +354,15 @@  discard block
 block discarded – undo
354 354
 		$description = generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']);
355 355
 		$site['link_banner'] = (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : '';
356 356
 
357
-		$url			= $site['link_url'];
358
-		$site_name		= $site['link_name'];
357
+		$url = $site['link_url'];
358
+		$site_name = $site['link_name'];
359 359
 		$description	= $description['text'];
360 360
 		$guest_email	= $site['link_guest_email'];
361
-		$rss			= $site['link_rss'];
362
-		$banner 		= $site['link_banner'];
363
-		$back			= $site['link_back'];
364
-		$flag 			= $site['link_flag'];
365
-		$id				= $site['link_cat'];
361
+		$rss = $site['link_rss'];
362
+		$banner = $site['link_banner'];
363
+		$back = $site['link_back'];
364
+		$flag = $site['link_flag'];
365
+		$id = $site['link_cat'];
366 366
 	}
367 367
 
368 368
 	if (!$user->data['is_registered'] && $config['dir_visual_confirm'] && $mode == 'new')
@@ -377,14 +377,14 @@  discard block
 block discarded – undo
377 377
 	}
378 378
 
379 379
 	// We get config for display options
380
-	$bbcode_status	= ($config['dir_allow_bbcode'] || $auth->acl_get('a_')) ? true : false;
381
-	$smilies_status	= ($bbcode_status && $config['dir_allow_smilies'] || $auth->acl_get('a_')) ? true : false;
380
+	$bbcode_status = ($config['dir_allow_bbcode'] || $auth->acl_get('a_')) ? true : false;
381
+	$smilies_status = ($bbcode_status && $config['dir_allow_smilies'] || $auth->acl_get('a_')) ? true : false;
382 382
 	$img_status		= ($bbcode_status || $auth->acl_get('a_')) ? true : false;
383 383
 	$url_status		= ($config['dir_allow_links']) ? true : false;
384 384
 
385 385
 	$s_guest	= (!$user->data['is_registered'] || !empty($guest_email));
386
-	$s_rss		= $config['dir_activ_rss'];
387
-	$s_banner	= $config['dir_activ_banner'];
386
+	$s_rss = $config['dir_activ_rss'];
387
+	$s_banner = $config['dir_activ_banner'];
388 388
 	$s_back		= $categorie->data['cat_link_back'];
389 389
 	$s_flag		= $config['dir_activ_flag'];
390 390
 
@@ -392,11 +392,11 @@  discard block
 block discarded – undo
392 392
 	$user->add_lang('posting');
393 393
 	display_custom_bbcodes();
394 394
 
395
-	$flag_path	= $phpbb_root_path.'images/directory/flags/';
396
-	$flag		= isset($flag) ? $flag : '';
395
+	$flag_path = $phpbb_root_path.'images/directory/flags/';
396
+	$flag = isset($flag) ? $flag : '';
397 397
 
398
-	$template->assign_vars( array(
399
-		'BBCODE_STATUS'			=> ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid($phpbb_root_path."faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid($phpbb_root_path."faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
398
+	$template->assign_vars(array(
399
+		'BBCODE_STATUS'			=> ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="'.append_sid($phpbb_root_path."faq.$phpEx", 'mode=bbcode').'">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="'.append_sid($phpbb_root_path."faq.$phpEx", 'mode=bbcode').'">', '</a>'),
400 400
 		'IMG_STATUS'			=> ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
401 401
 		'SMILIES_STATUS'		=> ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
402 402
 		'URL_STATUS'			=> ($bbcode_status && $url_status) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'],
@@ -411,10 +411,10 @@  discard block
 block discarded – undo
411 411
 		'S_BANNER'				=> $s_banner ? true : false,
412 412
 		'S_BACK'				=> $s_back ? true : false,
413 413
 		'S_FLAG'				=> $s_flag ? true : false,
414
-		'S_BBCODE_ALLOWED' 		=> (bool)$bbcode_status,
414
+		'S_BBCODE_ALLOWED' 		=> (bool) $bbcode_status,
415 415
 
416 416
 		'DIR_FLAG_PATH'			=> $flag_path,
417
-		'DIR_FLAG_IMAGE'		=> $flag ? $flag_path . $flag : $phpbb_root_path . 'images/spacer.gif',
417
+		'DIR_FLAG_IMAGE'		=> $flag ? $flag_path.$flag : $phpbb_root_path.'images/spacer.gif',
418 418
 
419 419
 		'EDIT_MODE'				=> ($mode == 'edit') ? true : false,
420 420
 
@@ -446,17 +446,17 @@  discard block
 block discarded – undo
446 446
 
447 447
 	$link_list = array();
448 448
 	$sort_days	= request_var('st', 0);
449
-	$sort_key	= request_var('sk', (string)substr($config['dir_default_order'], 0, 1));
450
-	$sort_dir	= request_var('sd', (string)substr($config['dir_default_order'], 2));
449
+	$sort_key	= request_var('sk', (string) substr($config['dir_default_order'], 0, 1));
450
+	$sort_dir	= request_var('sd', (string) substr($config['dir_default_order'], 2));
451 451
 
452 452
 	// We gete notification status
453 453
 
454 454
 	$data = array(
455
-		'n_user_id' 	=> (int)$user->data['user_id'],
456
-		'n_cat_id' 	=> (int)$id,
455
+		'n_user_id' 	=> (int) $user->data['user_id'],
456
+		'n_cat_id' 	=> (int) $id,
457 457
 	);
458 458
 
459
-	$sql = 'SELECT n_user_id FROM ' . DIR_NOTIFICATION_TABLE . ' WHERE ' . $db->sql_build_array('SELECT', $data);
459
+	$sql = 'SELECT n_user_id FROM '.DIR_NOTIFICATION_TABLE.' WHERE '.$db->sql_build_array('SELECT', $data);
460 460
 	$result = $db->sql_query($sql);
461 461
 	$cat = $db->sql_fetchrow($result);
462 462
 
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 	$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
469 469
 	gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
470 470
 
471
-	$u_sort_param = ($sort_days === 0 && $sort_key == (string)substr($config['dir_default_order'], 0, 1) && $sort_dir == (string)substr($config['dir_default_order'], 2)) ? '' : '&amp;'.$u_sort_param;
471
+	$u_sort_param = ($sort_days === 0 && $sort_key == (string) substr($config['dir_default_order'], 0, 1) && $sort_dir == (string) substr($config['dir_default_order'], 2)) ? '' : '&amp;'.$u_sort_param;
472 472
 
473 473
 	// A deadline has been selected
474 474
 	if ($sort_days)
@@ -476,8 +476,8 @@  discard block
 block discarded – undo
476 476
 		$min_post_time = time() - ($sort_days * 86400);
477 477
 
478 478
 		$sql = 'SELECT COUNT(link_id) AS nb_links
479
-			FROM ' . DIR_LINK_TABLE . '
480
-			WHERE link_cat = ' . (int)$id . '
479
+			FROM ' . DIR_LINK_TABLE.'
480
+			WHERE link_cat = ' . (int) $id.'
481 481
 				AND link_time >= ' . $min_post_time;
482 482
 		$result = $db->sql_query($sql);
483 483
 		$nb_links = (int) $db->sql_fetchfield('nb_links');
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 	else
493 493
 	{
494 494
 		$sql_limit_time = '';
495
-		$nb_links		= $categorie->data['cat_links'];
495
+		$nb_links = $categorie->data['cat_links'];
496 496
 	}
497 497
 
498 498
 	// Make sure $start is set to the last page if it exceeds the amount
@@ -503,13 +503,13 @@  discard block
 block discarded – undo
503 503
 
504 504
 	$categorie->display();
505 505
 
506
-	$title .= ' - ' . $categorie->data['cat_name'];
506
+	$title .= ' - '.$categorie->data['cat_name'];
507 507
 
508 508
 	// Build navigation links
509 509
 	generate_dir_nav($categorie->data);
510 510
 
511 511
 	$template->assign_vars(array(
512
-		'L_DIR_CAT_NAME'		=> $user->lang['DIR_CAT_NAME'] . ': ' . $categorie->data['cat_name'],
512
+		'L_DIR_CAT_NAME'		=> $user->lang['DIR_CAT_NAME'].': '.$categorie->data['cat_name'],
513 513
 		'L_DIR_NOTIFICATION'	=> (($cat['n_user_id']) ? $user->lang['DIR_BE_NOT_NOTIFIED'] : $user->lang['DIR_BE_NOTIFIED']),
514 514
 
515 515
 		'U_PAGE'				=> append_sid("{$directory_root_path}directory.$phpEx", "mode=cat&amp;id=$id{$u_sort_param}", true),
@@ -544,14 +544,14 @@  discard block
 block discarded – undo
544 544
 		}
545 545
 
546 546
 		// Select the sort order
547
-		$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'ASC' : 'DESC');
548
-		$sql_start		= max(0, $nb_links - $sql_limit - $start);
547
+		$sql_sort_order = $sort_by_sql[$sort_key].' '.(($sort_dir == 'd') ? 'ASC' : 'DESC');
548
+		$sql_start = max(0, $nb_links - $sql_limit - $start);
549 549
 	}
550 550
 	else
551 551
 	{
552 552
 		// Select the sort order
553
-		$sql_sort_order	= $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
554
-		$sql_start		= $start;
553
+		$sql_sort_order = $sort_by_sql[$sort_key].' '.(($sort_dir == 'd') ? 'DESC' : 'ASC');
554
+		$sql_start = $start;
555 555
 	}
556 556
 
557 557
 	// Grab just the sorted link ids
@@ -595,10 +595,10 @@  discard block
 block discarded – undo
595 595
 					),
596 596
 					array(
597 597
 						'FROM'	=> array(DIR_VOTE_TABLE => 'v'),
598
-						'ON'	=> 'l.link_id = v.vote_link_id AND v.vote_user_id = ' . $user->data['user_id']
598
+						'ON'	=> 'l.link_id = v.vote_link_id AND v.vote_user_id = '.$user->data['user_id']
599 599
 					)
600 600
 			),
601
-			'WHERE'		=> $db->sql_in_set('l.link_id', $link_list). $sql_limit_time);
601
+			'WHERE'		=> $db->sql_in_set('l.link_id', $link_list).$sql_limit_time);
602 602
 
603 603
 		$sql = $db->sql_build_query('SELECT', $sql_array);
604 604
 		$result = $db->sql_query($sql);
@@ -611,8 +611,8 @@  discard block
 block discarded – undo
611 611
 
612 612
 		$link_list = ($store_reverse) ? array_reverse($link_list) : $link_list;
613 613
 
614
-		$votes_status 		= ((int)$categorie->data['cat_allow_votes']) ? true : false;
615
-		$comments_status 	= ((int)$categorie->data['cat_allow_comments']) ? true : false;
614
+		$votes_status = ((int) $categorie->data['cat_allow_votes']) ? true : false;
615
+		$comments_status = ((int) $categorie->data['cat_allow_comments']) ? true : false;
616 616
 
617 617
 		foreach ($link_list as $link_id)
618 618
 		{
@@ -622,12 +622,12 @@  discard block
 block discarded – undo
622 622
 			$s_note		= $link->display_note($site['link_note'], $site['link_vote'], $votes_status);
623 623
 			$s_thumb	= $link->display_thumb($site);
624 624
 			$s_vote		= $link->display_vote($site, $votes_status);
625
-			$s_comment	= $link->display_comm($site['link_id'], $site['link_comment'], $comments_status);
626
-			$s_banner	= $link->display_bann($site);
627
-			$s_pr		= $link->display_pagerank($site);
628
-			$s_rss		= $site['link_rss'];
625
+			$s_comment = $link->display_comm($site['link_id'], $site['link_comment'], $comments_status);
626
+			$s_banner = $link->display_bann($site);
627
+			$s_pr = $link->display_pagerank($site);
628
+			$s_rss = $site['link_rss'];
629 629
 
630
-			$edit_allowed 	= ($user->data['is_registered'] && ($auth->acl_get('m_edit_dir') || ($user->data['user_id'] == $site['link_user_id'] && $auth->acl_get('u_edit_dir'))));
630
+			$edit_allowed = ($user->data['is_registered'] && ($auth->acl_get('m_edit_dir') || ($user->data['user_id'] == $site['link_user_id'] && $auth->acl_get('u_edit_dir'))));
631 631
 			$delete_allowed = ($user->data['is_registered'] && ($auth->acl_get('m_delete_dir') || ($user->data['user_id'] == $site['link_user_id'] && $auth->acl_get('u_delete_dir'))));
632 632
 
633 633
 			$template->assign_block_vars('site', array(
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
 				'DESCRIPTION' 	=> generate_text_for_display($site['link_description'], $site['link_uid'], $site['link_bitfield'], $site['link_flags']),
637 637
 				'THUMB'			=> '<img src="'.$s_thumb.'" alt="'.$user->lang['DIR_THUMB'].'" title="'.$site['link_name'].'"/>',
638 638
 				'NOTE'			=> $s_note,
639
-				'NB_VOTE'		=> ($site['link_vote'] > 1) ? $user->lang('DIR_NB_VOTES', $site['link_vote'])  : sprintf($user->lang['DIR_NB_VOTE'], $site['link_vote']),
639
+				'NB_VOTE'		=> ($site['link_vote'] > 1) ? $user->lang('DIR_NB_VOTES', $site['link_vote']) : sprintf($user->lang['DIR_NB_VOTE'], $site['link_vote']),
640 640
 				'VOTE'			=> $s_vote,
641 641
 				'PAGERANK'		=> $s_pr,
642 642
 				'COMMENT'		=> $s_comment,
@@ -653,15 +653,15 @@  discard block
 block discarded – undo
653 653
 				'ON_CLICK' 		=> "onclick=\"window.open('".append_sid($directory_root_path.'directory.'.$phpEx, array('mode' => 'view_url', 'u' => $site['link_id']))."');return false;\"",
654 654
 
655 655
 				'U_LINK'	=> $site['link_url'],
656
-				'U_EDIT'	=> ($edit_allowed) ? append_sid("{$directory_root_path}directory.$phpEx", "mode=edit&amp;id=$id&amp;u=" . $site['link_id'], true) : '',
657
-				'U_DELETE'	=> ($delete_allowed) ? append_sid("{$directory_root_path}directory.$phpEx", "mode=delete&amp;id=$id&amp;u=" . $site['link_id'], true) : '',
656
+				'U_EDIT'	=> ($edit_allowed) ? append_sid("{$directory_root_path}directory.$phpEx", "mode=edit&amp;id=$id&amp;u=".$site['link_id'], true) : '',
657
+				'U_DELETE'	=> ($delete_allowed) ? append_sid("{$directory_root_path}directory.$phpEx", "mode=delete&amp;id=$id&amp;u=".$site['link_id'], true) : '',
658 658
 			));
659 659
 		}
660 660
 
661 661
 		// Links back verification is on, we do a checkup
662 662
 		if ($categorie->data['cat_cron_enable'] && $categorie->data['cat_cron_next'] < time())
663 663
 		{
664
-			$template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid($phpbb_root_path . 'cron.' . $phpEx, 'cron_type=prune_directory&amp;cat=' . $id) . '" alt="cron" width="1" height="1" />');
664
+			$template->assign_var('RUN_CRON_TASK', '<img src="'.append_sid($phpbb_root_path.'cron.'.$phpEx, 'cron_type=prune_directory&amp;cat='.$id).'" alt="cron" width="1" height="1" />');
665 665
 		}
666 666
 	}
667 667
 	else
Please login to merge, or discard this patch.
root/directory_search.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 define('IN_PHPBB', true);
19 19
 $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
20 20
 $phpEx = substr(strrchr(__FILE__, '.'), 1);
21
-include($phpbb_root_path . 'common.' . $phpEx);
22
-include($phpbb_root_path . 'includes/mods/directory/functions.' . $phpEx);
21
+include($phpbb_root_path.'common.'.$phpEx);
22
+include($phpbb_root_path.'includes/mods/directory/functions.'.$phpEx);
23 23
 $directory_root_path = $config['dir_root_path'];
24 24
 
25 25
 // Start session management
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
 $user->setup('mods/directory');
29 29
 
30 30
 $keyword	= utf8_normalize_nfc(trim(request_var('keyword', '', true)));
31
-$cat		= request_var('cat', 0);
31
+$cat = request_var('cat', 0);
32 32
 $method		= request_var('search_method', 'any');
33 33
 $fields		= request_var('sf', 'all');
34
-$categorie	= new categorie();
35
-$start		= request_var('start', 0);
34
+$categorie = new categorie();
35
+$start = request_var('start', 0);
36 36
 
37 37
 $template->assign_block_vars('navlinks', array(
38 38
 	'FORUM_NAME'	=> $user->lang['DIRECTORY'],
@@ -64,16 +64,16 @@  discard block
 block discarded – undo
64 64
 			switch ($fields)
65 65
 			{
66 66
 				case 'titleonly':
67
-					$ssql .= ' (LOWER(a.link_name) ' . $db->sql_like_expression(str_replace('*', $db->any_char, $db->any_char . strtolower($db->sql_escape($keytab[$i])) . $db->any_char)) .')';
67
+					$ssql .= ' (LOWER(a.link_name) '.$db->sql_like_expression(str_replace('*', $db->any_char, $db->any_char.strtolower($db->sql_escape($keytab[$i])).$db->any_char)).')';
68 68
 					break;
69 69
 
70 70
 				case 'desconly':
71
-					$ssql .= ' (LOWER(a.link_description) ' . $db->sql_like_expression(str_replace('*', $db->any_char, $db->any_char . strtolower($db->sql_escape($keytab[$i])) . $db->any_char)) .')';
71
+					$ssql .= ' (LOWER(a.link_description) '.$db->sql_like_expression(str_replace('*', $db->any_char, $db->any_char.strtolower($db->sql_escape($keytab[$i])).$db->any_char)).')';
72 72
 					break;
73 73
 
74 74
 				default:
75
-					$ssql .= ' (LOWER(a.link_name) ' . $db->sql_like_expression(str_replace('*', $db->any_char, $db->any_char . strtolower($db->sql_escape($keytab[$i])) . $db->any_char));
76
-					$ssql .= ' OR LOWER(a.link_description) ' . $db->sql_like_expression(str_replace('*', $db->any_char, $db->any_char . strtolower($db->sql_escape($keytab[$i])) . $db->any_char)) .')';
75
+					$ssql .= ' (LOWER(a.link_name) '.$db->sql_like_expression(str_replace('*', $db->any_char, $db->any_char.strtolower($db->sql_escape($keytab[$i])).$db->any_char));
76
+					$ssql .= ' OR LOWER(a.link_description) '.$db->sql_like_expression(str_replace('*', $db->any_char, $db->any_char.strtolower($db->sql_escape($keytab[$i])).$db->any_char)).')';
77 77
 					break;
78 78
 			}
79 79
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 		if (!empty($cat))
84 84
 		{
85
-			$ssql .= ' AND a.link_cat = ' . (int)$cat;
85
+			$ssql .= ' AND a.link_cat = '.(int) $cat;
86 86
 		}
87 87
 
88 88
 		$sql_array = array(
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 						'ON'	=> 'u.user_id = a.link_user_id'
100 100
 					)
101 101
 			),
102
-			'WHERE'		=> $ssql . ' AND a.link_active = 1',
102
+			'WHERE'		=> $ssql.' AND a.link_active = 1',
103 103
 			'ORDER_BY'	=> 'a.link_name ASC');
104 104
 
105 105
 		$sql = $db->sql_build_query('SELECT', $sql_array);
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 	{
124 124
 		$have_result = true;
125 125
 
126
-		$s_banner	= $link->display_bann($data);
127
-		$s_thumb	= $link->display_thumb($data);
126
+		$s_banner = $link->display_bann($data);
127
+		$s_thumb = $link->display_thumb($data);
128 128
 
129 129
 		$template->assign_block_vars('result', array(
130 130
 			'S_SITE'		=> $data['link_name'],
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
 
138 138
 			'THUMB'		=> '<img src="'.$s_thumb.'" alt="'.$user->lang['DIR_THUMB'].'" title="'.$data['link_name'].'"/>',
139 139
 			'IMG_BANNER'	=> $s_banner,
140
-			'IMG_FLAG'		=> (($data['link_flag'] == '') ? '' : '&nbsp;<img src="' . $phpbb_root_path . 'images/directory/flags/' . $data['link_flag'] . '" alt="' . $data['link_flag'] . '" title="' . $data['link_flag'] . '" border="0" width="17" height="12" />&nbsp;'),
140
+			'IMG_FLAG'		=> (($data['link_flag'] == '') ? '' : '&nbsp;<img src="'.$phpbb_root_path.'images/directory/flags/'.$data['link_flag'].'" alt="'.$data['link_flag'].'" title="'.$data['link_flag'].'" border="0" width="17" height="12" />&nbsp;'),
141 141
 			'ON_CLICK' 		=> "onclick=\"window.open('".append_sid($directory_root_path.'directory.'.$phpEx, array('mode' => 'view_url', 'u' => $data['link_id']))."');return false;\"",
142 142
 
143 143
 			'L_DIR_SEARCH_NB_CLIC'	=> ($data['link_view'] > 1) ? $user->lang['DIR_SEARCH_NB_CLICS'] : $user->lang['DIR_SEARCH_NB_CLIC'],
144
-			'L_DIR_SEARCH_NB_COMM'	=> ($data['link_comment'] > 1) ? $user->lang['L_DIR_SEARCH_NB_COMMS']: $user->lang['L_DIR_SEARCH_NB_COMM'],
144
+			'L_DIR_SEARCH_NB_COMM'	=> ($data['link_comment'] > 1) ? $user->lang['L_DIR_SEARCH_NB_COMMS'] : $user->lang['L_DIR_SEARCH_NB_COMM'],
145 145
 
146 146
 			'U_SITE'		=> $data['link_url'],
147 147
 			'LINK_ID'		=> $data['link_id'],
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	}
161 161
 }
162 162
 
163
-$template->assign_vars( array(
163
+$template->assign_vars(array(
164 164
 	'AND_SELECT'	=> ($method == 'all') ? 'checked="checked"' : '',
165 165
 	'OR_SELECT'		=> ($method == 'any') ? 'checked="checked"' : '',
166 166
 	'ALL_SELECT'	=> ($fields == 'all') ? 'checked="checked"' : '',
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	'S_HAVE_SEARCH'	=> $have_search,
174 174
 	'S_HAVE_RESULT'	=> $have_result,
175 175
 
176
-	'U_SOMMAIRE'	=> append_sid('directory.' . $phpEx)
176
+	'U_SOMMAIRE'	=> append_sid('directory.'.$phpEx)
177 177
 ));
178 178
 
179 179
 page_header($user->lang['DIR_MAKE_SEARCH'], false);
Please login to merge, or discard this patch.
root/language/sr/mods/info_acp_directory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
 	'DIR_DELETE_ALL_LINKS'					=> 'izbrisati sve vebsajtove',
98 98
 	'DIR_DELETE_ORPHANS'					=> 'Izbrisati orphan banere',
99 99
 	'DIR_DELETE_ORPHANS_CONFIRM'			=> 'Da li ste sigurni da zelite da izbrisete orphan banere?',
100
-	'DIR_DELETE_ORPHANS_EXPLAIN'			=> 'Orphan baneri su baneri koji su kopirani na server ali iz nepoznatog razloga nisu vise povezani sa direktorijumom vebsajta.' ,
100
+	'DIR_DELETE_ORPHANS_EXPLAIN'			=> 'Orphan baneri su baneri koji su kopirani na server ali iz nepoznatog razloga nisu vise povezani sa direktorijumom vebsajta.',
101 101
 	'DIR_DELETE_SUBCATS'					=> 'Izbrisati vebsajtove i kategorije',
102 102
 	'DIR_DOWNLOAD_LATEST'					=> 'Download poslednju verziju',
103 103
 	'DIR_EDIT_CAT'							=> 'Izmeniti kategoriju',
Please login to merge, or discard this patch.
root/includes/acp/info/acp_directory.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -14,27 +14,27 @@
 block discarded – undo
14 14
 */
15 15
 class acp_directory_info
16 16
 {
17
-    function module()
18
-    {
19
-        return array(
20
-            'filename'		=> 'acp_directory',
21
-            'title'			=> 'ACP_DIRECTORY',
22
-            'version'		=> '1.0.1',
23
-            'modes'			=> array(
24
-            	''				=> array('title' => 'ACP_DIRECTORY',			'auth'	=> 'acl_a_board', 'cat' => array('')),
25
-            	'main'			=> array('title' => 'ACP_DIRECTORY_MAIN',		'auth'	=> 'acl_a_board', 'cat' => array('ACP_DIRECTORY')),
17
+	function module()
18
+	{
19
+		return array(
20
+			'filename'		=> 'acp_directory',
21
+			'title'			=> 'ACP_DIRECTORY',
22
+			'version'		=> '1.0.1',
23
+			'modes'			=> array(
24
+				''				=> array('title' => 'ACP_DIRECTORY',			'auth'	=> 'acl_a_board', 'cat' => array('')),
25
+				'main'			=> array('title' => 'ACP_DIRECTORY_MAIN',		'auth'	=> 'acl_a_board', 'cat' => array('ACP_DIRECTORY')),
26 26
 				'settings'		=> array('title' => 'ACP_DIRECTORY_SETTINGS',	'auth'	=> 'acl_a_board', 'cat' => array('ACP_DIRECTORY')),
27 27
 				'cat'			=> array('title' => 'ACP_DIRECTORY_CATS',		'auth'	=> 'acl_a_board', 'cat' => array('ACP_DIRECTORY')),
28 28
 				'val'			=> array('title' => 'ACP_DIRECTORY_VAL',		'auth'	=> 'acl_a_board', 'cat' => array('ACP_DIRECTORY')),
29
-            ),
30
-        );
31
-    }
29
+			),
30
+		);
31
+	}
32 32
 
33
-    function install()
34
-    {
35
-    }
33
+	function install()
34
+	{
35
+	}
36 36
 
37
-    function uninstall()
38
-    {
39
-    }
37
+	function uninstall()
38
+	{
39
+	}
40 40
 }
41 41
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,11 +21,11 @@
 block discarded – undo
21 21
             'title'			=> 'ACP_DIRECTORY',
22 22
             'version'		=> '1.0.1',
23 23
             'modes'			=> array(
24
-            	''				=> array('title' => 'ACP_DIRECTORY',			'auth'	=> 'acl_a_board', 'cat' => array('')),
25
-            	'main'			=> array('title' => 'ACP_DIRECTORY_MAIN',		'auth'	=> 'acl_a_board', 'cat' => array('ACP_DIRECTORY')),
26
-				'settings'		=> array('title' => 'ACP_DIRECTORY_SETTINGS',	'auth'	=> 'acl_a_board', 'cat' => array('ACP_DIRECTORY')),
27
-				'cat'			=> array('title' => 'ACP_DIRECTORY_CATS',		'auth'	=> 'acl_a_board', 'cat' => array('ACP_DIRECTORY')),
28
-				'val'			=> array('title' => 'ACP_DIRECTORY_VAL',		'auth'	=> 'acl_a_board', 'cat' => array('ACP_DIRECTORY')),
24
+            	''				=> array('title' => 'ACP_DIRECTORY', 'auth'	=> 'acl_a_board', 'cat' => array('')),
25
+            	'main'			=> array('title' => 'ACP_DIRECTORY_MAIN', 'auth'	=> 'acl_a_board', 'cat' => array('ACP_DIRECTORY')),
26
+				'settings'		=> array('title' => 'ACP_DIRECTORY_SETTINGS', 'auth'	=> 'acl_a_board', 'cat' => array('ACP_DIRECTORY')),
27
+				'cat'			=> array('title' => 'ACP_DIRECTORY_CATS', 'auth'	=> 'acl_a_board', 'cat' => array('ACP_DIRECTORY')),
28
+				'val'			=> array('title' => 'ACP_DIRECTORY_VAL', 'auth'	=> 'acl_a_board', 'cat' => array('ACP_DIRECTORY')),
29 29
             ),
30 30
         );
31 31
     }
Please login to merge, or discard this patch.
root/directory_comment.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 define('IN_PHPBB', true);
19 19
 $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
20 20
 $phpEx = substr(strrchr(__FILE__, '.'), 1);
21
-include($phpbb_root_path . 'common.' . $phpEx);
22
-include($phpbb_root_path . 'includes/mods/directory/functions.' . $phpEx);
23
-include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
24
-include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
21
+include($phpbb_root_path.'common.'.$phpEx);
22
+include($phpbb_root_path.'includes/mods/directory/functions.'.$phpEx);
23
+include($phpbb_root_path.'includes/functions_posting.'.$phpEx);
24
+include($phpbb_root_path.'includes/functions_display.'.$phpEx);
25 25
 $directory_root_path = $config['dir_root_path'];
26 26
 
27 27
 // Start session management
@@ -32,18 +32,18 @@  discard block
 block discarded – undo
32 32
 $mode = request_var('mode', '');
33 33
 $u = request_var('u', 0);
34 34
 $id = request_var('id', 0);
35
-$start	= request_var('start', 0);
35
+$start = request_var('start', 0);
36 36
 $view = request_var('view', '');
37 37
 $s_hidden_fields = array();
38 38
 
39
-$sql = 'SELECT link_cat FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int)$u;
39
+$sql = 'SELECT link_cat FROM '.DIR_LINK_TABLE.' WHERE link_id = '.(int) $u;
40 40
 $result = $db->sql_query($sql);
41 41
 $cat_id = (int) $db->sql_fetchfield('link_cat');
42 42
 $db->sql_freeresult($result);
43 43
 
44
-$categorie	= new categorie($cat_id);
44
+$categorie = new categorie($cat_id);
45 45
 
46
-if(!$categorie->data['cat_allow_comments'])
46
+if (!$categorie->data['cat_allow_comments'])
47 47
 {
48 48
 	trigger_error('DIR_ERROR_NOT_AUTH');
49 49
 }
@@ -51,16 +51,16 @@  discard block
 block discarded – undo
51 51
 $comm = new comment;
52 52
 
53 53
 // The CAPTCHA kicks in here. We can't help that the information gets lost on language change.
54
-if(!$user->data['is_registered'] && $config['dir_visual_confirm'])
54
+if (!$user->data['is_registered'] && $config['dir_visual_confirm'])
55 55
 {
56
-	include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
57
-	$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
56
+	include($phpbb_root_path.'includes/captcha/captcha_factory.'.$phpEx);
57
+	$captcha = & phpbb_captcha_factory::get_instance($config['captcha_plugin']);
58 58
 	$captcha->init(CONFIRM_POST);
59 59
 }
60 60
 
61 61
 // get config for options
62
-$bbcode_status	= $config['dir_allow_bbcode'] ? true : false;
63
-$smilies_status	= $config['dir_allow_smilies'] ? true : false;
62
+$bbcode_status = $config['dir_allow_bbcode'] ? true : false;
63
+$smilies_status = $config['dir_allow_smilies'] ? true : false;
64 64
 $img_status		= $bbcode_status ? true : false;
65 65
 $url_status		= $config['dir_allow_links'] ? true : false;
66 66
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	}
79 79
 
80 80
 	$reply = utf8_normalize_nfc(request_var('message', '', true));
81
-	include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
81
+	include($phpbb_root_path.'includes/functions_user.'.$phpEx);
82 82
 	$user->add_lang('ucp');
83 83
 
84 84
 	$error = validate_data(
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
 	if ($error)
111 111
 	{
112
-		$template->assign_vars( array(
112
+		$template->assign_vars(array(
113 113
 	   		'ERROR'	=> (sizeof($error)) ? implode('<br />', $error) : ''
114 114
 	   	));
115 115
 	}
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 		if (isset($_POST['submit_comment']))
130 130
 		{
131 131
 			$data_add = array(
132
-				'comment_link_id'	=> (int)$u,
132
+				'comment_link_id'	=> (int) $u,
133 133
 				'comment_date'		=> time(),
134 134
 				'comment_user_id'	=> $user->data['user_id'],
135 135
 				'comment_user_ip'	=> $user->ip,
@@ -148,12 +148,12 @@  discard block
 block discarded – undo
148 148
 }
149 149
 elseif ($mode == 'edit' || $mode == 'delete')
150 150
 {
151
-	$sql = 'SELECT * FROM ' . DIR_COMMENT_TABLE . '
151
+	$sql = 'SELECT * FROM '.DIR_COMMENT_TABLE.'
152 152
 			WHERE comment_id = ' . $id;
153 153
 	$result = $db->sql_query($sql);
154 154
 	$value = $db->sql_fetchrow($result);
155 155
 
156
-	if($mode == 'edit')
156
+	if ($mode == 'edit')
157 157
 	{
158 158
 		if (!$auth->acl_get('m_edit_comment_dir') && (!$auth->acl_get('u_edit_comment_dir') || $user->data['user_id'] != $value['comment_user_id']))
159 159
 		{
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		$s_comment = generate_text_for_edit($value['comment_text'], $value['comment_uid'], $value['comment_flags']);
164 164
 
165 165
 		$s_hidden_fields = array(
166
-			'id'	=> (int)$id,
166
+			'id'	=> (int) $id,
167 167
 		);
168 168
 	}
169 169
 	else
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 		{
173 173
 			trigger_error('DIR_ERROR_NOT_AUTH');
174 174
 		}
175
-		$template->assign_vars( array(
175
+		$template->assign_vars(array(
176 176
 			'S_DELETE'			=> true,
177 177
 		));
178 178
 
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
 //
184 184
 // main
185 185
 $sql = 'SELECT COUNT(comment_id) AS nb_comments
186
-			FROM ' . DIR_COMMENT_TABLE . '
187
-			WHERE comment_link_id = ' . (int)$u;
186
+			FROM ' . DIR_COMMENT_TABLE.'
187
+			WHERE comment_link_id = ' . (int) $u;
188 188
 $result = $db->sql_query($sql);
189 189
 $nb_comments = (int) $db->sql_fetchfield('nb_comments');
190 190
 $db->sql_freeresult($result);
@@ -205,10 +205,10 @@  discard block
 block discarded – undo
205 205
 			),
206 206
 			array(
207 207
 				'FROM'	=> array(ZEBRA_TABLE => 'z'),
208
-				'ON'	=> 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = a.comment_user_id'
208
+				'ON'	=> 'z.user_id = '.$user->data['user_id'].' AND z.zebra_id = a.comment_user_id'
209 209
 			)
210 210
 	),
211
-	'WHERE'		=> 'a.comment_link_id = ' . $u,
211
+	'WHERE'		=> 'a.comment_link_id = '.$u,
212 212
 	'ORDER_BY'	=> 'a.comment_date DESC');
213 213
 
214 214
 $sql = $db->sql_build_query('SELECT', $sql_array);
@@ -262,12 +262,12 @@  discard block
 block discarded – undo
262 262
 	));
263 263
 }
264 264
 
265
-$template->assign_vars( array(
265
+$template->assign_vars(array(
266 266
 	'S_AUTH_COMM' 		=> $auth->acl_get('u_comment_dir'),
267 267
 	'S_DELETE'			=> ($mode == 'delete') ? true : false,
268 268
 	'S_DIR_COMMENT'		=> true,
269 269
 
270
-	'BBCODE_STATUS'		=> ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid($phpbb_root_path."faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid($phpbb_root_path."faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
270
+	'BBCODE_STATUS'		=> ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="'.append_sid($phpbb_root_path."faq.$phpEx", 'mode=bbcode').'">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="'.append_sid($phpbb_root_path."faq.$phpEx", 'mode=bbcode').'">', '</a>'),
271 271
 	'IMG_STATUS'		=> ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
272 272
 	'SMILIES_STATUS'	=> ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
273 273
 	'URL_STATUS'		=> ($bbcode_status && $url_status) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'],
Please login to merge, or discard this patch.