Completed
Branch 3.2.x (01dc0a)
by Erwan
03:51
created
controller/search.php 2 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -50,21 +50,21 @@  discard block
 block discarded – undo
50 50
 	protected $link;
51 51
 
52 52
 	/**
53
-	* Constructor
54
-	*
55
-	* @param \phpbb\db\driver\driver_interface 					$db				Database object
56
-	* @param \phpbb\config\config 								$config			Config object
57
-	* @param \phpbb\language\language							$language		Language object
58
-	* @param \phpbb\template\template 							$template		Template object
59
-	* @param \phpbb\user 										$user			User object
60
-	* @param \phpbb\controller\helper 							$helper			Controller helper object
61
-	* @param \phpbb\request\request 							$request		Request object
62
-	* @param \phpbb\auth\auth 									$auth			Auth object
63
-	* @param \phpbb\pagination 									$pagination		Pagination object
64
-	* @param \ernadoo\phpbbdirectory\search\fulltext_directory	$search			PhpBB Directory extension search object
65
-	* @param \ernadoo\phpbbdirectory\core\categorie				$categorie		PhpBB Directory extension categorie object
66
-	* @param \ernadoo\phpbbdirectory\core\link					$link			PhpBB Directory extension link object
67
-	*/
53
+	 * Constructor
54
+	 *
55
+	 * @param \phpbb\db\driver\driver_interface 					$db				Database object
56
+	 * @param \phpbb\config\config 								$config			Config object
57
+	 * @param \phpbb\language\language							$language		Language object
58
+	 * @param \phpbb\template\template 							$template		Template object
59
+	 * @param \phpbb\user 										$user			User object
60
+	 * @param \phpbb\controller\helper 							$helper			Controller helper object
61
+	 * @param \phpbb\request\request 							$request		Request object
62
+	 * @param \phpbb\auth\auth 									$auth			Auth object
63
+	 * @param \phpbb\pagination 									$pagination		Pagination object
64
+	 * @param \ernadoo\phpbbdirectory\search\fulltext_directory	$search			PhpBB Directory extension search object
65
+	 * @param \ernadoo\phpbbdirectory\core\categorie				$categorie		PhpBB Directory extension categorie object
66
+	 * @param \ernadoo\phpbbdirectory\core\link					$link			PhpBB Directory extension link object
67
+	 */
68 68
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\search\fulltext_directory $search, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link)
69 69
 	{
70 70
 		$this->db			= $db;
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
 	}
91 91
 
92 92
 	/**
93
-	* Search controller
94
-	*
95
-	* @param	int	$page	Page number taken from the URL
96
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
97
-	* @throws	\phpbb\exception\http_exception
98
-	*/
93
+	 * Search controller
94
+	 *
95
+	 * @param	int	$page	Page number taken from the URL
96
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
97
+	 * @throws	\phpbb\exception\http_exception
98
+	 */
99 99
 	public function main($page)
100 100
 	{
101 101
 		if (!$this->auth->acl_get('u_search_dir'))
@@ -319,11 +319,11 @@  discard block
 block discarded – undo
319 319
 	}
320 320
 
321 321
 	/**
322
-	*
323
-	* @param	array	$search_category
324
-	* @param	bool	$search_child
325
-	* @return	array	Categories to exclude from search
326
-	*/
322
+	 *
323
+	 * @param	array	$search_category
324
+	 * @param	bool	$search_child
325
+	 * @return	array	Categories to exclude from search
326
+	 */
327 327
 	private function _get_exclude_categories(&$search_category, $search_child)
328 328
 	{
329 329
 		$sql = 'SELECT cat_id, parent_id, right_id
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -67,18 +67,18 @@  discard block
 block discarded – undo
67 67
 	*/
68 68
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\search\fulltext_directory $search, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link)
69 69
 	{
70
-		$this->db			= $db;
71
-		$this->config		= $config;
70
+		$this->db = $db;
71
+		$this->config = $config;
72 72
 		$this->language		= $language;
73 73
 		$this->template		= $template;
74 74
 		$this->user			= $user;
75
-		$this->helper		= $helper;
76
-		$this->request		= $request;
75
+		$this->helper = $helper;
76
+		$this->request = $request;
77 77
 		$this->auth			= $auth;
78
-		$this->pagination	= $pagination;
79
-		$this->search		= $search;
80
-		$this->categorie	= $categorie;
81
-		$this->link			= $link;
78
+		$this->pagination = $pagination;
79
+		$this->search = $search;
80
+		$this->categorie = $categorie;
81
+		$this->link = $link;
82 82
 
83 83
 		$language->add_lang('directory', 'ernadoo/phpbbdirectory');
84 84
 		$language->add_lang('search');
@@ -103,24 +103,24 @@  discard block
 block discarded – undo
103 103
 			throw new \phpbb\exception\http_exception(403, 'DIR_ERROR_NOT_AUTH');
104 104
 		}
105 105
 
106
-		$cat_id				= $this->request->variable('cat_id', 0);
107
-		$keywords			= $this->request->variable('keywords', '', true);
106
+		$cat_id = $this->request->variable('cat_id', 0);
107
+		$keywords = $this->request->variable('keywords', '', true);
108 108
 		$search_terms		= $this->request->variable('terms', 'all');
109
-		$search_category	= $this->request->variable('cid', array(0));
110
-		$search_fields		= $this->request->variable('sf', 'all');
109
+		$search_category = $this->request->variable('cid', array(0));
110
+		$search_fields = $this->request->variable('sf', 'all');
111 111
 		$search_child		= $this->request->variable('sc', true);
112
-		$sort_days			= $this->request->variable('st', 0);
112
+		$sort_days = $this->request->variable('st', 0);
113 113
 		$sort_key			= $this->request->variable('sk', 't');
114 114
 		$sort_dir			= $this->request->variable('sd', 'd');
115
-		$start				= ($page - 1) * (int) $this->config['dir_show'];
115
+		$start = ($page - 1) * (int) $this->config['dir_show'];
116 116
 
117
-		$default_sort_days	= 0;
117
+		$default_sort_days = 0;
118 118
 		$default_sort_key	= (string) substr($this->config['dir_default_order'], 0, 1);
119 119
 		$default_sort_dir	= (string) substr($this->config['dir_default_order'], 2);
120 120
 
121 121
 		// Categorie ordering options
122 122
 		$limit_days		= array(0 => $this->language->lang('ALL_RESULTS'), 1 => $this->language->lang('1_DAY'), 7 => $this->language->lang('7_DAYS'), 14 => $this->language->lang('2_WEEKS'), 30 => $this->language->lang('1_MONTH'), 90 => $this->language->lang('3_MONTHS'), 180 => $this->language->lang('6_MONTHS'), 365 => $this->language->lang('1_YEAR'));
123
-		$sort_by_text	= array('a' => $this->language->lang('AUTHOR'), 't' => $this->language->lang('POST_TIME'), 'r' => $this->language->lang('DIR_COMMENTS_ORDER'), 's' =>  $this->language->lang('DIR_NAME_ORDER'), 'v' => $this->language->lang('DIR_NB_CLICKS_ORDER'));
123
+		$sort_by_text = array('a' => $this->language->lang('AUTHOR'), 't' => $this->language->lang('POST_TIME'), 'r' => $this->language->lang('DIR_COMMENTS_ORDER'), 's' =>  $this->language->lang('DIR_NAME_ORDER'), 'v' => $this->language->lang('DIR_NB_CLICKS_ORDER'));
124 124
 		$sort_by_sql	= array('a' => 'u.username_clean', 't' => array('l.link_time', 'l.link_id'), 'r' => 'l.link_comment', 's' => 'l.link_name', 'v' => 'l.link_view');
125 125
 
126 126
 		if ($this->config['dir_activ_pagerank'])
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
 
170 170
 			$u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit)));
171 171
 
172
-			($u_hilit) 					? $u_search['keywords']		= urlencode(htmlspecialchars_decode($keywords)) : '';
173
-			($search_terms != 'all') 	? $u_search['terms']		= $search_terms : '';
174
-			($cat_id)					? $u_search['cat_id']		= $cat_id : '';
175
-			($search_category)			? $u_search['cid']			= $search_category : '';
176
-			(!$search_child)			? $u_search['sc']			= 0 : '';
177
-			($search_fields != 'all')	? $u_search['sf'] 			= $search_fields : '';
172
+			($u_hilit) ? $u_search['keywords'] = urlencode(htmlspecialchars_decode($keywords)) : '';
173
+			($search_terms != 'all') ? $u_search['terms'] = $search_terms : '';
174
+			($cat_id) ? $u_search['cat_id'] = $cat_id : '';
175
+			($search_category) ? $u_search['cid'] = $search_category : '';
176
+			(!$search_child) ? $u_search['sc'] = 0 : '';
177
+			($search_fields != 'all') ? $u_search['sf'] = $search_fields : '';
178 178
 
