Completed
Push — 3.2.x ( 5d776c...185810 )
by Erwan
02:30
created
core/helper.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -37,37 +37,37 @@  discard block
 block discarded – undo
37 37
 	private $ext_name = 'ernadoo/phpbbdirectory';
38 38
 
39 39
 	/**
40
-	* Set the extension manager
41
-	*
42
-	* @param \phpbb\extension\manager	$phpbb_extension_manager
43
-	* @return null
44
-	*/
40
+	 * Set the extension manager
41
+	 *
42
+	 * @param \phpbb\extension\manager	$phpbb_extension_manager
43
+	 * @return null
44
+	 */
45 45
 	public function set_extension_manager(\phpbb\extension\manager $phpbb_extension_manager)
46 46
 	{
47 47
 		$this->extension_manager	= $phpbb_extension_manager;
48 48
 	}
49 49
 
50 50
 	/**
51
-	* Set the path helper
52
-	*
53
-	* @param \phpbb\path_helper	$path_helper
54
-	* @return null
55
-	*/
51
+	 * Set the path helper
52
+	 *
53
+	 * @param \phpbb\path_helper	$path_helper
54
+	 * @return null
55
+	 */
56 56
 	public function set_path_helper(\phpbb\path_helper $path_helper)
57 57
 	{
58 58
 		$this->path_helper = $path_helper;
59 59
 	}
60 60
 
61 61
 	/**
62
-	* Set the tables names
63
-	*
64
-	* @param string	$categories_table
65
-	* @param string	$comments_table
66
-	* @param string	$links_table
67
-	* @param string	$votes_table
68
-	* @param string	$watch_table
69
-	* @return null
70
-	*/
62
+	 * Set the tables names
63
+	 *
64
+	 * @param string	$categories_table
65
+	 * @param string	$comments_table
66
+	 * @param string	$links_table
67
+	 * @param string	$votes_table
68
+	 * @param string	$watch_table
69
+	 * @return null
70
+	 */
71 71
 	public function set_tables($categories_table, $comments_table, $links_table, $votes_table, $watch_table)
72 72
 	{
73 73
 		$this->comments_table		= $comments_table;
@@ -77,48 +77,48 @@  discard block
 block discarded – undo
77 77
 		$this->categories_table		= $categories_table;
78 78
 	}
79 79
 	/**
80
-	* Return ext name
81
-	*
82
-	* @param	bool	$web_root_path Whether the path should be relative to web root
83
-	* @return	string					Path to an extension
84
-	*/
80
+	 * Return ext name
81
+	 *
82
+	 * @param	bool	$web_root_path Whether the path should be relative to web root
83
+	 * @return	string					Path to an extension
84
+	 */
85 85
 	public function get_ext_name($web_root_path = false)
86 86
 	{
87 87
 		return (($web_root_path) ? $this->path_helper->get_web_root_path() : '') . $this->extension_manager->get_extension_path($this->ext_name);
88 88
 	}
89 89
 
90 90
 	/**
91
-	* Return path to resource image
92
-	*
93
-	* @param	string $type	is ressource type (flags|icons)
94
-	* @param	string $image	is the resource to display
95
-	* @return	string			The relative path to ressource
96
-	*/
91
+	 * Return path to resource image
92
+	 *
93
+	 * @param	string $type	is ressource type (flags|icons)
94
+	 * @param	string $image	is the resource to display
95
+	 * @return	string			The relative path to ressource
96
+	 */
97 97
 	public function get_img_path($type, $image = '')
98 98
 	{
99 99
 		return $this->get_ext_name(true) . 'images/' . $type . '/' . $image;
100 100
 	}
101 101
 
102 102
 	/**
103
-	* Return path to banner
104
-	*
105
-	* @param	string	$banner	is the physical name
106
-	* @return	string			The relative path to banner
107
-	*/
103
+	 * Return path to banner
104
+	 *
105
+	 * @param	string	$banner	is the physical name
106
+	 * @return	string			The relative path to banner
107
+	 */
108 108
 	public function get_banner_path($banner = '')
109 109
 	{
110 110
 		return 'files/' . $this->get_ext_name() . 'banners/' . $banner;
111 111
 	}
