Completed
Push — 3.2.x ( b8f3d7...182c32 )
by Erwan
01:52
created
controller/categories.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -46,20 +46,20 @@  discard block
 block discarded – undo
46 46
 	protected $link;
47 47
 
48 48
 	/**
49
-	* Constructor
50
-	*
51
-	* @param \phpbb\db\driver\driver_interface					$db			Database object
52
-	* @param \phpbb\config\config								$config		Config object
53
-	* @param \phpbb\language\language							$language	Language object
54
-	* @param \phpbb\template\template							$template	Template object
55
-	* @param \phpbb\user										$user		User object
56
-	* @param \phpbb\controller\helper							$helper		Controller helper object
57
-	* @param \phpbb\request\request								$request	Request object
58
-	* @param \phpbb\auth\auth									$auth		Auth object
59
-	* @param \phpbb\pagination									$pagination	Pagination object
60
-	* @param \ernadoo\phpbbdirectory\core\categorie				$categorie	PhpBB Directory extension categorie object
61
-	* @param \ernadoo\phpbbdirectory\core\link					$link		PhpBB Directory extension link object
62
-	*/
49
+	 * Constructor
50
+	 *
51
+	 * @param \phpbb\db\driver\driver_interface					$db			Database object
52
+	 * @param \phpbb\config\config								$config		Config object
53
+	 * @param \phpbb\language\language							$language	Language object
54
+	 * @param \phpbb\template\template							$template	Template object
55
+	 * @param \phpbb\user										$user		User object
56
+	 * @param \phpbb\controller\helper							$helper		Controller helper object
57
+	 * @param \phpbb\request\request								$request	Request object
58
+	 * @param \phpbb\auth\auth									$auth		Auth object
59
+	 * @param \phpbb\pagination									$pagination	Pagination object
60
+	 * @param \ernadoo\phpbbdirectory\core\categorie				$categorie	PhpBB Directory extension categorie object
61
+	 * @param \ernadoo\phpbbdirectory\core\link					$link		PhpBB Directory extension link 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\pagination $pagination, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link)
64 64
 	{
65 65
 		$this->db			= $db;
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
 	}
84 84
 
85 85
 	/**
86
-	* Base controller to be accessed with the URL /directory
87
-	*
88
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
89
-	*/
86
+	 * Base controller to be accessed with the URL /directory
87
+	 *
88
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
89
+	 */
90 90
 	public function base()
91 91
 	{
92 92
 		$this->categorie->display();
@@ -96,17 +96,17 @@  discard block
 block discarded – undo
96 96
 	}
97 97
 
98 98
 	/**
99
-	* View controller for display a category
100
-	*
101
-	* @param	int		$cat_id		The category ID
102
-	* @param	int		$page		Page number taken from the URL
103
-	* @param	int		$sort_days	Specifies the maximum amount of days a link may be old
104
-	* @param	string	$sort_key	is the key of $sort_by_sql for the selected sorting: a|t|r|s|v|p
105
-	* @param	string	$sort_dir	is either a or d representing ASC and DESC (ascending|descending)
106
-	* @param	string	$mode		watch|unwatch
107
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
108
-	* @throws	\phpbb\exception\http_exception
109
-	*/
99
+	 * View controller for display a category
100
+	 *
101
+	 * @param	int		$cat_id		The category ID
102
+	 * @param	int		$page		Page number taken from the URL
103
+	 * @param	int		$sort_days	Specifies the maximum amount of days a link may be old
104
+	 * @param	string	$sort_key	is the key of $sort_by_sql for the selected sorting: a|t|r|s|v|p
105
+	 * @param	string	$sort_dir	is either a or d representing ASC and DESC (ascending|descending)
106
+	 * @param	string	$mode		watch|unwatch
107
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
108
+	 * @throws	\phpbb\exception\http_exception
109
+	 */
110 110
 	public function view($cat_id, $page, $sort_days, $sort_key, $sort_dir, $mode = '')
111 111
 	{
112 112
 		if (false === $this->categorie->get($cat_id))
@@ -366,11 +366,11 @@  discard block
 block discarded – undo
366 366
 	}
367 367
 
368 368
 	/**
369
-	* date controller for return a date
370
-	*
371
-	* @return	\phpbb\json_response	A Json Response
372
-	* @throws	\phpbb\exception\http_exception
373
-	*/
369
+	 * date controller for return a date
370
+	 *
371
+	 * @return	\phpbb\json_response	A Json Response
372
+	 * @throws	\phpbb\exception\http_exception
373
+	 */
374 374
 	public function return_date()