179 179
 			$base_url = array(
180 180
 				'routes'	=> 'ernadoo_phpbbdirectory_search_controller',
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 
249 249
 					foreach ($rowset as $data)
250 250
 					{
251
-						$s_banner	= $this->link->display_bann($data);
251
+						$s_banner = $this->link->display_bann($data);
252 252
 						$s_thumb	= $this->link->display_thumb($data);
253 253
 						$s_flag		= $this->link->display_flag($data);
254 254
 
@@ -269,10 +269,10 @@  discard block
 block discarded – undo
269 269
 							'S_TIME'		=> ($data['link_time'] != 0) ? $this->user->format_date($data['link_time']) : '',
270 270
 							'S_COMMENT'		=> $data['link_comment'],
271 271
 
272
-							'THUMB'			=> '<img src="'.$s_thumb.'" alt="'.$this->language->lang('DIR_THUMB').'" title="'.$data['link_name'].'"/>',
272
+							'THUMB'			=> '<img src="' . $s_thumb . '" alt="' . $this->language->lang('DIR_THUMB') . '" title="' . $data['link_name'] . '"/>',
273 273
 							'IMG_BANNER'	=> $s_banner,
274 274
 							'IMG_FLAG'		=> $s_flag,
275
-							'ON_CLICK' 		=> "onclick=\"window.open('".$this->helper->route('ernadoo_phpbbdirectory_view_controller', array('link_id' => (int) $data['link_id']))."'); return false;\"",
275
+							'ON_CLICK' 		=> "onclick=\"window.open('" . $this->helper->route('ernadoo_phpbbdirectory_view_controller', array('link_id' => (int) $data['link_id'])) . "'); return false;\"",
276 276
 
277 277
 							'L_DIR_SEARCH_NB_CLICKS'	=> $this->language->lang('DIR_SEARCH_NB_CLICKS', (int) $data['link_view']),
278 278
 							'L_DIR_SEARCH_NB_COMMS'		=> $this->language->lang('DIR_SEARCH_NB_COMMS', (int) $data['link_comment']),
Please login to merge, or discard this patch.
core/categorie.php 2 patches
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -47,19 +47,19 @@  discard block
 block discarded – undo
47 47
 	public $data = array();
48 48
 
49 49
 	/**
50
-	* Constructor
51
-	*
52
-	* @param \phpbb\db\driver\driver_interface 		$db			Database object
53
-	* @param \phpbb\config\config 					$config		Config object
54
-	* @param \phpbb\language\language				$language	Language object
55
-	* @param \phpbb\template\template 				$template	Template object
56
-	* @param \phpbb\user 							$user		User object
57
-	* @param \phpbb\controller\helper 				$helper		Controller helper object
58
-	* @param \phpbb\request\request 				$request	Request object
59
-	* @param \phpbb\auth\auth 						$auth		Auth object
60
-	* @param \phpbb\cron\manager					$cron		Cron object
61
-	* @param \ernadoo\phpbbdirectory\core\helper	$dir_helper	PhpBB Directory extension helper object
62
-	*/
50
+	 * Constructor
51
+	 *
52
+	 * @param \phpbb\db\driver\driver_interface 		$db			Database object
53
+	 * @param \phpbb\config\config 					$config		Config object
54
+	 * @param \phpbb\language\language				$language	Language object
55
+	 * @param \phpbb\template\template 				$template	Template object
56
+	 * @param \phpbb\user 							$user		User object
57
+	 * @param \phpbb\controller\helper 				$helper		Controller helper object
58
+	 * @param \phpbb\request\request 				$request	Request object
59
+	 * @param \phpbb\auth\auth 						$auth		Auth object
60
+	 * @param \phpbb\cron\manager					$cron		Cron object
61
+	 * @param \ernadoo\phpbbdirectory\core\helper	$dir_helper	PhpBB Directory extension helper object
62
+	 */
63 63
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\cron\manager $cron, \ernadoo\phpbbdirectory\core\helper $dir_helper)
64 64
 	{
65 65
 		$this->db			= $db;
@@ -75,21 +75,21 @@  discard block
 block discarded – undo
75 75
 	}
76 76
 
77 77
 	/**
78
-	* Function for get approval setting
79
-	* used in edit mode for test the setting of new category's link
80
-	*
81
-	* @return bool
82
-	*/
78
+	 * Function for get approval setting
79
+	 * used in edit mode for test the setting of new category's link
80
+	 *
81
+	 * @return bool
82
+	 */
83 83
 	public function need_approval()
84 84
 	{
85 85
 		return (bool) $this->data['cat_validate'];
86 86
 	}
87 87
 
88 88
 	/**
89
-	* Generate Jumpbox
90
-	*
91
-	* @return null
92
-	*/
89
+	 * Generate Jumpbox
90
+	 *
91
+	 * @return null
92
+	 */
93 93
 	public function make_cat_jumpbox()
94 94
 	{
95 95
 		$sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
 	}
143 143
 
144 144
 	/**
145
-	* Generate a list of directory's categories
146
-	*
147
-	* @param	int		$select_id		Selected category
148
-	* @param	array	$ignore_id		Array of ignored categories
149
-	* @return	string	$cat_list		html code
150
-	*/
145
+	 * Generate a list of directory's categories
146
+	 *
147
+	 * @param	int		$select_id		Selected category
148
+	 * @param	array	$ignore_id		Array of ignored categories
149
+	 * @return	string	$cat_list		html code
150
+	 */
151 151
 	public function make_cat_select($select_id = 0, $ignore_id = array())
152 152
 	{
153 153
 		$ignore_id = is_array($ignore_id) ? $ignore_id : array($ignore_id);
@@ -193,10 +193,10 @@  discard block
 block discarded – undo
193 193
 	}
194 194
 
195 195
 	/**
196
-	* Display cat or subcat
197
-	*
198
-	* @return	null
199
-	*/
196
+	 * Display cat or subcat
197
+	 *
198
+	 * @return	null
199
+	 */
200 200
 	public function display()
201 201
 	{
202 202
 		$cat_rows	= $subcats = array();
@@ -325,11 +325,11 @@  discard block
 block discarded – undo
325 325
 	}
326 326
 
327 327
 	/**
328
-	* Get informations about a cat or subcat
329
-	*
330
-	* @param	int	$cat_id		The category ID
331
-	* @return	null|false
332
-	*/
328
+	 * Get informations about a cat or subcat
329
+	 *
330
+	 * @param	int	$cat_id		The category ID
331
+	 * @return	null|false
332
+	 */
333 333
 	public function get($cat_id = 0)
334 334
 	{
335 335
 		if ($cat_id)
@@ -357,11 +357,11 @@  discard block
 block discarded – undo
357 357
 	}
358 358
 
359 359
 	/**
360
-	* Create category navigation links for given category, create parent
361
-	* list if currently null, assign basic category info to template
362
-	*
363
-	* @param	array	$dir_cat_data
364
-	*/
360
+	 * Create category navigation links for given category, create parent
361
+	 * list if currently null, assign basic category info to template
362
+	 *
363
+	 * @param	array	$dir_cat_data
364
+	 */
365 365
 	public function generate_dir_nav(&$dir_cat_data)
366 366
 	{
367 367
 		global $phpbb_container;
@@ -398,12 +398,12 @@  discard block
 block discarded – undo
398 398
 	}
399 399
 
400 400
 	/**
401
-	* Return good key language
402
-	*
403
-	* @param	bool	$validate	True if approbation needed before publication
404
-	* @return	string				Information about approval, depends on user auth level
405
-	* @throws	\phpbb\exception\runtime_exception
406
-	*/
401
+	 * Return good key language
402
+	 *
403
+	 * @param	bool	$validate	True if approbation needed before publication
404
+	 * @return	string				Information about approval, depends on user auth level
405
+	 * @throws	\phpbb\exception\runtime_exception
406
+	 */
407 407
 	public function dir_submit_type($validate)
408 408
 	{
409 409
 		if ($validate && !$this->auth->acl_get('a_'))
@@ -427,15 +427,15 @@  discard block
 block discarded – undo
427 427
 	}
428 428
 
429 429
 	/**
430
-	* Category watching common code
431
-	*
432
-	* @param	string	$mode			Watch or unwatch a category
433
-	* @param	array	$s_watching		An empty array, passed by reference
434
-	* @param	int		$user_id		The user ID
435
-	* @param	int		$cat_id			The category ID
436
-	* @param	string	$notify_status	User is watching the category?
437
-	* @return	null
438
-	*/
430
+	 * Category watching common code
431
+	 *
432
+	 * @param	string	$mode			Watch or unwatch a category
433
+	 * @param	array	$s_watching		An empty array, passed by reference
434
+	 * @param	int		$user_id		The user ID
435
+	 * @param	int		$cat_id			The category ID
436
+	 * @param	string	$notify_status	User is watching the category?
437
+	 * @return	null
438
+	 */
439 439
 	public function watch_categorie($mode, &$s_watching, $user_id, $cat_id, $notify_status)
440 440
 	{
441 441
 		// Is user watching this thread?
@@ -521,11 +521,11 @@  discard block
 block discarded – undo
521 521
 	}
522 522
 
523 523
 	/**
524
-	* Return Category name
525
-	*
526
-	* @param	int		$cat_id		The category ID
527
-	* @return	string				The category name
528
-	*/
524
+	 * Return Category name
525
+	 *
526
+	 * @param	int		$cat_id		The category ID
527
+	 * @return	string				The category name
528
+	 */
529 529
 	static public function getname($cat_id)
530 530
 	{
531 531
 		global $db;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -62,16 +62,16 @@  discard block
 block discarded – undo
62 62
 	*/
63 63
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\cron\manager $cron, \ernadoo\phpbbdirectory\core\helper $dir_helper)
64 64
 	{
65
-		$this->db			= $db;
66
-		$this->config		= $config;
65
+		$this->db = $db;
66
+		$this->config = $config;
67 67
 		$this->language		= $language;
68 68
 		$this->template		= $template;
69 69
 		$this->user			= $user;
70
-		$this->helper		= $helper;
71
-		$this->request		= $request;
70
+		$this->helper = $helper;
71
+		$this->request = $request;
72 72
 		$this->auth			= $auth;
73 73
 		$this->cron 		= $cron;
74
-		$this->dir_helper	= $dir_helper;
74
+		$this->dir_helper = $dir_helper;
75 75
 	}
76 76
 
77 77
 	/**
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	*/
200 200
 	public function display()
201 201
 	{
202
-		$cat_rows	= $subcats = array();
202
+		$cat_rows = $subcats = array();
203 203
 		$parent_id	= $visible_cats = 0;
204 204
 
205 205
 		$sql_array = array(
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 			{
265 265
 				foreach ($subcats[$dir_cat_id] as $subcat_id => $subcat_row)
266 266
 				{
267
-					$row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links']+$subcat_row['links']) : $row['cat_links'];
267
+					$row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links'] + $subcat_row['links']) : $row['cat_links'];
268 268
 
269 269
 					if ($subcat_row['display'] && $subcat_row['parent_id'] == $dir_cat_id)
270 270
 					{
@@ -510,9 +510,9 @@  discard block
 block discarded – undo
510 510
 
511 511
 		if ($can_watch)
512 512
 		{
513
-			$s_watching['link'] 		= $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch')));
513
+			$s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch')));
514 514
 			$s_watching['link_toggle'] 	= $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => ((!$is_watching) ? 'unwatch' : 'watch')));
515
-			$s_watching['title'] 		= $this->language->lang((($is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT');
515
+			$s_watching['title'] = $this->language->lang((($is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT');
516 516
 			$s_watching['title_toggle'] = $this->language->lang(((!$is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT');
517 517
 			$s_watching['is_watching'] 	= $is_watching;
518 518
 		}
Please login to merge, or discard this patch.
core/comment.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 	protected $language;
23 23
 
24 24
 	/**
25
-	* Constructor
26
-	*
27
-	* @param \phpbb\db\driver\driver_interface	$db			Database object
28
-	* @param \phpbb\language\language			$language	Language object
29
-	*/
25
+	 * Constructor
26
+	 *
27
+	 * @param \phpbb\db\driver\driver_interface	$db			Database object
28
+	 * @param \phpbb\language\language			$language	Language object
29
+	 */
30 30
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language)
31 31
 	{
32 32
 		$this->db		= $db;
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
 	}
35 35
 
36 36
 	/**
37
-	* Add a comment
38
-	*
39
-	* @param	array	$data	Link's data from db
40
-	* @return	null
41
-	*/
37
+	 * Add a comment
38
+	 *
39
+	 * @param	array	$data	Link's data from db
40
+	 * @return	null
41
+	 */
42 42
 	public function add($data)
43 43
 	{
44 44
 		$this->db->sql_transaction('begin');
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
 	}
56 56
 
57 57
 	/**
58
-	* Edit a comment
59
-	*
60
-	* @param	array	$data		Data to edit
61
-	* @param	int		$comment_id	The comment ID
62
-	* @return	null
63
-	*/
58
+	 * Edit a comment
59
+	 *
60
+	 * @param	array	$data		Data to edit
61
+	 * @param	int		$comment_id	The comment ID
62
+	 * @return	null
63
+	 */
64 64
 	public function edit($data, $comment_id)
65 65
 	{
66 66
 		$sql = 'UPDATE ' . DIR_COMMENT_TABLE . '
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
 	}
71 71
 
72 72
 	/**
73
-	* Delete a comment
74
-	*
75
-	* @param	string	$link_id	The link ID
76
-	* @param	string	$comment_id	The comment ID
77
-	* @return	null
78
-	*/
73
+	 * Delete a comment
74
+	 *
75
+	 * @param	string	$link_id	The link ID
76
+	 * @param	string	$comment_id	The comment ID
77
+	 * @return	null
78
+	 */
79 79
 	public function del($link_id, $comment_id)
80 80
 	{
81 81
 		global $request;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@
 block discarded – undo
29 29
 	*/
30 30
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language)
31 31
 	{
32
-		$this->db		= $db;
33
-		$this->language	= $language;
32
+		$this->db = $db;
33
+		$this->language = $language;
34 34
 	}
35 35
 
36 36
 	/**
Please login to merge, or discard this patch.
core/helper.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 	private $ext_name = 'ernadoo/phpbbdirectory';
23 23
 
24 24
 	/**
25
-	* Constructor
26
-	*
27
-	* @param \phpbb\extension\manager 		$phpbb_extension_manager	Extension manager helper
28
-	* @param \phpbb\path_helper				$path_helper				Controller path helper object
29
-	*/
25
+	 * Constructor
26
+	 *
27
+	 * @param \phpbb\extension\manager 		$phpbb_extension_manager	Extension manager helper
28
+	 * @param \phpbb\path_helper				$path_helper				Controller path helper object
29
+	 */
30 30
 	public function __construct(\phpbb\extension\manager $phpbb_extension_manager, \phpbb\path_helper $path_helper)
31 31
 	{
32 32
 		$this->extension_manager	= $phpbb_extension_manager;
@@ -34,48 +34,48 @@  discard block
 block discarded – undo
34 34
 	}
35 35
 
36 36
 	/**
37
-	* Return ext name
38
-	*
39
-	* @param	bool	$web_root_path Whether the path should be relative to web root
40
-	* @return	string					Path to an extension
41
-	*/
37
+	 * Return ext name
38
+	 *
39
+	 * @param	bool	$web_root_path Whether the path should be relative to web root
40
+	 * @return	string					Path to an extension
41
+	 */
42 42
 	public function get_ext_name($web_root_path = false)
43 43
 	{
44 44
 		return (($web_root_path) ? $this->path_helper->get_web_root_path() : '') . $this->extension_manager->get_extension_path($this->ext_name);
45 45
 	}
46 46
 
47 47
 	/**
48
-	* Return path to resource image
49
-	*
50
-	* @param	string $type	is ressource type (flags|icons)
51
-	* @param	string $image	is the resource to display
52
-	* @return	string			The relative path to ressource
53
-	*/
48
+	 * Return path to resource image
49
+	 *
50
+	 * @param	string $type	is ressource type (flags|icons)
51
+	 * @param	string $image	is the resource to display
52
+	 * @return	string			The relative path to ressource
53
+	 */
54 54
 	public function get_img_path($type, $image = '')
55 55
 	{
56 56
 		return $this->get_ext_name(true) . 'images/' . $type . '/' . $image;
57 57
 	}
58 58
 
59 59
 	/**
60
-	* Return path to banner
61
-	*
62
-	* @param	string	$banner	is the physical name
63
-	* @return	string			The relative path to banner
64
-	*/
60
+	 * Return path to banner
61
+	 *
62
+	 * @param	string	$banner	is the physical name
63
+	 * @return	string			The relative path to banner
64
+	 */
65 65
 	public function get_banner_path($banner = '')
66 66
 	{
67 67
 		return 'files/' . $this->get_ext_name() . 'banners/' . $banner;
68 68
 	}
69 69
 
70 70
 	/**
71
-	* Return array entries that match the pattern
72
-	*
73
-	* @link http://php.net/manual/fr/function.preg-grep.php#95787
74
-	*
75
-	* @param 	string	$pattern	The pattern to search for
76
-	* @param	array	$input		The input array
77
-	* @return	array	$vals		Returns an array indexed using the keys from the input array
78
-	*/
71
+	 * Return array entries that match the pattern
72
+	 *
73
+	 * @link http://php.net/manual/fr/function.preg-grep.php#95787
74
+	 *
75
+	 * @param 	string	$pattern	The pattern to search for
76
+	 * @param	array	$input		The input array
77
+	 * @return	array	$vals		Returns an array indexed using the keys from the input array
78
+	 */
79 79
 	public function preg_grep_keys($pattern, $input)
80 80
 	{
81 81
 		$keys = preg_grep($pattern, array_keys($input));
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@
 block discarded – undo
29 29
 	*/
30 30
 	public function __construct(\phpbb\extension\manager $phpbb_extension_manager, \phpbb\path_helper $path_helper)
31 31
 	{
32
-		$this->extension_manager	= $phpbb_extension_manager;
33
-		$this->path_helper			= $path_helper;
32
+		$this->extension_manager = $phpbb_extension_manager;
33
+		$this->path_helper = $path_helper;
34 34
 	}
35 35
 
36 36
 	/**
Please login to merge, or discard this patch.
core/link.php 2 patches
Indentation   +181 added lines, -181 removed lines patch added patch discarded remove patch
@@ -58,24 +58,24 @@  discard block
 block discarded – undo
58 58
 	protected $php_ext;
59 59
 
60 60
 	/**
61
-	* Constructor
62
-	*
63
-	* @param \phpbb\db\driver\driver_interface 					$db					Database object
64
-	* @param \phpbb\config\config 								$config				Config object
65
-	* @param \phpbb\language\language							$language			Language object
66
-	* @param \phpbb\template\template 							$template			Template object
67
-	* @param \phpbb\user 										$user				User object
68
-	* @param \phpbb\controller\helper 							$helper				Controller helper object
69
-	* @param \phpbb\request\request 							$request			Request object
70
-	* @param \phpbb\auth\auth 									$auth				Auth object
71
-	* @param \phpbb\notification\manager						$notification		Notification object
72
-	* @param \phpbb\filesystem\filesystem_interface				$filesystem			phpBB filesystem helper
73
-	* @param \FastImageSize\FastImageSize						$imagesize 			FastImageSize class
74
-	* @param \phpbb\files\factory								$files_factory		File classes factory
75
-	* @param \ernadoo\phpbbdirectory\core\helper				$dir_helper			PhpBB Directory extension helper object
76
-	* @param string         									$root_path			phpBB root path
77
-	* @param string         									$php_ext			phpEx
78
-	*/
61
+	 * Constructor
62
+	 *
63
+	 * @param \phpbb\db\driver\driver_interface 					$db					Database object
64
+	 * @param \phpbb\config\config 								$config				Config object
65
+	 * @param \phpbb\language\language							$language			Language object
66
+	 * @param \phpbb\template\template 							$template			Template object
67
+	 * @param \phpbb\user 										$user				User object
68
+	 * @param \phpbb\controller\helper 							$helper				Controller helper object
69
+	 * @param \phpbb\request\request 							$request			Request object
70
+	 * @param \phpbb\auth\auth 									$auth				Auth object
71
+	 * @param \phpbb\notification\manager						$notification		Notification object
72
+	 * @param \phpbb\filesystem\filesystem_interface				$filesystem			phpBB filesystem helper
73
+	 * @param \FastImageSize\FastImageSize						$imagesize 			FastImageSize class
74
+	 * @param \phpbb\files\factory								$files_factory		File classes factory
75
+	 * @param \ernadoo\phpbbdirectory\core\helper				$dir_helper			PhpBB Directory extension helper object
76
+	 * @param string         									$root_path			phpBB root path
77
+	 * @param string         									$php_ext			phpEx
78
+	 */
79 79
 	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, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext)
80 80
 	{
81 81
 		$this->db				= $db;
@@ -96,12 +96,12 @@  discard block
 block discarded – undo
96 96
 	}
97 97
 
98 98
 	/**
99
-	* Add a link into db
100
-	*
101
-	* @param	array	$data			Contains all data to insert in db
102
-	* @param	bool	$need_approval	Links needs to be approved?
103
-	* @return	null
104
-	*/
99
+	 * Add a link into db
100
+	 *
101
+	 * @param	array	$data			Contains all data to insert in db
102
+	 * @param	bool	$need_approval	Links needs to be approved?
103
+	 * @return	null
104
+	 */
105 105
 	public function add($data, $need_approval)
106 106
 	{
107 107
 		$notification_data = array();
@@ -146,13 +146,13 @@  discard block
 block discarded – undo
146 146
 	}
147 147
 
148 148
 	/**
149
-	* Edit a link of the db
150
-	*
151
-	* @param	array	$data			Contains all data to edit in db
152
-	* @param	int		$link_id		is link's id, for WHERE clause
153
-	* @param	bool	$need_approval	Links needs to be approved?
154
-	* @return	null
155
-	*/
149
+	 * Edit a link of the db
150
+	 *
151
+	 * @param	array	$data			Contains all data to edit in db
152
+	 * @param	int		$link_id		is link's id, for WHERE clause
153
+	 * @param	bool	$need_approval	Links needs to be approved?
154
+	 * @return	null
155
+	 */
156 156
 	public function edit($data, $link_id, $need_approval)
157 157
 	{
158 158
 		$notification_data = array(
@@ -204,12 +204,12 @@  discard block
 block discarded – undo
204 204
 	}
205 205
 
206 206
 	/**
207
-	* Delete a link of the db
208
-	*
209
-	* @param	int 	$cat_id		The category ID
210
-	* @param	mixed 	$link_id	Link's id, for WHERE clause
211
-	* @return	null
212
-	*/
207
+	 * Delete a link of the db
208
+	 *
209
+	 * @param	int 	$cat_id		The category ID
210
+	 * @param	mixed 	$link_id	Link's id, for WHERE clause
211
+	 * @return	null
212
+	 */
213 213
 	public function del($cat_id, $link_id)
214 214
 	{
215 215
 		$this->db->sql_transaction('begin');
@@ -282,12 +282,12 @@  discard block
 block discarded – undo
282 282
 	}
283 283
 
284 284
 	/**
285
-	* Increments link view counter
286
-	*
287
-	* @param	int		$link_id	Link's id, for WHERE clause
288
-	* @return	null
289
-	* @throws	\phpbb\exception\http_exception
290
-	*/
285
+	 * Increments link view counter
286
+	 *
287
+	 * @param	int		$link_id	Link's id, for WHERE clause
288
+	 * @return	null
289
+	 * @throws	\phpbb\exception\http_exception
290
+	 */
291 291
 	public function view($link_id)
292 292
 	{
293 293
 		$sql = 'SELECT link_id, link_url
@@ -311,11 +311,11 @@  discard block
 block discarded – undo
311 311
 	}
312 312
 
313 313
 	/**
314
-	* Verify that an URL exist before add into db
315
-	*
316
-	* @param	string	$url	The URL to check
317
-	* @return	bool			True if url is reachable, else false.
318
-	*/
314
+	 * Verify that an URL exist before add into db
315
+	 *
316
+	 * @param	string	$url	The URL to check
317
+	 * @return	bool			True if url is reachable, else false.
318
+	 */
319 319
 	public function checkurl($url)
320 320
 	{
321 321
 		$details = parse_url($url);
@@ -352,11 +352,11 @@  discard block
 block discarded – undo
352 352
 	}
353 353
 
354 354
 	/**
355
-	* Delete the final '/', if no path
356
-	*
357
-	* @param	string	$url	URL to clean
358
-	* @return	string	$url	The correct string.
359
-	*/
355
+	 * Delete the final '/', if no path
356
+	 *
357
+	 * @param	string	$url	URL to clean
358
+	 * @return	string	$url	The correct string.
359
+	 */
360 360
 	public function clean_url($url)
361 361
 	{
362 362
 		$details = parse_url($url);
@@ -369,11 +369,11 @@  discard block
 block discarded – undo
369 369
 	}
370 370
 
371 371
 	/**
372
-	* Display a flag
373
-	*
374
-	* @param	array	$data	Link's data from db
375
-	* @return	string			Flag path.
376
-	*/
372
+	 * Display a flag
373
+	 *
374
+	 * @param	array	$data	Link's data from db
375
+	 * @return	string			Flag path.
376
+	 */
377 377
 	public function display_flag($data)
378 378
 	{
379 379
 		global $phpbb_extension_manager;
@@ -391,13 +391,13 @@  discard block
 block discarded – undo
391 391
 	}
392 392
 
393 393
 	/**
394
-	* Calculate the link's note
395
-	*
396
-	* @param	int		$total_note		Sum of all link's notes
397
-	* @param	int		$nb_vote		Number of votes
398
-	* @param	bool	$votes_status	Votes are enable in this category?
399
-	* @return	string	$note			The calculated note.
400
-	*/
394
+	 * Calculate the link's note
395
+	 *
396
+	 * @param	int		$total_note		Sum of all link's notes
397
+	 * @param	int		$nb_vote		Number of votes
398
+	 * @param	bool	$votes_status	Votes are enable in this category?
399
+	 * @return	string	$note			The calculated note.
400
+	 */
401 401
 	public function display_note($total_note, $nb_vote, $votes_status)
402 402
 	{
403 403
 		if (!$votes_status)
@@ -412,11 +412,11 @@  discard block
 block discarded – undo
412 412
 	}
413 413
 
414 414
 	/**
415
-	* Display the vote form for auth users
416
-	*
417
-	* @param	array	$data	Link's data from db
418
-	* @return	null|string		Html combo list or nothing if votes are not available.
419
-	*/
415
+	 * Display the vote form for auth users
416
+	 *
417
+	 * @param	array	$data	Link's data from db
418
+	 * @return	null|string		Html combo list or nothing if votes are not available.
419
+	 */
420 420
 	public function display_vote($data)
421 421
 	{
422 422
 		if ($this->user->data['is_registered'] && $this->auth->acl_get('u_vote_dir') && empty($data['vote_user_id']))
@@ -433,11 +433,11 @@  discard block
 block discarded – undo
433 433
 	}
434 434
 
435 435
 	/**
436
-	* Display the RSS icon
437
-	*
438
-	* @param	array	$data	Link's data from db
439
-	* @return	null|string		RSS feed URL or nothing.
440
-	*/
436
+	 * Display the RSS icon
437
+	 *
438
+	 * @param	array	$data	Link's data from db
439
+	 * @return	null|string		RSS feed URL or nothing.
440
+	 */
441 441
 	public function display_rss($data)
442 442
 	{
443 443
 		if ($this->config['dir_activ_rss'] && !empty($data['link_rss']))
@@ -447,13 +447,13 @@  discard block
 block discarded – undo
447 447
 	}
448 448
 
449 449
 	/**
450
-	* Display link's thumb if thumb service enabled.
451
-	* if thumb don't exists in db or if a new service was choosen in acp
452
-	* thumb is research
453
-	*
454
-	* @param	array		$data	Link's data from db
455
-	* @return	string|null			Thumb or null.
456
-	*/
450
+	 * Display link's thumb if thumb service enabled.
451
+	 * if thumb don't exists in db or if a new service was choosen in acp
452
+	 * thumb is research
453
+	 *
454
+	 * @param	array		$data	Link's data from db
455
+	 * @return	string|null			Thumb or null.
456
+	 */
457 457
 	public function display_thumb($data)
458 458
 	{
459 459
 		if ($this->config['dir_activ_thumb'])
@@ -474,11 +474,11 @@  discard block
 block discarded – undo
474 474
 	}
475 475
 
476 476
 	/**
477
-	* Display and calculate PageRank if needed
478
-	*
479
-	* @param	array	$data	Link's data from db
480
-	* @return	string			Pagerank, 'n/a' or false
481
-	*/
477
+	 * Display and calculate PageRank if needed
478
+	 *
479
+	 * @param	array	$data	Link's data from db
480
+	 * @return	string			Pagerank, 'n/a' or false
481
+	 */
482 482
 	public function display_pagerank($data)
483 483
 	{
484 484
 		if ($this->config['dir_activ_pagerank'])
@@ -508,11 +508,11 @@  discard block
 block discarded – undo
508 508
 	}
509 509
 
510 510
 	/**
511
-	* Display and resize a banner
512
-	*
513
-	* @param	array	$data		link's data from db
514
-	* @return	string	$s_banner	html code.
515
-	*/
511
+	 * Display and resize a banner
512
+	 *
513
+	 * @param	array	$data		link's data from db
514
+	 * @return	string	$s_banner	html code.
515
+	 */
516 516
 	public function display_bann($data)
517 517
 	{
518 518
 		if (!empty($data['link_banner']))
@@ -550,11 +550,11 @@  discard block
 block discarded – undo
550 550
 	}
551 551
 
552 552
 	/**
553
-	* Add a vote in db, for a specifi link
554
-	*
555
-	* @param	int		$link_id	Link_id from db
556
-	* @return	null
557
-	*/
553
+	 * Add a vote in db, for a specifi link
554
+	 *
555
+	 * @param	int		$link_id	Link_id from db
556
+	 * @return	null
557
+	 */
558 558
 	public function add_vote($link_id)
559 559
 	{
560 560
 		$data = array(
@@ -598,11 +598,11 @@  discard block
 block discarded – undo
598 598
 	}
599 599
 
600 600
 	/**
601
-	* Search an appropriate thumb for url
602
-	*
603
-	* @param	string	$url	Link's url
604
-	* @return	string			The thumb url
605
-	*/
601
+	 * Search an appropriate thumb for url
602
+	 *
603
+	 * @param	string	$url	Link's url
604
+	 * @return	string			The thumb url
605
+	 */
606 606
 	public function thumb_process($url)
607 607
 	{
608 608
 		if (!$this->config['dir_activ_thumb'])
@@ -623,12 +623,12 @@  discard block
 block discarded – undo
623 623
 	}
624 624
 
625 625
 	/**
626
-	* Check if ascreen thumb exists
627
-	*
628
-	* @param	string	$protocol	The protocol
629
-	* @param	string	$host		The hostname
630
-	* @return	bool				True if ascreen file exixts, else false
631
-	*/
626
+	 * Check if ascreen thumb exists
627
+	 *
628
+	 * @param	string	$protocol	The protocol
629
+	 * @param	string	$host		The hostname
630
+	 * @return	bool				True if ascreen file exixts, else false
631
+	 */
632 632
 	private function _ascreen_exist($protocol, $host)
633 633
 	{
634 634
 		if (($thumb_info = $this->imagesize->getImageSize($protocol.'://'.$host.'/ascreen.jpg')) !== false)
@@ -643,12 +643,12 @@  discard block
 block discarded – undo
643 643
 	}
644 644
 
645 645
 	/**
646
-	* Primary work on banner, can edit, copy or check a banner
647
-	*
648
-	* @param	string	$banner	The banner's remote url
649
-	* @param	array	$error	The array error, passed by reference
650
-	* @return	null
651
-	*/
646
+	 * Primary work on banner, can edit, copy or check a banner
647
+	 *
648
+	 * @param	string	$banner	The banner's remote url
649
+	 * @param	array	$error	The array error, passed by reference
650
+	 * @return	null
651
+	 */
652 652
 	public function banner_process(&$banner, &$error)
653 653
 	{
654 654
 		$old_banner = $this->request->variable('old_banner', '');
@@ -684,13 +684,13 @@  discard block
 block discarded – undo
684 684
 	}
685 685
 
686 686
 	/**
687
-	* Copy a remonte banner to server.
688
-	* called by banner_process()
689
-	*
690
-	* @param	string	$banner The banner's remote url
691
-	* @param	array	$error	The array error, passed by reference
692
-	* @return	false|string	String if no errors, else false
693
-	*/
687
+	 * Copy a remonte banner to server.
688
+	 * called by banner_process()
689
+	 *
690
+	 * @param	string	$banner The banner's remote url
691
+	 * @param	array	$error	The array error, passed by reference
692
+	 * @return	false|string	String if no errors, else false
693
+	 */
694 694
 	private function _banner_upload($banner, &$error)
695 695
 	{
696 696
 		/** @var \phpbb\files\upload $upload */
@@ -721,13 +721,13 @@  discard block
 block discarded – undo
721 721
 	}
722 722
 
723 723
 	/**
724
-	* Check than remote banner exists
725
-	* called by banner_process()
726
-	*
727
-	* @param	string	$banner	The banner's remote url
728
-	* @param	array	$error	The array error, passed by reference
729
-	* @return	false|string	String if no errors, else false
730
-	*/
724
+	 * Check than remote banner exists
725
+	 * called by banner_process()
726
+	 *
727
+	 * @param	string	$banner	The banner's remote url
728
+	 * @param	array	$error	The array error, passed by reference
729
+	 * @return	false|string	String if no errors, else false
730
+	 */
731 731
 	private function _banner_remote($banner, &$error)
732 732
 	{
733 733
 		if (!preg_match('#^(http|https|ftp)://#i', $banner))
@@ -835,11 +835,11 @@  discard block
 block discarded – undo
835 835
 	}
836 836
 
837 837
 	/**
838
-	* Delete a banner from server
839
-	*
840
-	* @param	string	$file	The file's name
841
-	* @return	bool			True if delete success, else false
842
-	*/
838
+	 * Delete a banner from server
839
+	 *
840
+	 * @param	string	$file	The file's name
841
+	 * @return	bool			True if delete success, else false
842
+	 */
843 843
 	private function _banner_delete($file)
844 844
 	{
845 845
 		if (file_exists($this->dir_helper->get_banner_path($file)))
@@ -852,18 +852,18 @@  discard block
 block discarded – undo
852 852
 	}
853 853
 
854 854
 	/**
855
-	* PageRank Lookup (Based on Google Toolbar for Mozilla Firefox)
856
-	*
857
-	* @copyright 2012 HM2K <[email protected]>
858
-	* @link http://pagerank.phurix.net/
859
-	* @author James Wade <[email protected]>
860
-	* @version $Revision: 2.1 $
861
-	* @require PHP 4.3.0 (file_get_contents)
862
-	* @updated 06/10/11
863
-	*
864
-	* @param	string		$q	The website URL
865
-	* @return	string			The calculated pagerank, or -1
866
-	*/
855
+	 * PageRank Lookup (Based on Google Toolbar for Mozilla Firefox)
856
+	 *
857
+	 * @copyright 2012 HM2K <[email protected]>
858
+	 * @link http://pagerank.phurix.net/
859
+	 * @author James Wade <[email protected]>
860
+	 * @version $Revision: 2.1 $
861
+	 * @require PHP 4.3.0 (file_get_contents)
862
+	 * @updated 06/10/11
863
+	 *
864
+	 * @param	string		$q	The website URL
865
+	 * @return	string			The calculated pagerank, or -1
866
+	 */
867 867
 	public function pagerank_process($q)
868 868
 	{
869 869
 		$googleDomains	= array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch');
@@ -897,12 +897,12 @@  discard block
 block discarded – undo
897 897
 	}
898 898
 
899 899
 	/**
900
-	* List flags
901
-	*
902
-	* @param	string	$flag_path	The flag directory path
903
-	* @param	string	$value		Selected flag
904
-	* @return	string	$list		Html code
905
-	*/
900
+	 * List flags
901
+	 *
902
+	 * @param	string	$flag_path	The flag directory path
903
+	 * @param	string	$value		Selected flag
904
+	 * @return	string	$list		Html code
905
+	 */
906 906
 	public function get_dir_flag_list($flag_path, $value)
907 907
 	{
908 908
 		$list = '';
@@ -937,10 +937,10 @@  discard block
 block discarded – undo
937 937
 	}
938 938
 
939 939
 	/**
940
-	* Display recents links added
941
-	*
942
-	* @return	null
943
-	*/
940
+	 * Display recents links added
941
+	 *
942
+	 * @return	null
943
+	 */
944 944
 	public function recents()
945 945
 	{
946 946
 		if ($this->config['dir_recent_block'])
@@ -1017,13 +1017,13 @@  discard block
 block discarded – undo
1017 1017
 	}
1018 1018
 
1019 1019
 	/**
1020
-	* Validate back link
1021
-	*
1022
-	* @param	string		$remote_url	Page URL contains the backlink
1023
-	* @param	bool		$optional	Link back is optional in this category?
1024
-	* @param	bool		$cron		This methos is called by con process?
1025
-	* @return	false|string			Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
1026
-	*/
1020
+	 * Validate back link
1021
+	 *
1022
+	 * @param	string		$remote_url	Page URL contains the backlink
1023
+	 * @param	bool		$optional	Link back is optional in this category?
1024
+	 * @param	bool		$cron		This methos is called by con process?
1025
+	 * @return	false|string			Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
1026
+	 */
1027 1027
 	public function validate_link_back($remote_url, $optional, $cron = false)
1028 1028
 	{
1029 1029
 		if (!$cron)
@@ -1063,14 +1063,14 @@  discard block
 block discarded – undo
1063 1063
 	}
1064 1064
 
1065 1065
 	/**
1066
-	* Check, for website with backlink specified, if backlink is always here.
1067
-	* After $nb_check verification, website is deleted, otherwise, a notification is send to poster
1068
-	*
1069
-	* @param	int		$cat_id		The categoryID
1070
-	* @param	int		$nb_check	Number of check before demete a website
1071
-	* @param	int		$next_prune	Date of next auto check
1072
-	* @return	null
1073
-	*/
1066
+	 * Check, for website with backlink specified, if backlink is always here.
1067
+	 * After $nb_check verification, website is deleted, otherwise, a notification is send to poster
1068
+	 *
1069
+	 * @param	int		$cat_id		The categoryID
1070
+	 * @param	int		$nb_check	Number of check before demete a website
1071
+	 * @param	int		$next_prune	Date of next auto check
1072
+	 * @return	null
1073
+	 */
1074 1074
 	private function _check($cat_id, $nb_check, $next_prune)
1075 1075
 	{
1076 1076
 		$del_array = $update_array = array();
@@ -1118,11 +1118,11 @@  discard block
 block discarded – undo
1118 1118
 	}
1119 1119
 
1120 1120
 	/**
1121
-	* Method called by cron task.
1122
-	*
1123
-	* @param	array	$cat_data	Information about category, from db
1124
-	* @return	null
1125
-	*/
1121
+	 * Method called by cron task.
1122
+	 *
1123
+	 * @param	array	$cat_data	Information about category, from db
1124
+	 * @return	null
1125
+	 */
1126 1126
 	public function auto_check($cat_data)
1127 1127
 	{
1128 1128
 		global $phpbb_log;
@@ -1152,12 +1152,12 @@  discard block
 block discarded – undo
1152 1152
 	}
1153 1153
 
1154 1154
 	/**
1155
-	* Update website verification number after a missing backlink, and send notificaton
1156
-	*
1157
-	* @param	array	$u_array	Information about website
1158
-	* @param	int		$next_prune	Date of next auto check
1159
-	* @return	null
1160
-	*/
1155
+	 * Update website verification number after a missing backlink, and send notificaton
1156
+	 *
1157
+	 * @param	array	$u_array	Information about website
1158
+	 * @param	int		$next_prune	Date of next auto check
1159
+	 * @return	null
1160
+	 */
1161 1161
 	private function _update_check($u_array, $next_prune)
1162 1162
 	{
1163 1163
 		if (!class_exists('messenger'))
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -78,21 +78,21 @@  discard block
 block discarded – undo
78 78
 	*/
79 79
 	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, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext)
80 80
 	{
81
-		$this->db				= $db;
82
-		$this->config			= $config;
81
+		$this->db = $db;
82
+		$this->config = $config;
83 83
 		$this->language			= $language;
84 84
 		$this->template			= $template;
85 85
 		$this->user				= $user;
86
-		$this->helper			= $helper;
87
-		$this->request			= $request;
86
+		$this->helper = $helper;
87
+		$this->request = $request;
88 88
 		$this->auth				= $auth;
89
-		$this->notification		= $notification;
89
+		$this->notification = $notification;
90 90
 		$this->filesystem		= $filesystem;
91 91
 		$this->imagesize		= $imagesize;
92
-		$this->files_factory 	= $files_factory;
92
+		$this->files_factory = $files_factory;
93 93
 		$this->dir_helper		= $dir_helper;
94 94
 		$this->root_path		= $root_path;
95
-		$this->php_ext			= $php_ext;
95
+		$this->php_ext = $php_ext;
96 96
 	}
97 97
 
98 98
 	/**
@@ -243,11 +243,11 @@  discard block
 block discarded – undo
243 243
 
244 244
 		foreach ($link_datas_ary as $table => $field)
245 245
 		{
246
-			$this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $url_array));
246
+			$this->db->sql_query("DELETE FROM $table WHERE " . $this->db->sql_in_set($field, $url_array));
247 247
 		}
248 248
 
249 249
 		$sql = 'UPDATE ' . DIR_CAT_TABLE . '
250
-			SET cat_links = cat_links - '.sizeof($url_array).'
250
+			SET cat_links = cat_links - '.sizeof($url_array) . '
251 251
 			WHERE cat_id = ' . (int) $cat_id;
252 252
 		$this->db->sql_query($sql);
253 253
 
@@ -331,8 +331,8 @@  discard block
 block discarded – undo
331 331
 
332 332
 		if ($sock = @fsockopen($details['host'], $details['port'], $errno, $errstr, 1))
333 333
 		{
334
-			$requete = 'GET '.$details['path']." HTTP/1.1\r\n";
335
-			$requete .= 'Host: '.$details['host']."\r\n\r\n";
334
+			$requete = 'GET ' . $details['path'] . " HTTP/1.1\r\n";
335
+			$requete .= 'Host: ' . $details['host'] . "\r\n\r\n";
336 336
 
337 337
 			// Send a HTTP GET header
338 338
 			fputs($sock, $requete);
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 		global $phpbb_extension_manager;
380 380
 
381 381
 		$ext_path = $phpbb_extension_manager->get_extension_path('ernadoo/phpbbdirectory', false);
382
-		$flag_path = $ext_path.'images/flags/';
382
+		$flag_path = $ext_path . 'images/flags/';
383 383
 		$img_flag = 'no_flag.png';
384 384
 
385 385
 		if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path . $data['link_flag']))
@@ -497,12 +497,12 @@  discard block
 block discarded – undo
497 497
 				$pagerank = (int) $data['link_pagerank'];
498 498
 			}
499 499
 
500
-			$prpos=40*$pagerank/10;
501
-			$prneg=40-$prpos;
502
-			$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.'" /> ';
500
+			$prpos = 40 * $pagerank / 10;
501
+			$prneg = 40 - $prpos;
502
+			$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 . '" /> ';
503 503
 
504 504
 			$pagerank = $pagerank == '-1' ? $this->language->lang('DIR_PAGERANK_NOT_AVAILABLE') : $this->language->lang('DIR_FROM_TEN', $pagerank);
505
-			return $html.$pagerank;
505
+			return $html . $pagerank;
506 506
 		}
507 507
 		return false;
508 508
 	}
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 				$height /= $coef_max;
545 545
 			}
546 546
 
547
-			return '<img src="' . $img_src . '" width="' . $width . '" height="' . $height . '" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />';
547
+			return '<img src="' . $img_src . '" width="' . $width . '" height="' . $height . '" alt="' . $data['link_name'] . '" title="' . $data['link_name'] . '" />';
548 548
 		}
549 549
 		return '';
550 550
 	}
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
 
579 579
 		if ($this->request->is_ajax())
580 580
 		{
581
-			$sql= 'SELECT link_vote, link_note FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int) $link_id;
581
+			$sql = 'SELECT link_vote, link_note FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int) $link_id;
582 582
 			$result = $this->db->sql_query($sql);
583 583
 			$data = $this->db->sql_fetchrow($result);
584 584
 
@@ -607,19 +607,19 @@  discard block
 block discarded – undo
607 607
 	{
608 608
 		if (!$this->config['dir_activ_thumb'])
609 609
 		{
610
-			return $this->root_path.'images/directory/nothumb.gif';
610
+			return $this->root_path . 'images/directory/nothumb.gif';
611 611
 		}
612 612
 
613 613
 		$details = parse_url($url);
614 614
 
615
-		$root_url		= $details['scheme'].'://'.$details['host'];
616
-		$absolute_url	= isset($details['path']) ? $root_url.$details['path'] : $root_url;
615
+		$root_url = $details['scheme'] . '://' . $details['host'];
616
+		$absolute_url = isset($details['path']) ? $root_url . $details['path'] : $root_url;
617 617
 
618 618
 		if ($this->config['dir_activ_thumb_remote'] && $this->_ascreen_exist($details['scheme'], $details['host']))
619 619
 		{
620
-			return $root_url.'/ascreen.jpg';
620
+			return $root_url . '/ascreen.jpg';
621 621
 		}
622
-		return $this->config['dir_thumb_service'].$absolute_url;
622
+		return $this->config['dir_thumb_service'] . $absolute_url;
623 623
 	}
624 624
 
625 625
 	/**
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 	*/
632 632
 	private function _ascreen_exist($protocol, $host)
633 633
 	{
634
-		if (($thumb_info = $this->imagesize->getImageSize($protocol.'://'.$host.'/ascreen.jpg')) !== false)
634
+		if (($thumb_info = $this->imagesize->getImageSize($protocol . '://' . $host . '/ascreen.jpg')) !== false)
635 635
 		{
636 636
 			// Obviously this is an image, we did some additional tests
637 637
 			if ($thumb_info['width'] == '120' && $thumb_info['height'] == '90' && $thumb_info['type'] == 2)
@@ -763,8 +763,8 @@  discard block
 block discarded – undo
763 763
 		}
764 764
 
765 765
 		// Check image type
766
-		$types		= \phpbb\files\upload::image_types();
767
-		$extension	= strtolower(\phpbb\files\filespec::get_extension($banner));
766
+		$types = \phpbb\files\upload::image_types();
767
+		$extension = strtolower(\phpbb\files\filespec::get_extension($banner));
768 768
 
769 769
 		// Check if this is actually an image
770 770
 		if ($file_stream = @fopen($banner, 'r'))
@@ -866,14 +866,14 @@  discard block
 block discarded – undo
866 866
 	*/
867 867
 	public function pagerank_process($q)
868 868
 	{
869
-		$googleDomains	= array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch');
870
-		$seed			= $this->language->lang('SEED');
871
-		$result			= 0x01020345;
869
+		$googleDomains = array('.com', '.com.tr', '.de', '.fr', '.be', '.ca', '.ro', '.ch');
870
+		$seed = $this->language->lang('SEED');
871
+		$result = 0x01020345;
872 872
 		$len			= strlen($q);
873 873
 
874
-		for ($i=0; $i<$len; $i++)
874
+		for ($i = 0; $i < $len; $i++)
875 875
 		{
876
-			$result ^= ord($seed{$i%strlen($seed)}) ^ ord($q{$i});
876
+			$result ^= ord($seed{$i % strlen($seed)}) ^ ord($q{$i});
877 877
 			$result = (($result >> 23) & 0x1ff) | $result << 9;
878 878
 		}
879 879
 
@@ -884,10 +884,10 @@  discard block
 block discarded – undo
884 884
 
885 885
 		$ch		= sprintf('8%x', $result);
886 886
 		$url	= 'http://%s/tbr?client=navclient-auto&ch=%s&features=Rank&q=info:%s';
887
-		$host	= 'toolbarqueries.google'.$googleDomains[mt_rand(0,count($googleDomains)-1)];
887
+		$host = 'toolbarqueries.google' . $googleDomains[mt_rand(0, count($googleDomains) - 1)];
888 888
 
889
-		$url	= sprintf($url,$host,$ch,$q);
890
-		@$pr	= trim(file_get_contents($url,false));
889
+		$url	= sprintf($url, $host, $ch, $q);
890
+		@$pr	= trim(file_get_contents($url, false));
891 891
 
892 892
 		if (is_numeric(substr(strrchr($pr, ':'), 1)))
893 893
 		{
@@ -925,9 +925,9 @@  discard block
 block discarded – undo
925 925
 
926 926
 		foreach ($flags as $file => $name)
927 927
 		{
928
-			$img_file = strtolower(substr(strrchr($file, '_'), 1)).'.png';
928
+			$img_file = strtolower(substr(strrchr($file, '_'), 1)) . '.png';
929 929
 
930
-			if (file_exists($flag_path.$img_file))
930
+			if (file_exists($flag_path . $img_file))
931 931
 			{
932 932
 				$list .= '<option value="' . $img_file . '" ' . (($img_file == $value) ? 'selected="selected"' : '') . '>' . $name . '</option>';
933 933
 			}
@@ -945,8 +945,8 @@  discard block
 block discarded – undo
945 945
 	{
946 946
 		if ($this->config['dir_recent_block'])
947 947
 		{
948
-			$limit_sql		= $this->config['dir_recent_rows'] * $this->config['dir_recent_columns'];
949
-			$exclude_array	= explode(',', str_replace(' ', '', $this->config['dir_recent_exclude']));
948
+			$limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns'];
949
+			$exclude_array = explode(',', str_replace(' ', '', $this->config['dir_recent_exclude']));
950 950
 
951 951
 			$sql_array = array(
952 952
 				'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',
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
 							'ON'	=> 'l.link_cat = c.cat_id'
963 963
 						)
964 964
 				),
965
-				'WHERE'		=> $this->db->sql_in_set('l.link_cat', $exclude_array, true).' AND l.link_active = 1',
965
+				'WHERE'		=> $this->db->sql_in_set('l.link_cat', $exclude_array, true) . ' AND l.link_active = 1',
966 966
 				'ORDER_BY'	=> 'l.link_time DESC, l.link_id DESC');
967 967
 
968 968
 			$sql = $this->db->sql_build_query('SELECT', $sql_array);
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
 					}
991 991
 
992 992
 					$this->template->assign_block_vars('block.row.col', array(
993
-						'UC_THUMBNAIL'            => '<a href="'.$row['link_url'].'" onclick="window.open(\''.$this->helper->route('ernadoo_phpbbdirectory_view_controller', array('link_id' => (int) $row['link_id'])).'\'); return false;"><img src="'.$row['link_thumb'].'" title="'.$row['link_name'].'" alt="'.$row['link_name'].'" /></a>',
993
+						'UC_THUMBNAIL'            => '<a href="' . $row['link_url'] . '" onclick="window.open(\'' . $this->helper->route('ernadoo_phpbbdirectory_view_controller', array('link_id' => (int) $row['link_id'])) . '\'); return false;"><img src="' . $row['link_thumb'] . '" title="' . $row['link_name'] . '" alt="' . $row['link_name'] . '" /></a>',
994 994
 						'NAME'                    => $row['link_name'],
995 995
 						'USER'                    => get_username_string('full', $row['link_user_id'], $row['username'], $row['user_colour']),
996 996
 						'TIME'                    => ($row['link_time']) ? $this->user->format_date($row['link_time']) : '',
@@ -1085,7 +1085,7 @@  discard block
 block discarded – undo
1085 1085
 						'ON'	=> 'l.link_user_id = u.user_id'
1086 1086
 					)
1087 1087
 			),
1088
-			'WHERE'		=> 'l.link_back <> "" AND l.link_active = 1 AND l.link_cat = '  . (int) $cat_id);
1088
+			'WHERE'		=> 'l.link_back <> "" AND l.link_active = 1 AND l.link_cat = ' . (int) $cat_id);
1089 1089
 
1090 1090
 		$sql = $this->db->sql_build_query('SELECT', $sql_array);
1091 1091
 		$result = $this->db->sql_query($sql);
@@ -1094,7 +1094,7 @@  discard block
 block discarded – undo
1094 1094
 		{
1095 1095
 			if ($this->validate_link_back($row['link_back'], false, true) !== false)
1096 1096
 			{
1097
-				if (!$nb_check || ($row['link_nb_check']+1) >= $nb_check)
1097
+				if (!$nb_check || ($row['link_nb_check'] + 1) >= $nb_check)
1098 1098
 				{
1099 1099
 					$del_array[] = $row['link_id'];
1100 1100
 				}
Please login to merge, or discard this patch.
cron/task/core/prune_categorie.php 2 patches
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
 	private $cat_data;
29 29
 
30 30
 	/**
31
-	* Constructor.
32
-	*
33
-	* @param \phpbb\db\driver\driver_interface 	$db				Database object
34
-	* @param \phpbb\config\config 				$config			Config object
35
-	* @param \ernadoo\phpbbdirectory\core\link	$directory_cron	PhpBB Directory extension link object
36
-	* @param string								$php_ext		phpEx
37
-	*/
31
+	 * Constructor.
32
+	 *
33
+	 * @param \phpbb\db\driver\driver_interface 	$db				Database object
34
+	 * @param \phpbb\config\config 				$config			Config object
35
+	 * @param \ernadoo\phpbbdirectory\core\link	$directory_cron	PhpBB Directory extension link object
36
+	 * @param string								$php_ext		phpEx
37
+	 */
38 38
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \ernadoo\phpbbdirectory\core\link $directory_cron, $php_ext)
39 39
 	{
40 40
 		$this->db 				= $db;
@@ -44,66 +44,66 @@  discard block
 block discarded – undo
44 44
 	}
45 45
 
46 46
 	/**
47
-	* Manually set categorie data.
48
-	*
49
-	* @param array $cat_data Information about a category to be pruned.
50
-	*/
47
+	 * Manually set categorie data.
48
+	 *
49
+	 * @param array $cat_data Information about a category to be pruned.
50
+	 */
51 51
 	public function set_categorie_data($cat_data)
52 52
 	{
53 53
 		$this->cat_data = $cat_data;
54 54
 	}
55 55
 
56 56
 	/**
57
-	* Runs this cron task.
58
-	*
59
-	* @return null
60
-	*/
57
+	 * Runs this cron task.
58
+	 *
59
+	 * @return null
60
+	 */
61 61
 	public function run()
62 62
 	{
63 63
 		$this->dir_cron->auto_check($this->cat_data);
64 64
 	}
65 65
 
66 66
 	/**
67
-	* Returns whether this cron task can run, given current board configuration.
68
-	*
69
-	* @return bool
70
-	*/
67
+	 * Returns whether this cron task can run, given current board configuration.
68
+	 *
69
+	 * @return bool
70
+	 */
71 71
 	public function is_runnable()
72 72
 	{
73 73
 		return !$this->config['use_system_cron'] && !empty($this->cat_data);
74 74
 	}
75 75
 
76 76
 	/**
77
-	* Returns whether this cron task should run now, because enough time
78
-	* has passed since it was last run.
79
-	*
80
-	* @return bool
81
-	*/
77
+	 * Returns whether this cron task should run now, because enough time
78
+	 * has passed since it was last run.
79
+	 *
80
+	 * @return bool
81
+	 */
82 82
 	public function should_run()
83 83
 	{
84 84
 		return $this->cat_data['cat_cron_enable'] && $this->cat_data['cat_cron_next'] < time();
85 85
 	}
86 86
 
87 87
 	/**
88
-	* Returns parameters of this cron task as an array.
89
-	* The array has one key, c, whose value is id of the category to be pruned.
90
-	*
91
-	* @return array
92
-	*/
88
+	 * Returns parameters of this cron task as an array.
89
+	 * The array has one key, c, whose value is id of the category to be pruned.
90
+	 *
91
+	 * @return array
92
+	 */
93 93
 	public function get_parameters()
94 94
 	{
95 95
 		return array('c' => $this->cat_data['cat_id']);
96 96
 	}
97 97
 
98 98
 	/**
99
-	* Parses parameters found in $request, which is an instance of
100
-	* \phpbb\request\request_interface.
101
-	*
102
-	* It is expected to have a key f whose value is id of the forum to be pruned.
103
-	*
104
-	* @param	\phpbb\request\request_interface	$request Request object.
105
-	* @return	null
106
-	*/
99
+	 * Parses parameters found in $request, which is an instance of
100
+	 * \phpbb\request\request_interface.
101
+	 *
102
+	 * It is expected to have a key f whose value is id of the forum to be pruned.
103
+	 *
104
+	 * @param	\phpbb\request\request_interface	$request Request object.
105
+	 * @return	null
106
+	 */
107 107
 	public function parse_parameters(\phpbb\request\request_interface $request)
108 108
 	{
109 109
 		$this->cat_data = array();
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@
 block discarded – undo
37 37
 	*/
38 38
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \ernadoo\phpbbdirectory\core\link $directory_cron, $php_ext)
39 39
 	{
40
-		$this->db 				= $db;
41
-		$this->config 			= $config;
40
+		$this->db = $db;
41
+		$this->config = $config;
42 42
 		$this->dir_cron 		= $directory_cron;
43 43
 		$this->php_ext 			= $php_ext;
44 44
 	}
Please login to merge, or discard this patch.
event/listener.php 2 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -39,17 +39,17 @@  discard block
 block discarded – undo
39 39
 	protected $php_ext;
40 40
 
41 41
 	/**
42
-	* Constructor
43
-	*
44
-	* @param \phpbb\db\driver\driver_interface		$db				Database object
45
-	* @param \phpbb\controller\helper				$helper			Controller helper object
46
-	* @param \phpbb\language\language				$language		Language object
47
-	* @param \phpbb\template\template				$template		Template object
48
-	* @param \ernadoo\phpbbdirectory\core\helper	$dir_helper		PhpBB Directory extension helper object
49
-	* @param string									$table_prefix 	prefix table
50
-	* @param string									$php_ext 		phpEx
51
-	* @access public
52
-	*/
42
+	 * Constructor
43
+	 *
44
+	 * @param \phpbb\db\driver\driver_interface		$db				Database object
45
+	 * @param \phpbb\controller\helper				$helper			Controller helper object
46
+	 * @param \phpbb\language\language				$language		Language object
47
+	 * @param \phpbb\template\template				$template		Template object
48
+	 * @param \ernadoo\phpbbdirectory\core\helper	$dir_helper		PhpBB Directory extension helper object
49
+	 * @param string									$table_prefix 	prefix table
50
+	 * @param string									$php_ext 		phpEx
51
+	 * @access public
52
+	 */
53 53
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\template\template $template, \ernadoo\phpbbdirectory\core\helper $dir_helper, $table_prefix, $php_ext)
54 54
 	{
55 55
 		$this->db			= $db;
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
 	}
63 63
 
64 64
 	/**
65
-	* Assign functions defined in this class to event listeners in the core
66
-	*
67
-	* @return	array
68
-	* @static
69
-	* @access	public
70
-	*/
65
+	 * Assign functions defined in this class to event listeners in the core
66
+	 *
67
+	 * @return	array
68
+	 * @static
69
+	 * @access	public
70
+	 */
71 71
 	static public function getSubscribedEvents()
72 72
 	{
73 73
 		return array(
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
 	}
82 82
 
83 83
 	/**
84
-	* Define table constants
85
-	*
86
-	* @return null
87
-	*/
84
+	 * Define table constants
85
+	 *
86
+	 * @return null
87
+	 */
88 88
 	public function set_constants_tables()
89 89
 	{
90 90
 		define('DIR_CAT_TABLE', $this->table_prefix.'directory_cats');
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
 	}
96 96
 
97 97
 	/**
98
-	* Display links to Directory
99
-	*
100
-	* @return null
101
-	*/
98
+	 * Display links to Directory
99
+	 *
100
+	 * @return null
101
+	 */
102 102
 	public function add_page_header_variables()
103 103
 	{
104 104
 		$ext_theme_path		= $this->dir_helper->get_ext_name() . '/styles/prosilver/theme/';
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
 	}
119 119
 
120 120
 	/**
121
-	* Show users as viewing Directory on Who Is Online page
122
-	*
123
-	* @param	object $event The event object
124
-	* @return	null
125
-	*/
121
+	 * Show users as viewing Directory on Who Is Online page
122
+	 *
123
+	 * @param	object $event The event object
124
+	 * @return	null
125
+	 */
126 126
 	public function add_page_viewonline($event)
127 127
 	{
128 128
 		if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/directory') === 0)
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
 	}
134 134
 
135 135
 	/**
136
-	* Load common language files during user setup
137
-	*
138
-	* @param	object $event The event object
139
-	* @return	null
140
-	*/
136
+	 * Load common language files during user setup
137
+	 *
138
+	 * @param	object $event The event object
139
+	 * @return	null
140
+	 */
141 141
 	public function load_language_on_setup($event)
142 142
 	{
143 143
 		$lang_set_ext = $event['lang_set_ext'];
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
 	}
150 150
 
151 151
 	/**
152
-	* Add administrative permissions to manage Directory
153
-	*
154
-	* @param	object $event The event object
155
-	* @return	null
156
-	*/
152
+	 * Add administrative permissions to manage Directory
153
+	 *
154
+	 * @param	object $event The event object
155
+	 * @return	null
156
+	 */
157 157
 	public function permissions_add_directory($event)
158 158
 	{
159 159
 		$categories				= $event['categories'];
@@ -182,11 +182,11 @@  discard block
 block discarded – undo
182 182
 	}
183 183
 
184 184
 	/**
185
-	* Update Directory tables if needed, after deleted an user
186
-	*
187
-	* @param	object $event The event object
188
-	* @return	null
189
-	*/
185
+	 * Update Directory tables if needed, after deleted an user
186
+	 *
187
+	 * @param	object $event The event object
188
+	 * @return	null
189
+	 */
190 190
 	public function update_links_with_anonymous($event)
191 191
 	{
192 192
 		$user_ids = $event['user_ids'];
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
 	*/
53 53
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\template\template $template, \ernadoo\phpbbdirectory\core\helper $dir_helper, $table_prefix, $php_ext)
54 54
 	{
55
-		$this->db			= $db;
56
-		$this->helper 		= $helper;
55
+		$this->db = $db;
56
+		$this->helper = $helper;
57 57
 		$this->language		= $language;
58 58
 		$this->template 	= $template;
59
-		$this->dir_helper	= $dir_helper;
59
+		$this->dir_helper = $dir_helper;
60 60
 		$this->table_prefix = $table_prefix;
61
-		$this->php_ext		= $php_ext;
61
+		$this->php_ext = $php_ext;
62 62
 	}
63 63
 
64 64
 	/**
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
 	*/
88 88
 	public function set_constants_tables()
89 89
 	{
90
-		define('DIR_CAT_TABLE', $this->table_prefix.'directory_cats');
91
-		define('DIR_COMMENT_TABLE', $this->table_prefix.'directory_comments');
92
-		define('DIR_LINK_TABLE', $this->table_prefix.'directory_links');
93
-		define('DIR_VOTE_TABLE', $this->table_prefix.'directory_votes');
94
-		define('DIR_WATCH_TABLE', $this->table_prefix.'directory_watch');
90
+		define('DIR_CAT_TABLE', $this->table_prefix . 'directory_cats');
91
+		define('DIR_COMMENT_TABLE', $this->table_prefix . 'directory_comments');
92
+		define('DIR_LINK_TABLE', $this->table_prefix . 'directory_links');
93
+		define('DIR_VOTE_TABLE', $this->table_prefix . 'directory_votes');
94
+		define('DIR_WATCH_TABLE', $this->table_prefix . 'directory_watch');
95 95
 	}
96 96
 
97 97
 	/**
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 	{
128 128
 		if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/directory') === 0)
129 129
 		{
130
-			$event['location']		= $this->language->lang('DIRECTORY');
131
-			$event['location_url']	= $this->helper->route('ernadoo_phpbbdirectory_base_controller');
130
+			$event['location'] = $this->language->lang('DIRECTORY');
131
+			$event['location_url'] = $this->helper->route('ernadoo_phpbbdirectory_base_controller');
132 132
 		}
133 133
 	}
134 134
 
@@ -158,24 +158,24 @@  discard block
 block discarded – undo
158 158
 	{
159 159
 		$categories				= $event['categories'];
160 160
 		$categories				= array_merge($categories, array('dir' => 'ACL_CAT_DIRECTORY'));
161
-		$event['categories']	= $categories;
161
+		$event['categories'] = $categories;
162 162
 
163 163
 		$permissions = $event['permissions'];
164 164
 
165 165
 		$permissions = array_merge($permissions, array(
166
-			'm_delete_dir'			=> array('lang' => 'ACL_M_DELETE_DIR', 			'cat' => 'dir'),
167
-			'm_delete_comment_dir'	=> array('lang' => 'ACL_M_DELETE_COMMENT_DIR',	'cat' => 'dir'),
168
-			'm_edit_dir'			=> array('lang' => 'ACL_M_EDIT_DIR',			'cat' => 'dir'),
169
-			'm_edit_comment_dir'	=> array('lang' => 'ACL_M_EDIT_COMMENT_DIR',	'cat' => 'dir'),
170
-
171
-			'u_comment_dir'			=> array('lang' => 'ACL_U_COMMENT_DIR',			'cat' => 'dir'),
172
-			'u_delete_dir'			=> array('lang' => 'ACL_U_DELETE_DIR',			'cat' => 'dir'),
173
-			'u_delete_comment_dir'	=> array('lang' => 'ACL_U_DELETE_COMMENT_DIR',	'cat' => 'dir'),
174
-			'u_edit_dir'			=> array('lang' => 'ACL_U_EDIT_DIR',			'cat' => 'dir'),
175
-			'u_edit_comment_dir'	=> array('lang' => 'ACL_U_EDIT_COMMENT_DIR',	'cat' => 'dir'),
176
-			'u_search_dir'			=> array('lang' => 'ACL_U_SEARCH_DIR',			'cat' => 'dir'),
177
-			'u_submit_dir'			=> array('lang' => 'ACL_U_SUBMIT_DIR',			'cat' => 'dir'),
178
-			'u_vote_dir'			=> array('lang' => 'ACL_U_VOTE_DIR',			'cat' => 'dir'),
166
+			'm_delete_dir'			=> array('lang' => 'ACL_M_DELETE_DIR', 'cat' => 'dir'),
167
+			'm_delete_comment_dir'	=> array('lang' => 'ACL_M_DELETE_COMMENT_DIR', 'cat' => 'dir'),
168
+			'm_edit_dir'			=> array('lang' => 'ACL_M_EDIT_DIR', 'cat' => 'dir'),
169
+			'm_edit_comment_dir'	=> array('lang' => 'ACL_M_EDIT_COMMENT_DIR', 'cat' => 'dir'),
170
+
171
+			'u_comment_dir'			=> array('lang' => 'ACL_U_COMMENT_DIR', 'cat' => 'dir'),
172
+			'u_delete_dir'			=> array('lang' => 'ACL_U_DELETE_DIR', 'cat' => 'dir'),
173
+			'u_delete_comment_dir'	=> array('lang' => 'ACL_U_DELETE_COMMENT_DIR', 'cat' => 'dir'),
174
+			'u_edit_dir'			=> array('lang' => 'ACL_U_EDIT_DIR', 'cat' => 'dir'),
175
+			'u_edit_comment_dir'	=> array('lang' => 'ACL_U_EDIT_COMMENT_DIR', 'cat' => 'dir'),
176
+			'u_search_dir'			=> array('lang' => 'ACL_U_SEARCH_DIR', 'cat' => 'dir'),
177
+			'u_submit_dir'			=> array('lang' => 'ACL_U_SUBMIT_DIR', 'cat' => 'dir'),
178
+			'u_vote_dir'			=> array('lang' => 'ACL_U_VOTE_DIR', 'cat' => 'dir'),
179 179
 		));
180 180
 
181 181
 		$event['permissions'] = $permissions;
Please login to merge, or discard this patch.
language/nl/info_acp_directory.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
5 5
 *
6 6
 * @copyright (c) 2014 ErnadoO <http://www.phpbb-services.com>
7 7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
- * Dutch translation by Dutch Translators (https://github.com/dutch-translators)
9
- *
10
- */
8
+	 * Dutch translation by Dutch Translators (https://github.com/dutch-translators)
9
+	 *
10
+	 */
11 11
 
12 12
 /**
13 13
  * DO NOT CHANGE
Please login to merge, or discard this patch.
migrations/converter/convert_module.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
 class convert_module extends \phpbb\db\migration\migration
17 17
 {
18 18
 	/**
19
-	* Skip this migration if an ACP_DIRECTORY module does not exist
20
-	*
21
-	* @return	bool	True if table does not exist
22
-	* @access	public
23
-	*/
19
+	 * Skip this migration if an ACP_DIRECTORY module does not exist
20
+	 *
21
+	 * @return	bool	True if table does not exist
22
+	 * @access	public
23
+	 */
24 24
 	public function effectively_installed()
25 25
 	{
26 26
 		$sql = 'SELECT module_id
@@ -37,11 +37,11 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 
39 39
 	/**
40
-	* Add or update data in the database
41
-	*
42
-	* @return	array Array of table data
43
-	* @access	public
44
-	*/
40
+	 * Add or update data in the database
41
+	 *
42
+	 * @return	array Array of table data
43
+	 * @access	public
44
+	 */
45 45
 	public function update_data()
46 46
 	{
47 47
 		return array(
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 			'module_auth'		=> 'ext_ernadoo/phpbbdirectory'
57 57
 		);
58 58
 
59
-		$sql = 'UPDATE '  . $this->table_prefix . 'modules
59
+		$sql = 'UPDATE ' . $this->table_prefix . 'modules
60 60
 			SET ' . $this->db->sql_build_array('UPDATE', $module_data) . "
61 61
 			WHERE module_basename = 'acp_directory'
62 62
 				AND module_mode IN ('main', 'settings', 'cat', 'val')";
Please login to merge, or discard this patch.