Completed
Push — 3.2.x ( be9360...c8dee9 )
by Erwan
12:34
created
migrations/converter/convert_module.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	public function effectively_installed()
25 25
 	{
26 26
 		$sql = 'SELECT module_id
27
-			FROM ' . $this->table_prefix . "modules
27
+			FROM ' . $this->table_prefix."modules
28 28
 			WHERE module_class = 'acp'
29 29
 				AND module_basename = 'acp_directory'
30 30
 				AND module_mode = 'main'";
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 			'module_auth'		=> 'ext_ernadoo/phpbbdirectory'
57 57
 		);
58 58
 
59
-		$sql = 'UPDATE '  . $this->table_prefix . 'modules
60
-			SET ' . $this->db->sql_build_array('UPDATE', $module_data) . "
59
+		$sql = 'UPDATE '.$this->table_prefix.'modules
60
+			SET ' . $this->db->sql_build_array('UPDATE', $module_data)."
61 61
 			WHERE module_basename = 'acp_directory'
62 62
 				AND " . $this->db->sql_in_set('module_mode', array('main', 'settings', 'cat', 'val'));
63 63
 		$this->db->sql_query($sql);
Please login to merge, or discard this patch.
controller/search.php 1 patch
Spacing   +20 added lines, -20 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
 		$template->assign_vars(array(
86 86
 			'S_PHPBB_DIRECTORY'	=> true,
@@ -103,18 +103,18 @@  discard block
 block discarded – undo
103 103
 
104 104
 		$this->language->add_lang('search');
105 105
 
106
-		$cat_id				= $this->request->variable('cat_id', 0);
107
-		$keywords			= $this->request->variable('keywords', '', true);
106
+		$cat_id = $this->request->variable('cat_id', 0);
107
+		$keywords = $this->request->variable('keywords', '', true);
108 108
 		$search_terms		= $this->request->variable('terms', 'all');
109
-		$search_category	= $this->request->variable('cid', array(0));
110
-		$search_fields		= $this->request->variable('sf', 'all');
109
+		$search_category = $this->request->variable('cid', array(0));
110
+		$search_fields = $this->request->variable('sf', 'all');
111 111
 		$search_child		= $this->request->variable('sc', true);
112
-		$sort_days			= $this->request->variable('st', 0);
112
+		$sort_days = $this->request->variable('st', 0);
113 113
 		$sort_key			= $this->request->variable('sk', 't');
114 114
 		$sort_dir			= $this->request->variable('sd', 'd');
115
-		$start				= ($page - 1) * (int) $this->config['dir_show'];
115
+		$start = ($page - 1) * (int) $this->config['dir_show'];
116 116
 
117
-		$default_sort_days	= 0;
117
+		$default_sort_days = 0;
118 118
 		$default_sort_key	= (string) substr($this->config['dir_default_order'], 0, 1);
119 119
 		$default_sort_dir	= (string) substr($this->config['dir_default_order'], 2);
120 120
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 			{
217 217
 				$this->template->assign_vars(array(
218 218
 					'SEARCH_CATEGORY'	=> $this->language->lang('RETURN_TO', \ernadoo\phpbbdirectory\core\categorie::getname((int) $cat_id)),
219
-					'U_SEARCH_CATEGORY'	=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id),
219
+					'U_SEARCH_CATEGORY'	=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id),
220 220
 				));
221 221
 			}
222 222
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 
261 261
 					foreach ($rowset as $data)
262 262
 					{
263
-						$s_banner	= $this->link->display_bann($data);
263
+						$s_banner = $this->link->display_bann($data);
264 264
 						$s_thumb	= $this->link->display_thumb($data);
265 265
 						$s_flag		= $this->link->display_flag($data);
266 266
 
@@ -268,8 +268,8 @@  discard block
 block discarded – undo
268 268
 
269 269
 						if ($hilit)
270 270
 						{
271
-							$data['link_name'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_name']);
272
-							$data['link_description'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_description']);
271
+							$data['link_name'] = preg_replace('#(?!<.*)(?<!\w)('.$hilit.')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_name']);
272
+							$data['link_description'] = preg_replace('#(?!<.*)(?<!\w)('.$hilit.')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_description']);
273 273
 						}
274 274
 
275 275
 						$this->template->assign_block_vars('results', array(
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 	private function _get_exclude_categories(&$search_category, $search_child)
330 330
 	{
331 331
 		$sql = 'SELECT cat_id, parent_id, right_id
332
-				FROM ' . $this->categories_table . '
332
+				FROM ' . $this->categories_table.'
333 333
 				ORDER BY left_id';
334 334
 		$result = $this->db->sql_query($sql);
335 335
 
Please login to merge, or discard this patch.
controller/categories.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
 	*/
67 67
 	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)
68 68
 	{
69
-		$this->db			= $db;
70
-		$this->config		= $config;
69
+		$this->db = $db;
70
+		$this->config = $config;
71 71
 		$this->language		= $language;
72 72
 		$this->template		= $template;
73 73
 		$this->user			= $user;
74
-		$this->helper		= $helper;
75
-		$this->request		= $request;
74
+		$this->helper = $helper;
75
+		$this->request = $request;
76 76
 		$this->auth			= $auth;
77
-		$this->pagination	= $pagination;
78
-		$this->categorie	= $categorie;
77
+		$this->pagination = $pagination;
78
+		$this->categorie = $categorie;
79 79
 		$this->link			= $link;
80 80
 
81 81
 		$template->assign_vars(array(
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 			throw new \phpbb\exception\http_exception(404, 'DIR_ERROR_NO_CATS');
114 114
 		}
115 115
 
116
-		$url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id, array('page' => $page));
116
+		$url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id, array('page' => $page));
117 117
 
118 118
 		return new RedirectResponse($url, 301);
119 119
 	}
@@ -139,13 +139,13 @@  discard block
 block discarded – undo
139 139
 
140 140
 		$start = ($page - 1) * $this->config['dir_show'];
141 141
 
142
-		$default_sort_days	= 0;
142
+		$default_sort_days = 0;
143 143
 		$default_sort_key	= (string) substr($this->config['dir_default_order'], 0, 1);
144 144
 		$default_sort_dir	= (string) substr($this->config['dir_default_order'], 2);
145 145
 
146 146
 		$sort_days	= (!$sort_days) ? $this->request->variable('st', $default_sort_days) : $sort_days;
147 147
 		$sort_key 	= (!$sort_key) ? $this->request->variable('sk', $default_sort_key) : $sort_key;
148
-		$sort_dir	= (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir;
148
+		$sort_dir = (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir;
149 149
 		$link_list = $rowset = array();
150 150
 
151 151
 		// Categorie ordering options
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
 			$min_post_time = time() - ($sort_days * 86400);
184 184
 
185 185
 			$sql = 'SELECT COUNT(link_id) AS nb_links
186
-				FROM ' . $this->links_table . '
187
-				WHERE link_cat = ' . (int) $cat_id . '
186
+				FROM ' . $this->links_table.'
187
+				WHERE link_cat = ' . (int) $cat_id.'
188 188
 					AND link_time >= ' . (int) $min_post_time;
189 189
 			$result = $this->db->sql_query($sql);
190 190
 			$nb_links = (int) $this->db->sql_fetchfield('nb_links');
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 		else
200 200
 		{
201 201
 			$sql_limit_time = '';
202
-			$nb_links		= (int) $this->categorie->data['cat_links'];
202
+			$nb_links = (int) $this->categorie->data['cat_links'];
203 203
 		}
204 204
 
205 205
 		// Make sure $start is set to the last page if it exceeds the amount
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 		$this->categorie->make_cat_jumpbox();
213 213
 
214 214
 		$base_url = array(
215
-			'routes'	=> 'ernadoo_phpbbdirectory_dynamic_route_' . $cat_id,
215
+			'routes'	=> 'ernadoo_phpbbdirectory_dynamic_route_'.$cat_id,
216 216
 			'params'	=> array_merge(array('cat_id' => $cat_id), $u_sort_param),
217 217
 		);
218 218
 
@@ -225,14 +225,14 @@  discard block
 block discarded – undo
225 225
 			'S_SELECT_SORT_KEY'		=> $s_sort_key,
226 226
 			'S_SELECT_SORT_DAYS'	=> $s_limit_days,
227 227
 			'S_CATLIST'				=> $this->categorie->make_cat_select($cat_id),
228
-			'S_PAGE_ACTION'			=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id, array('page' => $page)),
228
+			'S_PAGE_ACTION'			=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id, array('page' => $page)),
229 229
 			'S_CAT_ID'				=> $cat_id,
230 230
 
231 231
 			'TOTAL_LINKS'			=> $this->language->lang('DIR_NB_LINKS', (int) $nb_links),
232 232
 
233 233
 			'U_NEW_SITE' 			=> $this->helper->route('ernadoo_phpbbdirectory_new_controller', array('cat_id' => $cat_id)),
234 234
 
235
-			'U_VIEW_CAT'			=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id),
235
+			'U_VIEW_CAT'			=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id),
236 236
 			'U_WATCH_CAT'			=> $s_watching_categorie['link'],
237 237
 			'U_WATCH_CAT_TOGGLE'	=> $s_watching_categorie['link_toggle'],
238 238
 			'S_WATCH_CAT_TITLE'		=> $s_watching_categorie['title'],
@@ -262,11 +262,11 @@  discard block
 block discarded – undo
262 262
 
263 263
 		if (is_array($sort_by_sql[$sort_key]))
264 264
 		{
265
-			$sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
265
+			$sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction;
266 266
 		}
267 267
 		else
268 268
 		{
269
-			$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
269
+			$sql_sort_order = $sort_by_sql[$sort_key].' '.$direction;
270 270
 		}
271 271
 
272 272
 		// Grab just the sorted link ids
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 						'ON'	=> 'l.link_user_id = u.user_id'
281 281
 					),
282 282
 			),
283
-			'WHERE'		=> 'l.link_cat = ' . (int) $cat_id . "
283
+			'WHERE'		=> 'l.link_cat = '.(int) $cat_id."
284 284
 				AND l.link_active = 1
285 285
 					$sql_limit_time",
286 286
 			'ORDER_BY'	=> $sql_sort_order
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 						),
310 310
 						array(
311 311
 							'FROM'	=> array($this->votes_table => 'v'),
312
-							'ON'	=> 'l.link_id = v.vote_link_id AND v.vote_user_id = ' . $this->user->data['user_id']
312
+							'ON'	=> 'l.link_id = v.vote_link_id AND v.vote_user_id = '.$this->user->data['user_id']
313 313
 						)
314 314
 				),
315 315
 				'WHERE'		=> $this->db->sql_in_set('l.link_id', $link_list)
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
 
327 327
 			$link_list = ($store_reverse) ? array_reverse($link_list) : $link_list;