375 375
 	{
376 376
 		if (!$this->request->is_ajax())
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -64,16 +64,16 @@  discard block
 block discarded – undo
64 64
 	*/
65 65
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link)
66 66
 	{
67
-		$this->db			= $db;
68
-		$this->config		= $config;
67
+		$this->db = $db;
68
+		$this->config = $config;
69 69
 		$this->language		= $language;
70 70
 		$this->template		= $template;
71 71
 		$this->user			= $user;
72
-		$this->helper		= $helper;
73
-		$this->request		= $request;
72
+		$this->helper = $helper;
73
+		$this->request = $request;
74 74
 		$this->auth			= $auth;
75
-		$this->pagination	= $pagination;
76
-		$this->categorie	= $categorie;
75
+		$this->pagination = $pagination;
76
+		$this->categorie = $categorie;
77 77
 		$this->link			= $link;
78 78
 
79 79
 		$language->add_lang('directory', 'ernadoo/phpbbdirectory');
@@ -117,18 +117,18 @@  discard block
 block discarded – undo
117 117
 
118 118
 		$start = ($page - 1) * $this->config['dir_show'];
119 119
 
120
-		$default_sort_days	= 0;
120
+		$default_sort_days = 0;
121 121
 		$default_sort_key	= (string) substr($this->config['dir_default_order'], 0, 1);
122 122
 		$default_sort_dir	= (string) substr($this->config['dir_default_order'], 2);
123 123
 
124 124
 		$sort_days	= (!$sort_days) ? $this->request->variable('st', $default_sort_days) : $sort_days;
125 125
 		$sort_key 	= (!$sort_key) ? $this->request->variable('sk', $default_sort_key) : $sort_key;
126
-		$sort_dir	= (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir;
126
+		$sort_dir = (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir;
127 127
 		$link_list = $rowset = array();
128 128
 
129 129
 		// Categorie ordering options
130 130
 		$limit_days		= array(0 => $this->language->lang('SEE_ALL'), 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'));
131
-		$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'));
131
+		$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'));
132 132
 		$sort_by_sql	= array('a' => 'u.username_clean', 't' => array('l.link_time', 'l.link_id'), 'r' => 'l.link_comment', 's' => 'LOWER(l.link_name)', 'v' => 'l.link_view');
133 133
 
134 134
 		if ($this->config['dir_activ_pagerank'])
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 			$min_post_time = time() - ($sort_days * 86400);
168 168
 
169 169
 			$sql = 'SELECT COUNT(link_id) AS nb_links
170
-				FROM ' . $this->links_table . '
171
-				WHERE link_cat = ' . (int) $cat_id . '
170
+				FROM ' . $this->links_table.'
171
+				WHERE link_cat = ' . (int) $cat_id.'
172 172
 					AND link_time >= ' . (int) $min_post_time;
173 173
 			$result = $this->db->sql_query($sql);
174 174
 			$nb_links = (int) $this->db->sql_fetchfield('nb_links');
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		else
184 184
 		{
185 185
 			$sql_limit_time = '';
186
-			$nb_links		= (int) $this->categorie->data['cat_links'];
186
+			$nb_links = (int) $this->categorie->data['cat_links'];
187 187
 		}
188 188
 
189 189
 		// Make sure $start is set to the last page if it exceeds the amount
@@ -246,11 +246,11 @@  discard block
 block discarded – undo
246 246
 
247 247
 		if (is_array($sort_by_sql[$sort_key]))
248 248
 		{
249
-			$sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
249
+			$sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction;
250 250
 		}
251 251
 		else
252 252
 		{
253
-			$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
253
+			$sql_sort_order = $sort_by_sql[$sort_key].' '.$direction;
254 254
 		}
255 255
 
256 256
 		// Grab just the sorted link ids
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 						),
294 294
 						array(
295 295
 							'FROM'	=> array($this->votes_table => 'v'),
296
-							'ON'	=> 'l.link_id = v.vote_link_id AND v.vote_user_id = ' . $this->user->data['user_id']
296
+							'ON'	=> 'l.link_id = v.vote_link_id AND v.vote_user_id = '.$this->user->data['user_id']
297 297
 						)
298 298
 				),
299 299
 				'WHERE'		=> $this->db->sql_in_set('l.link_id', $link_list)
@@ -310,8 +310,8 @@  discard block
 block discarded – undo
310 310
 
311 311
 			$link_list = ($store_reverse) ? array_reverse($link_list) : $link_list;
312 312
 
313
-			$votes_status 		= ($this->categorie->data['cat_allow_votes']) ? true : false;
314
-			$comments_status 	= ($this->categorie->data['cat_allow_comments']) ? true : false;
313
+			$votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false;
314
+			$comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false;
315 315
 
316 316
 			foreach ($link_list as $link_id)
317 317
 			{
@@ -321,11 +321,11 @@  discard block
 block discarded – undo
321 321
 				$s_note		= $this->link->display_note($site['link_note'], $site['link_vote'], $votes_status);
322 322
 				$s_thumb	= $this->link->display_thumb($site);
323 323
 				$s_vote		= $this->link->display_vote($site);
324
-				$s_banner	= $this->link->display_bann($site);
325
-				$s_pr		= $this->link->display_pagerank($site);
326
-				$s_rss		= $this->link->display_rss($site);
324
+				$s_banner = $this->link->display_bann($site);
325
+				$s_pr = $this->link->display_pagerank($site);
326
+				$s_rss = $this->link->display_rss($site);
327 327
 
328
-				$edit_allowed 	= ($this->user->data['is_registered'] && ($this->auth->acl_get('m_edit_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_edit_dir'))));
328
+				$edit_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_edit_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_edit_dir'))));
329 329
 				$delete_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_delete_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_delete_dir'))));
330 330
 
331 331
 				$this->template->assign_block_vars('site', array(
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 			$this->template->assign_block_vars('no_draw_link', array());
363 363
 		}
364 364
 
365
-		$page_title = $this->language->lang('DIRECTORY') . ' - ' . $this->categorie->data['cat_name'];
365
+		$page_title = $this->language->lang('DIRECTORY').' - '.$this->categorie->data['cat_name'];
366 366
 
367 367
 		$this->categorie->display();
368 368
 
Please login to merge, or discard this patch.
ext.php 2 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
 class ext extends \phpbb\extension\base
18 18
 {
19 19
 	/**
20
-	* Enable extension if requirements are met
21
-	*
22
-	* @return bool
23
-	* @aceess public
24
-	*/
20
+	 * Enable extension if requirements are met
21
+	 *
22
+	 * @return bool
23
+	 * @aceess public
24
+	 */
25 25
 	public function is_enableable()
26 26
 	{
27 27
 		$config = $this->container->get('config');
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 	}
43 43
 
44 44
 	/**
45
-	* Single enable step that installs any included migrations
46
-	*
47
-	* @param mixed $old_state State returned by previous call of this method
48
-	* @return mixed Returns false after last step, otherwise temporary state
49
-	*/
45
+	 * Single enable step that installs any included migrations
46
+	 *
47
+	 * @param mixed $old_state State returned by previous call of this method
48
+	 * @return mixed Returns false after last step, otherwise temporary state
49
+	 */
50 50
 	public function enable_step($old_state)
51 51
 	{
52 52
 		switch ($old_state)
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
 	}
75 75
 
76 76
 	/**
77
-	* Single disable step that does nothing
78
-	*
79
-	* @param mixed $old_state State returned by previous call of this method
80
-	* @return mixed Returns false after last step, otherwise temporary state
81
-	*/
77
+	 * Single disable step that does nothing
78
+	 *
79
+	 * @param mixed $old_state State returned by previous call of this method
80
+	 * @return mixed Returns false after last step, otherwise temporary state
81
+	 */
82 82
 	public function disable_step($old_state)
83 83
 	{
84 84
 		switch ($old_state)
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
 	}
107 107
 
108 108
 	/**
109
-	* Single purge step that reverts any included and installed migrations
110
-	*
111
-	* @param mixed $old_state State returned by previous call of this method
112
-	* @return mixed Returns false after last step, otherwise temporary state
113
-	*/
109
+	 * Single purge step that reverts any included and installed migrations
110
+	 *
111
+	 * @param mixed $old_state State returned by previous call of this method
112
+	 * @return mixed Returns false after last step, otherwise temporary state
113
+	 */
114 114
 	public function purge_step($old_state)
115 115
 	{
116 116
 		switch ($old_state)
@@ -138,16 +138,16 @@  discard block
 block discarded – undo
138 138
 	}
139 139
 
140 140
 	/**
141
-	* Notification handler to call notification enable/disable/purge steps
142
-	*
143
-	* @author VSEphpbb (Matt Friedman)
144
-	* @copyright (c) 2014 phpBB Limited <https://www.phpbb.com>
145
-	* @license GNU General Public License, version 2 (GPL-2.0)
146
-	* @param string $step The step (enable, disable, purge)
147
-	* @param array $notification_types The notification type names
148
-	* @return string Return notifications as temporary state
149
-	* @access protected
150
-	*/
141
+	 * Notification handler to call notification enable/disable/purge steps
142
+	 *
143
+	 * @author VSEphpbb (Matt Friedman)
144
+	 * @copyright (c) 2014 phpBB Limited <https://www.phpbb.com>
145
+	 * @license GNU General Public License, version 2 (GPL-2.0)
146
+	 * @param string $step The step (enable, disable, purge)
147
+	 * @param array $notification_types The notification type names
148
+	 * @return string Return notifications as temporary state
149
+	 * @access protected
150
+	 */
151 151
 	protected function notification_handler($step, $notification_types)
152 152
 	{
153 153
 		$phpbb_notifications = $this->container->get('notification_manager');
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@
 block discarded – undo
155 155
 
156 156
 		foreach ($notification_types as $notification_type)
157 157
 		{
158
-			call_user_func(array($phpbb_notifications, $step . '_notifications'), $notification_type);
158
+			call_user_func(array($phpbb_notifications, $step.'_notifications'), $notification_type);
159 159
 		}
160 160
 
161 161
 		return 'notifications';
Please login to merge, or discard this patch.
notification/type/directory_website_approved.php 1 patch
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -21,32 +21,32 @@  discard block
 block discarded – undo
21 21
 	protected $helper;
22 22
 
23 23
 	/**
24
-	* Set the controller helper
25
-	*
26
-	* @param \phpbb\controller\helper $helper
27
-	* @return null
28
-	*/
24
+	 * Set the controller helper
25
+	 *
26
+	 * @param \phpbb\controller\helper $helper
27
+	 * @return null
28
+	 */
29 29
 	public function set_controller_helper(\phpbb\controller\helper $helper)
30 30
 	{
31 31
 		$this->helper = $helper;
32 32
 	}
33 33
 
34 34
 	/**
35
-	* Get notification type name
36
-	*
37
-	* @return string
38
-	*/
35
+	 * Get notification type name
36
+	 *
37
+	 * @return string
38
+	 */
39 39
 	public function get_type()
40 40
 	{
41 41
 		return 'ernadoo.phpbbdirectory.notification.type.directory_website_approved';
42 42
 	}
43 43
 
44 44
 	/**
45
-	* Notification option data (for outputting to the user)
46
-	*
47
-	* @var bool|array False if the service should use it's default data
48
-	* 					Array of data (including keys 'id', 'lang', and 'group')
49
-	*/
45
+	 * Notification option data (for outputting to the user)
46
+	 *
47
+	 * @var bool|array False if the service should use it's default data
48
+	 * 					Array of data (including keys 'id', 'lang', and 'group')
49
+	 */
50 50
 	public static $notification_option = array(
51 51
 		'id'	=> 'dir_moderation_queue',
52 52
 		'lang'	=> 'NOTIFICATION_TYPE_DIR_UCP_MODERATION_QUEUE',
@@ -54,17 +54,17 @@  discard block
 block discarded – undo
54 54
 	);
55 55
 
56 56
 	/**
57
-	* Permission to check for (in find_users_for_notification)
58
-	*
59
-	* @var string Permission name
60
-	*/
57
+	 * Permission to check for (in find_users_for_notification)
58
+	 *
59
+	 * @var string Permission name
60
+	 */
61 61
 	protected $permission = array('a_', 'm_');
62 62
 
63 63
 	/**
64
-	* Is available
65
-	*
66
-	* @return bool True/False whether or not this is available to the user
67
-	*/
64
+	 * Is available
65
+	 *
66
+	 * @return bool True/False whether or not this is available to the user
67
+	 */
68 68
 	public function is_available()
69 69
 	{
70 70
 		$has_permission = $this->auth->acl_gets($this->permission, true);
@@ -73,21 +73,21 @@  discard block
 block discarded – undo
73 73
 	}
74 74
 
75 75
 	/**
76
-	* Get link id
77
-	*
78
-	* @param array $data The data from the link
79
-	* @return int
80
-	*/
76
+	 * Get link id
77
+	 *
78
+	 * @param array $data The data from the link
79
+	 * @return int
80
+	 */
81 81
 	static public function get_item_id($data)
82 82
 	{
83 83
 		return (int) $data['link_id'];
84 84
 	}
85 85
 
86 86
 	/**
87
-	* Get parent id - it's not used
88
-	*
89
-	* @param array $data The data from the link
90
-	*/
87
+	 * Get parent id - it's not used
88
+	 *
89
+	 * @param array $data The data from the link
90
+	 */
91 91
 	static public function get_item_parent_id($data)
92 92
 	{
93 93
 		// No parent
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
 	}
96 96
 
97 97
 	/**
98
-	* Find the users who want to receive notifications
99
-	*
100
-	* @param	array	$data		Data from submit link
101
-	* @param	array	$options	Options for finding users for notification
102
-	* @return	array
103
-	*/
98
+	 * Find the users who want to receive notifications
99
+	 *
100
+	 * @param	array	$data		Data from submit link
101
+	 * @param	array	$options	Options for finding users for notification
102
+	 * @return	array
103
+	 */
104 104
 	public function find_users_for_notification($data, $options = array())
105 105
 	{
106 106
 		$options = array_merge(array(
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
 	}
117 117
 
118 118
 	/**
119
-	* Get the HTML formatted title of this notification
120
-	*
121
-	* @return string
122
-	*/
119
+	 * Get the HTML formatted title of this notification
120
+	 *
121
+	 * @return string
122
+	 */
123 123
 	public function get_title()
124 124
 	{
125 125
 		$link_name = $this->get_data('link_name');
@@ -129,20 +129,20 @@  discard block
 block discarded – undo
129 129
 	}
130 130
 
131 131
 	/**
132
-	* Get email template
133
-	*
134
-	* @return string
135
-	*/
132
+	 * Get email template
133
+	 *
134
+	 * @return string
135
+	 */
136 136
 	public function get_email_template()
137 137
 	{
138 138
 		return '@ernadoo_phpbbdirectory/directory_website_approved';
139 139
 	}
140 140
 
141 141
 	/**
142
-	* Get email template variables
143
-	*
144
-	* @return array
145
-	*/
142
+	 * Get email template variables
143
+	 *
144
+	 * @return array
145
+	 */
146 146
 	public function get_email_template_variables()
147 147
 	{
148 148
 		return array(
@@ -151,33 +151,33 @@  discard block
 block discarded – undo
151 151
 	}
152 152
 
153 153
 	/**
154
-	* Get the url to this item
155
-	*
156
-	* @return string URL
157
-	*/
154
+	 * Get the url to this item
155
+	 *
156
+	 * @return string URL
157
+	 */
158 158
 	public function get_url()
159 159
 	{
160 160
 		return $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $this->get_data('cat_id')));
161 161
 	}
162 162
 
163 163
 	/**
164
-	* Users needed to query before this notification can be displayed
165
-	*
166
-	* @return array Array of user_ids
167
-	*/
164
+	 * Users needed to query before this notification can be displayed
165
+	 *
166
+	 * @return array Array of user_ids
167
+	 */
168 168
 	public function users_to_query()
169 169
 	{
170 170
 		return array();
171 171
 	}
172 172
 
173 173
 	/**
174
-	* Function for preparing the data for insertion in an SQL query
175
-	* (The service handles insertion)
176
-	*
177
-	* @param	array	$data				Data from submit link
178
-	* @param	array	$pre_create_data	Data from pre_create_insert_array()
179
-	* @return	array						Array of data ready to be inserted into the database
180
-	*/
174
+	 * Function for preparing the data for insertion in an SQL query
175
+	 * (The service handles insertion)
176
+	 *
177
+	 * @param	array	$data				Data from submit link
178
+	 * @param	array	$pre_create_data	Data from pre_create_insert_array()
179
+	 * @return	array						Array of data ready to be inserted into the database
180
+	 */
181 181
 	public function create_insert_array($data, $pre_create_data = array())
182 182
 	{
183 183
 		$this->set_data('link_name', $data['link_name']);
Please login to merge, or discard this patch.
controller/search.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -69,18 +69,18 @@  discard block
 block discarded – undo
69 69
 	*/
70 70
 	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)
71 71
 	{
72
-		$this->db			= $db;
73
-		$this->config		= $config;
72
+		$this->db = $db;
73
+		$this->config = $config;
74 74
 		$this->language		= $language;
75 75
 		$this->template		= $template;
76 76
 		$this->user			= $user;
77
-		$this->helper		= $helper;
78
-		$this->request		= $request;
77
+		$this->helper = $helper;
78
+		$this->request = $request;
79 79
 		$this->auth			= $auth;
80
-		$this->pagination	= $pagination;
81
-		$this->search		= $search;
82
-		$this->categorie	= $categorie;
83
-		$this->link			= $link;
80
+		$this->pagination = $pagination;
81
+		$this->search = $search;
82
+		$this->categorie = $categorie;
83
+		$this->link = $link;
84 84
 
85 85
 		$language->add_lang('directory', 'ernadoo/phpbbdirectory');
86 86
 		$language->add_lang('search');
@@ -104,24 +104,24 @@  discard block
 block discarded – undo
104 104
 			throw new \phpbb\exception\http_exception(403, 'DIR_ERROR_NOT_AUTH');
105 105
 		}
106 106
 
107
-		$cat_id				= $this->request->variable('cat_id', 0);
108
-		$keywords			= $this->request->variable('keywords', '', true);
107
+		$cat_id = $this->request->variable('cat_id', 0);
108
+		$keywords = $this->request->variable('keywords', '', true);
109 109
 		$search_terms		= $this->request->variable('terms', 'all');
110
-		$search_category	= $this->request->variable('cid', array(0));
111
-		$search_fields		= $this->request->variable('sf', 'all');
110
+		$search_category = $this->request->variable('cid', array(0));
111
+		$search_fields = $this->request->variable('sf', 'all');
112 112
 		$search_child		= $this->request->variable('sc', true);
113
-		$sort_days			= $this->request->variable('st', 0);
113
+		$sort_days = $this->request->variable('st', 0);
114 114
 		$sort_key			= $this->request->variable('sk', 't');
115 115
 		$sort_dir			= $this->request->variable('sd', 'd');
116
-		$start				= ($page - 1) * (int) $this->config['dir_show'];
116
+		$start = ($page - 1) * (int) $this->config['dir_show'];
117 117
 
118
-		$default_sort_days	= 0;
118
+		$default_sort_days = 0;
119 119
 		$default_sort_key	= (string) substr($this->config['dir_default_order'], 0, 1);
120 120
 		$default_sort_dir	= (string) substr($this->config['dir_default_order'], 2);
121 121
 
122 122
 		// Categorie ordering options
123 123
 		$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'));
124
-		$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
+		$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'));
125 125
 		$sort_by_sql	= array('a' => 'u.username_clean', 't' => array('l.link_time', 'l.link_id'), 'r' => 'l.link_comment', 's' => 'LOWER(l.link_name)', 'v' => 'l.link_view');
126 126
 
127 127
 		if ($this->config['dir_activ_pagerank'])
@@ -170,12 +170,12 @@  discard block
 block discarded – undo
170 170
 
171 171
 			$u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit)));
172 172
 
173
-			($u_hilit) 					? $u_search['keywords']		= urlencode(htmlspecialchars_decode($keywords)) : '';
174
-			($search_terms != 'all') 	? $u_search['terms']		= $search_terms : '';
175
-			($cat_id)					? $u_search['cat_id']		= $cat_id : '';
176
-			($search_category)			? $u_search['cid']			= $search_category : '';
177
-			(!$search_child)			? $u_search['sc']			= 0 : '';
178
-			($search_fields != 'all')	? $u_search['sf'] 			= $search_fields : '';
173
+			($u_hilit) ? $u_search['keywords'] = urlencode(htmlspecialchars_decode($keywords)) : '';
174
+			($search_terms != 'all') ? $u_search['terms'] = $search_terms : '';
175
+			($cat_id) ? $u_search['cat_id'] = $cat_id : '';
176
+			($search_category) ? $u_search['cid'] = $search_category : '';
177
+			(!$search_child) ? $u_search['sc'] = 0 : '';
178
+			($search_fields != 'all') ? $u_search['sf'] = $search_fields : '';
179 179
 
180 180
 			$base_url = array(
181 181
 				'routes'	=> 'ernadoo_phpbbdirectory_search_controller',
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 
250 250
 					foreach ($rowset as $data)
251 251
 					{
252
-						$s_banner	= $this->link->display_bann($data);
252
+						$s_banner = $this->link->display_bann($data);
253 253
 						$s_thumb	= $this->link->display_thumb($data);
254 254
 						$s_flag		= $this->link->display_flag($data);
255 255
 
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
 
258 258
 						if ($hilit)
259 259
 						{
260
-							$data['link_name'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_name']);
261
-							$data['link_description'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_description']);
260
+							$data['link_name'] = preg_replace('#(?!<.*)(?<!\w)('.$hilit.')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_name']);
261
+							$data['link_description'] = preg_replace('#(?!<.*)(?<!\w)('.$hilit.')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_description']);
262 262
 						}
263 263
 
264 264
 						$this->template->assign_block_vars('results', array(
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	private function _get_exclude_categories(&$search_category, $search_child)
329 329
 	{
330 330
 		$sql = 'SELECT cat_id, parent_id, right_id
331
-				FROM ' . $this->categories_table . '
331
+				FROM ' . $this->categories_table.'
332 332
 				ORDER BY left_id';
333 333
 		$result = $this->db->sql_query($sql);
334 334
 
Please login to merge, or discard this patch.
controller/links.php 1 patch
Spacing   +39 added lines, -39 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
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
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);
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 
148 148
 			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $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_page_controller', array('cat_id' => (int) $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_page_controller', array('cat_id' => (int) $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_user_id
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);
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		$cat_id		= $this->request->variable('id', $cat_id);
184 184
 		$submit		= $this->request->is_set_post('submit') ? true : false;
185 185
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
186
-		$title		= $this->language->lang('DIR_EDIT_SITE');
186
+		$title = $this->language->lang('DIR_EDIT_SITE');
187 187
 
188 188
 		$this->template->assign_block_vars('dir_navlinks', array(
189 189
 			'FORUM_NAME'	=> $title,
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 		else
204 204
 		{
205 205
 			$sql = 'SELECT link_id, link_uid, link_flags, link_bitfield, link_cat, link_url, link_description, link_guest_email, link_name, link_rss, link_back, link_banner, link_flag, link_cat, link_time
206
-				FROM ' . $this->links_table . '
206
+				FROM ' . $this->links_table.'
207 207
 				WHERE link_id = ' . (int) $link_id;
208 208
 			$result = $this->db->sql_query($sql);
209 209
 
@@ -219,15 +219,15 @@  discard block
 block discarded – undo
219 219
 				'old_banner'	=> $site['link_banner'],
220 220
 			);
221 221
 
222
-			$site_description		= generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']);
223
-			$site['link_banner'] 	= (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : '';
222
+			$site_description = generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']);
223
+			$site['link_banner'] = (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : '';
224 224
 
225
-			$this->url			= $site['link_url'];
226
-			$this->site_name	= $site['link_name'];
225
+			$this->url = $site['link_url'];
226
+			$this->site_name = $site['link_name'];
227 227
 			$this->description	= $site_description['text'];
228 228
 			$this->guest_email	= $site['link_guest_email'];
229
-			$this->rss			= $site['link_rss'];
230
-			$this->banner 		= $site['link_banner'];
229
+			$this->rss = $site['link_rss'];
230
+			$this->banner = $site['link_banner'];
231 231
 			$this->back			= $site['link_back'];
232 232
 			$this->flag 		= $site['link_flag'];
233 233
 		}
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 		$cat_id		= $this->request->variable('id', $cat_id);
255 255
 		$submit		= $this->request->is_set_post('submit') ? true : false;
256 256
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
257
-		$title		= $this->language->lang('DIR_NEW_SITE');
257
+		$title = $this->language->lang('DIR_NEW_SITE');
258 258
 
259 259
 		$this->template->assign_block_vars('dir_navlinks', array(
260 260
 			'FORUM_NAME'	=> $title,
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
 		// We check if user had already vot for this website.
320 320
 		$sql = 'SELECT vote_link_id
321
-			FROM ' . $this->votes_table . '
321
+			FROM ' . $this->votes_table.'
322 322
 			WHERE ' . $this->db->sql_build_array('SELECT', $data);
323 323
 		$result = $this->db->sql_query($sql);
324 324
 		$data = $this->db->sql_fetchrow($result);
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
 		$meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id));
334 334
 		meta_refresh(3, $meta_info);
335
-		$message = $this->language->lang('DIR_VOTE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $meta_info . '">', '</a>');
335
+		$message = $this->language->lang('DIR_VOTE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$meta_info.'">', '</a>');
336 336
 		return $this->helper->message($message);
337 337
 	}
338 338
 
@@ -357,18 +357,18 @@  discard block
 block discarded – undo
357 357
 			return $this->helper->message('FORM_INVALID');
358 358
 		}
359 359
 
360
-		$this->url			= $this->request->variable('url', '');
361
-		$this->site_name	= $this->request->variable('site_name', '', true);
360
+		$this->url = $this->request->variable('url', '');
361
+		$this->site_name = $this->request->variable('site_name', '', true);
362 362
 		$this->description	= $this->request->variable('description', '', true);
363 363
 		$this->guest_email	= $this->request->variable('guest_email', '');
364
-		$this->rss			= $this->request->variable('rss', '');
365
-		$this->banner 		= $this->request->variable('banner', '');
364
+		$this->rss = $this->request->variable('rss', '');
365
+		$this->banner = $this->request->variable('banner', '');
366 366
 		$this->back			= $this->request->variable('back', '');
367 367
 		$this->flag 		= $this->request->variable('flag', '');
368 368
 
369 369
 		if (!function_exists('validate_data'))
370 370
 		{
371
-			include($this->root_path . 'includes/functions_user.' . $this->php_ext);
371
+			include($this->root_path.'includes/functions_user.'.$this->php_ext);
372 372
 		}
373 373
 
374 374
 		// We define variables to check
@@ -391,17 +391,17 @@  discard block
 block discarded – undo
391 391
 			'site_name' =>			array(
392 392
 				array('string', false, 1, 100)),
393 393
 			'website'		=>		array(
394
-				array('string',	false, 12, 255),
395
-				array('match',	true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
394
+				array('string', false, 12, 255),
395
+				array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
396 396
 			'description'	=>		array(
397 397
 				array('string', !$this->categorie->data['cat_must_describe'], 1, $this->config['dir_length_describe'])),
398 398
 			'rss'			=>		array(
399 399
 				array('string', true, 12, 255),
400
-				array('match',	empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
400
+				array('match', empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
401 401
 			'banner'		=>		array(
402 402
 				array('string', true, 5, 255)),
403 403
 			'back'			=>		array(
404
-				array('string',	!$this->categorie->data['cat_link_back'], 12, 255),
404
+				array('string', !$this->categorie->data['cat_link_back'], 12, 255),
405 405
 				array(array($this->link, 'link_back'), true)),
406 406
 			'cat'			=>		array(
407 407
 				array('num', '', 1))
@@ -450,8 +450,8 @@  discard block
 block discarded – undo
450 450
 		// Still no errors?? So let's go!
451 451
 		if (!$error)
452 452
 		{
453
-			$this->banner	= (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
454
-			$this->url		= $this->link->clean_url($this->url);
453
+			$this->banner = (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
454
+			$this->url = $this->link->clean_url($this->url);
455 455
 
456 456
 			$data_edit = array(
457 457
 				'link_user_id'		=> $this->link_user_id,
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id));
501 501
 			meta_refresh(3, $meta_info);
502 502
 			$message	= ($need_approval) ? $this->language->lang('DIR_'.strtoupper($mode).'_SITE_ACTIVE') : $this->language->lang('DIR_'.strtoupper($mode).'_SITE_OK');
503
-			$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_page_controller', array('cat_id' => (int) $cat_id)) . '">', '</a>');
503
+			$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_page_controller', array('cat_id' => (int) $cat_id)).'">', '</a>');
504 504
 			return $this->helper->message($message);
505 505
 		}
506 506
 		else
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 	{
530 530
 		if (!function_exists('file_gc'))
531 531
 		{
532
-			include($this->root_path . 'includes/functions_download.' . $this->php_ext);
532
+			include($this->root_path.'includes/functions_download.'.$this->php_ext);
533 533
 		}
534 534
 
535 535
 		$file_path = $this->get_banner_path($banner_img);
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 
585 585
 		if (!function_exists('display_custom_bbcodes'))
586 586
 		{
587
-			include($this->root_path . 'includes/functions_display.' . $this->php_ext);
587
+			include($this->root_path.'includes/functions_display.'.$this->php_ext);
588 588
 		}
589 589
 		display_custom_bbcodes();
590 590
 		add_form_key('dir_form');
@@ -593,17 +593,17 @@  discard block
 block discarded – undo
593 593
 		$flag_path = $ext_path.'images/flags/';
594 594
 
595 595
 		$s_guest	= (!$this->user->data['is_registered'] || !empty($this->guest_email));
596
-		$s_rss		= $this->config['dir_activ_rss'];
597
-		$s_banner	= $this->config['dir_activ_banner'];
596
+		$s_rss = $this->config['dir_activ_rss'];
597
+		$s_banner = $this->config['dir_activ_banner'];
598 598
 		$s_back		= $this->categorie->data['cat_link_back'];
599 599
 		$s_flag		= $this->config['dir_activ_flag'];
600 600
 
601 601
 		$this->template->assign_vars(array(
602
-			'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>'),
603
-			'IMG_STATUS'			=> ($this->config['allow_bbcode'])	? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
602
+			'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>'),
603
+			'IMG_STATUS'			=> ($this->config['allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
604 604
 			'SMILIES_STATUS'		=> ($this->config['allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'),
605 605
 			'URL_STATUS'			=> ($this->config['allow_post_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'),
606
-			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash'])	? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
606
+			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
607 607
 
608 608
 			'L_TITLE'				=> $title,
609 609
 			'L_DIR_DESCRIPTION_EXP'	=> $this->language->lang('DIR_DESCRIPTION_EXP', $this->config['dir_length_describe']),
Please login to merge, or discard this patch.
controller/acp/cat.php 2 patches
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -69,19 +69,19 @@  discard block
 block discarded – undo
69 69
 	private $update;
70 70
 
71 71
 	/**
72
-	* Constructor
73
-	*
74
-	* @param \phpbb\cache\service								$cache				Cache object
75
-	* @param \phpbb\db\driver\driver_interface 					$db					Database object
76
-	* @param \phpbb\controller\helper							$helper				Helper object
77
-	* @param \phpbb\language\language							$language			Language object
78
-	* @param \phpbb\log\log										$log				Log object
79
-	* @param \phpbb\request\request								$request			Request object
80
-	* @param \phpbb\template\template							$template			Template object
81
-	* @param \phpbb\user										$user				User object
82
-	* @param \ernadoo\phpbbdirectory\core\categorie				$categorie			PhpBB Directory extension categorie object
83
-	* @param \ernadoo\phpbbdirectory\core\nestedset_category	$nestedset_category	PhpBB Directory extension nestedset object
84
-	*/
72
+	 * Constructor
73
+	 *
74
+	 * @param \phpbb\cache\service								$cache				Cache object
75
+	 * @param \phpbb\db\driver\driver_interface 					$db					Database object
76
+	 * @param \phpbb\controller\helper							$helper				Helper object
77
+	 * @param \phpbb\language\language							$language			Language object
78
+	 * @param \phpbb\log\log										$log				Log object
79
+	 * @param \phpbb\request\request								$request			Request object
80
+	 * @param \phpbb\template\template							$template			Template object
81
+	 * @param \phpbb\user										$user				User object
82
+	 * @param \ernadoo\phpbbdirectory\core\categorie				$categorie			PhpBB Directory extension categorie object
83
+	 * @param \ernadoo\phpbbdirectory\core\nestedset_category	$nestedset_category	PhpBB Directory extension nestedset object
84
+	 */
85 85
 	public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category)
86 86
 	{
87 87
 		$this->cache				= $cache;
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
 	}
106 106
 
107 107
 	/**
108
-	* Initialize defaults data for add page
109
-	*
110
-	* @return null
111
-	*/
108
+	 * Initialize defaults data for add page
109
+	 *
110
+	 * @return null
111
+	 */
112 112
 	public function action_add()
113 113
 	{
114 114
 		$this->cat_id = $this->parent_id;
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
 	}
143 143
 
144 144
 	/**
145
-	* Display deleting page
146
-	*
147
-	* @return null
148
-	*/
145
+	 * Display deleting page
146
+	 *
147
+	 * @return null
148
+	 */
149 149
 	public function action_delete()
150 150
 	{
151 151
 		if (!$this->cat_id)
@@ -196,10 +196,10 @@  discard block
 block discarded – undo
196 196
 	}
197 197
 
198 198
 	/**
199
-	* Initialize data for edit page
200
-	*
201
-	* @return null
202
-	*/
199
+	 * Initialize data for edit page
200
+	 *
201
+	 * @return null
202
+	 */
203 203
 	public function action_edit()
204 204
 	{
205 205
 		$row = $this->_get_cat_info($this->cat_id);
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
 	}
227 227
 
228 228
 	/**
229
-	* Move order categories
230
-	*
231
-	* @return null
232
-	*/
229
+	 * Move order categories
230
+	 *
231
+	 * @return null
232
+	 */
233 233
 	public function action_move()
234 234
 	{
235 235
 		if (!$this->cat_id)
@@ -272,10 +272,10 @@  discard block
 block discarded – undo
272 272
 	}
273 273
 
274 274
 	/**
275
-	* Display progress bar for syncinc categories
276
-	*
277
-	* @return null
278
-	*/
275
+	 * Display progress bar for syncinc categories
276
+	 *
277
+	 * @return null
278
+	 */
279 279
 	public function action_progress_bar()
280 280
 	{
281 281
 		$start = $this->request->variable('start', 0);
@@ -296,10 +296,10 @@  discard block
 block discarded – undo
296 296
 	}
297 297
 
298 298
 	/**
299
-	* Get link's ID interval for _sync_dir_links()
300
-	*
301
-	* @return null
302
-	*/
299
+	 * Get link's ID interval for _sync_dir_links()
300
+	 *
301
+	 * @return null
302
+	 */
303 303
 	public function action_sync()
304 304
 	{
305 305
 		if (!$this->cat_id)
@@ -383,10 +383,10 @@  discard block
 block discarded – undo
383 383
 	}
384 384
 
385 385
 	/**
386
-	* Sync category data
387
-	*
388
-	* @return null
389
-	*/
386
+	 * Sync category data
387
+	 *
388
+	 * @return null
389
+	 */
390 390
 	public function action_sync_cat()
391 391
 	{
392 392
 		$sql = 'SELECT cat_name
@@ -410,10 +410,10 @@  discard block
 block discarded – undo
410 410
 	}
411 411
 
412 412
 	/**
413
-	* Display categories page
414
-	*
415
-	* @return null
416
-	*/
413
+	 * Display categories page
414
+	 *
415
+	 * @return null
416
+	 */
417 417
 	public function display_cats()
418 418
 	{
419 419
 		// Default management page
@@ -508,22 +508,22 @@  discard block
 block discarded – undo
508 508
 	}
509 509
 
510 510
 	/**
511
-	* Set page url
512
-	*
513
-	* @param	string $u_action Custom form action
514
-	* @return	null
515
-	* @access	public
516
-	*/
511
+	 * Set page url
512
+	 *
513
+	 * @param	string $u_action Custom form action
514
+	 * @return	null
515
+	 * @access	public
516
+	 */
517 517
 	public function set_page_url($u_action)
518 518
 	{
519 519
 		$this->u_action = $u_action;
520 520
 	}
521 521
 
522 522
 	/**
523
-	* Update cat table
524
-	*
525
-	* @return null
526
-	*/
523
+	 * Update cat table
524
+	 *
525
+	 * @return null
526
+	 */
527 527
 	public function update()
528 528
 	{
529 529
 		if (!check_form_key($this->form_key))
@@ -617,11 +617,11 @@  discard block
 block discarded – undo
617 617
 	}
618 618
 
619 619
 	/**
620
-	* Display form
621
-	*
622
-	* @param	string $parents_list	Drop-down list
623
-	* @return	null
624
-	*/
620
+	 * Display form
621
+	 *
622
+	 * @param	string $parents_list	Drop-down list
623
+	 * @return	null
624
+	 */
625 625
 	private function _display_cat_form($parents_list)
626 626
 	{
627 627
 		$dir_cat_desc_data = array(
@@ -691,11 +691,11 @@  discard block
 block discarded – undo
691 691
 	}
692 692
 
693 693
 	/**
694
-	* Get category details
695
-	*
696
-	* @param	int		$cat_id	The category ID
697
-	* @return 	array
698
-	*/
694
+	 * Get category details
695
+	 *
696
+	 * @param	int		$cat_id	The category ID
697
+	 * @return 	array
698
+	 */
699 699
 	private function _get_cat_info($cat_id)
700 700
 	{
701 701
 		$sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next
@@ -714,10 +714,10 @@  discard block
 block discarded – undo
714 714
 	}
715 715
 
716 716
 	/**
717
-	* Update category data
718
-	*
719
-	* @return array
720
-	*/
717
+	 * Update category data
718
+	 *
719
+	 * @return array
720
+	 */
721 721
 	private function _update_cat_data()
722 722
 	{
723 723
 		if (!$this->cat_data['cat_name'])
@@ -811,14 +811,14 @@  discard block
 block discarded – undo
811 811
 	}
812 812
 
813 813
 	/**
814
-	* Remove complete category
815
-	*
816
-	* @param	string	$action_links	Action for categories links
817
-	* @param	string	$action_subcats	Action for sub-categories
818
-	* @param	int		$links_to_id	New category ID for links
819
-	* @param	int		$subcats_to_id	New category ID for sub-categories
820
-	* @return 	array
821
-	*/
814
+	 * Remove complete category
815
+	 *
816
+	 * @param	string	$action_links	Action for categories links
817
+	 * @param	string	$action_subcats	Action for sub-categories
818
+	 * @param	int		$links_to_id	New category ID for links
819
+	 * @param	int		$subcats_to_id	New category ID for sub-categories
820
+	 * @return 	array
821
+	 */
822 822
 	private function _delete_cat($action_links = 'delete', $action_subcats = 'delete', $links_to_id = 0, $subcats_to_id = 0)
823 823
 	{
824 824
 		$this->cat_data = $this->_get_cat_info($this->cat_id);
@@ -935,12 +935,12 @@  discard block
 block discarded – undo
935 935
 	}
936 936
 
937 937
 	/**
938
-	* Move category content from one to another forum
939
-	*
940
-	* @param	int	$from_id
941
-	* @param	int	$to_id
942
-	* @return	null
943
-	*/
938
+	 * Move category content from one to another forum
939
+	 *
940
+	 * @param	int	$from_id
941
+	 * @param	int	$to_id
942
+	 * @return	null
943
+	 */
944 944
 	private function _move_cat_content($from_id, $to_id)
945 945
 	{
946 946
 		$sql = 'UPDATE ' . $this->links_table . '
@@ -956,10 +956,10 @@  discard block
 block discarded – undo
956 956
 	}
957 957
 
958 958
 	/**
959
-	* Delete category content
960
-	*
961
-	* @return array
962
-	*/
959
+	 * Delete category content
960
+	 *
961
+	 * @return array
962
+	 */
963 963
 	private function _delete_cat_content()
964 964
 	{
965 965
 		$this->db->sql_transaction('begin');
@@ -1018,11 +1018,11 @@  discard block
 block discarded – undo
1018 1018
 	}
1019 1019
 
1020 1020
 	/**
1021
-	* Update links counter
1022
-	*
1023
-	* @param	int $cat_id	The category ID
1024
-	* @return	null
1025
-	*/
1021
+	 * Update links counter
1022
+	 *
1023
+	 * @param	int $cat_id	The category ID
1024
+	 * @return	null
1025
+	 */
1026 1026
 	private function _sync_dir_cat($cat_id)
1027 1027
 	{
1028 1028
 		$sql = 'SELECT COUNT(link_id) AS num_links
@@ -1040,12 +1040,12 @@  discard block
 block discarded – undo
1040 1040
 	}
1041 1041
 
1042 1042
 	/**
1043
-	* Update link data (note, vote, comment)
1044
-	*
1045
-	* @param	int	$start
1046
-	* @param	int	$stop
1047
-	* @return	null
1048
-	*/
1043
+	 * Update link data (note, vote, comment)
1044
+	 *
1045
+	 * @param	int	$start
1046
+	 * @param	int	$stop
1047
+	 * @return	null
1048
+	 */
1049 1049
 	private function _sync_dir_links($start, $stop)
1050 1050
 	{
1051 1051
 		$sql_ary = array(
@@ -1088,12 +1088,12 @@  discard block
 block discarded – undo
1088 1088
 	}
1089 1089
 
1090 1090
 	/**
1091
-	* Display icons drop-down list
1092
-	*
1093
-	* @param	string	$icons_path
1094
-	* @param	string	$img_selected
1095
-	* @return	string
1096
-	*/
1091
+	 * Display icons drop-down list
1092
+	 *
1093
+	 * @param	string	$icons_path
1094
+	 * @param	string	$img_selected
1095
+	 * @return	string
1096
+	 */
1097 1097
 	private function _get_dir_icon_list($icons_path, $img_selected)
1098 1098
 	{
1099 1099
 		$imglist = filelist($icons_path, '');
Please login to merge, or discard this patch.
Spacing   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -84,23 +84,23 @@  discard block
 block discarded – undo
84 84
 	*/
85 85
 	public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category)
86 86
 	{
87
-		$this->cache				= $cache;
88
-		$this->db					= $db;
89
-		$this->helper				= $helper;
87
+		$this->cache = $cache;
88
+		$this->db = $db;
89
+		$this->helper = $helper;
90 90
 		$this->language				= $language;
91 91
 		$this->phpbb_log			= $log;
92
-		$this->request				= $request;
92
+		$this->request = $request;
93 93
 		$this->template				= $template;
94
-		$this->user					= $user;
94
+		$this->user = $user;
95 95
 		$this->categorie			= $categorie;
96
-		$this->nestedset_category	= $nestedset_category;
96
+		$this->nestedset_category = $nestedset_category;
97 97
 
98 98
 		$this->form_key = 'acp_dir_cat';
99 99
 		add_form_key($this->form_key);
100 100
 
101 101
 		$this->action		= $this->request->variable('action', '');
102 102
 		$this->cat_id		= $request->variable('c', 0);
103
-		$this->parent_id	= $request->variable('parent_id', 0);
103
+		$this->parent_id = $request->variable('parent_id', 0);
104 104
 		$this->update		= ($this->request->is_set_post('update')) ? true : false;
105 105
 	}
106 106
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	{
151 151
 		if (!$this->cat_id)
152 152
 		{
153
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
153
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
154 154
 		}
155 155
 
156 156
 		$this->cat_data = $this->_get_cat_info($this->cat_id);
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 		$cat_list = $this->categorie->make_cat_select((int) $this->cat_data['parent_id'], $subcats_id);
167 167
 
168 168
 		$sql = 'SELECT cat_id
169
-			FROM ' . $this->categories_table . '
169
+			FROM ' . $this->categories_table.'
170 170
 			WHERE cat_id <> ' . (int) $this->cat_id;
171 171
 		$result = $this->db->sql_query_limit($sql, 1);
172 172
 
@@ -182,8 +182,8 @@  discard block
 block discarded – undo
182 182
 
183 183
 		$this->template->assign_vars(array(
184 184
 			'S_DELETE_DIR_CAT'		=> true,
185
-			'U_ACTION'				=> $this->u_action . "&amp;parent_id={$parent_id}&amp;action=delete&amp;c=$this->cat_id",
186
-			'U_BACK'				=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
185
+			'U_ACTION'				=> $this->u_action."&amp;parent_id={$parent_id}&amp;action=delete&amp;c=$this->cat_id",
186
+			'U_BACK'				=> $this->u_action.'&amp;parent_id='.$this->parent_id,
187 187
 
188 188
 			'DIR_CAT_NAME'			=> $this->cat_data['cat_name'],
189 189
 			'S_HAS_SUBCATS'			=> ($this->cat_data['right_id'] - $this->cat_data['left_id'] > 1) ? true : false,
@@ -234,11 +234,11 @@  discard block
 block discarded – undo
234 234
 	{
235 235
 		if (!$this->cat_id)
236 236
 		{
237
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
237
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
238 238
 		}
239 239
 
240 240
 		$sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id
241
-			FROM ' . $this->categories_table . '
241
+			FROM ' . $this->categories_table.'
242 242
 			WHERE cat_id = ' . (int) $this->cat_id;
243 243
 		$result = $this->db->sql_query($sql);
244 244
 		$row = $this->db->sql_fetchrow($result);
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 
247 247
 		if (!$row)
248 248
 		{
249
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
249
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
250 250
 		}
251 251
 
252 252
 		try
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 
261 261
 		if ($move_cat_name !== false)
262 262
 		{
263
-			$this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_' . strtoupper($this->action), time(), array($row['cat_name'], $move_cat_name));
263
+			$this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_'.strtoupper($this->action), time(), array($row['cat_name'], $move_cat_name));
264 264
 			$this->cache->destroy('sql', $this->categories_table);
265 265
 		}
266 266
 
@@ -304,13 +304,13 @@  discard block
 block discarded – undo
304 304
 	{
305 305
 		if (!$this->cat_id)
306 306
 		{
307
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
307
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
308 308
 		}
309 309
 
310 310
 		@set_time_limit(0);
311 311
 
312 312
 		$sql = 'SELECT cat_name, cat_links
313
-			FROM ' . $this->categories_table . '
313
+			FROM ' . $this->categories_table.'
314 314
 			WHERE cat_id = ' . (int) $this->cat_id;
315 315
 		$result = $this->db->sql_query($sql);
316 316
 		$row = $this->db->sql_fetchrow($result);
@@ -318,12 +318,12 @@  discard block
 block discarded – undo
318 318
 
319 319
 		if (!$row)
320 320
 		{
321
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
321
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
322 322
 		}
323 323
 
324 324
 		$sql = 'SELECT MIN(link_id) as min_link_id, MAX(link_id) as max_link_id
325
-			FROM ' . $this->links_table . '
326
-			WHERE link_cat = ' . (int) $this->cat_id . '
325
+			FROM ' . $this->links_table.'
326
+			WHERE link_cat = ' . (int) $this->cat_id.'
327 327
 				AND link_active = 1';
328 328
 		$result = $this->db->sql_query($sql);
329 329
 		$row2 = $this->db->sql_fetchrow($result);
@@ -345,22 +345,22 @@  discard block
 block discarded – undo
345 345
 		{
346 346
 			// We really need to find a way of showing statistics... no progress here
347 347
 			$sql = 'SELECT COUNT(link_id) as num_links
348
-				FROM ' . $this->links_table . '
349
-				WHERE link_cat = ' . (int) $this->cat_id . '
348
+				FROM ' . $this->links_table.'
349
+				WHERE link_cat = ' . (int) $this->cat_id.'
350 350
 						AND link_active = 1
351
-						AND link_id BETWEEN ' . (int) $start . ' AND ' . (int) $end;
351
+						AND link_id BETWEEN ' . (int) $start.' AND '.(int) $end;
352 352
 			$result = $this->db->sql_query($sql);
353 353
 			$links_done = $this->request->variable('links_done', 0) + (int) $this->db->sql_fetchfield('num_links');
354 354
 			$this->db->sql_freeresult($result);
355 355
 
356 356
 			$start += $batch_size;
357 357
 
358
-			$url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync&amp;start=$start&amp;links_done=$links_done&amp;total={$row['cat_links']}";
358
+			$url = $this->u_action."&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync&amp;start=$start&amp;links_done=$links_done&amp;total={$row['cat_links']}";
359 359
 
360 360
 			meta_refresh(0, $url);
361 361
 
362 362
 			$this->template->assign_vars(array(
363
-				'UA_PROGRESS_BAR'		=> $this->u_action . "&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}",
363
+				'UA_PROGRESS_BAR'		=> $this->u_action."&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}",
364 364
 				'S_CONTINUE_SYNC'		=> true,
365 365
 				'L_PROGRESS_EXPLAIN'	=> $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', $links_done, $row['cat_links']))
366 366
 			);
@@ -368,11 +368,11 @@  discard block
 block discarded – undo
368 368
 			return;
369 369
 		}
370 370
 
371
-		$url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync_cat";
371
+		$url = $this->u_action."&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync_cat";
372 372
 		meta_refresh(0, $url);
373 373
 
374 374
 		$this->template->assign_vars(array(
375
-			'UA_PROGRESS_BAR'		=> $this->u_action . '&amp;action=progress_bar',
375
+			'UA_PROGRESS_BAR'		=> $this->u_action.'&amp;action=progress_bar',
376 376
 			'S_CONTINUE_SYNC'		=> true,
377 377
 			'L_PROGRESS_EXPLAIN'	=> $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', 0, $row['cat_links']))
378 378
 		);
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 	public function action_sync_cat()
389 389
 	{
390 390
 		$sql = 'SELECT cat_name
391
-			FROM ' . $this->categories_table . '
391
+			FROM ' . $this->categories_table.'
392 392
 			WHERE cat_id = ' . (int) $this->cat_id;
393 393
 		$result = $this->db->sql_query($sql);
394 394
 		$row = $this->db->sql_fetchrow($result);
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 
397 397
 		if (!$row)
398 398
 		{
399
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
399
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
400 400
 		}
401 401
 
402 402
 		$this->_sync_dir_cat($this->cat_id);
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 		}
422 422
 		else
423 423
 		{
424
-			$navigation = '<a href="' . $this->u_action . '">' . $this->language->lang('DIR_INDEX') . '</a>';
424
+			$navigation = '<a href="'.$this->u_action.'">'.$this->language->lang('DIR_INDEX').'</a>';
425 425
 
426 426
 			$cats_nav = $this->nestedset_category->get_path_data($this->parent_id);
427 427
 
@@ -429,11 +429,11 @@  discard block
 block discarded – undo
429 429
 			{
430 430
 				if ($row['cat_id'] == $this->parent_id)
431 431
 				{
432
-					$navigation .= ' -&gt; ' . $row['cat_name'];
432
+					$navigation .= ' -&gt; '.$row['cat_name'];
433 433
 				}
434 434
 				else
435 435
 				{
436
-					$navigation .= ' -&gt; <a href="' . $this->u_action . '&amp;parent_id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a>';
436
+					$navigation .= ' -&gt; <a href="'.$this->u_action.'&amp;parent_id='.$row['cat_id'].'">'.$row['cat_name'].'</a>';
437 437
 				}
438 438
 			}
439 439
 		}
@@ -447,8 +447,8 @@  discard block
 block discarded – undo
447 447
 		}
448 448
 
449 449
 		$sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_name, cat_icon, cat_desc_uid, cat_desc_bitfield, cat_desc, cat_desc_options, cat_links
450
-			FROM ' . $this->categories_table . '
451
-			WHERE parent_id = ' . (int) $this->parent_id . '
450
+			FROM ' . $this->categories_table.'
451
+			WHERE parent_id = ' . (int) $this->parent_id.'
452 452
 			ORDER BY left_id';
453 453
 		$result = $this->db->sql_query($sql);
454 454
 
@@ -456,23 +456,23 @@  discard block
 block discarded – undo
456 456
 		{
457 457
 			do
458 458
 			{
459
-				$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="' . $this->language->lang('DIR_SUBCAT') . '" />' : '<img src="images/icon_folder.gif" alt="' . $this->language->lang('FOLDER') . '" />';
459
+				$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="'.$this->language->lang('DIR_SUBCAT').'" />' : '<img src="images/icon_folder.gif" alt="'.$this->language->lang('FOLDER').'" />';
460 460
 
461
-				$url = $this->u_action . "&amp;parent_id=$this->parent_id&amp;c={$row['cat_id']}";
461
+				$url = $this->u_action."&amp;parent_id=$this->parent_id&amp;c={$row['cat_id']}";
462 462
 
463 463
 				$this->template->assign_block_vars('cats', array(
464 464
 					'FOLDER_IMAGE'		=> $folder_image,
465
-					'CAT_IMAGE'			=> ($row['cat_icon']) ? '<img src="' . $this->get_img_path('icons', $row['cat_icon']) . '" alt="" />' : '',
465
+					'CAT_IMAGE'			=> ($row['cat_icon']) ? '<img src="'.$this->get_img_path('icons', $row['cat_icon']).'" alt="" />' : '',
466 466
 					'CAT_NAME'			=> $row['cat_name'],
467 467
 					'CAT_DESCRIPTION'	=> generate_text_for_display($row['cat_desc'], $row['cat_desc_uid'], $row['cat_desc_bitfield'], $row['cat_desc_options']),
468 468
 					'CAT_LINKS'			=> $row['cat_links'],
469 469
 
470
-					'U_CAT'				=> $this->u_action . '&amp;parent_id=' . $row['cat_id'],
471
-					'U_MOVE_UP'			=> $url . '&amp;action=move_up',
472
-					'U_MOVE_DOWN'		=> $url . '&amp;action=move_down',
473
-					'U_EDIT'			=> $url . '&amp;action=edit',
474
-					'U_DELETE'			=> $url . '&amp;action=delete',
475
-					'U_SYNC'			=> $url . '&amp;action=sync')
470
+					'U_CAT'				=> $this->u_action.'&amp;parent_id='.$row['cat_id'],
471
+					'U_MOVE_UP'			=> $url.'&amp;action=move_up',
472
+					'U_MOVE_DOWN'		=> $url.'&amp;action=move_down',
473
+					'U_EDIT'			=> $url.'&amp;action=edit',
474
+					'U_DELETE'			=> $url.'&amp;action=delete',
475
+					'U_SYNC'			=> $url.'&amp;action=sync')
476 476
 				);
477 477
 			}
478 478
 			while ($row = $this->db->sql_fetchrow($result));
@@ -481,14 +481,14 @@  discard block
 block discarded – undo
481 481
 		{
482 482
 			$row = $this->_get_cat_info($this->parent_id);
483 483
 
484
-			$url = $this->u_action . '&amp;parent_id=' . $this->parent_id . '&amp;c=' . $row['cat_id'];
484
+			$url = $this->u_action.'&amp;parent_id='.$this->parent_id.'&amp;c='.$row['cat_id'];
485 485
 
486 486
 			$this->template->assign_vars(array(
487 487
 				'S_NO_CATS'			=> true,
488 488
 
489
-				'U_EDIT'			=> $url . '&amp;action=edit',
490
-				'U_DELETE'			=> $url . '&amp;action=delete',
491
-				'U_SYNC'			=> $url . '&amp;action=sync')
489
+				'U_EDIT'			=> $url.'&amp;action=edit',
490
+				'U_DELETE'			=> $url.'&amp;action=delete',
491
+				'U_SYNC'			=> $url.'&amp;action=sync')
492 492
 			);
493 493
 		}
494 494
 		$this->db->sql_freeresult($result);
@@ -498,9 +498,9 @@  discard block
 block discarded – undo
498 498
 			'NAVIGATION'	=> $navigation,
499 499
 			'CAT_BOX'		=> $cat_box,
500 500
 			'U_SEL_ACTION'	=> $this->u_action,
501
-			'U_ACTION'		=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
501
+			'U_ACTION'		=> $this->u_action.'&amp;parent_id='.$this->parent_id,
502 502
 
503
-			'UA_PROGRESS_BAR'	=> $this->u_action . '&amp;action=progress_bar',
503
+			'UA_PROGRESS_BAR'	=> $this->u_action.'&amp;action=progress_bar',
504 504
 		));
505 505
 	}
506 506
 
@@ -532,10 +532,10 @@  discard block
 block discarded – undo
532 532
 		switch ($this->action)
533 533
 		{
534 534
 			case 'delete':
535
-				$action_subcats	= $this->request->variable('action_subcats', '');
536
-				$subcats_to_id	= $this->request->variable('subcats_to_id', 0);
537
-				$action_links	= $this->request->variable('action_links', '');
538
-				$links_to_id	= $this->request->variable('links_to_id', 0);
535
+				$action_subcats = $this->request->variable('action_subcats', '');
536
+				$subcats_to_id = $this->request->variable('subcats_to_id', 0);
537
+				$action_links = $this->request->variable('action_links', '');
538
+				$links_to_id = $this->request->variable('links_to_id', 0);
539 539
 
540 540
 				try
541 541
 				{
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 
554 554
 				$this->cache->destroy('sql', $this->categories_table);
555 555
 
556
-				trigger_error($this->language->lang('DIR_CAT_DELETED') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
556
+				trigger_error($this->language->lang('DIR_CAT_DELETED').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id));
557 557
 
558 558
 				break;
559 559
 
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 
607 607
 					$message = ($this->action == 'add') ? $this->language->lang('DIR_CAT_CREATED') : $this->language->lang('DIR_CAT_UPDATED');
608 608
 
609
-					trigger_error($message . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
609
+					trigger_error($message.adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id));
610 610
 				}
611 611
 
612 612
 			break;
@@ -651,10 +651,10 @@  discard block
 block discarded – undo
651 651
 			'S_CAT_PARENT_ID'	=> $this->cat_data['parent_id'],
652 652
 			'S_ADD_ACTION'		=> ($this->action == 'add') ? true : false,
653 653
 
654
-			'U_BACK'			=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
655
-			'U_EDIT_ACTION'		=> $this->u_action . "&amp;parent_id={$this->parent_id}&amp;action=$this->action&amp;c=$this->cat_id",
654
+			'U_BACK'			=> $this->u_action.'&amp;parent_id='.$this->parent_id,
655
+			'U_EDIT_ACTION'		=> $this->u_action."&amp;parent_id={$this->parent_id}&amp;action=$this->action&amp;c=$this->cat_id",
656 656
 
657
-			'L_TITLE'					=> $this->language->lang('DIR_' . strtoupper($this->action) . '_CAT'),
657
+			'L_TITLE'					=> $this->language->lang('DIR_'.strtoupper($this->action).'_CAT'),
658 658
 			'ERROR_MSG'					=> (sizeof($this->errors)) ? implode('<br />', $this->errors) : '',
659 659
 			'ICON_IMAGE'				=> ($this->cat_data['cat_icon']) ? $this->get_img_path('icons', $this->cat_data['cat_icon']) : 'images/spacer.gif',
660 660
 
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 	private function _get_cat_info($cat_id)
697 697
 	{
698 698
 		$sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next
699
-			FROM ' . $this->categories_table . '
699
+			FROM ' . $this->categories_table.'
700 700
 			WHERE cat_id = ' . (int) $cat_id;
701 701
 		$result = $this->db->sql_query($sql);
702 702
 		$row = $this->db->sql_fetchrow($result);
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 		{
760 760
 			if ($cat_data_sql['cat_cron_enable'])
761 761
 			{
762
-				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400;
762
+				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400;
763 763
 			}
764 764
 
765 765
 			$this->cat_data = $this->nestedset_category->insert($cat_data_sql);
@@ -782,13 +782,13 @@  discard block
 block discarded – undo
782 782
 
783 783
 			if ($cat_data_sql['cat_cron_enable'] && ($row['cat_cron_freq'] != $cat_data_sql['cat_cron_freq'] || !$row['cat_cron_enable']))
784 784
 			{
785
-				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400;
785
+				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400;
786 786
 			}
787 787
 
788 788
 			if ($row['cat_name'] != $cat_data_sql['cat_name'])
789 789
 			{
790 790
 				// the cat name has changed, clear the parents list of all categories (for safety)
791
-				$sql = 'UPDATE ' . $this->categories_table . "
791
+				$sql = 'UPDATE '.$this->categories_table."
792 792
 					SET cat_parents = ''";
793 793
 				$this->db->sql_query($sql);
794 794
 			}
@@ -796,8 +796,8 @@  discard block
 block discarded – undo
796 796
 			// Setting the cat id to the categorie id is not really received well by some dbs. ;)
797 797
 			unset($cat_data_sql['cat_id']);
798 798
 
799
-			$sql = 'UPDATE ' . $this->categories_table . '
800
-				SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql) . '
799
+			$sql = 'UPDATE '.$this->categories_table.'
800
+				SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql).'
801 801
 				WHERE cat_id = ' . (int) $this->cat_id;
802 802
 			$this->db->sql_query($sql);
803 803
 
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
 				$log_action_links = 'MOVE_LINKS';
839 839
 
840 840
 				$sql = 'SELECT cat_name
841
-					FROM ' . $this->categories_table . '
841
+					FROM ' . $this->categories_table.'
842 842
 					WHERE cat_id = ' . (int) $links_to_id;
843 843
 				$result = $this->db->sql_query($sql);
844 844
 				$row = $this->db->sql_fetchrow($result);
@@ -940,12 +940,12 @@  discard block
 block discarded – undo
940 940
 	*/
941 941
 	private function _move_cat_content($from_id, $to_id)
942 942
 	{
943
-		$sql = 'UPDATE ' . $this->links_table . '
944
-			SET link_cat = ' . (int) $to_id . '
943
+		$sql = 'UPDATE '.$this->links_table.'
944
+			SET link_cat = ' . (int) $to_id.'
945 945
 			WHERE link_cat = ' . (int) $from_id;
946 946
 		$this->db->sql_query($sql);
947 947
 
948
-		$sql = 'DELETE FROM ' . $this->watch_table . '
948
+		$sql = 'DELETE FROM '.$this->watch_table.'
949 949
 			WHERE cat_id = ' . (int) $from_id;
950 950
 		$this->db->sql_query($sql);
951 951
 
@@ -963,7 +963,7 @@  discard block
 block discarded – undo
963 963
 
964 964
 		// Before we remove anything we make sure we are able to adjust the post counts later. ;)
965 965
 		$sql = 'SELECT link_id, link_banner
966
-			FROM ' . $this->links_table . '
966
+			FROM ' . $this->links_table.'
967 967
 			WHERE link_cat = ' . (int) $this->cat_id;
968 968
 		$result = $this->db->sql_query($sql);
969 969
 
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
 
995 995
 			foreach ($link_datas_ary as $table => $field)
996 996
 			{
997
-				$this->db->sql_query("DELETE FROM $table WHERE " . $this->db->sql_in_set($field, $link_ids));
997
+				$this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $link_ids));
998 998
 			}
999 999
 		}
1000 1000
 
@@ -1006,7 +1006,7 @@  discard block
 block discarded – undo
1006 1006
 
1007 1007
 		foreach ($cat_datas_ary as $table => $field)
1008 1008
 		{
1009
-			$this->db->sql_query("DELETE FROM $table WHERE $field = " . (int) $this->cat_id);
1009
+			$this->db->sql_query("DELETE FROM $table WHERE $field = ".(int) $this->cat_id);
1010 1010
 		}
1011 1011
 
1012 1012
 		$this->db->sql_transaction('commit');
@@ -1023,15 +1023,15 @@  discard block
 block discarded – undo
1023 1023
 	private function _sync_dir_cat($cat_id)
1024 1024
 	{
1025 1025
 		$sql = 'SELECT COUNT(link_id) AS num_links
1026
-			FROM ' . $this->links_table . '
1027
-			WHERE link_cat = ' . (int) $cat_id . '
1026
+			FROM ' . $this->links_table.'
1027
+			WHERE link_cat = ' . (int) $cat_id.'
1028 1028
 				AND link_active = 1';
1029 1029
 		$result = $this->db->sql_query($sql);
1030 1030
 		$total_links = (int) $this->db->sql_fetchfield('num_links');
1031 1031
 		$this->db->sql_freeresult($result);
1032 1032
 
1033
-		$sql = 'UPDATE ' . $this->categories_table . '
1034
-			SET cat_links = ' . $total_links . '
1033
+		$sql = 'UPDATE '.$this->categories_table.'
1034
+			SET cat_links = ' . $total_links.'
1035 1035
 			WHERE cat_id = ' . (int) $cat_id;
1036 1036
 		$this->db->sql_query($sql);
1037 1037
 	}
@@ -1051,33 +1051,33 @@  discard block
 block discarded – undo
1051 1051
 			'link_vote'		=> 0,
1052 1052
 		);
1053 1053
 
1054
-		$sql = 'UPDATE ' . $this->links_table . '
1055
-			SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
1056
-			WHERE link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop;
1054
+		$sql = 'UPDATE '.$this->links_table.'
1055
+			SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).'
1056
+			WHERE link_id BETWEEN ' . (int) $start.' AND '.(int) $stop;
1057 1057
 		$this->db->sql_query($sql);
1058 1058
 
1059
-		$sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM ' . $this->votes_table . '
1060
-			WHERE vote_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . '
1059
+		$sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM '.$this->votes_table.'
1060
+			WHERE vote_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.'
1061 1061
 			GROUP BY vote_link_id';
1062 1062
 		$result = $this->db->sql_query($sql);
1063 1063
 		while ($tmp = $this->db->sql_fetchrow($result))
1064 1064
 		{
1065
-			$sql = 'UPDATE ' . $this->links_table . '
1066
-				SET link_note = ' . (int) $tmp['total'] . ', link_vote = ' . (int) $tmp['nb_vote'] . '
1065
+			$sql = 'UPDATE '.$this->links_table.'
1066
+				SET link_note = ' . (int) $tmp['total'].', link_vote = '.(int) $tmp['nb_vote'].'
1067 1067
 				WHERE link_id = ' . (int) $tmp['vote_link_id'];
1068 1068
 			$this->db->sql_query($sql);
1069 1069
 		}
1070 1070
 		$this->db->sql_freeresult($result);
1071 1071
 
1072 1072
 		$sql = 'SELECT 	comment_link_id, COUNT(comment_id) AS nb_comment
1073
-			FROM ' . $this->comments_table . '
1074
-			WHERE comment_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . '
1073
+			FROM ' . $this->comments_table.'
1074
+			WHERE comment_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.'
1075 1075
 			GROUP BY comment_link_id';
1076 1076
 		$result = $this->db->sql_query($sql);
1077 1077
 		while ($tmp = $this->db->sql_fetchrow($result))
1078 1078
 		{
1079
-			$sql = 'UPDATE ' . $this->links_table . '
1080
-				SET link_comment = ' . (int) $tmp['nb_comment'] . '
1079
+			$sql = 'UPDATE '.$this->links_table.'
1080
+				SET link_comment = ' . (int) $tmp['nb_comment'].'
1081 1081
 				WHERE link_id = ' . (int) $tmp['comment_link_id'];
1082 1082
 			$this->db->sql_query($sql);
1083 1083
 		}
@@ -1102,7 +1102,7 @@  discard block
 block discarded – undo
1102 1102
 
1103 1103
 			foreach ($img_ary as $img)
1104 1104
 			{
1105
-				$img = $path . $img;
1105
+				$img = $path.$img;
1106 1106
 				$selected = '';
1107 1107
 
1108 1108
 				if (strlen($img) > 255)
@@ -1115,7 +1115,7 @@  discard block
 block discarded – undo
1115 1115
 					$selected = ' selected="selected"';
1116 1116
 				}
1117 1117
 
1118
-				$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
1118
+				$filename_list .= '<option value="'.htmlspecialchars($img).'"'.$selected.'>'.$img.'</option>';
1119 1119
 			}
1120 1120
 		}
1121 1121
 
Please login to merge, or discard this patch.
core/categorie.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
 	*/
61 61
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\cron\manager $cron)
62 62
 	{
63
-		$this->db			= $db;
64
-		$this->config		= $config;
63
+		$this->db = $db;
64
+		$this->config = $config;
65 65
 		$this->language		= $language;
66 66
 		$this->template		= $template;
67 67
 		$this->user			= $user;
68
-		$this->helper		= $helper;
69
-		$this->request		= $request;
68
+		$this->helper = $helper;
69
+		$this->request = $request;
70 70
 		$this->auth			= $auth;
71 71
 		$this->cron 		= $cron;
72 72
 	}
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	public function make_cat_jumpbox()
91 91
 	{
92 92
 		$sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id
93
-			FROM ' . $this->categories_table . '
93
+			FROM ' . $this->categories_table.'
94 94
 			ORDER BY left_id ASC';
95 95
 		$result = $this->db->sql_query($sql, 600);
96 96
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
 		// This query is identical to the jumpbox one
153 153
 		$sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id
154
-			FROM ' . $this->categories_table . '
154
+			FROM ' . $this->categories_table.'
155 155
 			ORDER BY left_id ASC';
156 156
 		$result = $this->db->sql_query($sql, 600);
157 157
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 			}
182 182
 
183 183
 			$selected = (($row['cat_id'] == $select_id) ? ' selected="selected"' : '');
184
-			$cat_list .= '<option value="' . $row['cat_id'] . '"' . (($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected) . '>' . $padding . $row['cat_name'] . '</option>';
184
+			$cat_list .= '<option value="'.$row['cat_id'].'"'.(($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected).'>'.$padding.$row['cat_name'].'</option>';
185 185
 		}
186 186
 		$this->db->sql_freeresult($result);
187 187
 		unset($padding_store);
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	*/
197 197
 	public function display()
198 198
 	{
199
-		$cat_rows	= $subcats = array();
199
+		$cat_rows = $subcats = array();
200 200
 		$parent_id	= $visible_cats = 0;
201 201
 
202 202
 		$sql_array = array(
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		else
215 215
 		{
216 216
 			$root_data = $this->data;
217
-			$sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id'];
217
+			$sql_where = 'left_id > '.$root_data['left_id'].' AND left_id < '.$root_data['right_id'];
218 218
 		}
219 219
 
220 220
 		$sql = $this->db->sql_build_query('SELECT', array(
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 			{
262 262
 				foreach ($subcats[$dir_cat_id] as $subcat_id => $subcat_row)
263 263
 				{
264
-					$row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links']+$subcat_row['links']) : $row['cat_links'];
264
+					$row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links'] + $subcat_row['links']) : $row['cat_links'];
265 265
 
266 266
 					if ($subcat_row['display'] && $subcat_row['parent_id'] == $dir_cat_id)
267 267
 					{
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 			if ($task->is_ready())
317 317
 			{
318 318
 				$url = $task->get_url();
319
-				$this->template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="" />');
319
+				$this->template->assign_var('RUN_CRON_TASK', '<img src="'.$url.'" width="1" height="1" alt="" />');
320 320
 			}
321 321
 		}
322 322
 	}
@@ -338,10 +338,10 @@  discard block
 block discarded – undo
338 338
 				'LEFT_JOIN'	=> array(
339 339
 						array(
340 340
 							'FROM'	=> array($this->watch_table	=> 'w'),
341
-							'ON'	=> 'c.cat_id = w.cat_id AND w.user_id = ' . (int) $this->user->data['user_id']
341
+							'ON'	=> 'c.cat_id = w.cat_id AND w.user_id = '.(int) $this->user->data['user_id']
342 342
 						),
343 343
 				),
344
-				'WHERE'		=> 'c.cat_id = ' . (int) $cat_id
344
+				'WHERE'		=> 'c.cat_id = '.(int) $cat_id
345 345
 			);
346 346
 			$sql = $this->db->sql_build_query('SELECT', $sql_array);
347 347
 			$result = $this->db->sql_query($sql);
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 				$this->template->assign_block_vars('dir_navlinks', array(
379 379
 					'FORUM_NAME'	=> $parent_data['cat_name'],
380 380
 					'FORUM_ID'		=> $parent_cat_id,
381
-					'MICRODATA'		=> $microdata_attr . '="' . $parent_cat_id . '"',
381
+					'MICRODATA'		=> $microdata_attr.'="'.$parent_cat_id.'"',
382 382
 					'U_VIEW_FORUM'	=> $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $parent_cat_id)),
383 383
 				));
384 384
 			}
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 		$this->template->assign_block_vars('dir_navlinks', array(
388 388
 			'FORUM_NAME'	=> $dir_cat_data['cat_name'],
389 389
 			'FORUM_ID'		=> $dir_cat_data['cat_id'],
390
-			'MICRODATA'		=> $microdata_attr . '="' . $dir_cat_data['cat_id'] . '"',
390
+			'MICRODATA'		=> $microdata_attr.'="'.$dir_cat_data['cat_id'].'"',
391 391
 			'U_VIEW_FORUM'	=> $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $dir_cat_data['cat_id'])),
392 392
 		));
393 393
 
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 			{
445 445
 				if ($mode == 'unwatch')
446 446
 				{
447
-					$sql = 'DELETE FROM ' . $this->watch_table . "
447
+					$sql = 'DELETE FROM '.$this->watch_table."
448 448
 						WHERE cat_id = $cat_id
449 449
 							AND user_id = $user_id";
450 450
 					$this->db->sql_query($sql);
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 
455 455
 					if (!$this->request->is_ajax())
456 456
 					{
457
-						$message .= '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>');
457
+						$message .= '<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>');
458 458
 					}
459 459
 
460 460
 					meta_refresh(3, $redirect_url);
@@ -466,8 +466,8 @@  discard block
 block discarded – undo
466 466
 
467 467
 					if ($notify_status != NOTIFY_YES)
468 468
 					{
469
-						$sql = 'UPDATE ' . $this->watch_table . '
470
-							SET notify_status = ' . NOTIFY_YES . "
469
+						$sql = 'UPDATE '.$this->watch_table.'
470
+							SET notify_status = ' . NOTIFY_YES."
471 471
 							WHERE cat_id = $cat_id
472 472
 								AND user_id = $user_id";
473 473
 						$this->db->sql_query($sql);
@@ -478,8 +478,8 @@  discard block
 block discarded – undo
478 478
 			{
479 479
 				if ($mode == 'watch')
480 480
 				{
481
-					$sql = 'INSERT INTO ' . $this->watch_table . " (user_id, cat_id, notify_status)
482
-						VALUES ($user_id, $cat_id, " . NOTIFY_YES . ')';
481
+					$sql = 'INSERT INTO '.$this->watch_table." (user_id, cat_id, notify_status)
482
+						VALUES ($user_id, $cat_id, ".NOTIFY_YES.')';
483 483
 					$this->db->sql_query($sql);
484 484
 
485 485
 					$redirect_url = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id));
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 
488 488
 					if (!$this->request->is_ajax())
489 489
 					{
490
-						$message .= '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>');
490
+						$message .= '<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>');
491 491
 					}
492 492
 
493 493
 					meta_refresh(3, $redirect_url);
@@ -507,10 +507,10 @@  discard block
 block discarded – undo
507 507
 
508 508
 		if ($can_watch)
509 509
 		{
510
-			$s_watching['link'] 		= $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch')));
510
+			$s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch')));
511 511
 			$s_watching['link_toggle'] 	= $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => ((!$is_watching) ? 'unwatch' : 'watch')));
512
-			$s_watching['title'] 		= $this->language->lang((($is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT');
513
-			$s_watching['title_toggle'] = $this->language->lang(((!$is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT');
512
+			$s_watching['title'] = $this->language->lang((($is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT');
513
+			$s_watching['title_toggle'] = $this->language->lang(((!$is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT');
514 514
 			$s_watching['is_watching'] 	= $is_watching;
515 515
 		}
516 516
 
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 		$categories_table = $phpbb_container->getParameter('tables.dir.categories');
531 531
 
532 532
 		$sql = 'SELECT cat_name
533
-			FROM ' . $categories_table . '
533
+			FROM ' . $categories_table.'
534 534
 			WHERE cat_id = ' . (int) $cat_id;
535 535
 		$result = $db->sql_query($sql);
536 536
 		$row = $db->sql_fetchrow($result);
Please login to merge, or discard this patch.
core/link.php 1 patch
Spacing   +53 added lines, -53 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\factory $files_factory, $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
-		$this->notification		= $notification;
88
-		$this->filesystem		= $filesystem;
87
+		$this->notification = $notification;
88
+		$this->filesystem = $filesystem;
89 89
 		$this->imagesize		= $imagesize;
90
-		$this->files_factory 	= $files_factory;
90
+		$this->files_factory = $files_factory;
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
 
@@ -486,8 +486,8 @@  discard block
 block discarded – undo
486 486
 			{
487 487
 				$pagerank = $this->pagerank_process($data['link_url']);
488 488
 
489
-				$sql = 'UPDATE ' . $this->links_table . '
490
-					SET link_pagerank = ' . (int) $pagerank . '
489
+				$sql = 'UPDATE '.$this->links_table.'
490
+					SET link_pagerank = ' . (int) $pagerank.'
491 491
 					WHERE link_id = ' . (int) $data['link_id'];
492 492
 				$this->db->sql_query($sql);
493 493
 			}
@@ -496,9 +496,9 @@  discard block
 block discarded – undo
496 496
 				$pagerank = (int) $data['link_pagerank'];
497 497
 			}
498 498
 
499
-			$prpos=40*$pagerank/10;
500
-			$prneg=40-$prpos;
501
-			$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.'" /> ';
499
+			$prpos = 40 * $pagerank / 10;
500
+			$prneg = 40 - $prpos;
501
+			$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.'" /> ';
502 502
 
503 503
 			$pagerank = $pagerank == '-1' ? $this->language->lang('DIR_PAGERANK_NOT_AVAILABLE') : $this->language->lang('DIR_FROM_TEN', $pagerank);
504 504
 			return $html.$pagerank;
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 				$height /= $coef_max;
544 544
 			}
545 545
 
546
-			return '<img src="' . $img_src . '" width="' . $width . '" height="' . $height . '" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />';
546
+			return '<img src="'.$img_src.'" width="'.$width.'" height="'.$height.'" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />';
547 547
 		}
548 548
 		return '';
549 549
 	}
@@ -564,12 +564,12 @@  discard block
 block discarded – undo
564 564
 
565 565
 		$this->db->sql_transaction('begin');
566 566
 
567
-		$sql = 'INSERT INTO ' . $this->votes_table . ' ' . $this->db->sql_build_array('INSERT', $data);
567
+		$sql = 'INSERT INTO '.$this->votes_table.' '.$this->db->sql_build_array('INSERT', $data);
568 568
 		$this->db->sql_query($sql);
569 569
 
570
-		$sql = 'UPDATE ' . $this->links_table . '
570
+		$sql = 'UPDATE '.$this->links_table.'
571 571
 			SET link_vote = link_vote + 1,
572
-			link_note = link_note + ' . (int) $data['vote_note'] . '
572
+			link_note = link_note + ' . (int) $data['vote_note'].'
573 573
 		WHERE link_id = ' . (int) $link_id;
574 574
 		$this->db->sql_query($sql);
575 575
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 
578 578
 		if ($this->request->is_ajax())
579 579
 		{
580
-			$sql= 'SELECT link_vote, link_note FROM ' . $this->links_table . ' WHERE link_id = ' . (int) $link_id;
580
+			$sql = 'SELECT link_vote, link_note FROM '.$this->links_table.' WHERE link_id = '.(int) $link_id;
581 581
 			$result = $this->db->sql_query($sql);
582 582
 			$data = $this->db->sql_fetchrow($result);
583 583
 
@@ -611,8 +611,8 @@  discard block
 block discarded – undo
611 611
 
612 612
 		$details = parse_url($url);
613 613
 
614
-		$root_url		= $details['scheme'].'://'.$details['host'];
615
-		$absolute_url	= isset($details['path']) ? $root_url.$details['path'] : $root_url;
614
+		$root_url = $details['scheme'].'://'.$details['host'];
615
+		$absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url;
616 616
 
617 617
 		if ($this->config['dir_activ_thumb_remote'] && $this->_ascreen_exist($details['scheme'], $details['host']))
618 618
 		{
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 		$destination = $this->get_banner_path();
656 656
 
657 657
 		// Can we upload?
658
-		$can_upload = ($this->config['dir_storage_banner'] && $this->filesystem->exists($this->root_path . $destination) && $this->filesystem->is_writable($this->root_path . $destination) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
658
+		$can_upload = ($this->config['dir_storage_banner'] && $this->filesystem->exists($this->root_path.$destination) && $this->filesystem->is_writable($this->root_path.$destination) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
659 659
 
660 660
 		if ($banner && $can_upload)
661 661
 		{
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
 
702 702
 		$file = $upload->handle_upload('files.types.remote', $banner);
703 703
 
704
-		$prefix = unique_id() . '_';
704
+		$prefix = unique_id().'_';
705 705
 		$file->clean_filename('real', $prefix);
706 706
 
707 707
 		if (sizeof($file->error))
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 	{
733 733
 		if (!preg_match('#^(http|https|ftp)://#i', $banner))
734 734
 		{
735
-			$banner = 'http://' . $banner;
735
+			$banner = 'http://'.$banner;
736 736
 		}
737 737
 		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))
738 738
 		{
@@ -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
 		{
@@ -929,7 +929,7 @@  discard block
 block discarded – undo
929 929
 
930 930
 			if (file_exists($flag_path.$img_file))
931 931
 			{
932
-				$list .= '<option value="' . $img_file . '" ' . (($img_file == $value) ? 'selected="selected"' : '') . '>' . $name . '</option>';
932
+				$list .= '<option value="'.$img_file.'" '.(($img_file == $value) ? 'selected="selected"' : '').'>'.$name.'</option>';
933 933
 			}
934 934
 		}
935 935
 
@@ -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',
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
 			if (sizeof($rowset))
980 980
 			{
981 981
 				$this->template->assign_block_vars('block', array(
982
-					'S_COL_WIDTH'			=> (100 / $this->config['dir_recent_columns']) . '%',
982
+					'S_COL_WIDTH'			=> (100 / $this->config['dir_recent_columns']).'%',
983 983
 				));
984 984
 
985 985
 				foreach ($rowset as $row)
Please login to merge, or discard this patch.
notification/type/directory_website.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -122,9 +122,9 @@
 block discarded – undo
122 122
 		$users = array();
123 123
 
124 124
 		$sql = 'SELECT user_id
125
-			FROM ' . $this->watch_table . '
126
-			WHERE cat_id = ' . (int) $data['cat_id'] . '
127
-				AND notify_status = ' . NOTIFY_YES . '
125
+			FROM ' . $this->watch_table.'
126
+			WHERE cat_id = ' . (int) $data['cat_id'].'
127
+				AND notify_status = ' . NOTIFY_YES.'
128 128
 				AND user_id <> ' . (int) $data['user_from'];
129 129
 		$result = $this->db->sql_query($sql);
130 130
 		while ($row = $this->db->sql_fetchrow($result))
Please login to merge, or discard this patch.
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
 	protected $watch_table;
25 25
 
26 26
 	/**
27
-	* Set the controller helper
28
-	*
29
-	* @param \phpbb\controller\helper $helper
30
-	* @return null
31
-	*/
27
+	 * Set the controller helper
28
+	 *
29
+	 * @param \phpbb\controller\helper $helper
30
+	 * @return null
31
+	 */
32 32
 	public function set_controller_helper(\phpbb\controller\helper $helper)
33 33
 	{
34 34
 		$this->helper = $helper;
@@ -46,21 +46,21 @@  discard block
 block discarded – undo
46 46
 	}
47 47
 
48 48
 	/**
49
-	* Get notification type name
50
-	*
51
-	* @return string
52
-	*/
49
+	 * Get notification type name
50
+	 *
51
+	 * @return string
52
+	 */
53 53
 	public function get_type()
54 54
 	{
55 55
 		return 'ernadoo.phpbbdirectory.notification.type.directory_website';
56 56
 	}
57 57
 
58 58
 	/**
59
-	* Notification option data (for outputting to the user)
60
-	*
61
-	* @var bool|array False if the service should use it's default data
62
-	* 					Array of data (including keys 'id', 'lang', and 'group')
63
-	*/
59
+	 * Notification option data (for outputting to the user)
60
+	 *
61
+	 * @var bool|array False if the service should use it's default data
62
+	 * 					Array of data (including keys 'id', 'lang', and 'group')
63
+	 */
64 64
 	public static $notification_option = array(
65 65
 		'lang'	=> 'NOTIFICATION_TYPE_DIR_UCP_WEBSITE',
66 66
 		'group'	=> 'NOTIFICATION_DIR_UCP',
@@ -75,31 +75,31 @@  discard block
 block discarded – undo
75 75
 	}
76 76
 
77 77
 	/**
78
-	* Is available
79
-	*
80
-	* @return bool True/False whether or not this is available to the user
81
-	*/
78
+	 * Is available
79
+	 *
80
+	 * @return bool True/False whether or not this is available to the user
81
+	 */
82 82
 	public function is_available()
83 83
 	{
84 84
 		return true;
85 85
 	}
86 86
 
87 87
 	/**
88
-	* Get link id
89
-	*
90
-	* @param array $data The data from the link
91
-	* @return int
92
-	*/
88
+	 * Get link id
89
+	 *
90
+	 * @param array $data The data from the link
91
+	 * @return int
92
+	 */
93 93
 	static public function get_item_id($data)
94 94
 	{
95 95
 		return (int) $data['link_id'];
96 96
 	}
97 97
 
98 98
 	/**
99
-	* Get parent id - it's not used
100
-	*
101
-	* @param array $data The data from the link
102
-	*/
99
+	 * Get parent id - it's not used
100
+	 *
101
+	 * @param array $data The data from the link
102
+	 */
103 103
 	static public function get_item_parent_id($data)
104 104
 	{
105 105
 		// No parent
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
 	}
108 108
 
109 109
 	/**
110
-	* Find the users who want to receive notifications
111
-	*
112
-	* @param	array	$data		Data from submit link
113
-	* @param	array	$options	Options for finding users for notification
114
-	* @return	array
115
-	*/
110
+	 * Find the users who want to receive notifications
111
+	 *
112
+	 * @param	array	$data		Data from submit link
113
+	 * @param	array	$options	Options for finding users for notification
114
+	 * @return	array
115
+	 */
116 116
 	public function find_users_for_notification($data, $options = array())
117 117
 	{
118 118
 		$options = array_merge(array(
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
 	}
145 145
 
146 146
 	/**
147
-	* Get the user's avatar
148
-	*/
147
+	 * Get the user's avatar
148
+	 */
149 149
 	public function get_avatar()
150 150
 	{
151 151
 		return $this->user_loader->get_avatar($this->get_data('user_from'), false, true);
@@ -153,10 +153,10 @@  discard block
 block discarded – undo
153 153
 
154 154
 
155 155
 	/**
156
-	* Get the HTML formatted title of this notification
157
-	*
158
-	* @return string
159
-	*/
156
+	 * Get the HTML formatted title of this notification
157
+	 *
158
+	 * @return string
159
+	 */
160 160
 
161 161
 	public function get_title()
162 162
 	{
@@ -169,20 +169,20 @@  discard block
 block discarded – undo
169 169
 
170 170
 
171 171
 	/**
172
-	* Get email template
173
-	*
174
-	* @return string
175
-	*/
172
+	 * Get email template
173
+	 *
174
+	 * @return string
175
+	 */
176 176
 	public function get_email_template()
177 177
 	{
178 178
 		return '@ernadoo_phpbbdirectory/directory_website';
179 179
 	}
180 180
 
181 181
 	/**
182
-	* Get email template variables
183
-	*
184
-	* @return array
185
-	*/
182
+	 * Get email template variables
183
+	 *
184
+	 * @return array
185
+	 */
186 186
 	public function get_email_template_variables()
187 187
 	{
188 188
 		return array(
@@ -194,33 +194,33 @@  discard block
 block discarded – undo
194 194
 	}
195 195
 
196 196
 	/**
197
-	* Get the url to this item
198
-	*
199
-	* @return string URL
200
-	*/
197
+	 * Get the url to this item
198
+	 *
199
+	 * @return string URL
200
+	 */
201 201
 	public function get_url()
202 202
 	{
203 203
 		return $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $this->get_data('cat_id')));
204 204
 	}
205 205
 
206 206
 	/**
207
-	* Users needed to query before this notification can be displayed
208
-	*
209
-	* @return array Array of user_ids
210
-	*/
207
+	 * Users needed to query before this notification can be displayed
208
+	 *
209
+	 * @return array Array of user_ids
210
+	 */
211 211
 	public function users_to_query()
212 212
 	{
213 213
 		return array($this->get_data('user_from'));
214 214
 	}
215 215
 
216 216
 	/**
217
-	* Function for preparing the data for insertion in an SQL query
218
-	* (The service handles insertion)
219
-	*
220
-	* @param	array	$data				Data from submit link
221
-	* @param	array	$pre_create_data	Data from pre_create_insert_array()
222
-	* @return	array						Array of data ready to be inserted into the database
223
-	*/
217
+	 * Function for preparing the data for insertion in an SQL query
218
+	 * (The service handles insertion)
219
+	 *
220
+	 * @param	array	$data				Data from submit link
221
+	 * @param	array	$pre_create_data	Data from pre_create_insert_array()
222
+	 * @return	array						Array of data ready to be inserted into the database
223
+	 */
224 224
 	public function create_insert_array($data, $pre_create_data = array())
225 225
 	{
226 226
 		$this->set_data('link_name', $data['link_name']);
Please login to merge, or discard this patch.