Completed
Push — 3.2.x ( 405e9a...927199 )
by Erwan
03:07
created
core/link.php 1 patch
Indentation   +145 added lines, -145 removed lines patch added patch discarded remove patch
@@ -57,23 +57,23 @@  discard block
 block discarded – undo
57 57
 	protected $php_ext;
58 58
 
59 59
 	/**
60
-	* Constructor
61
-	*
62
-	* @param \phpbb\db\driver\driver_interface 					$db					Database object
63
-	* @param \phpbb\config\config 								$config				Config object
64
-	* @param \phpbb\language\language							$language			Language object
65
-	* @param \phpbb\template\template 							$template			Template object
66
-	* @param \phpbb\user 										$user				User object
67
-	* @param \phpbb\controller\helper 							$helper				Controller helper object
68
-	* @param \phpbb\request\request 							$request			Request object
69
-	* @param \phpbb\auth\auth 									$auth				Auth object
70
-	* @param \phpbb\notification\manager						$notification		Notification object
71
-	* @param \phpbb\filesystem\filesystem_interface				$filesystem			phpBB filesystem helper
72
-	* @param \FastImageSize\FastImageSize						$imagesize 			FastImageSize class
73
-	* @param \phpbb\files\factory								$files_factory		File classes factory
74
-	* @param string         									$root_path			phpBB root path
75
-	* @param string         									$php_ext			phpEx
76
-	*/
60
+	 * Constructor
61
+	 *
62
+	 * @param \phpbb\db\driver\driver_interface 					$db					Database object
63
+	 * @param \phpbb\config\config 								$config				Config object
64
+	 * @param \phpbb\language\language							$language			Language object
65
+	 * @param \phpbb\template\template 							$template			Template object
66
+	 * @param \phpbb\user 										$user				User object
67
+	 * @param \phpbb\controller\helper 							$helper				Controller helper object
68
+	 * @param \phpbb\request\request 							$request			Request object
69
+	 * @param \phpbb\auth\auth 									$auth				Auth object
70
+	 * @param \phpbb\notification\manager						$notification		Notification object
71
+	 * @param \phpbb\filesystem\filesystem_interface				$filesystem			phpBB filesystem helper
72
+	 * @param \FastImageSize\FastImageSize						$imagesize 			FastImageSize class
73
+	 * @param \phpbb\files\factory								$files_factory		File classes factory
74
+	 * @param string         									$root_path			phpBB root path
75
+	 * @param string         									$php_ext			phpEx
76
+	 */
77 77
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\notification\manager $notification, \phpbb\filesystem\filesystem_interface $filesystem, \FastImageSize\FastImageSize $imagesize, \phpbb\files\factory $files_factory, $root_path, $php_ext)
78 78
 	{
79 79
 		$this->db				= $db;
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
 	}
94 94
 
95 95
 	/**
96
-	* Add a link into db
97
-	*
98
-	* @param	array	$data			Contains all data to insert in db
99
-	* @param	bool	$need_approval	Links needs to be approved?
100
-	* @return	null
101
-	*/
96
+	 * Add a link into db
97
+	 *
98
+	 * @param	array	$data			Contains all data to insert in db
99
+	 * @param	bool	$need_approval	Links needs to be approved?
100
+	 * @return	null
101
+	 */
102 102
 	public function add($data, $need_approval)
103 103
 	{
104 104
 		$notification_data = array();
@@ -143,13 +143,13 @@  discard block
 block discarded – undo
143 143
 	}
144 144
 
145 145
 	/**
146
-	* Edit a link of the db
147
-	*
148
-	* @param	array	$data			Contains all data to edit in db
149
-	* @param	int		$link_id		is link's id, for WHERE clause
150
-	* @param	bool	$need_approval	Links needs to be approved?
151
-	* @return	null
152
-	*/
146
+	 * Edit a link of the db
147
+	 *
148
+	 * @param	array	$data			Contains all data to edit in db
149
+	 * @param	int		$link_id		is link's id, for WHERE clause
150
+	 * @param	bool	$need_approval	Links needs to be approved?
151
+	 * @return	null
152
+	 */
153 153
 	public function edit($data, $link_id, $need_approval)