328 328
 
329
-			$votes_status 		= ($this->categorie->data['cat_allow_votes']) ? true : false;
330
-			$comments_status 	= ($this->categorie->data['cat_allow_comments']) ? true : false;
329
+			$votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false;
330
+			$comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false;
331 331
 
332 332
 			foreach ($link_list as $link_id)
333 333
 			{
@@ -337,10 +337,10 @@  discard block
 block discarded – undo
337 337
 				$s_note		= $this->link->display_note($site['link_note'], $site['link_vote'], $votes_status);
338 338
 				$s_thumb	= $this->link->display_thumb($site);
339 339
 				$s_vote		= $this->link->display_vote($site);
340
-				$s_banner	= $this->link->display_bann($site);
341
-				$s_rss		= $this->link->display_rss($site);
340
+				$s_banner = $this->link->display_bann($site);
341
+				$s_rss = $this->link->display_rss($site);
342 342
 
343
-				$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'))));
343
+				$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'))));
344 344
 				$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'))));
345 345
 
346 346
 				$this->template->assign_block_vars('site', array(
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 			$this->template->assign_block_vars('no_draw_link', array());
377 377
 		}
378 378
 
379
-		$page_title = $this->language->lang('DIRECTORY') . ' - ' . $this->categorie->data['cat_name'];
379
+		$page_title = $this->language->lang('DIRECTORY').' - '.$this->categorie->data['cat_name'];
380 380
 
381 381
 		$this->categorie->display();
382 382
 
Please login to merge, or discard this patch.
controller/links.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -87,19 +87,19 @@  discard block
 block discarded – undo
87 87
 	*/
88 88
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext)
89 89
 	{
90
-		$this->db				= $db;
91
-		$this->config			= $config;
90
+		$this->db = $db;
91
+		$this->config = $config;
92 92
 		$this->language			= $language;
93 93
 		$this->template			= $template;
94 94
 		$this->user				= $user;
95
-		$this->helper			= $helper;
96
-		$this->request			= $request;
95
+		$this->helper = $helper;
96
+		$this->request = $request;
97 97
 		$this->auth				= $auth;
98
-		$this->captcha_factory 	= $captcha_factory;
98
+		$this->captcha_factory = $captcha_factory;
99 99
 		$this->categorie		= $categorie;
100 100
 		$this->link				= $link;
101 101
 		$this->root_path		= $root_path;
102
-		$this->php_ext			= $php_ext;
102
+		$this->php_ext = $php_ext;
103 103
 
104 104
 		$template->assign_vars(array(
105 105
 			'S_PHPBB_DIRECTORY'	=> true,
@@ -117,12 +117,12 @@  discard block
 block discarded – undo
117 117
 	{
118 118
 		if ($this->request->is_set_post('cancel'))
119 119
 		{
120
-			$redirect = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
120
+			$redirect = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
121 121
 			redirect($redirect);
122 122
 		}
123 123
 
124 124
 		$sql = 'SELECT link_user_id
125
-			FROM ' . $this->links_table . '
125
+			FROM ' . $this->links_table.'
126 126
 			WHERE link_id = ' . (int) $link_id;
127 127
 		$result = $this->db->sql_query($sql);
128 128
 		$link_data = $this->db->sql_fetchrow($result);
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
 		{
144 144
 			$this->link->del($cat_id, $link_id);
145 145
 
146
-			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
146
+			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
147 147
 			meta_refresh(3, $meta_info);
148
-			$message = $this->language->lang('DIR_DELETE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id) . '">', '</a>');
148
+			$message = $this->language->lang('DIR_DELETE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id).'">', '</a>');
149 149
 			return $this->helper->message($message);
150 150
 		}
151 151
 		else
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	public function edit_link($cat_id, $link_id)
166 166
 	{
167 167
 		$sql = 'SELECT link_id, link_uid, link_user_id, link_flags, link_bitfield, link_cat, link_url, link_description, link_guest_email, link_name, link_rss, link_back, link_banner, link_flag, link_cat, link_time
168
-			FROM ' . $this->links_table . '
168
+			FROM ' . $this->links_table.'
169 169
 			WHERE link_id = ' . (int) $link_id;
170 170
 		$result = $this->db->sql_query($sql);
171 171
 		$link_data = $this->db->sql_fetchrow($result);
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 		$cat_id		= $this->request->variable('id', $cat_id);
187 187
 		$submit		= $this->request->is_set_post('submit') ? true : false;
188 188
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
189
-		$title		= $this->language->lang('DIR_EDIT_SITE');
189
+		$title = $this->language->lang('DIR_EDIT_SITE');
190 190
 
191 191
 		$this->template->assign_block_vars('dir_navlinks', array(
192 192
 			'FORUM_NAME'	=> $title,
@@ -210,15 +210,15 @@  discard block
 block discarded – undo
210 210
 				'old_banner'	=> $link_data['link_banner'],
211 211
 			);
212 212
 
213
-			$site_description			= generate_text_for_edit($link_data['link_description'], $link_data['link_uid'], $link_data['link_flags']);
214
-			$link_data['link_banner'] 	= (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $link_data['link_banner'])) ? $link_data['link_banner'] : '';
213
+			$site_description = generate_text_for_edit($link_data['link_description'], $link_data['link_uid'], $link_data['link_flags']);
214
+			$link_data['link_banner'] = (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $link_data['link_banner'])) ? $link_data['link_banner'] : '';
215 215
 
216
-			$this->url			= $link_data['link_url'];
217
-			$this->site_name	= $link_data['link_name'];
216
+			$this->url = $link_data['link_url'];
217
+			$this->site_name = $link_data['link_name'];
218 218
 			$this->description	= $site_description['text'];
219 219
 			$this->guest_email	= $link_data['link_guest_email'];
220
-			$this->rss			= $link_data['link_rss'];
221
-			$this->banner 		= $link_data['link_banner'];
220
+			$this->rss = $link_data['link_rss'];
221
+			$this->banner = $link_data['link_banner'];
222 222
 			$this->back			= $link_data['link_back'];
223 223
 			$this->flag 		= $link_data['link_flag'];
224 224
 		}
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 		$cat_id		= $this->request->variable('id', $cat_id);
246 246
 		$submit		= $this->request->is_set_post('submit') ? true : false;
247 247
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
248
-		$title		= $this->language->lang('DIR_NEW_SITE');
248
+		$title = $this->language->lang('DIR_NEW_SITE');
249 249
 
250 250
 		$this->template->assign_block_vars('dir_navlinks', array(
251 251
 			'FORUM_NAME'	=> $title,
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 
310 310
 		// We check if user had already vot for this website.
311 311
 		$sql = 'SELECT vote_link_id
312
-			FROM ' . $this->votes_table . '
312
+			FROM ' . $this->votes_table.'
313 313
 			WHERE ' . $this->db->sql_build_array('SELECT', $data);
314 314
 		$result = $this->db->sql_query($sql);
315 315
 		$data = $this->db->sql_fetchrow($result);
@@ -321,9 +321,9 @@  discard block
 block discarded – undo
321 321
 
322 322
 		$this->link->add_vote($link_id, $this->request->variable('vote', 0));
323 323
 
324
-		$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
324
+		$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
325 325
 		meta_refresh(3, $meta_info);
326
-		$message = $this->language->lang('DIR_VOTE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $meta_info . '">', '</a>');
326
+		$message = $this->language->lang('DIR_VOTE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$meta_info.'">', '</a>');
327 327
 		return $this->helper->message($message);
328 328
 	}
329 329
 
@@ -348,18 +348,18 @@  discard block
 block discarded – undo
348 348
 			return $this->helper->message('FORM_INVALID');
349 349
 		}
350 350
 
351
-		$this->url			= $this->request->variable('url', '');
352
-		$this->site_name	= $this->request->variable('site_name', '', true);
351
+		$this->url = $this->request->variable('url', '');
352
+		$this->site_name = $this->request->variable('site_name', '', true);
353 353
 		$this->description	= $this->request->variable('description', '', true);
354 354
 		$this->guest_email	= $this->request->variable('guest_email', '');
355
-		$this->rss			= $this->request->variable('rss', '');
356
-		$this->banner 		= $this->request->variable('banner', '');
355
+		$this->rss = $this->request->variable('rss', '');
356
+		$this->banner = $this->request->variable('banner', '');
357 357
 		$this->back			= $this->request->variable('back', '');
358 358
 		$this->flag 		= $this->request->variable('flag', '');
359 359
 
360 360
 		if (!function_exists('validate_data'))
361 361
 		{
362
-			include($this->root_path . 'includes/functions_user.' . $this->php_ext);
362
+			include($this->root_path.'includes/functions_user.'.$this->php_ext);
363 363
 		}
364 364
 
365 365
 		// We define variables to check
@@ -382,17 +382,17 @@  discard block
 block discarded – undo
382 382
 			'site_name' =>			array(
383 383
 				array('string', false, 1, 100)),
384 384
 			'website'		=>		array(
385
-				array('string',	false, 12, 255),
386
-				array('match',	true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
385
+				array('string', false, 12, 255),
386
+				array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
387 387
 			'description'	=>		array(
388 388
 				array('string', !$this->categorie->data['cat_must_describe'], 1, $this->config['dir_length_describe'])),
389 389
 			'rss'			=>		array(
390 390
 				array('string', true, 12, 255),
391
-				array('match',	empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
391
+				array('match', empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
392 392
 			'banner'		=>		array(
393 393
 				array('string', true, 5, 255)),
394 394
 			'back'			=>		array(
395
-				array('string',	!$this->categorie->data['cat_link_back'], 12, 255),
395
+				array('string', !$this->categorie->data['cat_link_back'], 12, 255),
396 396
 				array(array($this->link, 'link_back'), true)),
397 397
 			'cat'			=>		array(
398 398
 				array('num', '', 1))
@@ -438,8 +438,8 @@  discard block
 block discarded – undo
438 438
 		// Still no errors?? So let's go!
439 439
 		if (!$error)
440 440
 		{
441
-			$this->banner	= (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
442
-			$this->url		= $this->link->clean_url($this->url);
441
+			$this->banner = (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
442
+			$this->url = $this->link->clean_url($this->url);
443 443
 
444 444
 			$data_edit = array(
445 445
 				'link_user_id'		=> $this->link_user_id,
@@ -484,10 +484,10 @@  discard block
 block discarded – undo
484 484
 				$this->link->add($data_add, $need_approval);
485 485
 			}
486 486
 
487
-			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id);
487
+			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id);
488 488
 			meta_refresh(3, $meta_info);
489 489
 			$message	= ($need_approval) ? $this->language->lang('DIR_'.strtoupper($mode).'_SITE_ACTIVE') : $this->language->lang('DIR_'.strtoupper($mode).'_SITE_OK');
490
-			$message	= $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id) . '">', '</a>');
490
+			$message	= $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id).'">', '</a>');
491 491
 			return $this->helper->message($message);
492 492
 		}
493 493
 		else
@@ -516,10 +516,10 @@  discard block
 block discarded – undo
516 516
 	{
517 517
 		if (!function_exists('file_gc'))
518 518
 		{
519
-			include($this->root_path . 'includes/functions_download.' . $this->php_ext);
519
+			include($this->root_path.'includes/functions_download.'.$this->php_ext);
520 520
 		}
521 521
 
522
-		$file_path = $this->root_path . $this->get_banner_path($banner_img);
522
+		$file_path = $this->root_path.$this->get_banner_path($banner_img);
523 523
 
524 524
 		if ((@file_exists($file_path) && @is_readable($file_path)))
525 525
 		{
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 
572 572
 		if (!function_exists('display_custom_bbcodes'))
573 573
 		{
574
-			include($this->root_path . 'includes/functions_display.' . $this->php_ext);
574
+			include($this->root_path.'includes/functions_display.'.$this->php_ext);
575 575
 		}
576 576
 		display_custom_bbcodes();
577 577
 		add_form_key('dir_form');
@@ -580,17 +580,17 @@  discard block
 block discarded – undo
580 580
 		$flag_path = $ext_path.'images/flags/';
581 581
 
582 582
 		$s_guest	= (!$this->user->data['is_registered'] || !empty($this->guest_email));
583
-		$s_rss		= $this->config['dir_activ_rss'];
584
-		$s_banner	= $this->config['dir_activ_banner'];
583
+		$s_rss = $this->config['dir_activ_rss'];
584
+		$s_banner = $this->config['dir_activ_banner'];
585 585
 		$s_back		= $this->categorie->data['cat_link_back'];
586 586
 		$s_flag		= $this->config['dir_activ_flag'];
587 587
 
588 588
 		$this->template->assign_vars(array(
589
-			'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>'),
590
-			'IMG_STATUS'			=> ($this->config['allow_bbcode'])	? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
589
+			'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>'),
590
+			'IMG_STATUS'			=> ($this->config['allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
591 591
 			'SMILIES_STATUS'		=> ($this->config['allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'),
592 592
 			'URL_STATUS'			=> ($this->config['allow_post_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'),
593
-			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash'])	? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
593
+			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
594 594
 
595 595
 			'L_TITLE'				=> $title,
596 596
 			'L_DIR_DESCRIPTION_EXP'	=> $this->language->lang('DIR_DESCRIPTION_EXP', $this->config['dir_length_describe']),
Please login to merge, or discard this patch.
controller/comments.php 2 patches
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -61,23 +61,23 @@  discard block
 block discarded – undo
61 61
 	protected $php_ext;
62 62
 
63 63
 	/**
64
-	* Constructor
65
-	*
66
-	* @param \phpbb\db\driver\driver_interface					$db					Database object
67
-	* @param \phpbb\config\config								$config				Config object
68
-	* @param \phpbb\language\language							$language			Language object
69
-	* @param \phpbb\template\template							$template			Template object
70
-	* @param \phpbb\user										$user				User object
71
-	* @param \phpbb\controller\helper							$helper				Controller helper object
72
-	* @param \phpbb\request\request								$request			Request object
73
-	* @param \phpbb\auth\auth									$auth				Auth object
74
-	* @param \phpbb\pagination									$pagination			Pagination object
75
-	* @param \phpbb\captcha\factory								$captcha_factory	Captcha object
76
-	* @param \ernadoo\phpbbdirectory\core\categorie				$categorie			PhpBB Directory extension categorie object
77
-	* @param \ernadoo\phpbbdirectory\core\comment				$comment			PhpBB Directory extension comment object
78
-	* @param string												$root_path			phpBB root path
79
-	* @param string												$php_ext			phpEx
80
-	*/
64
+	 * Constructor
65
+	 *
66
+	 * @param \phpbb\db\driver\driver_interface					$db					Database object
67
+	 * @param \phpbb\config\config								$config				Config object
68
+	 * @param \phpbb\language\language							$language			Language object
69
+	 * @param \phpbb\template\template							$template			Template object
70
+	 * @param \phpbb\user										$user				User object
71
+	 * @param \phpbb\controller\helper							$helper				Controller helper object
72
+	 * @param \phpbb\request\request								$request			Request object
73
+	 * @param \phpbb\auth\auth									$auth				Auth object
74
+	 * @param \phpbb\pagination									$pagination			Pagination object
75
+	 * @param \phpbb\captcha\factory								$captcha_factory	Captcha object
76
+	 * @param \ernadoo\phpbbdirectory\core\categorie				$categorie			PhpBB Directory extension categorie object
77
+	 * @param \ernadoo\phpbbdirectory\core\comment				$comment			PhpBB Directory extension comment object
78
+	 * @param string												$root_path			phpBB root path
79
+	 * @param string												$php_ext			phpEx
80
+	 */
81 81
 	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, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\comment $comment, $root_path, $php_ext)
82 82
 	{
83 83
 		$this->db				= $db;
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 	}
110 110
 
111 111
 	/**
112
-	* Populate form when an error occurred
113
-	*
114
-	* @param	int		$link_id		The link ID
115
-	* @param	int		$comment_id		The comment ID
116
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
117
-	* @throws	\phpbb\exception\http_exception
118
-	*/
112
+	 * Populate form when an error occurred
113
+	 *
114
+	 * @param	int		$link_id		The link ID
115
+	 * @param	int		$comment_id		The comment ID
116
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
117
+	 * @throws	\phpbb\exception\http_exception
118
+	 */
119 119
 	public function delete_comment($link_id, $comment_id)
120 120
 	{
121 121
 		$this->_check_comments_enable($link_id);
@@ -154,13 +154,13 @@  discard block
 block discarded – undo
154 154
 	}
155 155
 
156 156
 	/**
157
-	* Edit a comment
158
-	*
159
-	* @param	int		$link_id		The category ID
160
-	* @param	int		$comment_id		The comment ID
161
-	* @return	null|\Symfony\Component\HttpFoundation\Response	A Symfony Response object
162
-	* @throws	\phpbb\exception\http_exception
163
-	*/
157
+	 * Edit a comment
158
+	 *
159
+	 * @param	int		$link_id		The category ID
160
+	 * @param	int		$comment_id		The comment ID
161
+	 * @return	null|\Symfony\Component\HttpFoundation\Response	A Symfony Response object
162
+	 * @throws	\phpbb\exception\http_exception
163
+	 */
164 164
 	public function edit_comment($link_id, $comment_id)
165 165
 	{
166 166
 		$this->_check_comments_enable($link_id);
@@ -191,12 +191,12 @@  discard block
 block discarded – undo
191 191
 	}
192 192
 
193 193
 	/**
194
-	* Post a new comment
195
-	*
196
-	* @param	int	$link_id		The category ID
197
-	* @return	null
198
-	* @throws	\phpbb\exception\http_exception
199
-	*/
194
+	 * Post a new comment
195
+	 *
196
+	 * @param	int	$link_id		The category ID
197
+	 * @return	null
198
+	 * @throws	\phpbb\exception\http_exception
199
+	 */
200 200
 	public function new_comment($link_id)
201 201
 	{
202 202
 		$this->_check_comments_enable($link_id);
@@ -222,14 +222,14 @@  discard block
 block discarded – undo
222 222
 	}
223 223
 
224 224
 	/**
225
-	* Display popup comment
226
-	*
227
-	* @param	int		$link_id		The category ID
228
-	* @param	int		$page			Page number taken from the URL
229
-	* @param	string	$mode			add|edit
230
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
231
-	* @throws	\phpbb\exception\http_exception
232
-	*/
225
+	 * Display popup comment
226
+	 *
227
+	 * @param	int		$link_id		The category ID
228
+	 * @param	int		$page			Page number taken from the URL
229
+	 * @param	string	$mode			add|edit
230
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
231
+	 * @throws	\phpbb\exception\http_exception
232
+	 */
233 233
 	public function view($link_id, $page, $mode = 'new')
234 234
 	{
235 235
 		$this->_check_comments_enable($link_id);
@@ -322,13 +322,13 @@  discard block
 block discarded – undo
322 322
 	}
323 323
 
324 324
 	/**
325
-	* Routine
326
-	*
327
-	* @param	int		$link_id		The link ID
328
-	* @param	int		$comment_id		The comment ID
329
-	* @param	string	$mode			new|edit
330
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
331
-	*/
325
+	 * Routine
326
+	 *
327
+	 * @param	int		$link_id		The link ID
328
+	 * @param	int		$comment_id		The comment ID
329
+	 * @param	string	$mode			new|edit
330
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
331
+	 */
332 332
 	private function _data_processing($link_id, $comment_id = 0, $mode = 'new')
333 333
 	{
334 334
 		if (!check_form_key('dir_form_comment'))
@@ -416,12 +416,12 @@  discard block
 block discarded – undo
416 416
 	}
417 417
 
418 418
 	/**
419
-	* Check if comments are enable in a category
420
-	*
421
-	* @param	int		$link_id		The link ID
422
-	* @return	null					Retun null if comments are allowed, http_exception if not
423
-	* @throws	\phpbb\exception\http_exception
424
-	*/
419
+	 * Check if comments are enable in a category
420
+	 *
421
+	 * @param	int		$link_id		The link ID
422
+	 * @return	null					Retun null if comments are allowed, http_exception if not
423
+	 * @throws	\phpbb\exception\http_exception
424
+	 */
425 425
 	private function _check_comments_enable($link_id)
426 426
 	{
427 427
 		$sql = 'SELECT link_cat
@@ -447,12 +447,12 @@  discard block
 block discarded – undo
447 447
 	}
448 448
 
449 449
 	/**
450
-	* Populate form when an error occurred
451
-	*
452
-	* @param	int		$link_id		The link ID
453
-	* @param	string	$mode			add|edit
454
-	* @return	null
455
-	*/
450
+	 * Populate form when an error occurred
451
+	 *
452
+	 * @param	int		$link_id		The link ID
453
+	 * @param	string	$mode			add|edit
454
+	 * @return	null
455
+	 */
456 456
 	private function _populate_form($link_id, $mode)
457 457
 	{
458 458
 		$this->user->add_lang(array('ucp', 'posting'));
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -80,16 +80,16 @@  discard block
 block discarded – undo
80 80
 	*/
81 81
 	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, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\comment $comment, $root_path, $php_ext)
82 82
 	{
83
-		$this->db				= $db;
84
-		$this->config			= $config;
83
+		$this->db = $db;
84
+		$this->config = $config;
85 85
 		$this->language			= $language;
86 86
 		$this->template			= $template;
87 87
 		$this->user				= $user;
88
-		$this->helper			= $helper;
89
-		$this->request			= $request;
88
+		$this->helper = $helper;
89
+		$this->request = $request;
90 90
 		$this->auth				= $auth;
91
-		$this->pagination		= $pagination;
92
-		$this->captcha_factory 	= $captcha_factory;
91
+		$this->pagination = $pagination;
92
+		$this->captcha_factory = $captcha_factory;
93 93
 		$this->categorie		= $categorie;
94 94
 		$this->comment			= $comment;
95 95
 		$this->root_path		= $root_path;
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		}
128 128
 
129 129
 		$sql = 'SELECT *
130
-			FROM ' . $this->comments_table . '
130
+			FROM ' . $this->comments_table.'
131 131
 			WHERE comment_id = ' . (int) $comment_id;
132 132
 		$result = $this->db->sql_query($sql);
133 133
 		$value = $this->db->sql_fetchrow($result);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id));
145 145
 			meta_refresh(3, $meta_info);
146 146
 			$message = $this->language->lang('DIR_COMMENT_DELETE_OK');
147
-			$message = $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>');
147
+			$message = $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="'.$meta_info.'">', '</a>');
148 148
 			return $this->helper->message($message);
149 149
 		}
150 150
 		else
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 		$this->_check_comments_enable($link_id);
167 167
 
168 168
 		$sql = 'SELECT *
169
-			FROM ' . $this->comments_table . '
169
+			FROM ' . $this->comments_table.'
170 170
 			WHERE comment_id = ' . (int) $comment_id;
171 171
 		$result = $this->db->sql_query($sql);
172 172
 		$value = $this->db->sql_fetchrow($result);
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 		$comment_text = generate_text_for_edit($value['comment_text'], $value['comment_uid'], $value['comment_flags']);
180 180
 		$this->s_comment = $comment_text['text'];
181 181
 
182
-		$submit	= $this->request->is_set_post('update_comment') ? true : false;
182
+		$submit = $this->request->is_set_post('update_comment') ? true : false;
183 183
 
184 184
 		// If form is done
185 185
 		if ($submit)
@@ -235,15 +235,15 @@  discard block
 block discarded – undo
235 235
 		$this->_check_comments_enable($link_id);
236 236
 
237 237
 		$comment_id = $this->request->variable('c', 0);
238
-		$view 		= $this->request->variable('view', '');
239
-		$start 		= ($page - 1) * $this->config['dir_comments_per_page'];
238
+		$view = $this->request->variable('view', '');
239
+		$start = ($page - 1) * $this->config['dir_comments_per_page'];
240 240
 
241 241
 		$this->s_hidden_fields = array_merge($this->s_hidden_fields, array('page' => $page));
242 242
 
243 243
 		$this->_populate_form($link_id, $mode);
244 244
 
245 245
 		$sql = 'SELECT COUNT(comment_id) AS nb_comments
246
-			FROM ' . $this->comments_table . '
246
+			FROM ' . $this->comments_table.'
247 247
 			WHERE comment_link_id = ' . (int) $link_id;
248 248
 		$result = $this->db->sql_query($sql);
249 249
 		$nb_comments = (int) $this->db->sql_fetchfield('nb_comments');
@@ -263,10 +263,10 @@  discard block
 block discarded – undo
263 263
 					),
264 264
 					array(
265 265
 						'FROM'	=> array(ZEBRA_TABLE => 'z'),
266
-						'ON'	=> 'z.user_id = ' . (int) $this->user->data['user_id'] . ' AND z.zebra_id = a.comment_user_id'
266
+						'ON'	=> 'z.user_id = '.(int) $this->user->data['user_id'].' AND z.zebra_id = a.comment_user_id'
267 267
 					)
268 268
 			),
269
-			'WHERE'		=> 'a.comment_link_id = ' . (int) $link_id,
269
+			'WHERE'		=> 'a.comment_link_id = '.(int) $link_id,
270 270
 			'ORDER_BY'	=> 'a.comment_date DESC');
271 271
 		$sql = $this->db->sql_build_query('SELECT', $sql_array);
272 272
 		$result = $this->db->sql_query_limit($sql, $this->config['dir_comments_per_page'], $start);
@@ -295,12 +295,12 @@  discard block
 block discarded – undo
295 295
 				'S_COMMENT'			=> generate_text_for_display($comments['comment_text'], $comments['comment_uid'], $comments['comment_bitfield'], $comments['comment_flags']),
296 296
 				'S_ID'				=> $comments['comment_id'],
297 297
 
298
-				'U_EDIT'			=> ($edit_allowed) 		? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '',
299
-				'U_DELETE'			=> ($delete_allowed) 	? $this->helper->route('ernadoo_phpbbdirectory_comment_delete_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'], '_referer' => $this->helper->get_current_url())) : '',
298
+				'U_EDIT'			=> ($edit_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '',
299
+				'U_DELETE'			=> ($delete_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_delete_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'], '_referer' => $this->helper->get_current_url())) : '',
300 300
 
301 301
 				'S_IGNORE_POST'		=> ($comments['foe'] && ($view != 'show' || $comment_id != $comments['comment_id'])) ? true : false,
302 302
 				'L_IGNORE_POST'		=> ($comments['foe']) ? $this->language->lang('POST_BY_FOE', get_username_string('full', $comments['comment_user_id'], $comments['username'], $comments['user_colour'])) : '',
303
-				'L_POST_DISPLAY'	=> ($comments['foe']) ? $this->language->lang('POST_DISPLAY', '<a class="display_post" data-post-id="' . $comments['comment_id'] . '" href="' . $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id, 'page' => $page)).'?c='.(int) $comments['comment_id'] . '&view=show#c'.(int) $comments['comment_id'].'">', '</a>') : '',
303
+				'L_POST_DISPLAY'	=> ($comments['foe']) ? $this->language->lang('POST_DISPLAY', '<a class="display_post" data-post-id="'.$comments['comment_id'].'" href="'.$this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id, 'page' => $page)).'?c='.(int) $comments['comment_id'].'&view=show#c'.(int) $comments['comment_id'].'">', '</a>') : '',
304 304
 
305 305
 				'S_INFO'			=> $this->auth->acl_get('m_info'),
306 306
 			));
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 
341 341
 		if (!function_exists('validate_data'))
342 342
 		{
343
-			include($this->root_path . 'includes/functions_user.' . $this->php_ext);
343
+			include($this->root_path.'includes/functions_user.'.$this->php_ext);
344 344
 		}
345 345
 
346 346
 		$error = validate_data(
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id));
403 403
 			meta_refresh(3, $meta_info);
404 404
 			$message = $this->language->lang('DIR_'.strtoupper($mode).'_COMMENT_OK');
405
-			$message = $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>');
405
+			$message = $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="'.$meta_info.'">', '</a>');
406 406
 			return $this->helper->message($message);
407 407
 		}