112 112
 
113 113
 	/**
114
-	* Return array entries that match the pattern
115
-	*
116
-	* @link http://php.net/manual/fr/function.preg-grep.php#95787
117
-	*
118
-	* @param 	string	$pattern	The pattern to search for
119
-	* @param	array	$input		The input array
120
-	* @return	array	$vals		Returns an array indexed using the keys from the input array
121
-	*/
114
+	 * Return array entries that match the pattern
115
+	 *
116
+	 * @link http://php.net/manual/fr/function.preg-grep.php#95787
117
+	 *
118
+	 * @param 	string	$pattern	The pattern to search for
119
+	 * @param	array	$input		The input array
120
+	 * @return	array	$vals		Returns an array indexed using the keys from the input array
121
+	 */
122 122
 	public function preg_grep_keys($pattern, $input)
123 123
 	{
124 124
 		$keys = preg_grep($pattern, array_keys($input));
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	*/
45 45
 	public function set_extension_manager(\phpbb\extension\manager $phpbb_extension_manager)
46 46
 	{
47
-		$this->extension_manager	= $phpbb_extension_manager;
47
+		$this->extension_manager = $phpbb_extension_manager;
48 48
 	}
49 49
 
50 50
 	/**
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
 	*/
71 71
 	public function set_tables($categories_table, $comments_table, $links_table, $votes_table, $watch_table)
72 72
 	{
73
-		$this->comments_table		= $comments_table;
73
+		$this->comments_table = $comments_table;
74 74
 		$this->links_table			= $links_table;
75 75
 		$this->votes_table			= $votes_table;
76 76
 		$this->watch_table			= $watch_table;
77
-		$this->categories_table		= $categories_table;
77
+		$this->categories_table = $categories_table;
78 78
 	}
79 79
 	/**
80 80
 	* Return ext name
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	*/
85 85
 	public function get_ext_name($web_root_path = false)
86 86
 	{
87
-		return (($web_root_path) ? $this->path_helper->get_web_root_path() : '') . $this->extension_manager->get_extension_path($this->ext_name);
87
+		return (($web_root_path) ? $this->path_helper->get_web_root_path() : '').$this->extension_manager->get_extension_path($this->ext_name);
88 88
 	}
89 89
 
90 90
 	/**
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	*/
97 97
 	public function get_img_path($type, $image = '')
98 98
 	{
99
-		return $this->get_ext_name(true) . 'images/' . $type . '/' . $image;
99
+		return $this->get_ext_name(true).'images/'.$type.'/'.$image;
100 100
 	}
101 101
 
102 102
 	/**
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	*/
108 108
 	public function get_banner_path($banner = '')
109 109
 	{
110
-		return 'files/' . $this->get_ext_name() . 'banners/' . $banner;
110
+		return 'files/'.$this->get_ext_name().'banners/'.$banner;
111 111
 	}
112 112
 
113 113
 	/**
Please login to merge, or discard this patch.
core/link.php 2 patches
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\upload								$files_upload		Upload object
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\upload								$files_upload		Upload object
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\upload $files_upload, $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.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -76,20 +76,20 @@  discard block
 block discarded – undo
76 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\upload $files_upload, $root_path, $php_ext)
78 78
 	{
79
-		$this->db				= $db;
80
-		$this->config			= $config;
79
+		$this->db = $db;
80
+		$this->config = $config;
81 81
 		$this->language			= $language;
82 82
 		$this->template			= $template;
83 83
 		$this->user				= $user;
84
-		$this->helper			= $helper;
85
-		$this->request			= $request;
84
+		$this->helper = $helper;
85
+		$this->request = $request;
86 86
 		$this->auth				= $auth;
87 87
 		$this->notification		= $notification;
88
-		$this->filesystem		= $filesystem;
88
+		$this->filesystem = $filesystem;
89 89
 		$this->imagesize		= $imagesize;
90 90
 		$this->files_upload 	= $files_upload;
91 91
 		$this->root_path		= $root_path;
92
-		$this->php_ext			= $php_ext;
92
+		$this->php_ext = $php_ext;
93 93
 	}
94 94
 
95 95
 	/**
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
 
106 106
 		$this->db->sql_transaction('begin');
107 107
 
108
-		$sql = 'INSERT INTO ' . $this->links_table . ' ' . $this->db->sql_build_array('INSERT', $data);
108
+		$sql = 'INSERT INTO '.$this->links_table.' '.$this->db->sql_build_array('INSERT', $data);
109 109
 		$this->db->sql_query($sql);
110 110
 		$notification_data['link_id'] = $this->db->sql_nextid();
111 111
 
112 112
 		if (!$need_approval || $this->auth->acl_get('a_') || $this->auth->acl_get('m_'))
113 113
 		{
114
-			$sql = 'UPDATE ' . $this->categories_table . '
114
+			$sql = 'UPDATE '.$this->categories_table.'
115 115
 				SET cat_links = cat_links + 1
116 116
 				WHERE cat_id = ' . (int) $data['link_cat'];
117 117
 			$this->db->sql_query($sql);
@@ -169,14 +169,14 @@  discard block
 block discarded – undo
169 169
 
170 170
 			$this->db->sql_transaction('begin');
171 171
 
172
-			$sql = 'UPDATE ' . $this->categories_table . '
172
+			$sql = 'UPDATE '.$this->categories_table.'
173 173
 				SET cat_links = cat_links - 1
174 174
 				WHERE cat_id = ' . (int) $old_cat;
175 175
 			$this->db->sql_query($sql);
176 176
 
177 177
 			if (!$need_approval)
178 178
 			{
179
-				$sql = 'UPDATE ' . $this->categories_table . '
179
+				$sql = 'UPDATE '.$this->categories_table.'
180 180
 					SET cat_links = cat_links + 1
181 181
 					WHERE cat_id = ' . (int) $data['link_cat'];
182 182
 				$this->db->sql_query($sql);
@@ -194,8 +194,8 @@  discard block
 block discarded – undo
194 194
 			$this->notification->add_notifications($notification_type, $notification_data);
195 195
 		}
196 196
 
197
-		$sql = 'UPDATE ' . $this->links_table . '
198
-			SET ' . $this->db->sql_build_array('UPDATE', $data) . '
197
+		$sql = 'UPDATE '.$this->links_table.'
198
+			SET ' . $this->db->sql_build_array('UPDATE', $data).'
199 199
 			WHERE link_id = ' . (int) $link_id;
200 200
 		$this->db->sql_query($sql);
201 201
 	}
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 		);
222 222
 
223 223
 		$sql = 'SELECT link_banner
224
-			FROM ' . $this->links_table . '
224
+			FROM ' . $this->links_table.'
225 225
 			WHERE '. $this->db->sql_in_set('link_id', $url_array);
226 226
 		$result = $this->db->sql_query($sql);
227 227
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 			$this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $url_array));
244 244
 		}
245 245
 
246
-		$sql = 'UPDATE ' . $this->categories_table . '
246
+		$sql = 'UPDATE '.$this->categories_table.'
247 247
 			SET cat_links = cat_links - '.sizeof($url_array).'
248 248
 			WHERE cat_id = ' . (int) $cat_id;
249 249
 		$this->db->sql_query($sql);
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 		if ($this->request->is_ajax())
262 262
 		{
263 263
 			$sql = 'SELECT cat_links
264
-				FROM ' . $this->categories_table . '
264
+				FROM ' . $this->categories_table.'
265 265
 				WHERE cat_id = ' . (int) $cat_id;
266 266
 			$result = $this->db->sql_query($sql);
267 267
 			$data = $this->db->sql_fetchrow($result);
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	public function view($link_id)
289 289
 	{
290 290
 		$sql = 'SELECT link_id, link_url
291
-			FROM ' . $this->links_table . '
291
+			FROM ' . $this->links_table.'
292 292
 			WHERE link_id = ' . (int) $link_id;
293 293
 		$result = $this->db->sql_query($sql);
294 294
 		$data = $this->db->sql_fetchrow($result);
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 			throw new \phpbb\exception\http_exception(404, 'DIR_ERROR_NO_LINKS');
299 299
 		}
300 300
 
301
-		$sql = 'UPDATE ' . $this->links_table . '
301
+		$sql = 'UPDATE '.$this->links_table.'
302 302
 			SET link_view = link_view + 1
303 303
 			WHERE link_id = ' . (int) $link_id;
304 304
 		$this->db->sql_query($sql);
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 		if ($details['scheme'] == 'https')
324 324
 		{
325 325
 			$default_port = 443;
326
-			$hostname = 'tls://' . $details['host'];
326
+			$hostname = 'tls://'.$details['host'];
327 327
 		}
328 328
 
329 329
 		if (!isset($details['path']))
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 		$flag_path = $ext_path.'images/flags/';
382 382
 		$img_flag = 'no_flag.png';
383 383
 
384
-		if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path . $data['link_flag']))
384
+		if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path.$data['link_flag']))
385 385
 		{
386 386
 			$img_flag = $data['link_flag'];
387 387
 		}
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 			$list = '<select name="vote">';
424 424
 			for ($i = 0; $i <= 10; $i++)
425 425
 			{
426
-				$list .= '<option value="' . $i . '"' . (($i == 5) ? ' selected="selected"' : '') . '>' . $i . '</option>';
426
+				$list .= '<option value="'.$i.'"'.(($i == 5) ? ' selected="selected"' : '').'>'.$i.'</option>';
427 427
 			}
428 428
 			$list .= '</select>';
429 429
 
@@ -461,8 +461,8 @@  discard block
 block discarded – undo
461 461
 			{
462 462
 				$thumb = $this->thumb_process($data['link_url']);
463 463
 
464
-				$sql = 'UPDATE ' . $this->links_table . "
465
-					SET link_thumb = '" . $this->db->sql_escape($thumb) . "'
464
+				$sql = 'UPDATE '.$this->links_table."
465
+					SET link_thumb = '" . $this->db->sql_escape($thumb)."'
466 466
 					WHERE link_id = " . (int) $data['link_id'];
467 467
 				$this->db->sql_query($sql);
468 468
 
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 				$height /= $coef_max;
510 510
 			}
511 511
 
512
-			return '<img src="' . $img_src . '" width="' . $width . '" height="' . $height . '" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />';
512
+			return '<img src="'.$img_src.'" width="'.$width.'" height="'.$height.'" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />';
513 513
 		}
514 514
 		return '';
515 515
 	}
@@ -531,12 +531,12 @@  discard block
 block discarded – undo
531 531
 
532 532
 		$this->db->sql_transaction('begin');
533 533
 
534
-		$sql = 'INSERT INTO ' . $this->votes_table . ' ' . $this->db->sql_build_array('INSERT', $data);
534
+		$sql = 'INSERT INTO '.$this->votes_table.' '.$this->db->sql_build_array('INSERT', $data);
535 535
 		$this->db->sql_query($sql);
536 536
 
537
-		$sql = 'UPDATE ' . $this->links_table . '
537
+		$sql = 'UPDATE '.$this->links_table.'
538 538
 			SET link_vote = link_vote + 1,
539
-			link_note = link_note + ' . (int) $data['vote_note'] . '
539
+			link_note = link_note + ' . (int) $data['vote_note'].'
540 540
 		WHERE link_id = ' . (int) $link_id;
541 541
 		$this->db->sql_query($sql);
542 542
 
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 
545 545
 		if ($this->request->is_ajax())
546 546
 		{
547
-			$sql= 'SELECT link_vote, link_note FROM ' . $this->links_table . ' WHERE link_id = ' . (int) $link_id;
547
+			$sql = 'SELECT link_vote, link_note FROM '.$this->links_table.' WHERE link_id = '.(int) $link_id;
548 548
 			$result = $this->db->sql_query($sql);
549 549
 			$data = $this->db->sql_fetchrow($result);
550 550
 
@@ -578,8 +578,8 @@  discard block
 block discarded – undo
578 578
 
579 579
 		$details = parse_url($url);
580 580
 
581
-		$root_url		= $details['scheme'].'://'.$details['host'];
582
-		$absolute_url	= isset($details['path']) ? $root_url.$details['path'] : $root_url;
581
+		$root_url = $details['scheme'].'://'.$details['host'];
582
+		$absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url;
583 583
 
584 584
 		if ($this->config['dir_activ_thumb_remote'] && $this->_ascreen_exist($details['scheme'], $details['host']))
585 585
 		{
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 	{
620 620
 		$old_banner = $this->request->variable('old_banner', '');
621 621
 
622
-		$destination = $this->root_path . $this->get_banner_path();
622
+		$destination = $this->root_path.$this->get_banner_path();
623 623
 
624 624
 		// Can we upload?
625 625
 		$can_upload = ($this->config['dir_storage_banner'] && $this->filesystem->exists($destination) && $this->filesystem->is_writable($destination) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 
669 669
 		$file = $upload->handle_upload('files.types.remote', $banner);
670 670
 
671
-		$prefix = unique_id() . '_';
671
+		$prefix = unique_id().'_';
672 672
 		$file->clean_filename('real', $prefix);
673 673
 
674 674
 		if (sizeof($file->error))
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 	{
700 700
 		if (!preg_match('#^(http|https|ftp)://#i', $banner))
701 701
 		{
702
-			$banner = 'http://' . $banner;
702
+			$banner = 'http://'.$banner;
703 703
 		}
704 704
 		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))
705 705
 		{
@@ -730,8 +730,8 @@  discard block
 block discarded – undo
730 730
 		}
731 731
 
732 732
 		// Check image type
733
-		$types		= \phpbb\files\upload::image_types();
734
-		$extension	= strtolower(\phpbb\files\filespec::get_extension($banner));
733
+		$types = \phpbb\files\upload::image_types();
734
+		$extension = strtolower(\phpbb\files\filespec::get_extension($banner));
735 735
 
736 736
 		// Check if this is actually an image
737 737
 		if ($file_stream = @fopen($banner, 'r'))
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
 
852 852
 			if (file_exists($flag_path.$img_file))
853 853
 			{
854
-				$list .= '<option value="' . $img_file . '" ' . (($img_file == $value) ? 'selected="selected"' : '') . '>' . $name . '</option>';
854
+				$list .= '<option value="'.$img_file.'" '.(($img_file == $value) ? 'selected="selected"' : '').'>'.$name.'</option>';
855 855
 			}
856 856
 		}
857 857
 
@@ -867,8 +867,8 @@  discard block
 block discarded – undo
867 867
 	{
868 868
 		if ($this->config['dir_recent_block'])
869 869
 		{
870
-			$limit_sql		= $this->config['dir_recent_rows'] * $this->config['dir_recent_columns'];
871
-			$exclude_array	= array_filter(explode(',', str_replace(' ', '', $this->config['dir_recent_exclude'])));
870
+			$limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns'];
871
+			$exclude_array = array_filter(explode(',', str_replace(' ', '', $this->config['dir_recent_exclude'])));
872 872
 
873 873
 			$sql_array = array(
874 874
 				'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',
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
 							'ON'	=> 'l.link_cat = c.cat_id'
885 885
 						)
886 886
 				),
887
-				'WHERE'		=> 'l.link_active = 1' . (sizeof($exclude_array) ? ' AND ' . $this->db->sql_in_set('l.link_cat', $exclude_array, true) : ''),
887
+				'WHERE'		=> 'l.link_active = 1'.(sizeof($exclude_array) ? ' AND '.$this->db->sql_in_set('l.link_cat', $exclude_array, true) : ''),
888 888
 				'ORDER_BY'	=> 'l.link_time DESC, l.link_id DESC');
889 889
 
890 890
 			$sql = $this->db->sql_build_query('SELECT', $sql_array);
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 			if (sizeof($rowset))
902 902
 			{
903 903
 				$this->template->assign_block_vars('block', array(
904
-					'S_COL_WIDTH'			=> (100 / $this->config['dir_recent_columns']) . '%',
904
+					'S_COL_WIDTH'			=> (100 / $this->config['dir_recent_columns']).'%',
905 905
 				));
906 906
 
907 907
 				foreach ($rowset as $row)
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
 						'COUNT'					  => $row['link_view'],
921 921
 						'COMMENT'                 => $row['link_comment'],
922 922
 
923
-						'U_CAT'                   => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $row['link_cat']),
923
+						'U_CAT'                   => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$row['link_cat']),
924 924
 						'U_COMMENT'               => $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $row['link_id'])),
925 925
 
926 926
 						'L_DIR_SEARCH_NB_CLICKS'	=> $this->language->lang('DIR_SEARCH_NB_CLICKS', (int) $row['link_view']),
Please login to merge, or discard this patch.
controller/links.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -87,19 +87,19 @@  discard block
 block discarded – undo
87 87
 	*/
88 88
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext)
89 89
 	{
90
-		$this->db				= $db;
91
-		$this->config			= $config;
90
+		$this->db = $db;
91
+		$this->config = $config;
92 92
 		$this->language			= $language;
93 93
 		$this->template			= $template;
94 94
 		$this->user				= $user;
95
-		$this->helper			= $helper;
96
-		$this->request			= $request;
95
+		$this->helper = $helper;
96
+		$this->request = $request;
97 97
 		$this->auth				= $auth;
98
-		$this->captcha_factory 	= $captcha_factory;
98
+		$this->captcha_factory = $captcha_factory;
99 99
 		$this->categorie		= $categorie;
100 100
 		$this->link				= $link;
101 101
 		$this->root_path		= $root_path;
102
-		$this->php_ext			= $php_ext;
102
+		$this->php_ext = $php_ext;
103 103
 
104 104
 		$language->add_lang('directory', 'ernadoo/phpbbdirectory');
105 105
 
@@ -119,12 +119,12 @@  discard block
 block discarded – undo
119 119
 	{
120 120
 		if ($this->request->is_set_post('cancel'))
121 121
 		{
122
-			$redirect = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
122
+			$redirect = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
123 123
 			redirect($redirect);
124 124
 		}
125 125
 
126 126
 		$sql = 'SELECT link_user_id
127
-			FROM ' . $this->links_table . '
127
+			FROM ' . $this->links_table.'
128 128
 			WHERE link_id = ' . (int) $link_id;
129 129
 		$result = $this->db->sql_query($sql);
130 130
 		$link_data = $this->db->sql_fetchrow($result);
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
 		{
146 146
 			$this->link->del($cat_id, $link_id);
147 147
 
148
-			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
148
+			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
149 149
 			meta_refresh(3, $meta_info);
150
-			$message = $this->language->lang('DIR_DELETE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id) . '">', '</a>');
150
+			$message = $this->language->lang('DIR_DELETE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id).'">', '</a>');
151 151
 			return $this->helper->message($message);
152 152
 		}
153 153
 		else
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	public function edit_link($cat_id, $link_id)
168 168
 	{
169 169
 		$sql = 'SELECT link_id, link_uid, link_user_id, link_flags, link_bitfield, link_cat, link_url, link_description, link_guest_email, link_name, link_rss, link_back, link_banner, link_flag, link_cat, link_time
170
-			FROM ' . $this->links_table . '
170
+			FROM ' . $this->links_table.'
171 171
 			WHERE link_id = ' . (int) $link_id;
172 172
 		$result = $this->db->sql_query($sql);
173 173
 		$link_data = $this->db->sql_fetchrow($result);
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 		$cat_id		= $this->request->variable('id', $cat_id);
189 189
 		$submit		= $this->request->is_set_post('submit') ? true : false;
190 190
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
191
-		$title		= $this->language->lang('DIR_EDIT_SITE');
191
+		$title = $this->language->lang('DIR_EDIT_SITE');
192 192
 
193 193
 		$this->template->assign_block_vars('dir_navlinks', array(
194 194
 			'FORUM_NAME'	=> $title,
@@ -212,15 +212,15 @@  discard block
 block discarded – undo
212 212
 				'old_banner'	=> $link_data['link_banner'],
213 213
 			);
214 214
 
215
-			$site_description			= generate_text_for_edit($link_data['link_description'], $link_data['link_uid'], $link_data['link_flags']);
216
-			$link_data['link_banner'] 	= (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $link_data['link_banner'])) ? $link_data['link_banner'] : '';
215
+			$site_description = generate_text_for_edit($link_data['link_description'], $link_data['link_uid'], $link_data['link_flags']);
216
+			$link_data['link_banner'] = (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $link_data['link_banner'])) ? $link_data['link_banner'] : '';
217 217
 
218
-			$this->url			= $link_data['link_url'];
219
-			$this->site_name	= $link_data['link_name'];
218
+			$this->url = $link_data['link_url'];
219
+			$this->site_name = $link_data['link_name'];
220 220
 			$this->description	= $site_description['text'];
221 221
 			$this->guest_email	= $link_data['link_guest_email'];
222
-			$this->rss			= $link_data['link_rss'];
223
-			$this->banner 		= $link_data['link_banner'];
222
+			$this->rss = $link_data['link_rss'];
223
+			$this->banner = $link_data['link_banner'];
224 224
 			$this->back			= $link_data['link_back'];
225 225
 			$this->flag 		= $link_data['link_flag'];
226 226
 		}
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 		$cat_id		= $this->request->variable('id', $cat_id);
248 248
 		$submit		= $this->request->is_set_post('submit') ? true : false;
249 249
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
250
-		$title		= $this->language->lang('DIR_NEW_SITE');
250
+		$title = $this->language->lang('DIR_NEW_SITE');
251 251
 
252 252
 		$this->template->assign_block_vars('dir_navlinks', array(
253 253
 			'FORUM_NAME'	=> $title,
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 
312 312
 		// We check if user had already vot for this website.
313 313
 		$sql = 'SELECT vote_link_id
314
-			FROM ' . $this->votes_table . '
314
+			FROM ' . $this->votes_table.'
315 315
 			WHERE ' . $this->db->sql_build_array('SELECT', $data);
316 316
 		$result = $this->db->sql_query($sql);
317 317
 		$data = $this->db->sql_fetchrow($result);
@@ -323,9 +323,9 @@  discard block
 block discarded – undo
323 323
 
324 324
 		$this->link->add_vote($link_id, $this->request->variable('vote', 0));
325 325
 
326
-		$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
326
+		$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
327 327
 		meta_refresh(3, $meta_info);
328
-		$message = $this->language->lang('DIR_VOTE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $meta_info . '">', '</a>');
328
+		$message = $this->language->lang('DIR_VOTE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$meta_info.'">', '</a>');
329 329
 		return $this->helper->message($message);
330 330
 	}
331 331
 
@@ -350,18 +350,18 @@  discard block
 block discarded – undo
350 350
 			return $this->helper->message('FORM_INVALID');
351 351
 		}
352 352
 
353
-		$this->url			= $this->request->variable('url', '');
354
-		$this->site_name	= $this->request->variable('site_name', '', true);
353
+		$this->url = $this->request->variable('url', '');
354
+		$this->site_name = $this->request->variable('site_name', '', true);
355 355
 		$this->description	= $this->request->variable('description', '', true);
356 356
 		$this->guest_email	= $this->request->variable('guest_email', '');
357
-		$this->rss			= $this->request->variable('rss', '');
358
-		$this->banner 		= $this->request->variable('banner', '');
357
+		$this->rss = $this->request->variable('rss', '');
358
+		$this->banner = $this->request->variable('banner', '');
359 359
 		$this->back			= $this->request->variable('back', '');
360 360
 		$this->flag 		= $this->request->variable('flag', '');
361 361
 
362 362
 		if (!function_exists('validate_data'))
363 363
 		{
364
-			include($this->root_path . 'includes/functions_user.' . $this->php_ext);
364
+			include($this->root_path.'includes/functions_user.'.$this->php_ext);
365 365
 		}
366 366
 
367 367
 		// We define variables to check
@@ -384,17 +384,17 @@  discard block
 block discarded – undo
384 384
 			'site_name' =>			array(
385 385
 				array('string', false, 1, 100)),
386 386
 			'website'		=>		array(
387
-				array('string',	false, 12, 255),
388
-				array('match',	true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
387
+				array('string', false, 12, 255),
388
+				array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
389 389
 			'description'	=>		array(
390 390
 				array('string', !$this->categorie->data['cat_must_describe'], 1, $this->config['dir_length_describe'])),
391 391
 			'rss'			=>		array(
392 392
 				array('string', true, 12, 255),
393
-				array('match',	empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
393
+				array('match', empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
394 394
 			'banner'		=>		array(
395 395
 				array('string', true, 5, 255)),
396 396
 			'back'			=>		array(
397
-				array('string',	!$this->categorie->data['cat_link_back'], 12, 255),
397
+				array('string', !$this->categorie->data['cat_link_back'], 12, 255),
398 398
 				array(array($this->link, 'link_back'), true)),
399 399
 			'cat'			=>		array(
400 400
 				array('num', '', 1))
@@ -440,8 +440,8 @@  discard block
 block discarded – undo
440 440
 		// Still no errors?? So let's go!
441 441
 		if (!$error)
442 442
 		{
443
-			$this->banner	= (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
444
-			$this->url		= $this->link->clean_url($this->url);
443
+			$this->banner = (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
444
+			$this->url = $this->link->clean_url($this->url);
445 445
 
446 446
 			$data_edit = array(
447 447
 				'link_user_id'		=> $this->link_user_id,
@@ -486,10 +486,10 @@  discard block
 block discarded – undo
486 486
 				$this->link->add($data_add, $need_approval);
487 487
 			}
488 488
 
489
-			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
489
+			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
490 490
 			meta_refresh(3, $meta_info);
491 491
 			$message	= ($need_approval) ? $this->language->lang('DIR_'.strtoupper($mode).'_SITE_ACTIVE') : $this->language->lang('DIR_'.strtoupper($mode).'_SITE_OK');
492
-			$message	= $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id) . '">', '</a>');
492
+			$message	= $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id).'">', '</a>');
493 493
 			return $this->helper->message($message);
494 494
 		}
495 495
 		else
@@ -518,10 +518,10 @@  discard block
 block discarded – undo
518 518
 	{
519 519
 		if (!function_exists('file_gc'))
520 520
 		{
521
-			include($this->root_path . 'includes/functions_download.' . $this->php_ext);
521
+			include($this->root_path.'includes/functions_download.'.$this->php_ext);
522 522
 		}
523 523
 
524
-		$file_path = $this->root_path . $this->get_banner_path($banner_img);
524
+		$file_path = $this->root_path.$this->get_banner_path($banner_img);
525 525
 
526 526
 		if ((@file_exists($file_path) && @is_readable($file_path)))
527 527
 		{
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 
574 574
 		if (!function_exists('display_custom_bbcodes'))
575 575
 		{
576
-			include($this->root_path . 'includes/functions_display.' . $this->php_ext);
576
+			include($this->root_path.'includes/functions_display.'.$this->php_ext);
577 577
 		}
578 578
 		display_custom_bbcodes();
579 579
 		add_form_key('dir_form');
@@ -582,17 +582,17 @@  discard block
 block discarded – undo
582 582
 		$flag_path = $ext_path.'images/flags/';
583 583
 
584 584
 		$s_guest	= (!$this->user->data['is_registered'] || !empty($this->guest_email));
585
-		$s_rss		= $this->config['dir_activ_rss'];
586
-		$s_banner	= $this->config['dir_activ_banner'];
585
+		$s_rss = $this->config['dir_activ_rss'];
586
+		$s_banner = $this->config['dir_activ_banner'];
587 587
 		$s_back		= $this->categorie->data['cat_link_back'];
588 588
 		$s_flag		= $this->config['dir_activ_flag'];
589 589
 
590 590
 		$this->template->assign_vars(array(
591
-			'BBCODE_STATUS'			=> ($this->config['allow_bbcode']) 	? $this->language->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'),
592
-			'IMG_STATUS'			=> ($this->config['allow_bbcode'])	? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
591
+			'BBCODE_STATUS'			=> ($this->config['allow_bbcode']) ? $this->language->lang('BBCODE_IS_ON', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>'),
592
+			'IMG_STATUS'			=> ($this->config['allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
593 593
 			'SMILIES_STATUS'		=> ($this->config['allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'),
594 594
 			'URL_STATUS'			=> ($this->config['allow_post_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'),
595
-			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash'])	? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
595
+			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
596 596
 
597 597
 			'L_TITLE'				=> $title,
598 598
 			'L_DIR_DESCRIPTION_EXP'	=> $this->language->lang('DIR_DESCRIPTION_EXP', $this->config['dir_length_describe']),
Please login to merge, or discard this patch.