154 154
 	{
155 155
 		$notification_data = array(
@@ -201,12 +201,12 @@  discard block
 block discarded – undo
201 201
 	}
202 202
 
203 203
 	/**
204
-	* Delete a link of the db
205
-	*
206
-	* @param	int 	$cat_id		The category ID
207
-	* @param	mixed 	$link_id	Link's id, for WHERE clause
208
-	* @return	null
209
-	*/
204
+	 * Delete a link of the db
205
+	 *
206
+	 * @param	int 	$cat_id		The category ID
207
+	 * @param	mixed 	$link_id	Link's id, for WHERE clause
208
+	 * @return	null
209
+	 */
210 210
 	public function del($cat_id, $link_id)
211 211
 	{
212 212
 		$this->db->sql_transaction('begin');
@@ -279,12 +279,12 @@  discard block
 block discarded – undo
279 279
 	}
280 280
 
281 281
 	/**
282
-	* Increments link view counter
283
-	*
284
-	* @param	int		$link_id	Link's id, for WHERE clause
285
-	* @return	null
286
-	* @throws	\phpbb\exception\http_exception
287
-	*/
282
+	 * Increments link view counter
283
+	 *
284
+	 * @param	int		$link_id	Link's id, for WHERE clause
285
+	 * @return	null
286
+	 * @throws	\phpbb\exception\http_exception
287
+	 */
288 288
 	public function view($link_id)
289 289
 	{
290 290
 		$sql = 'SELECT link_id, link_url
@@ -308,11 +308,11 @@  discard block
 block discarded – undo
308 308
 	}
309 309
 
310 310
 	/**
311
-	* Verify that an URL exist before add into db
312
-	*
313
-	* @param	string	$url	The URL to check
314
-	* @return	bool			True if url is reachable, else false.
315
-	*/
311
+	 * Verify that an URL exist before add into db
312
+	 *
313
+	 * @param	string	$url	The URL to check
314
+	 * @return	bool			True if url is reachable, else false.
315
+	 */
316 316
 	public function checkurl($url)
317 317
 	{
318 318
 		$details = parse_url($url);
@@ -351,11 +351,11 @@  discard block
 block discarded – undo
351 351
 	}
352 352
 
353 353
 	/**
354
-	* Delete the final '/', if no path
355
-	*
356
-	* @param	string	$url	URL to clean
357
-	* @return	string	$url	The correct string.
358
-	*/
354
+	 * Delete the final '/', if no path
355
+	 *
356
+	 * @param	string	$url	URL to clean
357
+	 * @return	string	$url	The correct string.
358
+	 */
359 359
 	public function clean_url($url)
360 360
 	{
361 361
 		$details = parse_url($url);
@@ -368,11 +368,11 @@  discard block
 block discarded – undo
368 368
 	}
369 369
 
370 370
 	/**
371
-	* Display a flag
372
-	*
373
-	* @param	array	$data	Link's data from db
374
-	* @return	string			Flag path.
375
-	*/
371
+	 * Display a flag
372
+	 *
373
+	 * @param	array	$data	Link's data from db
374
+	 * @return	string			Flag path.
375
+	 */
376 376
 	public function display_flag($data)
377 377
 	{
378 378
 		global $phpbb_extension_manager;
@@ -390,13 +390,13 @@  discard block
 block discarded – undo
390 390
 	}
391 391
 
392 392
 	/**
393
-	* Calculate the link's note
394
-	*
395
-	* @param	int		$total_note		Sum of all link's notes
396
-	* @param	int		$nb_vote		Number of votes
397
-	* @param	bool	$votes_status	Votes are enable in this category?
398
-	* @return	string	$note			The calculated note.
399
-	*/
393
+	 * Calculate the link's note
394
+	 *
395
+	 * @param	int		$total_note		Sum of all link's notes
396
+	 * @param	int		$nb_vote		Number of votes
397
+	 * @param	bool	$votes_status	Votes are enable in this category?
398
+	 * @return	string	$note			The calculated note.
399
+	 */
400 400
 	public function display_note($total_note, $nb_vote, $votes_status)
401 401
 	{
402 402
 		if (!$votes_status)
@@ -411,11 +411,11 @@  discard block
 block discarded – undo
411 411
 	}
412 412
 
413 413
 	/**
414
-	* Display the vote form for auth users
415
-	*
416
-	* @param	array	$data	Link's data from db
417
-	* @return	null|string		Html combo list or nothing if votes are not available.
418
-	*/
414
+	 * Display the vote form for auth users
415
+	 *
416
+	 * @param	array	$data	Link's data from db
417
+	 * @return	null|string		Html combo list or nothing if votes are not available.
418
+	 */
419 419
 	public function display_vote($data)
420 420
 	{
421 421
 		if ($this->user->data['is_registered'] && $this->auth->acl_get('u_vote_dir') && empty($data['vote_user_id']))
@@ -432,11 +432,11 @@  discard block
 block discarded – undo
432 432
 	}
433 433
 
434 434
 	/**
435
-	* Display the RSS icon
436
-	*
437
-	* @param	array	$data	Link's data from db
438
-	* @return	null|string		RSS feed URL or nothing.
439
-	*/
435
+	 * Display the RSS icon
436
+	 *
437
+	 * @param	array	$data	Link's data from db
438
+	 * @return	null|string		RSS feed URL or nothing.
439
+	 */
440 440
 	public function display_rss($data)
441 441
 	{
442 442
 		if ($this->config['dir_activ_rss'] && !empty($data['link_rss']))
@@ -446,13 +446,13 @@  discard block
 block discarded – undo
446 446
 	}
447 447
 
448 448
 	/**
449
-	* Display link's thumb if thumb service enabled.
450
-	* if thumb don't exists in db or if a new service was choosen in acp
451
-	* thumb is research
452
-	*
453
-	* @param	array		$data	Link's data from db
454
-	* @return	string|null			Thumb or null.
455
-	*/
449
+	 * Display link's thumb if thumb service enabled.
450
+	 * if thumb don't exists in db or if a new service was choosen in acp
451
+	 * thumb is research
452
+	 *
453
+	 * @param	array		$data	Link's data from db
454
+	 * @return	string|null			Thumb or null.
455
+	 */
456 456
 	public function display_thumb($data)
457 457
 	{
458 458
 		if ($this->config['dir_activ_thumb'])
@@ -473,11 +473,11 @@  discard block
 block discarded – undo
473 473
 	}
474 474
 
475 475
 	/**
476
-	* Display and resize a banner
477
-	*
478
-	* @param	array	$data		link's data from db
479
-	* @return	string	$s_banner	html code.
480
-	*/
476
+	 * Display and resize a banner
477
+	 *
478
+	 * @param	array	$data		link's data from db
479
+	 * @return	string	$s_banner	html code.
480
+	 */
481 481
 	public function display_bann($data)
482 482
 	{
483 483
 		if (!empty($data['link_banner']))
@@ -515,12 +515,12 @@  discard block
 block discarded – undo
515 515
 	}
516 516
 
517 517
 	/**
518
-	* Add a vote in db, for a specifi link
519
-	*
520
-	* @param	int		$link_id	Link_id from db
521
-	* @param	int		$note		Note submeted
522
-	* @return	null
523
-	*/
518
+	 * Add a vote in db, for a specifi link
519
+	 *
520
+	 * @param	int		$link_id	Link_id from db
521
+	 * @param	int		$note		Note submeted
522
+	 * @return	null
523
+	 */
524 524
 	public function add_vote($link_id, $note)
525 525
 	{
526 526
 		$data = array(
@@ -564,11 +564,11 @@  discard block
 block discarded – undo
564 564
 	}
565 565
 
566 566
 	/**
567
-	* Search an appropriate thumb for url
568
-	*
569
-	* @param	string	$url	Link's url
570
-	* @return	string			The thumb url
571
-	*/
567
+	 * Search an appropriate thumb for url
568
+	 *
569
+	 * @param	string	$url	Link's url
570
+	 * @return	string			The thumb url
571
+	 */
572 572
 	public function thumb_process($url)
573 573
 	{
574 574
 		if (!$this->config['dir_activ_thumb'])
@@ -589,12 +589,12 @@  discard block
 block discarded – undo
589 589
 	}
590 590
 
591 591
 	/**
592
-	* Check if ascreen thumb exists
593
-	*
594
-	* @param	string	$protocol	The protocol
595
-	* @param	string	$host		The hostname
596
-	* @return	bool				True if ascreen file exixts, else false
597
-	*/
592
+	 * Check if ascreen thumb exists
593
+	 *
594
+	 * @param	string	$protocol	The protocol
595
+	 * @param	string	$host		The hostname
596
+	 * @return	bool				True if ascreen file exixts, else false
597
+	 */
598 598
 	private function _ascreen_exist($protocol, $host)
599 599
 	{
600 600
 		if (($thumb_info = $this->imagesize->getImageSize($protocol.'://'.$host.'/ascreen.jpg')) !== false)
@@ -609,12 +609,12 @@  discard block
 block discarded – undo
609 609
 	}
610 610
 
611 611
 	/**
612
-	* Primary work on banner, can edit, copy or check a banner
613
-	*
614
-	* @param	string	$banner	The banner's remote url
615
-	* @param	array	$error	The array error, passed by reference
616
-	* @return	null
617
-	*/
612
+	 * Primary work on banner, can edit, copy or check a banner
613
+	 *
614
+	 * @param	string	$banner	The banner's remote url
615
+	 * @param	array	$error	The array error, passed by reference
616
+	 * @return	null
617
+	 */
618 618
 	public function banner_process(&$banner, &$error)
619 619
 	{
620 620
 		$old_banner = $this->request->variable('old_banner', '');
@@ -650,13 +650,13 @@  discard block
 block discarded – undo
650 650
 	}
651 651
 
652 652
 	/**
653
-	* Copy a remonte banner to server.
654
-	* called by banner_process()
655
-	*
656
-	* @param	string	$banner The banner's remote url
657
-	* @param	array	$error	The array error, passed by reference
658
-	* @return	false|string	String if no errors, else false
659
-	*/
653
+	 * Copy a remonte banner to server.
654
+	 * called by banner_process()
655
+	 *
656
+	 * @param	string	$banner The banner's remote url
657
+	 * @param	array	$error	The array error, passed by reference
658
+	 * @return	false|string	String if no errors, else false
659
+	 */
660 660
 	private function _banner_upload($banner, &$error)
661 661
 	{
662 662
 		/** @var \phpbb\files\upload $upload */
@@ -688,13 +688,13 @@  discard block
 block discarded – undo
688 688
 	}
689 689
 
690 690
 	/**
691
-	* Check than remote banner exists
692
-	* called by banner_process()
693
-	*
694
-	* @param	string	$banner	The banner's remote url
695
-	* @param	array	$error	The array error, passed by reference
696
-	* @return	false|string	String if no errors, else false
697
-	*/
691
+	 * Check than remote banner exists
692
+	 * called by banner_process()
693
+	 *
694
+	 * @param	string	$banner	The banner's remote url
695
+	 * @param	array	$error	The array error, passed by reference
696
+	 * @return	false|string	String if no errors, else false
697
+	 */
698 698
 	private function _banner_remote($banner, &$error)
699 699
 	{
700 700
 		if (!preg_match('#^(http|https|ftp)://#i', $banner))
@@ -802,11 +802,11 @@  discard block
 block discarded – undo
802 802
 	}
803 803
 
804 804
 	/**
805
-	* Delete a banner from server
806
-	*
807
-	* @param	string	$file	The file's name
808
-	* @return	bool			True if delete success, else false
809
-	*/
805
+	 * Delete a banner from server
806
+	 *
807
+	 * @param	string	$file	The file's name
808
+	 * @return	bool			True if delete success, else false
809
+	 */
810 810
 	private function _banner_delete($file)
811 811
 	{
812 812
 		if (file_exists($this->get_banner_path($file)))
@@ -819,12 +819,12 @@  discard block
 block discarded – undo
819 819
 	}
820 820
 
821 821
 	/**
822
-	* List flags
823
-	*
824
-	* @param	string	$flag_path	The flag directory path
825
-	* @param	string	$value		Selected flag
826
-	* @return	string	$list		Html code
827
-	*/
822
+	 * List flags
823
+	 *
824
+	 * @param	string	$flag_path	The flag directory path
825
+	 * @param	string	$value		Selected flag
826
+	 * @return	string	$list		Html code
827
+	 */
828 828
 	public function get_dir_flag_list($flag_path, $value)
829 829
 	{
830 830
 		$list = '';
@@ -859,10 +859,10 @@  discard block
 block discarded – undo
859 859
 	}
860 860
 
861 861
 	/**
862
-	* Display recents links added
863
-	*
864
-	* @return	null
865
-	*/
862
+	 * Display recents links added
863
+	 *
864
+	 * @return	null
865
+	 */
866 866
 	public function recents()
867 867
 	{
868 868
 		if ($this->config['dir_recent_block'])
@@ -939,13 +939,13 @@  discard block
 block discarded – undo
939 939
 	}
940 940
 
941 941
 	/**
942
-	* Validate back link
943
-	*
944
-	* @param	string		$remote_url	Page URL contains the backlink
945
-	* @param	bool		$optional	Link back is optional in this category?
946
-	* @param	bool		$cron		This methos is called by con process?
947
-	* @return	false|string			Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
948
-	*/
942
+	 * Validate back link
943
+	 *
944
+	 * @param	string		$remote_url	Page URL contains the backlink
945
+	 * @param	bool		$optional	Link back is optional in this category?
946
+	 * @param	bool		$cron		This methos is called by con process?
947
+	 * @return	false|string			Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
948
+	 */
949 949
 	public function validate_link_back($remote_url, $optional, $cron = false)
950 950
 	{
951 951
 		if (!$cron)
Please login to merge, or discard this patch.
controller/links.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -87,19 +87,19 @@  discard block
 block discarded – undo
87 87
 	*/
88 88
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext)
89 89
 	{
90
-		$this->db				= $db;
91
-		$this->config			= $config;
90
+		$this->db = $db;
91
+		$this->config = $config;
92 92
 		$this->language			= $language;
93 93
 		$this->template			= $template;
94 94
 		$this->user				= $user;
95
-		$this->helper			= $helper;
96
-		$this->request			= $request;
95
+		$this->helper = $helper;
96
+		$this->request = $request;
97 97
 		$this->auth				= $auth;
98
-		$this->captcha_factory 	= $captcha_factory;
98
+		$this->captcha_factory = $captcha_factory;
99 99
 		$this->categorie		= $categorie;
100 100
 		$this->link				= $link;
101 101
 		$this->root_path		= $root_path;
102
-		$this->php_ext			= $php_ext;
102
+		$this->php_ext = $php_ext;
103 103
 
104 104
 		$language->add_lang('directory', 'ernadoo/phpbbdirectory');
105 105
 
@@ -119,12 +119,12 @@  discard block
 block discarded – undo
119 119
 	{
120 120
 		if ($this->request->is_set_post('cancel'))
121 121
 		{
122
-			$redirect = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
122
+			$redirect = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
123 123
 			redirect($redirect);
124 124
 		}
125 125
 
126 126
 		$sql = 'SELECT link_user_id
127
-			FROM ' . $this->links_table . '
127
+			FROM ' . $this->links_table.'
128 128
 			WHERE link_id = ' . (int) $link_id;
129 129
 		$result = $this->db->sql_query($sql);
130 130
 		$link_data = $this->db->sql_fetchrow($result);
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
 		{
146 146
 			$this->link->del($cat_id, $link_id);
147 147
 
148
-			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
148
+			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
149 149
 			meta_refresh(3, $meta_info);
150
-			$message = $this->language->lang('DIR_DELETE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id) . '">', '</a>');
150
+			$message = $this->language->lang('DIR_DELETE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id).'">', '</a>');
151 151
 			return $this->helper->message($message);
152 152
 		}
153 153
 		else
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	public function edit_link($cat_id, $link_id)
168 168
 	{
169 169
 		$sql = 'SELECT link_id, link_uid, link_user_id, link_flags, link_bitfield, link_cat, link_url, link_description, link_guest_email, link_name, link_rss, link_back, link_banner, link_flag, link_cat, link_time
170
-			FROM ' . $this->links_table . '
170
+			FROM ' . $this->links_table.'
171 171
 			WHERE link_id = ' . (int) $link_id;
172 172
 		$result = $this->db->sql_query($sql);
173 173
 		$link_data = $this->db->sql_fetchrow($result);
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		$cat_id		= $this->request->variable('id', $cat_id);
188 188
 		$submit		= $this->request->is_set_post('submit') ? true : false;
189 189
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
190
-		$title		= $this->language->lang('DIR_EDIT_SITE');
190
+		$title = $this->language->lang('DIR_EDIT_SITE');
191 191
 
192 192
 		$this->template->assign_block_vars('dir_navlinks', array(
193 193
 			'FORUM_NAME'	=> $title,
@@ -211,15 +211,15 @@  discard block
 block discarded – undo
211 211
 				'old_banner'	=> $link_data['link_banner'],
212 212
 			);
213 213
 
214
-			$site_description			= generate_text_for_edit($link_data['link_description'], $link_data['link_uid'], $link_data['link_flags']);
215
-			$link_data['link_banner'] 	= (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $link_data['link_banner'])) ? $link_data['link_banner'] : '';
214
+			$site_description = generate_text_for_edit($link_data['link_description'], $link_data['link_uid'], $link_data['link_flags']);
215
+			$link_data['link_banner'] = (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $link_data['link_banner'])) ? $link_data['link_banner'] : '';
216 216
 
217
-			$this->url			= $link_data['link_url'];
218
-			$this->site_name	= $link_data['link_name'];
217
+			$this->url = $link_data['link_url'];
218
+			$this->site_name = $link_data['link_name'];
219 219
 			$this->description	= $site_description['text'];
220 220
 			$this->guest_email	= $link_data['link_guest_email'];
221
-			$this->rss			= $link_data['link_rss'];
222
-			$this->banner 		= $link_data['link_banner'];
221
+			$this->rss = $link_data['link_rss'];
222
+			$this->banner = $link_data['link_banner'];
223 223
 			$this->back			= $link_data['link_back'];
224 224
 			$this->flag 		= $link_data['link_flag'];
225 225
 		}
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 		$cat_id		= $this->request->variable('id', $cat_id);
247 247
 		$submit		= $this->request->is_set_post('submit') ? true : false;
248 248
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
249
-		$title		= $this->language->lang('DIR_NEW_SITE');
249
+		$title = $this->language->lang('DIR_NEW_SITE');
250 250
 
251 251
 		$this->template->assign_block_vars('dir_navlinks', array(
252 252
 			'FORUM_NAME'	=> $title,
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 
311 311
 		// We check if user had already vot for this website.
312 312
 		$sql = 'SELECT vote_link_id
313
-			FROM ' . $this->votes_table . '
313
+			FROM ' . $this->votes_table.'
314 314
 			WHERE ' . $this->db->sql_build_array('SELECT', $data);
315 315
 		$result = $this->db->sql_query($sql);
316 316
 		$data = $this->db->sql_fetchrow($result);
@@ -322,9 +322,9 @@  discard block
 block discarded – undo
322 322
 
323 323
 		$this->link->add_vote($link_id, $this->request->variable('vote', 0));
324 324
 
325
-		$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
325
+		$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
326 326
 		meta_refresh(3, $meta_info);
327
-		$message = $this->language->lang('DIR_VOTE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $meta_info . '">', '</a>');
327
+		$message = $this->language->lang('DIR_VOTE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$meta_info.'">', '</a>');
328 328
 		return $this->helper->message($message);
329 329
 	}
330 330
 
@@ -349,18 +349,18 @@  discard block
 block discarded – undo
349 349
 			return $this->helper->message('FORM_INVALID');
350 350
 		}
351 351
 
352
-		$this->url			= $this->request->variable('url', '');
353
-		$this->site_name	= $this->request->variable('site_name', '', true);
352
+		$this->url = $this->request->variable('url', '');
353
+		$this->site_name = $this->request->variable('site_name', '', true);
354 354
 		$this->description	= $this->request->variable('description', '', true);
355 355
 		$this->guest_email	= $this->request->variable('guest_email', '');
356
-		$this->rss			= $this->request->variable('rss', '');
357
-		$this->banner 		= $this->request->variable('banner', '');
356
+		$this->rss = $this->request->variable('rss', '');
357
+		$this->banner = $this->request->variable('banner', '');
358 358
 		$this->back			= $this->request->variable('back', '');
359 359
 		$this->flag 		= $this->request->variable('flag', '');
360 360
 
361 361
 		if (!function_exists('validate_data'))
362 362
 		{
363
-			include($this->root_path . 'includes/functions_user.' . $this->php_ext);
363
+			include($this->root_path.'includes/functions_user.'.$this->php_ext);
364 364
 		}
365 365
 
366 366
 		// We define variables to check
@@ -383,17 +383,17 @@  discard block
 block discarded – undo
383 383
 			'site_name' =>			array(
384 384
 				array('string', false, 1, 100)),
385 385
 			'website'		=>		array(
386
-				array('string',	false, 12, 255),
387
-				array('match',	true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
386
+				array('string', false, 12, 255),
387
+				array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
388 388
 			'description'	=>		array(
389 389
 				array('string', !$this->categorie->data['cat_must_describe'], 1, $this->config['dir_length_describe'])),
390 390
 			'rss'			=>		array(
391 391
 				array('string', true, 12, 255),
392
-				array('match',	empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
392
+				array('match', empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
393 393
 			'banner'		=>		array(
394 394
 				array('string', true, 5, 255)),
395 395
 			'back'			=>		array(
396
-				array('string',	!$this->categorie->data['cat_link_back'], 12, 255),
396
+				array('string', !$this->categorie->data['cat_link_back'], 12, 255),
397 397
 				array(array($this->link, 'link_back'), true)),
398 398
 			'cat'			=>		array(
399 399
 				array('num', '', 1))
@@ -439,8 +439,8 @@  discard block
 block discarded – undo
439 439
 		// Still no errors?? So let's go!
440 440
 		if (!$error)
441 441
 		{
442
-			$this->banner	= (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
443
-			$this->url		= $this->link->clean_url($this->url);
442
+			$this->banner = (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
443
+			$this->url = $this->link->clean_url($this->url);
444 444
 
445 445
 			$data_edit = array(
446 446
 				'link_user_id'		=> $this->link_user_id,
@@ -485,10 +485,10 @@  discard block
 block discarded – undo
485 485
 				$this->link->add($data_add, $need_approval);
486 486
 			}
487 487
 
488
-			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
488
+			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
489 489
 			meta_refresh(3, $meta_info);
490 490
 			$message	= ($need_approval) ? $this->language->lang('DIR_'.strtoupper($mode).'_SITE_ACTIVE') : $this->language->lang('DIR_'.strtoupper($mode).'_SITE_OK');
491
-			$message	= $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id) . '">', '</a>');
491
+			$message	= $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id).'">', '</a>');
492 492
 			return $this->helper->message($message);
493 493
 		}
494 494
 		else
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 	{
518 518
 		if (!function_exists('file_gc'))
519 519
 		{
520
-			include($this->root_path . 'includes/functions_download.' . $this->php_ext);
520
+			include($this->root_path.'includes/functions_download.'.$this->php_ext);
521 521
 		}
522 522
 
523 523
 		$file_path = $this->get_banner_path($banner_img);
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
 
573 573
 		if (!function_exists('display_custom_bbcodes'))
574 574
 		{
575
-			include($this->root_path . 'includes/functions_display.' . $this->php_ext);
575
+			include($this->root_path.'includes/functions_display.'.$this->php_ext);
576 576
 		}
577 577
 		display_custom_bbcodes();
578 578
 		add_form_key('dir_form');
@@ -581,17 +581,17 @@  discard block
 block discarded – undo
581 581
 		$flag_path = $ext_path.'images/flags/';
582 582
 
583 583
 		$s_guest	= (!$this->user->data['is_registered'] || !empty($this->guest_email));
584
-		$s_rss		= $this->config['dir_activ_rss'];
585
-		$s_banner	= $this->config['dir_activ_banner'];
584
+		$s_rss = $this->config['dir_activ_rss'];
585
+		$s_banner = $this->config['dir_activ_banner'];
586 586
 		$s_back		= $this->categorie->data['cat_link_back'];
587 587
 		$s_flag		= $this->config['dir_activ_flag'];
588 588
 
589 589
 		$this->template->assign_vars(array(
590
-			'BBCODE_STATUS'			=> ($this->config['allow_bbcode']) 	? $this->language->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'),
591
-			'IMG_STATUS'			=> ($this->config['allow_bbcode'])	? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
590
+			'BBCODE_STATUS'			=> ($this->config['allow_bbcode']) ? $this->language->lang('BBCODE_IS_ON', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>'),
591
+			'IMG_STATUS'			=> ($this->config['allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
592 592
 			'SMILIES_STATUS'		=> ($this->config['allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'),
593 593
 			'URL_STATUS'			=> ($this->config['allow_post_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'),
594
-			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash'])	? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
594
+			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
595 595
 
596 596
 			'L_TITLE'				=> $title,
597 597
 			'L_DIR_DESCRIPTION_EXP'	=> $this->language->lang('DIR_DESCRIPTION_EXP', $this->config['dir_length_describe']),
Please login to merge, or discard this patch.