408 408
 		else
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 	private function _check_comments_enable($link_id)
426 426
 	{
427 427
 		$sql = 'SELECT link_cat
428
-			FROM ' . $this->links_table . '
428
+			FROM ' . $this->links_table.'
429 429
 			WHERE link_id = ' . (int) $link_id;
430 430
 		$result = $this->db->sql_query($sql);
431 431
 		$cat_id = (int) $this->db->sql_fetchfield('link_cat');
@@ -469,11 +469,11 @@  discard block
 block discarded – undo
469 469
 
470 470
 		if (!function_exists('generate_smilies'))
471 471
 		{
472
-			include($this->root_path . 'includes/functions_posting.' . $this->php_ext);
472
+			include($this->root_path.'includes/functions_posting.'.$this->php_ext);
473 473
 		}
474 474
 		if (!function_exists('display_custom_bbcodes'))
475 475
 		{
476
-			include($this->root_path . 'includes/functions_display.' . $this->php_ext);
476
+			include($this->root_path.'includes/functions_display.'.$this->php_ext);
477 477
 		}
478 478
 
479 479
 		generate_smilies('inline', 0);
@@ -483,11 +483,11 @@  discard block
 block discarded – undo
483 483
 		$this->template->assign_vars(array(
484 484
 			'S_AUTH_COMM' 		=> $this->auth->acl_get('u_comment_dir'),
485 485
 
486
-			'BBCODE_STATUS'		=> ($this->config['dir_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>'),
487
-			'IMG_STATUS'		=> ($this->config['dir_allow_bbcode']) 	? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
488
-			'SMILIES_STATUS'	=> ($this->config['dir_allow_smilies'])	? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'),
489
-			'URL_STATUS'		=> ($this->config['dir_allow_links'])	? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'),
490
-			'FLASH_STATUS'		=> ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash'])	? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
486
+			'BBCODE_STATUS'		=> ($this->config['dir_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>'),
487
+			'IMG_STATUS'		=> ($this->config['dir_allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
488
+			'SMILIES_STATUS'	=> ($this->config['dir_allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'),
489
+			'URL_STATUS'		=> ($this->config['dir_allow_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'),
490
+			'FLASH_STATUS'		=> ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
491 491
 
492 492
 			'L_DIR_REPLY_EXP'	=> $this->language->lang('DIR_REPLY_EXP', $this->config['dir_length_comments']),
493 493
 
Please login to merge, or discard this patch.
controller/acp/settings.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
 	*/
52 52
 	public function __construct(\phpbb\config\config $config, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
53 53
 	{
54
-		$this->config	= $config;
54
+		$this->config = $config;
55 55
 		$this->language	= $language;
56
-		$this->log		= $log;
56
+		$this->log = $log;
57 57
 		$this->template	= $template;
58
-		$this->user		= $user;
59
-		$this->request	= $request;
58
+		$this->user = $user;
59
+		$this->request = $request;
60 60
 
61 61
 		$this->_generate_config();
62 62
 	}
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			}
96 96
 			else if ($vars['explain'])
97 97
 			{
98
-				$l_explain = $this->language->lang($vars['lang'] . '_EXPLAIN');
98
+				$l_explain = $this->language->lang($vars['lang'].'_EXPLAIN');
99 99
 			}
100 100
 
101 101
 			$this->template->assign_block_vars('options', array(
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	*/
118 118
 	public function process()
119 119
 	{
120
-		$submit	= ($this->request->is_set_post('submit')) ? true : false;
120
+		$submit = ($this->request->is_set_post('submit')) ? true : false;
121 121
 
122 122
 		$this->new_config = $this->config;
123 123
 		$cfg_array = ($this->request->is_set('config')) ? $this->request->variable('config', array('' => ''), true) : $this->new_config;
@@ -158,12 +158,12 @@  discard block
 block discarded – undo
158 158
 		{
159 159
 			$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'DIR_CONFIG_SETTINGS');
160 160
 
161
-			trigger_error($this->language->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
161
+			trigger_error($this->language->lang('CONFIG_UPDATED').adm_back_link($this->u_action));
162 162
 		}
163 163
 
164 164
 		$this->template->assign_vars(array(
165 165
 			'L_TITLE'			=> $this->language->lang($this->display_vars['title']),
166
-			'L_TITLE_EXPLAIN'	=> $this->language->lang($this->display_vars['title'] . '_EXPLAIN'),
166
+			'L_TITLE_EXPLAIN'	=> $this->language->lang($this->display_vars['title'].'_EXPLAIN'),
167 167
 
168 168
 			'S_ERROR'			=> (sizeof($error)) ? true : false,
169 169
 			'ERROR_MSG'			=> implode('<br />', $error),
@@ -199,44 +199,44 @@  discard block
 block discarded – undo
199 199
 				'dir_banner_width'					=> '',
200 200
 				'dir_banner_height'					=> '',
201 201
 
202
-				'dir_mail'							=> array('lang' => 'DIR_MAIL_VALIDATION',	'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => false),
203
-				'dir_activ_checkurl'				=> array('lang' => 'DIR_ACTIVE_CHECK',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
204
-				'dir_activ_flag'					=> array('lang' => 'DIR_ACTIV_FLAG',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => false),
205
-				'dir_activ_rss'						=> array('lang' => 'DIR_ACTIV_RSS',			'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
206
-				'dir_show'							=> array('lang' => 'DIR_SHOW',				'validate' => 'int:1:9999', 'type' => 'number:1:9999',	'explain' => false),
207
-				'dir_length_describe'				=> array('lang' => 'DIR_MAX_DESC',			'validate' => 'int:1:999',	'type' => 'number:1:999',	'explain' => false),
208
-				'dir_new_time'						=> array('lang' => 'DIR_NEW_TIME',			'validate' => 'int:1:999', 	'type' => 'number:1:999',	'explain' => true),
209
-				'dir_default_order'					=> array('lang' => 'DIR_DEFAULT_ORDER',		'validate' => 'string', 	'type' => 'select',			'explain' => false, 'method' => 'get_order_list', 'params' => array('{CONFIG_VALUE}')),
202
+				'dir_mail'							=> array('lang' => 'DIR_MAIL_VALIDATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
203
+				'dir_activ_checkurl'				=> array('lang' => 'DIR_ACTIVE_CHECK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
204
+				'dir_activ_flag'					=> array('lang' => 'DIR_ACTIV_FLAG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
205
+				'dir_activ_rss'						=> array('lang' => 'DIR_ACTIV_RSS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
206
+				'dir_show'							=> array('lang' => 'DIR_SHOW', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false),
207
+				'dir_length_describe'				=> array('lang' => 'DIR_MAX_DESC', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false),
208
+				'dir_new_time'						=> array('lang' => 'DIR_NEW_TIME', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true),
209
+				'dir_default_order'					=> array('lang' => 'DIR_DEFAULT_ORDER', 'validate' => 'string', 'type' => 'select', 'explain' => false, 'method' => 'get_order_list', 'params' => array('{CONFIG_VALUE}')),
210 210
 
211 211
 				'legend2'							=> 'DIR_RECENT_GUEST',
212
-				'dir_recent_block'					=> array('lang' => 'DIR_RECENT_ENABLE',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
213
-				'dir_recent_rows'					=> array('lang' => 'DIR_RECENT_ROWS',		'validate' => 'int:1:999',	'type' => 'number:1:999',	'explain' => false),
214
-				'dir_recent_columns'				=> array('lang' => 'DIR_RECENT_COLUMNS',	'validate' => 'int:1:999',	'type' => 'number:1:999',	'explain' => false),
215
-				'dir_recent_exclude'				=> array('lang' => 'DIR_RECENT_EXCLUDE',	'validate' => 'string',		'type' => 'text:6:99',		'explain' => true),
212
+				'dir_recent_block'					=> array('lang' => 'DIR_RECENT_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
213
+				'dir_recent_rows'					=> array('lang' => 'DIR_RECENT_ROWS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false),
214
+				'dir_recent_columns'				=> array('lang' => 'DIR_RECENT_COLUMNS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false),
215
+				'dir_recent_exclude'				=> array('lang' => 'DIR_RECENT_EXCLUDE', 'validate' => 'string', 'type' => 'text:6:99', 'explain' => true),
216 216
 
217 217
 				'legend3'							=> 'DIR_ADD_GUEST',
218
-				'dir_visual_confirm'				=> array('lang' => 'DIR_VISUAL_CONFIRM',	'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
219
-				'dir_visual_confirm_max_attempts'	=> array('lang' => 'DIR_MAX_ADD_ATTEMPTS',	'validate' => 'int:0:9999',	'type' => 'number:0:9999',	'explain' => true),
218
+				'dir_visual_confirm'				=> array('lang' => 'DIR_VISUAL_CONFIRM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
219
+				'dir_visual_confirm_max_attempts'	=> array('lang' => 'DIR_MAX_ADD_ATTEMPTS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
220 220
 
221 221
 				'legend4'							=> 'DIR_THUMB_PARAM',
222
-				'dir_activ_thumb'					=> array('lang' => 'DIR_ACTIVE_THUMB',			'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => false),
223
-				'dir_activ_thumb_remote'			=> array('lang' => 'DIR_ACTIVE_THUMB_REMOTE',	'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
224
-				'dir_thumb_service'					=> array('lang' => 'DIR_THUMB_SERVICE',			'validate' => 'string', 'type' => 'select',			'explain' => true, 'method' => 'get_thumb_service_list', 'params' => array('{CONFIG_VALUE}')),
225
-				'dir_thumb_service_reverse'			=> array('lang' => 'DIR_THUMB_SERVICE_REVERSE',	'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
222
+				'dir_activ_thumb'					=> array('lang' => 'DIR_ACTIVE_THUMB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
223
+				'dir_activ_thumb_remote'			=> array('lang' => 'DIR_ACTIVE_THUMB_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
224
+				'dir_thumb_service'					=> array('lang' => 'DIR_THUMB_SERVICE', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_thumb_service_list', 'params' => array('{CONFIG_VALUE}')),
225
+				'dir_thumb_service_reverse'			=> array('lang' => 'DIR_THUMB_SERVICE_REVERSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
226 226
 
227 227
 				'legend5'							=> 'DIR_COMM_PARAM',
228
-				'dir_allow_bbcode'					=> array('lang' => 'DIR_ALLOW_BBCODE',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => false),
229
-				'dir_allow_flash'					=> array('lang' => 'DIR_ALLOW_FLASH',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => false),
230
-				'dir_allow_links'					=> array('lang' => 'DIR_ALLOW_LINKS',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => false),
231
-				'dir_allow_smilies'					=> array('lang' => 'DIR_ALLOW_SMILIES',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => false),
232
-				'dir_length_comments'				=> array('lang' => 'DIR_LENGTH_COMMENTS',	'validate' => 'int:1:999',	'type' => 'number:1:999',	'explain' => false),
233
-				'dir_comments_per_page'				=> array('lang' => 'DIR_COMM_PER_PAGE',		'validate' => 'int:1:9999',	'type' => 'number:1:9999',	'explain' => false),
228
+				'dir_allow_bbcode'					=> array('lang' => 'DIR_ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
229
+				'dir_allow_flash'					=> array('lang' => 'DIR_ALLOW_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
230
+				'dir_allow_links'					=> array('lang' => 'DIR_ALLOW_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
231
+				'dir_allow_smilies'					=> array('lang' => 'DIR_ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
232
+				'dir_length_comments'				=> array('lang' => 'DIR_LENGTH_COMMENTS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false),
233
+				'dir_comments_per_page'				=> array('lang' => 'DIR_COMM_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false),
234 234
 
235 235
 				'legend6'							=> 'DIR_BANN_PARAM',
236
-				'dir_activ_banner'					=> array('lang' => 'DIR_ACTIV_BANNER',		'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => false),
237
-				'dir_banner'						=> array('lang' => 'DIR_MAX_BANN',			'validate' => 'int:0',	'type' => 'dimension:0',	'explain' => true, 'append' => ' ' . $this->user->lang['PIXEL']),
238
-				'dir_banner_filesize'				=> array('lang' => 'DIR_MAX_SIZE',			'validate' => 'string',	'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
239
-				'dir_storage_banner'				=> array('lang' => 'DIR_STORAGE_BANNER',	'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
236
+				'dir_activ_banner'					=> array('lang' => 'DIR_ACTIV_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
237
+				'dir_banner'						=> array('lang' => 'DIR_MAX_BANN', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' '.$this->user->lang['PIXEL']),
238
+				'dir_banner_filesize'				=> array('lang' => 'DIR_MAX_SIZE', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
239
+				'dir_storage_banner'				=> array('lang' => 'DIR_STORAGE_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
240 240
 			)
241 241
 		);
242 242
 	}
Please login to merge, or discard this patch.
controller/acp/validation.php 1 patch
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -69,22 +69,22 @@  discard block
 block discarded – undo
69 69
 	private $links_data;
70 70
 
71 71
 	/**
72
-	* Constructor
73
-	*
74
-	* @param \phpbb\config\config								$config				Config object
75
-	* @param \phpbb\db\driver\driver_interface 					$db					Database object
76
-	* @param \phpbb\pagination									$pagination			Pagination object
77
-	* @param \phpbb\language\language							$language			Language object
78
-	* @param \phpbb\log\log										$log				Log object
79
-	* @param \phpbb\notification\manager						$notification		Notification object
80
-	* @param \phpbb\request\request								$request			Request object
81
-	* @param \phpbb\template\template							$template			Template object
82
-	* @param \phpbb\user										$user				User object
83
-	* @param \ernadoo\phpbbdirectory\core\categorie				$categorie			PhpBB Directory extension categorie object
84
-	* @param \ernadoo\phpbbdirectory\core\link					$link				PhpBB Directory extension link object
85
-	* @param string												$root_path			phpBB root path
86
-	* @param string												$php_ext   			phpEx
87
-	*/
72
+	 * Constructor
73
+	 *
74
+	 * @param \phpbb\config\config								$config				Config object
75
+	 * @param \phpbb\db\driver\driver_interface 					$db					Database object
76
+	 * @param \phpbb\pagination									$pagination			Pagination object
77
+	 * @param \phpbb\language\language							$language			Language object
78
+	 * @param \phpbb\log\log										$log				Log object
79
+	 * @param \phpbb\notification\manager						$notification		Notification object
80
+	 * @param \phpbb\request\request								$request			Request object
81
+	 * @param \phpbb\template\template							$template			Template object
82
+	 * @param \phpbb\user										$user				User object
83
+	 * @param \ernadoo\phpbbdirectory\core\categorie				$categorie			PhpBB Directory extension categorie object
84
+	 * @param \ernadoo\phpbbdirectory\core\link					$link				PhpBB Directory extension link object
85
+	 * @param string												$root_path			phpBB root path
86
+	 * @param string												$php_ext   			phpEx
87
+	 */
88 88
 	public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\notification\manager $notification, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext)
89 89
 	{
90 90
 		$this->config		= $config;
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
 	}
106 106
 
107 107
 	/**
108
-	* Display confirm box
109
-	*
110
-	* @param	array $mark Website selected for (dis)approval
111
-	* @return	null
112
-	*/
108
+	 * Display confirm box
109
+	 *
110
+	 * @param	array $mark Website selected for (dis)approval
111
+	 * @return	null
112
+	 */
113 113
 	public function display_confirm($mark)
114 114
 	{
115 115
 		$s_hidden_fields = array(
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
 	}
122 122
 
123 123
 	/**
124
-	* Display website list for (dis)approval
125
-	*
126
-	* @return null
127
-	*/
124
+	 * Display website list for (dis)approval
125
+	 *
126
+	 * @return null
127
+	 */
128 128
 	public function display_websites()
129 129
 	{
130 130
 		global $phpbb_admin_path;
@@ -228,11 +228,11 @@  discard block
 block discarded – undo
228 228
 	}
229 229
 
230 230
 	/**
231
-	* Get link's information and call appropriate action
232
-	*
233
-	* @param	array $mark Website selected for (dis)approval
234
-	* @return	null
235
-	*/
231
+	 * Get link's information and call appropriate action
232
+	 *
233
+	 * @param	array $mark Website selected for (dis)approval
234
+	 * @return	null
235
+	 */
236 236
 	public function exec_action($mark)
237 237
 	{
238 238
 		$this->_get_infos_links($mark);
@@ -255,10 +255,10 @@  discard block
 block discarded – undo
255 255
 	}
256 256
 
257 257
 	/**
258
-	* Notify users which had submitted their websites
259
-	*
260
-	* @return null
261
-	*/
258
+	 * Notify users which had submitted their websites
259
+	 *
260
+	 * @return null
261
+	 */
262 262
 	public function notifiy_submiters()
263 263
 	{
264 264
 		if (!class_exists('messenger'))
@@ -302,22 +302,22 @@  discard block
 block discarded – undo
302 302
 	}
303 303
 
304 304
 	/**
305
-	* Set page url
306
-	*
307
-	* @param	string $u_action Custom form action
308
-	* @return	null
309
-	* @access	public
310
-	*/
305
+	 * Set page url
306
+	 *
307
+	 * @param	string $u_action Custom form action
308
+	 * @return	null
309
+	 * @access	public
310
+	 */
311 311
 	public function set_page_url($u_action)
312 312
 	{
313 313
 		$this->u_action = $u_action;
314 314
 	}
315 315
 
316 316
 	/**
317
-	* Approve action
318
-	*
319
-	* @return null
320
-	*/
317
+	 * Approve action
318
+	 *
319
+	 * @return null
320
+	 */
321 321
 	private function _action_approved()
322 322
 	{
323 323
 		foreach ($this->links_data as $row)
@@ -346,10 +346,10 @@  discard block
 block discarded – undo
346 346
 	}
347 347
 
348 348
 	/**
349
-	* Disapprove action
350
-	*
351
-	* @return null
352
-	*/
349
+	 * Disapprove action
350
+	 *
351
+	 * @return null
352
+	 */
353 353
 	private function _action_disapproved()
354 354
 	{
355 355
 		foreach ($this->links_data as $row)
@@ -370,11 +370,11 @@  discard block
 block discarded – undo
370 370
 	}
371 371
 
372 372
 	/**
373
-	* Get informations about links selected
374
-	*
375
-	* @param	array $mark Website selected for (dis)approval
376
-	* @return	null
377
-	*/
373
+	 * Get informations about links selected
374
+	 *
375
+	 * @param	array $mark Website selected for (dis)approval
376
+	 * @return	null
377
+	 */
378 378
 	private function _get_infos_links($mark)
379 379
 	{
380 380
 		$sql_array = array(
@@ -409,11 +409,11 @@  discard block
 block discarded – undo
409 409
 	}
410 410
 
411 411
 	/**
412
-	* Notify users which watch categories
413
-	*
414
-	* @param	array $row Informations about website
415
-	* @return	null
416
-	*/
412
+	 * Notify users which watch categories
413
+	 *
414
+	 * @param	array $row Informations about website
415
+	 * @return	null
416
+	 */
417 417
 	private function _notify_suscribers($row)
418 418
 	{
419 419
 		$notification_data = array(
Please login to merge, or discard this patch.
controller/acp/cat.php 1 patch
Spacing   +89 added lines, -89 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
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	{
152 152
 		if (!$this->cat_id)
153 153
 		{
154
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
154
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
155 155
 		}
156 156
 
157 157
 		$this->cat_data = $this->_get_cat_info($this->cat_id);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		$cat_list = $this->categorie->make_cat_select((int) $this->cat_data['parent_id'], $subcats_id);
168 168
 
169 169
 		$sql = 'SELECT cat_id
170
-			FROM ' . $this->categories_table . '
170
+			FROM ' . $this->categories_table.'
171 171
 			WHERE cat_id <> ' . (int) $this->cat_id;
172 172
 		$result = $this->db->sql_query_limit($sql, 1);
173 173
 
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
 
184 184
 		$this->template->assign_vars(array(
185 185
 			'S_DELETE_DIR_CAT'		=> true,
186
-			'U_ACTION'				=> $this->u_action . "&amp;parent_id={$parent_id}&amp;action=delete&amp;c=$this->cat_id",
187
-			'U_BACK'				=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
186
+			'U_ACTION'				=> $this->u_action."&amp;parent_id={$parent_id}&amp;action=delete&amp;c=$this->cat_id",
187
+			'U_BACK'				=> $this->u_action.'&amp;parent_id='.$this->parent_id,
188 188
 
189 189
 			'DIR_CAT_NAME'			=> $this->cat_data['cat_name'],
190 190
 			'S_HAS_SUBCATS'			=> ($this->cat_data['right_id'] - $this->cat_data['left_id'] > 1) ? true : false,
@@ -235,11 +235,11 @@  discard block
 block discarded – undo
235 235
 	{
236 236
 		if (!$this->cat_id)
237 237
 		{
238
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
238
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
239 239
 		}
240 240
 
241 241
 		$sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id
242
-			FROM ' . $this->categories_table . '
242
+			FROM ' . $this->categories_table.'
243 243
 			WHERE cat_id = ' . (int) $this->cat_id;
244 244
 		$result = $this->db->sql_query($sql);
245 245
 		$row = $this->db->sql_fetchrow($result);
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 
248 248
 		if (!$row)
249 249
 		{
250
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
250
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
251 251
 		}
252 252
 
253 253
 		try
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 
262 262
 		if ($move_cat_name !== false)
263 263
 		{
264
-			$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
+			$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));
265 265
 			$this->cache->destroy('sql', $this->categories_table);
266 266
 		}
267 267
 
@@ -305,13 +305,13 @@  discard block
 block discarded – undo
305 305
 	{
306 306
 		if (!$this->cat_id)
307 307
 		{
308
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
308
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
309 309
 		}
310 310
 
311 311
 		@set_time_limit(0);
312 312
 
313 313
 		$sql = 'SELECT cat_name, cat_links
314
-			FROM ' . $this->categories_table . '
314
+			FROM ' . $this->categories_table.'
315 315
 			WHERE cat_id = ' . (int) $this->cat_id;
316 316
 		$result = $this->db->sql_query($sql);
317 317
 		$row = $this->db->sql_fetchrow($result);
@@ -319,12 +319,12 @@  discard block
 block discarded – undo
319 319
 
320 320
 		if (!$row)
321 321
 		{
322
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
322
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
323 323
 		}
324 324
 
325 325
 		$sql = 'SELECT MIN(link_id) as min_link_id, MAX(link_id) as max_link_id
326
-			FROM ' . $this->links_table . '
327
-			WHERE link_cat = ' . (int) $this->cat_id . '
326
+			FROM ' . $this->links_table.'
327
+			WHERE link_cat = ' . (int) $this->cat_id.'
328 328
 				AND link_active = 1';
329 329
 		$result = $this->db->sql_query($sql);
330 330
 		$row2 = $this->db->sql_fetchrow($result);
@@ -346,22 +346,22 @@  discard block
 block discarded – undo
346 346
 		{
347 347
 			// We really need to find a way of showing statistics... no progress here
348 348
 			$sql = 'SELECT COUNT(link_id) as num_links
349
-				FROM ' . $this->links_table . '
350
-				WHERE link_cat = ' . (int) $this->cat_id . '
349
+				FROM ' . $this->links_table.'
350
+				WHERE link_cat = ' . (int) $this->cat_id.'
351 351
 						AND link_active = 1
352
-						AND link_id BETWEEN ' . (int) $start . ' AND ' . (int) $end;
352
+						AND link_id BETWEEN ' . (int) $start.' AND '.(int) $end;
353 353
 			$result = $this->db->sql_query($sql);
354 354
 			$links_done = $this->request->variable('links_done', 0) + (int) $this->db->sql_fetchfield('num_links');
355 355
 			$this->db->sql_freeresult($result);
356 356
 
357 357
 			$start += $batch_size;
358 358
 
359
-			$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
+			$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']}";
360 360
 
361 361
 			meta_refresh(0, $url);
362 362
 
363 363
 			$this->template->assign_vars(array(
364
-				'U_PROGRESS_BAR'		=> $this->u_action . "&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}",
364
+				'U_PROGRESS_BAR'		=> $this->u_action."&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}",
365 365
 				'S_CONTINUE_SYNC'		=> true,
366 366
 				'L_PROGRESS_EXPLAIN'	=> $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', $links_done, $row['cat_links']))
367 367
 			);
@@ -369,11 +369,11 @@  discard block
 block discarded – undo
369 369
 			return;
370 370
 		}
371 371
 
372
-		$url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync_cat";
372
+		$url = $this->u_action."&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync_cat";
373 373
 		meta_refresh(0, $url);
374 374
 
375 375
 		$this->template->assign_vars(array(
376
-			'U_PROGRESS_BAR'		=> $this->u_action . '&amp;action=progress_bar',
376
+			'U_PROGRESS_BAR'		=> $this->u_action.'&amp;action=progress_bar',
377 377
 			'S_CONTINUE_SYNC'		=> true,
378 378
 			'L_PROGRESS_EXPLAIN'	=> $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', 0, $row['cat_links']))
379 379
 		);
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 	public function action_sync_cat()
390 390
 	{
391 391
 		$sql = 'SELECT cat_name
392
-			FROM ' . $this->categories_table . '
392
+			FROM ' . $this->categories_table.'
393 393
 			WHERE cat_id = ' . (int) $this->cat_id;
394 394
 		$result = $this->db->sql_query($sql);
395 395
 		$row = $this->db->sql_fetchrow($result);
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 
398 398
 		if (!$row)
399 399
 		{
400
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
400
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
401 401
 		}
402 402
 
403 403
 		$this->_sync_dir_cat($this->cat_id);
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 		}
423 423
 		else
424 424
 		{
425
-			$navigation = '<a href="' . $this->u_action . '">' . $this->language->lang('DIR_INDEX') . '</a>';
425
+			$navigation = '<a href="'.$this->u_action.'">'.$this->language->lang('DIR_INDEX').'</a>';
426 426
 
427 427
 			$cats_nav = $this->nestedset_category->get_path_data($this->parent_id);
428 428
 
@@ -430,11 +430,11 @@  discard block
 block discarded – undo
430 430
 			{
431 431
 				if ($row['cat_id'] == $this->parent_id)
432 432
 				{
433
-					$navigation .= ' -&gt; ' . $row['cat_name'];
433
+					$navigation .= ' -&gt; '.$row['cat_name'];
434 434
 				}
435 435
 				else
436 436
 				{
437
-					$navigation .= ' -&gt; <a href="' . $this->u_action . '&amp;parent_id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a>';
437
+					$navigation .= ' -&gt; <a href="'.$this->u_action.'&amp;parent_id='.$row['cat_id'].'">'.$row['cat_name'].'</a>';
438 438
 				}
439 439
 			}
440 440
 		}
@@ -448,8 +448,8 @@  discard block
 block discarded – undo
448 448
 		}
449 449
 
450 450
 		$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
451
-			FROM ' . $this->categories_table . '
452
-			WHERE parent_id = ' . (int) $this->parent_id . '
451
+			FROM ' . $this->categories_table.'
452
+			WHERE parent_id = ' . (int) $this->parent_id.'
453 453
 			ORDER BY left_id';
454 454
 		$result = $this->db->sql_query($sql);
455 455
 
@@ -457,23 +457,23 @@  discard block
 block discarded – undo
457 457
 		{
458 458
 			do
459 459
 			{
460
-				$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
+				$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').'" />';
461 461
 
462
-				$url = $this->u_action . "&amp;parent_id=$this->parent_id&amp;c={$row['cat_id']}";
462
+				$url = $this->u_action."&amp;parent_id=$this->parent_id&amp;c={$row['cat_id']}";
463 463
 
464 464
 				$this->template->assign_block_vars('cats', array(
465 465
 					'FOLDER_IMAGE'		=> $folder_image,
466
-					'CAT_IMAGE'			=> ($row['cat_icon']) ? '<img src="' . $this->get_img_path('icons', $row['cat_icon']) . '" alt="" />' : '',
466
+					'CAT_IMAGE'			=> ($row['cat_icon']) ? '<img src="'.$this->get_img_path('icons', $row['cat_icon']).'" alt="" />' : '',
467 467
 					'CAT_NAME'			=> $row['cat_name'],
468 468
 					'CAT_DESCRIPTION'	=> generate_text_for_display($row['cat_desc'], $row['cat_desc_uid'], $row['cat_desc_bitfield'], $row['cat_desc_options']),
469 469
 					'CAT_LINKS'			=> $row['cat_links'],
470 470
 
471
-					'U_CAT'				=> $this->u_action . '&amp;parent_id=' . $row['cat_id'],
472
-					'U_MOVE_UP'			=> $url . '&amp;action=move_up',
473
-					'U_MOVE_DOWN'		=> $url . '&amp;action=move_down',
474
-					'U_EDIT'			=> $url . '&amp;action=edit',
475
-					'U_DELETE'			=> $url . '&amp;action=delete',
476
-					'U_SYNC'			=> $url . '&amp;action=sync')
471
+					'U_CAT'				=> $this->u_action.'&amp;parent_id='.$row['cat_id'],
472
+					'U_MOVE_UP'			=> $url.'&amp;action=move_up',
473
+					'U_MOVE_DOWN'		=> $url.'&amp;action=move_down',
474
+					'U_EDIT'			=> $url.'&amp;action=edit',
475
+					'U_DELETE'			=> $url.'&amp;action=delete',
476
+					'U_SYNC'			=> $url.'&amp;action=sync')
477 477
 				);
478 478
 			}
479 479
 			while ($row = $this->db->sql_fetchrow($result));
@@ -482,14 +482,14 @@  discard block
 block discarded – undo
482 482
 		{
483 483
 			$row = $this->_get_cat_info($this->parent_id);
484 484
 
485
-			$url = $this->u_action . '&amp;parent_id=' . $this->parent_id . '&amp;c=' . $row['cat_id'];
485
+			$url = $this->u_action.'&amp;parent_id='.$this->parent_id.'&amp;c='.$row['cat_id'];
486 486
 
487 487
 			$this->template->assign_vars(array(
488 488
 				'S_NO_CATS'			=> true,
489 489
 
490
-				'U_EDIT'			=> $url . '&amp;action=edit',
491
-				'U_DELETE'			=> $url . '&amp;action=delete',
492
-				'U_SYNC'			=> $url . '&amp;action=sync')
490
+				'U_EDIT'			=> $url.'&amp;action=edit',
491
+				'U_DELETE'			=> $url.'&amp;action=delete',
492
+				'U_SYNC'			=> $url.'&amp;action=sync')
493 493
 			);
494 494
 		}
495 495
 		$this->db->sql_freeresult($result);
@@ -499,9 +499,9 @@  discard block
 block discarded – undo
499 499
 			'NAVIGATION'	=> $navigation,
500 500
 			'CAT_BOX'		=> $cat_box,
501 501
 			'U_SEL_ACTION'	=> $this->u_action,
502
-			'U_ACTION'		=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
502
+			'U_ACTION'		=> $this->u_action.'&amp;parent_id='.$this->parent_id,
503 503
 
504
-			'U_PROGRESS_BAR'	=> $this->u_action . '&amp;action=progress_bar',
504
+			'U_PROGRESS_BAR'	=> $this->u_action.'&amp;action=progress_bar',
505 505
 		));
506 506
 	}
507 507
 
@@ -534,10 +534,10 @@  discard block
 block discarded – undo
534 534
 		switch ($this->action)
535 535
 		{
536 536
 			case 'delete':
537
-				$action_subcats	= $this->request->variable('action_subcats', '');
538
-				$subcats_to_id	= $this->request->variable('subcats_to_id', 0);
539
-				$action_links	= $this->request->variable('action_links', '');
540
-				$links_to_id	= $this->request->variable('links_to_id', 0);
537
+				$action_subcats = $this->request->variable('action_subcats', '');
538
+				$subcats_to_id = $this->request->variable('subcats_to_id', 0);
539
+				$action_links = $this->request->variable('action_links', '');
540
+				$links_to_id = $this->request->variable('links_to_id', 0);
541 541
 
542 542
 				try
543 543
 				{
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 			// Purge the cache to refresh route collections
607 607
 			$this->cache->purge();
608 608
 
609
-			trigger_error($this->language->lang($message) . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
609
+			trigger_error($this->language->lang($message).adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id));
610 610
 		}
611 611
 	}
612 612
 
@@ -634,8 +634,8 @@  discard block
 block discarded – undo
634 634
 		}
635 635
 
636 636
 		$sql = 'SELECT cat_route
637
-			FROM ' . $this->categories_table  . "
638
-			WHERE cat_route = '" . $this->db->sql_escape($route) . "'
637
+			FROM ' . $this->categories_table."
638
+			WHERE cat_route = '" . $this->db->sql_escape($route)."'
639 639
 				AND cat_id <> " . $this->cat_id;
640 640
 		$result = $this->db->sql_query_limit($sql, 1);
641 641
 		$row = $this->db->sql_fetchrow($result);
@@ -685,10 +685,10 @@  discard block
 block discarded – undo
685 685
 			'S_CAT_PARENT_ID'	=> $this->cat_data['parent_id'],
686 686
 			'S_ADD_ACTION'		=> ($this->action == 'add') ? true : false,
687 687
 
688
-			'U_BACK'			=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
689
-			'U_EDIT_ACTION'		=> $this->u_action . "&amp;parent_id={$this->parent_id}&amp;action=$this->action&amp;c=$this->cat_id",
688
+			'U_BACK'			=> $this->u_action.'&amp;parent_id='.$this->parent_id,
689
+			'U_EDIT_ACTION'		=> $this->u_action."&amp;parent_id={$this->parent_id}&amp;action=$this->action&amp;c=$this->cat_id",
690 690
 
691
-			'L_TITLE'					=> $this->language->lang('DIR_' . strtoupper($this->action) . '_CAT'),
691
+			'L_TITLE'					=> $this->language->lang('DIR_'.strtoupper($this->action).'_CAT'),
692 692
 			'ERROR_MSG'					=> (sizeof($this->errors)) ? implode('<br />', $this->errors) : '',
693 693
 			'ICON_IMAGE'				=> ($this->cat_data['cat_icon']) ? $this->get_img_path('icons', $this->cat_data['cat_icon']) : 'images/spacer.gif',
694 694
 
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 	private function _get_cat_info($cat_id)
733 733
 	{
734 734
 		$sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, cat_route, 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
735
-			FROM ' . $this->categories_table . '
735
+			FROM ' . $this->categories_table.'
736 736
 			WHERE cat_id = ' . (int) $cat_id;
737 737
 		$result = $this->db->sql_query($sql);
738 738
 		$row = $this->db->sql_fetchrow($result);
@@ -797,7 +797,7 @@  discard block
 block discarded – undo
797 797
 		{
798 798
 			if ($cat_data_sql['cat_cron_enable'])
799 799
 			{
800
-				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400;
800
+				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400;
801 801
 			}
802 802
 
803 803
 			$this->cat_data = $this->nestedset_category->insert($cat_data_sql);
@@ -820,13 +820,13 @@  discard block
 block discarded – undo
820 820
 
821 821
 			if ($cat_data_sql['cat_cron_enable'] && ($row['cat_cron_freq'] != $cat_data_sql['cat_cron_freq'] || !$row['cat_cron_enable']))
822 822
 			{
823
-				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400;
823
+				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400;
824 824
 			}
825 825
 
826 826
 			if ($row['cat_name'] != $cat_data_sql['cat_name'])
827 827
 			{
828 828
 				// the cat name has changed, clear the parents list of all categories (for safety)
829
-				$sql = 'UPDATE ' . $this->categories_table . "
829
+				$sql = 'UPDATE '.$this->categories_table."
830 830
 					SET cat_parents = ''";
831 831
 				$this->db->sql_query($sql);
832 832
 			}
@@ -834,8 +834,8 @@  discard block
 block discarded – undo
834 834
 			// Setting the cat id to the categorie id is not really received well by some dbs. ;)
835 835
 			unset($cat_data_sql['cat_id']);
836 836
 
837
-			$sql = 'UPDATE ' . $this->categories_table . '
838
-				SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql) . '
837
+			$sql = 'UPDATE '.$this->categories_table.'
838
+				SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql).'
839 839
 				WHERE cat_id = ' . (int) $this->cat_id;
840 840
 			$this->db->sql_query($sql);
841 841
 
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
 				$log_action_links = 'MOVE_LINKS';
877 877
 
878 878
 				$sql = 'SELECT cat_name
879
-					FROM ' . $this->categories_table . '
879
+					FROM ' . $this->categories_table.'
880 880
 					WHERE cat_id = ' . (int) $links_to_id;
881 881
 				$result = $this->db->sql_query($sql);
882 882
 				$row = $this->db->sql_fetchrow($result);
@@ -976,12 +976,12 @@  discard block
 block discarded – undo
976 976
 	*/
977 977
 	private function _move_cat_content($from_id, $to_id)
978 978
 	{
979
-		$sql = 'UPDATE ' . $this->links_table . '
980
-			SET link_cat = ' . (int) $to_id . '
979
+		$sql = 'UPDATE '.$this->links_table.'
980
+			SET link_cat = ' . (int) $to_id.'
981 981
 			WHERE link_cat = ' . (int) $from_id;
982 982
 		$this->db->sql_query($sql);
983 983
 
984
-		$sql = 'DELETE FROM ' . $this->watch_table . '
984
+		$sql = 'DELETE FROM '.$this->watch_table.'
985 985
 			WHERE cat_id = ' . (int) $from_id;
986 986
 		$this->db->sql_query($sql);
987 987
 
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
 
1000 1000
 		// Before we remove anything we make sure we are able to adjust the post counts later. ;)
1001 1001
 		$sql = 'SELECT link_id, link_banner
1002
-			FROM ' . $this->links_table . '
1002
+			FROM ' . $this->links_table.'
1003 1003
 			WHERE link_cat = ' . (int) $this->cat_id;
1004 1004
 		$result = $this->db->sql_query($sql);
1005 1005
 
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
 
1031 1031
 			foreach ($link_datas_ary as $table => $field)
1032 1032
 			{
1033
-				$this->db->sql_query("DELETE FROM $table WHERE " . $this->db->sql_in_set($field, $link_ids));
1033
+				$this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $link_ids));
1034 1034
 			}
1035 1035
 		}
1036 1036
 
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
 
1043 1043
 		foreach ($cat_datas_ary as $table => $field)
1044 1044
 		{
1045
-			$this->db->sql_query("DELETE FROM $table WHERE $field = " . (int) $this->cat_id);
1045
+			$this->db->sql_query("DELETE FROM $table WHERE $field = ".(int) $this->cat_id);
1046 1046
 		}
1047 1047
 
1048 1048
 		$this->db->sql_transaction('commit');
@@ -1057,15 +1057,15 @@  discard block
 block discarded – undo
1057 1057
 	private function _sync_dir_cat($cat_id)
1058 1058
 	{
1059 1059
 		$sql = 'SELECT COUNT(link_id) AS num_links
1060
-			FROM ' . $this->links_table . '
1061
-			WHERE link_cat = ' . (int) $cat_id . '
1060
+			FROM ' . $this->links_table.'
1061
+			WHERE link_cat = ' . (int) $cat_id.'
1062 1062
 				AND link_active = 1';
1063 1063
 		$result = $this->db->sql_query($sql);
1064 1064
 		$total_links = (int) $this->db->sql_fetchfield('num_links');
1065 1065
 		$this->db->sql_freeresult($result);
1066 1066
 
1067
-		$sql = 'UPDATE ' . $this->categories_table . '
1068
-			SET cat_links = ' . $total_links . '
1067
+		$sql = 'UPDATE '.$this->categories_table.'
1068
+			SET cat_links = ' . $total_links.'
1069 1069
 			WHERE cat_id = ' . (int) $cat_id;
1070 1070
 		$this->db->sql_query($sql);
1071 1071
 	}
@@ -1085,33 +1085,33 @@  discard block
 block discarded – undo
1085 1085
 			'link_vote'		=> 0,
1086 1086
 		);
1087 1087
 
1088
-		$sql = 'UPDATE ' . $this->links_table . '
1089
-			SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
1090
-			WHERE link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop;
1088
+		$sql = 'UPDATE '.$this->links_table.'
1089
+			SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).'
1090
+			WHERE link_id BETWEEN ' . (int) $start.' AND '.(int) $stop;
1091 1091
 		$this->db->sql_query($sql);
1092 1092
 
1093
-		$sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM ' . $this->votes_table . '
1094
-			WHERE vote_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . '
1093
+		$sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM '.$this->votes_table.'
1094
+			WHERE vote_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.'
1095 1095
 			GROUP BY vote_link_id';
1096 1096
 		$result = $this->db->sql_query($sql);
1097 1097
 		while ($tmp = $this->db->sql_fetchrow($result))
1098 1098
 		{
1099
-			$sql = 'UPDATE ' . $this->links_table . '
1100
-				SET link_note = ' . (int) $tmp['total'] . ', link_vote = ' . (int) $tmp['nb_vote'] . '
1099
+			$sql = 'UPDATE '.$this->links_table.'
1100
+				SET link_note = ' . (int) $tmp['total'].', link_vote = '.(int) $tmp['nb_vote'].'
1101 1101
 				WHERE link_id = ' . (int) $tmp['vote_link_id'];
1102 1102
 			$this->db->sql_query($sql);
1103 1103
 		}
1104 1104
 		$this->db->sql_freeresult($result);
1105 1105
 
1106 1106
 		$sql = 'SELECT 	comment_link_id, COUNT(comment_id) AS nb_comment
1107
-			FROM ' . $this->comments_table . '
1108
-			WHERE comment_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . '
1107
+			FROM ' . $this->comments_table.'
1108
+			WHERE comment_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.'
1109 1109
 			GROUP BY comment_link_id';
1110 1110
 		$result = $this->db->sql_query($sql);
1111 1111
 		while ($tmp = $this->db->sql_fetchrow($result))
1112 1112
 		{
1113
-			$sql = 'UPDATE ' . $this->links_table . '
1114
-				SET link_comment = ' . (int) $tmp['nb_comment'] . '
1113
+			$sql = 'UPDATE '.$this->links_table.'
1114
+				SET link_comment = ' . (int) $tmp['nb_comment'].'
1115 1115
 				WHERE link_id = ' . (int) $tmp['comment_link_id'];
1116 1116
 			$this->db->sql_query($sql);
1117 1117
 		}
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
 
1137 1137
 			foreach ($img_ary as $img)
1138 1138
 			{
1139
-				$img = $path . $img;
1139
+				$img = $path.$img;
1140 1140
 				$selected = '';
1141 1141
 
1142 1142
 				if (strlen($img) > 255)
@@ -1149,7 +1149,7 @@  discard block
 block discarded – undo
1149 1149
 					$selected = ' selected="selected"';
1150 1150
 				}
1151 1151
 
1152
-				$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
1152
+				$filename_list .= '<option value="'.htmlspecialchars($img).'"'.$selected.'>'.$img.'</option>';
1153 1153
 			}
1154 1154
 		}
1155 1155
 
Please login to merge, or discard this patch.
controller/acp/main.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
 	*/
40 40
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, \phpbb\request\request $request, \phpbb\template\template $template)
41 41
 	{
42
-		$this->db			= $db;
42
+		$this->db = $db;
43 43
 		$this->language		= $language;
44 44
 		$this->template		= $template;
45
-		$this->request		= $request;
45
+		$this->request = $request;
46 46
 	}
47 47
 
48 48
 	/**
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 			{
149 149
 				if ($file[0] != '.' && $file[0] != '..' && strpos($file, 'index.') === false && strpos($file, '.db') === false)
150 150
 				{
151
-					$banners_dir_size += filesize($banners_path . $file);
151
+					$banners_dir_size += filesize($banners_path.$file);
152 152
 				}
153 153
 			}
154 154
 			closedir($banners_dir);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 			'U_ACTION'			=> $this->u_action,
168 168
 
169 169
 			'TOTAL_CATS'		=> $total_cats,
170
-			'TOTAL_LINKS'		=> $total_links-$waiting_links,
170
+			'TOTAL_LINKS'		=> $total_links - $waiting_links,
171 171
 			'WAITING_LINKS'		=> $waiting_links,
172 172
 			'TOTAL_COMMENTS'	=> $total_comments,
173 173
 			'TOTAL_VOTES'		=> $total_votes,
@@ -188,9 +188,9 @@  discard block
 block discarded – undo
188 188
 		switch ($action)
189 189
 		{
190 190
 			case 'votes':
191
-				$this->db->sql_query('DELETE FROM ' . $this->votes_table);
191
+				$this->db->sql_query('DELETE FROM '.$this->votes_table);
192 192
 
193
-				$sql = 'UPDATE ' . $this->links_table . '
193
+				$sql = 'UPDATE '.$this->links_table.'
194 194
 					SET link_vote = 0, link_note = 0';
195 195
 				$this->db->sql_query($sql);
196 196
 
@@ -205,15 +205,15 @@  discard block
 block discarded – undo
205 205
 				{
206 206
 					case 'sqlite':
207 207
 					case 'firebird':
208
-						$this->db->sql_query('DELETE FROM ' . $this->comments_table);
208
+						$this->db->sql_query('DELETE FROM '.$this->comments_table);
209 209
 					break;
210 210
 
211 211
 					default:
212
-						$this->db->sql_query('TRUNCATE TABLE ' . $this->comments_table);
212
+						$this->db->sql_query('TRUNCATE TABLE '.$this->comments_table);
213 213
 					break;
214 214
 				}
215 215
 
216
-				$sql = 'UPDATE ' . $this->links_table . '
216
+				$sql = 'UPDATE '.$this->links_table.'
217 217
 					SET link_comment = 0';
218 218
 				$this->db->sql_query($sql);
219 219
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 				break;
226 226
 
227 227
 			case 'clicks':
228
-				$sql = 'UPDATE ' . $this->links_table . '
228
+				$sql = 'UPDATE '.$this->links_table.'
229 229
 					SET link_view = 0';
230 230
 				$this->db->sql_query($sql);
231 231
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 			{
280 280
 				$physical_files[] = $img;
281 281
 			}
282
-			$sql = 'SELECT link_banner FROM ' . $this->links_table . "
282
+			$sql = 'SELECT link_banner FROM '.$this->links_table."
283 283
 				WHERE link_banner <> ''";
284 284
 			$result = $this->db->sql_query($sql);
285 285
 
Please login to merge, or discard this patch.