Completed
Push — master ( 5746ba...0240bd )
by Erwan
02:21
created
search/fulltext_directory.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -16,32 +16,32 @@
 block discarded – undo
16 16
 	protected $db;
17 17
 
18 18
 	/**
19
-	* Constructor
20
-	*
21
-	* @param \phpbb\db\driver\driver_interface $db
22
-	*/
19
+	 * Constructor
20
+	 *
21
+	 * @param \phpbb\db\driver\driver_interface $db
22
+	 */
23 23
 	public function __construct(\phpbb\db\driver\driver_interface $db)
24 24
 	{
25 25
 		$this->db = $db;
26 26
 	}
27 27
 
28 28
 	/**
29
-	* Performs a search on keywords depending on display specific params. You have to run split_keywords() first
30
-	*
31
-	* @param	array		$keywords_ary		contains each words to search
32
-	* @param	string		$fields				contains either titleonly (link titles should be searched), desconly (only description bodies should be searched)
33
-	* @param	string		$terms				is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
34
-	* @param	array		$sort_by_sql		contains SQL code for the ORDER BY part of a query
35
-	* @param	string		$sort_key			is the key of $sort_by_sql for the selected sorting
36
-	* @param	string		$sort_dir			is either a or d representing ASC and DESC
37
-	* @param	string		$sort_days			specifies the maximum amount of days a post may be old
38
-	* @param	array		$ex_cid_ary			specifies an array of category ids which should not be searched
39
-	* @param	int			$cat_id				is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
40
-	* @param	array		&$id_ary			passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
41
-	* @param	int			$start				indicates the first index of the page
42
-	* @param	int			$per_page			number of ids each page is supposed to contain
43
-	* @return	int								total number of results
44
-	*/
29
+	 * Performs a search on keywords depending on display specific params. You have to run split_keywords() first
30
+	 *
31
+	 * @param	array		$keywords_ary		contains each words to search
32
+	 * @param	string		$fields				contains either titleonly (link titles should be searched), desconly (only description bodies should be searched)
33
+	 * @param	string		$terms				is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
34
+	 * @param	array		$sort_by_sql		contains SQL code for the ORDER BY part of a query
35
+	 * @param	string		$sort_key			is the key of $sort_by_sql for the selected sorting
36
+	 * @param	string		$sort_dir			is either a or d representing ASC and DESC
37
+	 * @param	string		$sort_days			specifies the maximum amount of days a post may be old
38
+	 * @param	array		$ex_cid_ary			specifies an array of category ids which should not be searched
39
+	 * @param	int			$cat_id				is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
40
+	 * @param	array		&$id_ary			passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
41
+	 * @param	int			$start				indicates the first index of the page
42
+	 * @param	int			$per_page			number of ids each page is supposed to contain
43
+	 * @return	int								total number of results
44
+	 */
45 45
 	public function keyword_search($keywords_ary, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_cid_ary, $cat_id, &$id_ary, $start, $per_page)
46 46
 	{
47 47
 		$matches = array();
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -67,20 +67,20 @@  discard block
 block discarded – undo
67 67
 			$match_search_query = '';
68 68
 			foreach ($matches as $match)
69 69
 			{
70
-				$match_search_query .= (($match_search_query) ? ' OR ' : '') . 'LOWER('. $match . ') ';
71
-				$match_search_query .= $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), $this->db->get_any_char() . strtolower($word) . $this->db->get_any_char()));
70
+				$match_search_query .= (($match_search_query) ? ' OR ' : '').'LOWER('.$match.') ';
71
+				$match_search_query .= $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), $this->db->get_any_char().strtolower($word).$this->db->get_any_char()));
72 72
 			}
73
-			$search_query .= ((!$search_query) ? '' : (($terms == 'all') ? ' AND ' : ' OR ')) . '(' . $match_search_query . ')';
73
+			$search_query .= ((!$search_query) ? '' : (($terms == 'all') ? ' AND ' : ' OR ')).'('.$match_search_query.')';
74 74
 		}
75 75
 		$direction = (($sort_dir == 'd') ? 'DESC' : 'ASC');
76 76
 
77 77
 		if (is_array($sort_by_sql[$sort_key]))
78 78
 		{
79
-			$sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
79
+			$sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction;
80 80
 		}
81 81
 		else
82 82
 		{
83
-			$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
83
+			$sql_sort_order = $sort_by_sql[$sort_key].' '.$direction;
84 84
 		}
85 85
 
86 86
 		$sql_array = array(
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
 			'FROM'		=> array(
89 89
 					DIR_LINK_TABLE	=> 'l'),
90 90
 			'WHERE'		=> 'l.link_active = 1
91
-				' . (($search_query) ? 'AND (' . $search_query . ')' : '') . '
92
-				' . (sizeof($ex_cid_ary) ? ' AND ' . $this->db->sql_in_set('l.link_cat', $ex_cid_ary, true) : '') . '
93
-				' . (($cat_id) ? ' AND ' . $this->db->sql_in_set('l.link_cat', $cat_id) : '') . '
94
-				' . (($sort_days) ? ' AND l.link_time >= ' . (time() - ($sort_days * 86400)) : ''),
91
+				' . (($search_query) ? 'AND ('.$search_query.')' : '').'
92
+				' . (sizeof($ex_cid_ary) ? ' AND '.$this->db->sql_in_set('l.link_cat', $ex_cid_ary, true) : '').'
93
+				' . (($cat_id) ? ' AND '.$this->db->sql_in_set('l.link_cat', $cat_id) : '').'
94
+				' . (($sort_days) ? ' AND l.link_time >= '.(time() - ($sort_days * 86400)) : ''),
95 95
 			'ORDER_BY'	=> $sql_sort_order
96 96
 		);
97 97
 
Please login to merge, or discard this patch.
controller/acp/cat.php 2 patches
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -67,19 +67,19 @@  discard block
 block discarded – undo
67 67
 	private $update;
68 68
 
69 69
 	/**
70
-	* Constructor
71
-	*
72
-	* @param \phpbb\cache\service								$cache				Cache object
73
-	* @param \phpbb\db\driver\driver_interface 					$db					Database object
74
-	* @param \phpbb\controller\helper							$helper				Helper object
75
-	* @param \phpbb\log\log										$log				Log object
76
-	* @param \phpbb\request\request								$request			Request object
77
-	* @param \phpbb\template\template							$template			Template object
78
-	* @param \phpbb\user										$user				User object
79
-	* @param \ernadoo\phpbbdirectory\core\categorie				$categorie			PhpBB Directory extension categorie object
80
-	* @param \ernadoo\phpbbdirectory\core\helper				$dir_helper			PhpBB Directory extension helper object
81
-	* @param \ernadoo\phpbbdirectory\core\nestedset_category	$nestedset_category	PhpBB Directory extension nestedset object
82
-	*/
70
+	 * Constructor
71
+	 *
72
+	 * @param \phpbb\cache\service								$cache				Cache object
73
+	 * @param \phpbb\db\driver\driver_interface 					$db					Database object
74
+	 * @param \phpbb\controller\helper							$helper				Helper object
75
+	 * @param \phpbb\log\log										$log				Log object
76
+	 * @param \phpbb\request\request								$request			Request object
77
+	 * @param \phpbb\template\template							$template			Template object
78
+	 * @param \phpbb\user										$user				User object
79
+	 * @param \ernadoo\phpbbdirectory\core\categorie				$categorie			PhpBB Directory extension categorie object
80
+	 * @param \ernadoo\phpbbdirectory\core\helper				$dir_helper			PhpBB Directory extension helper object
81
+	 * @param \ernadoo\phpbbdirectory\core\nestedset_category	$nestedset_category	PhpBB Directory extension nestedset object
82
+	 */
83 83
 	public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\helper $dir_helper, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category)
84 84
 	{
85 85
 		$this->cache				= $cache;
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
 	}
104 104
 
105 105
 	/**
106
-	* Initialize defaults data for add page
107
-	*
108
-	* @return null
109
-	*/
106
+	 * Initialize defaults data for add page
107
+	 *
108
+	 * @return null
109
+	 */
110 110
 	public function action_add()
111 111
 	{
112 112
 		$this->cat_id = $this->parent_id;
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
 	}
141 141
 
142 142
 	/**
143
-	* Display deleting page
144
-	*
145
-	* @return null
146
-	*/
143
+	 * Display deleting page
144
+	 *
145
+	 * @return null
146
+	 */
147 147
 	public function action_delete()
148 148
 	{
149 149
 		if (!$this->cat_id)
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
 	}
195 195
 
196 196
 	/**
197
-	* Initialize data for edit page
198
-	*
199
-	* @return null
200
-	*/
197
+	 * Initialize data for edit page
198
+	 *
199
+	 * @return null
200
+	 */
201 201
 	public function action_edit()
202 202
 	{
203 203
 		$row = $this->_get_cat_info($this->cat_id);
@@ -224,10 +224,10 @@  discard block
 block discarded – undo
224 224
 	}
225 225
 
226 226
 	/**
227
-	* Move order categories
228
-	*
229
-	* @return null
230
-	*/
227
+	 * Move order categories
228
+	 *
229
+	 * @return null
230
+	 */
231 231
 	public function action_move()
232 232
 	{
233 233
 		if (!$this->cat_id)
@@ -270,10 +270,10 @@  discard block
 block discarded – undo
270 270
 	}
271 271
 
272 272
 	/**
273
-	* Display progress bar for syncinc categories
274
-	*
275
-	* @return null
276
-	*/
273
+	 * Display progress bar for syncinc categories
274
+	 *
275
+	 * @return null
276
+	 */
277 277
 	public function action_progress_bar()
278 278
 	{
279 279
 		$start = $this->request->variable('start', 0);
@@ -294,10 +294,10 @@  discard block
 block discarded – undo
294 294
 	}
295 295
 
296 296
 	/**
297
-	* Get link's ID interval for _sync_dir_links()
298
-	*
299
-	* @return null
300
-	*/
297
+	 * Get link's ID interval for _sync_dir_links()
298
+	 *
299
+	 * @return null
300
+	 */
301 301
 	public function action_sync()
302 302
 	{
303 303
 		if (!$this->cat_id)
@@ -381,10 +381,10 @@  discard block
 block discarded – undo
381 381
 	}
382 382
 
383 383
 	/**
384
-	* Sync category data
385
-	*
386
-	* @return null
387
-	*/
384
+	 * Sync category data
385
+	 *
386
+	 * @return null
387
+	 */
388 388
 	public function action_sync_cat()
389 389
 	{
390 390
 		$sql = 'SELECT cat_name
@@ -408,10 +408,10 @@  discard block
 block discarded – undo
408 408
 	}
409 409
 
410 410
 	/**
411
-	* Display categories page
412
-	*
413
-	* @return null
414
-	*/
411
+	 * Display categories page
412
+	 *
413
+	 * @return null
414
+	 */
415 415
 	public function display_cats()
416 416
 	{
417 417
 		// Default management page
@@ -506,22 +506,22 @@  discard block
 block discarded – undo
506 506
 	}
507 507
 
508 508
 	/**
509
-	* Set page url
510
-	*
511
-	* @param	string $u_action Custom form action
512
-	* @return	null
513
-	* @access	public
514
-	*/
509
+	 * Set page url
510
+	 *
511
+	 * @param	string $u_action Custom form action
512
+	 * @return	null
513
+	 * @access	public
514
+	 */
515 515
 	public function set_page_url($u_action)
516 516
 	{
517 517
 		$this->u_action = $u_action;
518 518
 	}
519 519
 
520 520
 	/**
521
-	* Update cat table
522
-	*
523
-	* @return null
524
-	*/
521
+	 * Update cat table
522
+	 *
523
+	 * @return null
524
+	 */
525 525
 	public function update()
526 526
 	{
527 527
 		if (!check_form_key($this->form_key))
@@ -615,11 +615,11 @@  discard block
 block discarded – undo
615 615
 	}
616 616
 
617 617
 	/**
618
-	* Display form
619
-	*
620
-	* @param	string $parents_list	Drop-down list
621
-	* @return	null
622
-	*/
618
+	 * Display form
619
+	 *
620
+	 * @param	string $parents_list	Drop-down list
621
+	 * @return	null
622
+	 */
623 623
 	private function _display_cat_form($parents_list)
624 624
 	{
625 625
 		$dir_cat_desc_data = array(
@@ -689,11 +689,11 @@  discard block
 block discarded – undo
689 689
 	}
690 690
 
691 691
 	/**
692
-	* Get category details
693
-	*
694
-	* @param	int		$cat_id	The category ID
695
-	* @return 	array
696
-	*/
692
+	 * Get category details
693
+	 *
694
+	 * @param	int		$cat_id	The category ID
695
+	 * @return 	array
696
+	 */
697 697
 	private function _get_cat_info($cat_id)
698 698
 	{
699 699
 		$sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next
@@ -712,10 +712,10 @@  discard block
 block discarded – undo
712 712
 	}
713 713
 
714 714
 	/**
715
-	* Update category data
716
-	*
717
-	* @return array
718
-	*/
715
+	 * Update category data
716
+	 *
717
+	 * @return array
718
+	 */
719 719
 	private function _update_cat_data()
720 720
 	{
721 721
 		if (!$this->cat_data['cat_name'])
@@ -809,14 +809,14 @@  discard block
 block discarded – undo
809 809
 	}
810 810
 
811 811
 	/**
812
-	* Remove complete category
813
-	*
814
-	* @param	string	$action_links	Action for categories links
815
-	* @param	string	$action_subcats	Action for sub-categories
816
-	* @param	int		$links_to_id	New category ID for links
817
-	* @param	int		$subcats_to_id	New category ID for sub-categories
818
-	* @return 	array
819
-	*/
812
+	 * Remove complete category
813
+	 *
814
+	 * @param	string	$action_links	Action for categories links
815
+	 * @param	string	$action_subcats	Action for sub-categories
816
+	 * @param	int		$links_to_id	New category ID for links
817
+	 * @param	int		$subcats_to_id	New category ID for sub-categories
818
+	 * @return 	array
819
+	 */
820 820
 	private function _delete_cat($action_links = 'delete', $action_subcats = 'delete', $links_to_id = 0, $subcats_to_id = 0)
821 821
 	{
822 822
 		$this->cat_data = $this->_get_cat_info($this->cat_id);
@@ -933,12 +933,12 @@  discard block
 block discarded – undo
933 933
 	}
934 934
 
935 935
 	/**
936
-	* Move category content from one to another forum
937
-	*
938
-	* @param	int	$from_id
939
-	* @param	int	$to_id
940
-	* @return	null
941
-	*/
936
+	 * Move category content from one to another forum
937
+	 *
938
+	 * @param	int	$from_id
939
+	 * @param	int	$to_id
940
+	 * @return	null
941
+	 */
942 942
 	private function _move_cat_content($from_id, $to_id)
943 943
 	{
944 944
 		$sql = 'UPDATE ' . DIR_LINK_TABLE . '
@@ -954,10 +954,10 @@  discard block
 block discarded – undo
954 954
 	}
955 955
 
956 956
 	/**
957
-	* Delete category content
958
-	*
959
-	* @return array
960
-	*/
957
+	 * Delete category content
958
+	 *
959
+	 * @return array
960
+	 */
961 961
 	private function _delete_cat_content()
962 962
 	{
963 963
 		$this->db->sql_transaction('begin');
@@ -1016,11 +1016,11 @@  discard block
 block discarded – undo
1016 1016
 	}
1017 1017
 
1018 1018
 	/**
1019
-	* Update links counter
1020
-	*
1021
-	* @param	int $cat_id	The category ID
1022
-	* @return	null
1023
-	*/
1019
+	 * Update links counter
1020
+	 *
1021
+	 * @param	int $cat_id	The category ID
1022
+	 * @return	null
1023
+	 */
1024 1024
 	private function _sync_dir_cat($cat_id)
1025 1025
 	{
1026 1026
 		$sql = 'SELECT COUNT(link_id) AS num_links
@@ -1038,12 +1038,12 @@  discard block
 block discarded – undo
1038 1038
 	}
1039 1039
 
1040 1040
 	/**
1041
-	* Update link data (note, vote, comment)
1042
-	*
1043
-	* @param	int	$start
1044
-	* @param	int	$stop
1045
-	* @return	null
1046
-	*/
1041
+	 * Update link data (note, vote, comment)
1042
+	 *
1043
+	 * @param	int	$start
1044
+	 * @param	int	$stop
1045
+	 * @return	null
1046
+	 */
1047 1047
 	private function _sync_dir_links($start, $stop)
1048 1048
 	{
1049 1049
 		$sql_ary = array(
@@ -1086,12 +1086,12 @@  discard block
 block discarded – undo
1086 1086
 	}
1087 1087
 
1088 1088
 	/**
1089
-	* Display icons drop-down list
1090
-	*
1091
-	* @param	string	$icons_path
1092
-	* @param	string	$img_selected
1093
-	* @return	string
1094
-	*/
1089
+	 * Display icons drop-down list
1090
+	 *
1091
+	 * @param	string	$icons_path
1092
+	 * @param	string	$img_selected
1093
+	 * @return	string
1094
+	 */
1095 1095
 	private function _get_dir_icon_list($icons_path, $img_selected)
1096 1096
 	{
1097 1097
 		$imglist = filelist($icons_path, '');
Please login to merge, or discard this patch.
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -82,23 +82,23 @@  discard block
 block discarded – undo
82 82
 	*/
83 83
 	public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\helper $dir_helper, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category)
84 84
 	{
85
-		$this->cache				= $cache;
86
-		$this->db					= $db;
87
-		$this->helper				= $helper;
85
+		$this->cache = $cache;
86
+		$this->db = $db;
87
+		$this->helper = $helper;
88 88
 		$this->phpbb_log			= $log;
89
-		$this->request				= $request;
89
+		$this->request = $request;
90 90
 		$this->template				= $template;
91
-		$this->user					= $user;
91
+		$this->user = $user;
92 92
 		$this->categorie			= $categorie;
93
-		$this->dir_helper			= $dir_helper;
94
-		$this->nestedset_category	= $nestedset_category;
93
+		$this->dir_helper = $dir_helper;
94
+		$this->nestedset_category = $nestedset_category;
95 95
 
96 96
 		$this->form_key = 'acp_dir_cat';
97 97
 		add_form_key($this->form_key);
98 98
 
99 99
 		$this->action		= $this->request->variable('action', '');
100 100
 		$this->cat_id		= $request->variable('c', 0);
101
-		$this->parent_id	= $request->variable('parent_id', 0);
101
+		$this->parent_id = $request->variable('parent_id', 0);
102 102
 		$this->update		= ($this->request->is_set_post('update')) ? true : false;
103 103
 	}
104 104
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	{
149 149
 		if (!$this->cat_id)
150 150
 		{
151
-			trigger_error($this->user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
151
+			trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING);
152 152
 		}
153 153
 
154 154
 		$this->cat_data = $this->_get_cat_info($this->cat_id);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 		$cat_list = $this->categorie->make_cat_select((int) $this->cat_data['parent_id'], $subcats_id);
165 165
 
166 166
 		$sql = 'SELECT cat_id
167
-			FROM ' . DIR_CAT_TABLE . '
167
+			FROM ' . DIR_CAT_TABLE.'
168 168
 			WHERE cat_id <> ' . (int) $this->cat_id;
169 169
 		$result = $this->db->sql_query_limit($sql, 1);
170 170
 
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
 
181 181
 		$this->template->assign_vars(array(
182 182
 			'S_DELETE_DIR_CAT'		=> true,
183
-			'U_ACTION'				=> $this->u_action . "&amp;parent_id={$parent_id}&amp;action=delete&amp;c=$this->cat_id",
184
-			'U_BACK'				=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
183
+			'U_ACTION'				=> $this->u_action."&amp;parent_id={$parent_id}&amp;action=delete&amp;c=$this->cat_id",
184
+			'U_BACK'				=> $this->u_action.'&amp;parent_id='.$this->parent_id,
185 185
 
186 186
 			'DIR_CAT_NAME'			=> $this->cat_data['cat_name'],
187 187
 			'S_HAS_SUBCATS'			=> ($this->cat_data['right_id'] - $this->cat_data['left_id'] > 1) ? true : false,
@@ -232,11 +232,11 @@  discard block
 block discarded – undo
232 232
 	{
233 233
 		if (!$this->cat_id)
234 234
 		{
235
-			trigger_error($this->user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
235
+			trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
236 236
 		}
237 237
 
238 238
 		$sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id
239
-			FROM ' . DIR_CAT_TABLE . '
239
+			FROM ' . DIR_CAT_TABLE.'
240 240
 			WHERE cat_id = ' . (int) $this->cat_id;
241 241
 		$result = $this->db->sql_query($sql);
242 242
 		$row = $this->db->sql_fetchrow($result);
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 
245 245
 		if (!$row)
246 246
 		{
247
-			trigger_error($this->user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
247
+			trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
248 248
 		}
249 249
 
250 250
 		try
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
 		if ($move_cat_name !== false)
260 260
 		{
261
-			$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));
261
+			$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));
262 262
 			$this->cache->destroy('sql', DIR_CAT_TABLE);
263 263
 		}
264 264
 
@@ -302,13 +302,13 @@  discard block
 block discarded – undo
302 302
 	{
303 303
 		if (!$this->cat_id)
304 304
 		{
305
-			trigger_error($this->user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
305
+			trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
306 306
 		}
307 307
 
308 308
 		@set_time_limit(0);
309 309
 
310 310
 		$sql = 'SELECT cat_name, cat_links
311
-			FROM ' . DIR_CAT_TABLE . '
311
+			FROM ' . DIR_CAT_TABLE.'
312 312
 			WHERE cat_id = ' . (int) $this->cat_id;
313 313
 		$result = $this->db->sql_query($sql);
314 314
 		$row = $this->db->sql_fetchrow($result);
@@ -316,12 +316,12 @@  discard block
 block discarded – undo
316 316
 
317 317
 		if (!$row)
318 318
 		{
319
-			trigger_error($this->user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
319
+			trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
320 320
 		}
321 321
 
322 322
 		$sql = 'SELECT MIN(link_id) as min_link_id, MAX(link_id) as max_link_id
323
-			FROM ' . DIR_LINK_TABLE . '
324
-			WHERE link_cat = ' . (int) $this->cat_id . '
323
+			FROM ' . DIR_LINK_TABLE.'
324
+			WHERE link_cat = ' . (int) $this->cat_id.'
325 325
 				AND link_active = 1';
326 326
 		$result = $this->db->sql_query($sql);
327 327
 		$row2 = $this->db->sql_fetchrow($result);
@@ -343,23 +343,23 @@  discard block
 block discarded – undo
343 343
 		{
344 344
 			// We really need to find a way of showing statistics... no progress here
345 345
 			$sql = 'SELECT COUNT(link_id) as num_links
346
-				FROM ' . DIR_LINK_TABLE . '
347
-				WHERE link_cat = ' . (int) $this->cat_id . '
346
+				FROM ' . DIR_LINK_TABLE.'
347
+				WHERE link_cat = ' . (int) $this->cat_id.'
348 348
 						AND link_active = 1
349
-						AND link_id BETWEEN ' . $start . ' AND ' . $end;
349
+						AND link_id BETWEEN ' . $start.' AND '.$end;
350 350
 			$result = $this->db->sql_query($sql);
351 351
 			$links_done = $this->request->variable('links_done', 0) + (int) $this->db->sql_fetchfield('num_links');
352 352
 			$this->db->sql_freeresult($result);
353 353
 
354 354
 			$start += $batch_size;
355 355
 
356
-			$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']}";
356
+			$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']}";
357 357
 
358 358
 			meta_refresh(0, $url);
359 359
 
360 360
 			$this->template->assign_vars(array(
361
-				'U_PROGRESS_BAR'		=> $this->u_action . "&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}",
362
-				'UA_PROGRESS_BAR'		=> addslashes($this->u_action . "&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}"),
361
+				'U_PROGRESS_BAR'		=> $this->u_action."&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}",
362
+				'UA_PROGRESS_BAR'		=> addslashes($this->u_action."&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}"),
363 363
 				'S_CONTINUE_SYNC'		=> true,
364 364
 				'L_PROGRESS_EXPLAIN'	=> $this->user->lang('SYNC_IN_PROGRESS_EXPLAIN', $links_done, $row['cat_links']))
365 365
 			);
@@ -367,12 +367,12 @@  discard block
 block discarded – undo
367 367
 			return;
368 368
 		}
369 369
 
370
-		$url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync_cat";
370
+		$url = $this->u_action."&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync_cat";
371 371
 		meta_refresh(0, $url);
372 372
 
373 373
 		$this->template->assign_vars(array(
374
-			'U_PROGRESS_BAR'		=> $this->u_action . '&amp;action=progress_bar',
375
-			'UA_PROGRESS_BAR'		=> addslashes($this->u_action . '&amp;action=progress_bar'),
374
+			'U_PROGRESS_BAR'		=> $this->u_action.'&amp;action=progress_bar',
375
+			'UA_PROGRESS_BAR'		=> addslashes($this->u_action.'&amp;action=progress_bar'),
376 376
 			'S_CONTINUE_SYNC'		=> true,
377 377
 			'L_PROGRESS_EXPLAIN'	=> $this->user->lang('SYNC_IN_PROGRESS_EXPLAIN', 0, $row['cat_links']))
378 378
 		);
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 	public function action_sync_cat()
389 389
 	{
390 390
 		$sql = 'SELECT cat_name
391
-			FROM ' . DIR_CAT_TABLE . '
391
+			FROM ' . DIR_CAT_TABLE.'
392 392
 			WHERE cat_id = ' . (int) $this->cat_id;
393 393
 		$result = $this->db->sql_query($sql);
394 394
 		$row = $this->db->sql_fetchrow($result);
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 
397 397
 		if (!$row)
398 398
 		{
399
-			trigger_error($this->user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
399
+			trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
400 400
 		}
401 401
 
402 402
 		$this->_sync_dir_cat($this->cat_id);
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 		}
422 422
 		else
423 423
 		{
424
-			$navigation = '<a href="' . $this->u_action . '">' . $this->user->lang['DIR_INDEX'] . '</a>';
424
+			$navigation = '<a href="'.$this->u_action.'">'.$this->user->lang['DIR_INDEX'].'</a>';
425 425
 
426 426
 			$cats_nav = $this->nestedset_category->get_path_data($this->parent_id);
427 427
 
@@ -429,11 +429,11 @@  discard block
 block discarded – undo
429 429
 			{
430 430
 				if ($row['cat_id'] == $this->parent_id)
431 431
 				{
432
-					$navigation .= ' -&gt; ' . $row['cat_name'];
432
+					$navigation .= ' -&gt; '.$row['cat_name'];
433 433
 				}
434 434
 				else
435 435
 				{
436
-					$navigation .= ' -&gt; <a href="' . $this->u_action . '&amp;parent_id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a>';
436
+					$navigation .= ' -&gt; <a href="'.$this->u_action.'&amp;parent_id='.$row['cat_id'].'">'.$row['cat_name'].'</a>';
437 437
 				}
438 438
 			}
439 439
 		}
@@ -447,8 +447,8 @@  discard block
 block discarded – undo
447 447
 		}
448 448
 
449 449
 		$sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_name, cat_icon, cat_desc_uid, cat_desc_bitfield, cat_desc, cat_desc_options, cat_links
450
-			FROM ' . DIR_CAT_TABLE . '
451
-			WHERE parent_id = ' . (int) $this->parent_id . '
450
+			FROM ' . DIR_CAT_TABLE.'
451
+			WHERE parent_id = ' . (int) $this->parent_id.'
452 452
 			ORDER BY left_id';
453 453
 		$result = $this->db->sql_query($sql);
454 454
 
@@ -456,23 +456,23 @@  discard block
 block discarded – undo
456 456
 		{
457 457
 			do
458 458
 			{
459
-				$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="' . $this->user->lang['DIR_SUBCAT'] . '" />' : '<img src="images/icon_folder.gif" alt="' . $this->user->lang['FOLDER'] . '" />';
459
+				$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="'.$this->user->lang['DIR_SUBCAT'].'" />' : '<img src="images/icon_folder.gif" alt="'.$this->user->lang['FOLDER'].'" />';
460 460
 
461
-				$url = $this->u_action . "&amp;parent_id=$this->parent_id&amp;c={$row['cat_id']}";
461
+				$url = $this->u_action."&amp;parent_id=$this->parent_id&amp;c={$row['cat_id']}";
462 462
 
463 463
 				$this->template->assign_block_vars('cats', array(
464 464
 					'FOLDER_IMAGE'		=> $folder_image,
465
-					'CAT_IMAGE'			=> ($row['cat_icon']) ? '<img src="' . $this->dir_helper->get_img_path('icons', $row['cat_icon']) . '" alt="" />' : '',
465
+					'CAT_IMAGE'			=> ($row['cat_icon']) ? '<img src="'.$this->dir_helper->get_img_path('icons', $row['cat_icon']).'" alt="" />' : '',
466 466
 					'CAT_NAME'			=> $row['cat_name'],
467 467
 					'CAT_DESCRIPTION'	=> generate_text_for_display($row['cat_desc'], $row['cat_desc_uid'], $row['cat_desc_bitfield'], $row['cat_desc_options']),
468 468
 					'CAT_LINKS'			=> $row['cat_links'],
469 469
 
470
-					'U_CAT'				=> $this->u_action . '&amp;parent_id=' . $row['cat_id'],
471
-					'U_MOVE_UP'			=> $url . '&amp;action=move_up',
472
-					'U_MOVE_DOWN'		=> $url . '&amp;action=move_down',
473
-					'U_EDIT'			=> $url . '&amp;action=edit',
474
-					'U_DELETE'			=> $url . '&amp;action=delete',
475
-					'U_SYNC'			=> $url . '&amp;action=sync')
470
+					'U_CAT'				=> $this->u_action.'&amp;parent_id='.$row['cat_id'],
471
+					'U_MOVE_UP'			=> $url.'&amp;action=move_up',
472
+					'U_MOVE_DOWN'		=> $url.'&amp;action=move_down',
473
+					'U_EDIT'			=> $url.'&amp;action=edit',
474
+					'U_DELETE'			=> $url.'&amp;action=delete',
475
+					'U_SYNC'			=> $url.'&amp;action=sync')
476 476
 				);
477 477
 			}
478 478
 			while ($row = $this->db->sql_fetchrow($result));
@@ -481,14 +481,14 @@  discard block
 block discarded – undo
481 481
 		{
482 482
 			$row = $this->_get_cat_info($this->parent_id);
483 483
 
484
-			$url = $this->u_action . '&amp;parent_id=' . $this->parent_id . '&amp;c=' . $row['cat_id'];
484
+			$url = $this->u_action.'&amp;parent_id='.$this->parent_id.'&amp;c='.$row['cat_id'];
485 485
 
486 486
 			$this->template->assign_vars(array(
487 487
 				'S_NO_CATS'			=> true,
488 488
 
489
-				'U_EDIT'			=> $url . '&amp;action=edit',
490
-				'U_DELETE'			=> $url . '&amp;action=delete',
491
-				'U_SYNC'			=> $url . '&amp;action=sync')
489
+				'U_EDIT'			=> $url.'&amp;action=edit',
490
+				'U_DELETE'			=> $url.'&amp;action=delete',
491
+				'U_SYNC'			=> $url.'&amp;action=sync')
492 492
 			);
493 493
 		}
494 494
 		$this->db->sql_freeresult($result);
@@ -498,10 +498,10 @@  discard block
 block discarded – undo
498 498
 			'NAVIGATION'	=> $navigation,
499 499
 			'CAT_BOX'		=> $cat_box,
500 500
 			'U_SEL_ACTION'	=> $this->u_action,
501
-			'U_ACTION'		=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
501
+			'U_ACTION'		=> $this->u_action.'&amp;parent_id='.$this->parent_id,
502 502
 
503
-			'U_PROGRESS_BAR'	=> $this->u_action . '&amp;action=progress_bar',
504
-			'UA_PROGRESS_BAR'	=> addslashes($this->u_action . '&amp;action=progress_bar'),
503
+			'U_PROGRESS_BAR'	=> $this->u_action.'&amp;action=progress_bar',
504
+			'UA_PROGRESS_BAR'	=> addslashes($this->u_action.'&amp;action=progress_bar'),
505 505
 		));
506 506
 	}
507 507
 
@@ -533,10 +533,10 @@  discard block
 block discarded – undo
533 533
 		switch ($this->action)
534 534
 		{
535 535
 			case 'delete':
536
-				$action_subcats	= $this->request->variable('action_subcats', '');
537
-				$subcats_to_id	= $this->request->variable('subcats_to_id', 0);
538
-				$action_links	= $this->request->variable('action_links', '');
539
-				$links_to_id	= $this->request->variable('links_to_id', 0);
536
+				$action_subcats = $this->request->variable('action_subcats', '');
537
+				$subcats_to_id = $this->request->variable('subcats_to_id', 0);
538
+				$action_links = $this->request->variable('action_links', '');
539
+				$links_to_id = $this->request->variable('links_to_id', 0);
540 540
 
541 541
 				try
542 542
 				{
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 
555 555
 				$this->cache->destroy('sql', DIR_CAT_TABLE);
556 556
 
557
-				trigger_error($this->user->lang['DIR_CAT_DELETED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
557
+				trigger_error($this->user->lang['DIR_CAT_DELETED'].adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id));
558 558
 
559 559
 				break;
560 560
 
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
 
608 608
 					$message = ($this->action == 'add') ? $this->user->lang['DIR_CAT_CREATED'] : $this->user->lang['DIR_CAT_UPDATED'];
609 609
 
610
-					trigger_error($message . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
610
+					trigger_error($message.adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id));
611 611
 				}
612 612
 
613 613
 			break;
@@ -652,10 +652,10 @@  discard block
 block discarded – undo
652 652
 			'S_CAT_PARENT_ID'	=> $this->cat_data['parent_id'],
653 653
 			'S_ADD_ACTION'		=> ($this->action == 'add') ? true : false,
654 654
 
655
-			'U_BACK'			=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
656
-			'U_EDIT_ACTION'		=> $this->u_action . "&amp;parent_id={$this->parent_id}&amp;action=$this->action&amp;c=$this->cat_id",
655
+			'U_BACK'			=> $this->u_action.'&amp;parent_id='.$this->parent_id,
656
+			'U_EDIT_ACTION'		=> $this->u_action."&amp;parent_id={$this->parent_id}&amp;action=$this->action&amp;c=$this->cat_id",
657 657
 
658
-			'L_TITLE'					=> $this->user->lang['DIR_' . strtoupper($this->action) . '_CAT'],
658
+			'L_TITLE'					=> $this->user->lang['DIR_'.strtoupper($this->action).'_CAT'],
659 659
 			'ERROR_MSG'					=> (sizeof($this->errors)) ? implode('<br />', $this->errors) : '',
660 660
 			'ICON_IMAGE'				=> ($this->cat_data['cat_icon']) ? $this->dir_helper->get_img_path('icons', $this->cat_data['cat_icon']) : 'images/spacer.gif',
661 661
 
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
 	private function _get_cat_info($cat_id)
698 698
 	{
699 699
 		$sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next
700
-			FROM ' . DIR_CAT_TABLE . '
700
+			FROM ' . DIR_CAT_TABLE.'
701 701
 			WHERE cat_id = ' . (int) $cat_id;
702 702
 		$result = $this->db->sql_query($sql);
703 703
 		$row = $this->db->sql_fetchrow($result);
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
 		{
761 761
 			if ($cat_data_sql['cat_cron_enable'])
762 762
 			{
763
-				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400;
763
+				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400;
764 764
 			}
765 765
 
766 766
 			$this->cat_data = $this->nestedset_category->insert($cat_data_sql);
@@ -783,13 +783,13 @@  discard block
 block discarded – undo
783 783
 
784 784
 			if ($cat_data_sql['cat_cron_enable'] && ($row['cat_cron_freq'] != $cat_data_sql['cat_cron_freq'] || !$row['cat_cron_enable']))
785 785
 			{
786
-				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400;
786
+				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400;
787 787
 			}
788 788
 
789 789
 			if ($row['cat_name'] != $cat_data_sql['cat_name'])
790 790
 			{
791 791
 				// the cat name has changed, clear the parents list of all categories (for safety)
792
-				$sql = 'UPDATE ' . DIR_CAT_TABLE . "
792
+				$sql = 'UPDATE '.DIR_CAT_TABLE."
793 793
 					SET cat_parents = ''";
794 794
 				$this->db->sql_query($sql);
795 795
 			}
@@ -797,8 +797,8 @@  discard block
 block discarded – undo
797 797
 			// Setting the cat id to the categorie id is not really received well by some dbs. ;)
798 798
 			unset($cat_data_sql['cat_id']);
799 799
 
800
-			$sql = 'UPDATE ' . DIR_CAT_TABLE . '
801
-				SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql) . '
800
+			$sql = 'UPDATE '.DIR_CAT_TABLE.'
801
+				SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql).'
802 802
 				WHERE cat_id = ' . (int) $this->cat_id;
803 803
 			$this->db->sql_query($sql);
804 804
 
@@ -839,7 +839,7 @@  discard block
 block discarded – undo
839 839
 				$log_action_links = 'MOVE_LINKS';
840 840
 
841 841
 				$sql = 'SELECT cat_name
842
-					FROM ' . DIR_CAT_TABLE . '
842
+					FROM ' . DIR_CAT_TABLE.'
843 843
 					WHERE cat_id = ' . (int) $links_to_id;
844 844
 				$result = $this->db->sql_query($sql);
845 845
 				$row = $this->db->sql_fetchrow($result);
@@ -941,12 +941,12 @@  discard block
 block discarded – undo
941 941
 	*/
942 942
 	private function _move_cat_content($from_id, $to_id)
943 943
 	{
944
-		$sql = 'UPDATE ' . DIR_LINK_TABLE . '
945
-			SET link_cat = ' . (int) $to_id . '
944
+		$sql = 'UPDATE '.DIR_LINK_TABLE.'
945
+			SET link_cat = ' . (int) $to_id.'
946 946
 			WHERE link_cat = ' . (int) $from_id;
947 947
 		$this->db->sql_query($sql);
948 948
 
949
-		$sql = 'DELETE FROM ' . DIR_WATCH_TABLE . '
949
+		$sql = 'DELETE FROM '.DIR_WATCH_TABLE.'
950 950
 			WHERE cat_id = ' . (int) $from_id;
951 951
 		$this->db->sql_query($sql);
952 952
 
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 
965 965
 		// Before we remove anything we make sure we are able to adjust the post counts later. ;)
966 966
 		$sql = 'SELECT link_id, link_banner
967
-			FROM ' . DIR_LINK_TABLE . '
967
+			FROM ' . DIR_LINK_TABLE.'
968 968
 			WHERE link_cat = ' . (int) $this->cat_id;
969 969
 		$result = $this->db->sql_query($sql);
970 970
 
@@ -995,7 +995,7 @@  discard block
 block discarded – undo
995 995
 
996 996
 			foreach ($link_datas_ary as $table => $field)
997 997
 			{
998
-				$this->db->sql_query("DELETE FROM $table WHERE " . $this->db->sql_in_set($field, $link_ids));
998
+				$this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $link_ids));
999 999
 			}
1000 1000
 		}
1001 1001
 
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
 
1008 1008
 		foreach ($cat_datas_ary as $table => $field)
1009 1009
 		{
1010
-			$this->db->sql_query("DELETE FROM $table WHERE $field = " . (int) $this->cat_id);
1010
+			$this->db->sql_query("DELETE FROM $table WHERE $field = ".(int) $this->cat_id);
1011 1011
 		}
1012 1012
 
1013 1013
 		$this->db->sql_transaction('commit');
@@ -1024,15 +1024,15 @@  discard block
 block discarded – undo
1024 1024
 	private function _sync_dir_cat($cat_id)
1025 1025
 	{
1026 1026
 		$sql = 'SELECT COUNT(link_id) AS num_links
1027
-			FROM ' . DIR_LINK_TABLE . '
1028
-			WHERE link_cat = ' . (int) $cat_id . '
1027
+			FROM ' . DIR_LINK_TABLE.'
1028
+			WHERE link_cat = ' . (int) $cat_id.'
1029 1029
 				AND link_active = 1';
1030 1030
 		$result = $this->db->sql_query($sql);
1031 1031
 		$total_links = (int) $this->db->sql_fetchfield('num_links');
1032 1032
 		$this->db->sql_freeresult($result);
1033 1033
 
1034
-		$sql = 'UPDATE ' . DIR_CAT_TABLE . '
1035
-			SET cat_links = ' . $total_links . '
1034
+		$sql = 'UPDATE '.DIR_CAT_TABLE.'
1035
+			SET cat_links = ' . $total_links.'
1036 1036
 			WHERE cat_id = ' . (int) $cat_id;
1037 1037
 		$this->db->sql_query($sql);
1038 1038
 	}
@@ -1052,33 +1052,33 @@  discard block
 block discarded – undo
1052 1052
 			'link_vote'		=> 0,
1053 1053
 		);
1054 1054
 
1055
-		$sql = 'UPDATE ' . DIR_LINK_TABLE . '
1056
-			SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
1057
-			WHERE link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop;
1055
+		$sql = 'UPDATE '.DIR_LINK_TABLE.'
1056
+			SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).'
1057
+			WHERE link_id BETWEEN ' . (int) $start.' AND '.(int) $stop;
1058 1058
 		$this->db->sql_query($sql);
1059 1059
 
1060
-		$sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM ' . DIR_VOTE_TABLE . '
1061
-			WHERE vote_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . '
1060
+		$sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM '.DIR_VOTE_TABLE.'
1061
+			WHERE vote_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.'
1062 1062
 			GROUP BY vote_link_id';
1063 1063
 		$result = $this->db->sql_query($sql);
1064 1064
 		while ($tmp = $this->db->sql_fetchrow($result))
1065 1065
 		{
1066
-			$sql = 'UPDATE ' . DIR_LINK_TABLE . '
1067
-				SET link_note = ' . (int) $tmp['total'] . ', link_vote = ' . (int) $tmp['nb_vote'] . '
1066
+			$sql = 'UPDATE '.DIR_LINK_TABLE.'
1067
+				SET link_note = ' . (int) $tmp['total'].', link_vote = '.(int) $tmp['nb_vote'].'
1068 1068
 				WHERE link_id = ' . (int) $tmp['vote_link_id'];
1069 1069
 			$this->db->sql_query($sql);
1070 1070
 		}
1071 1071
 		$this->db->sql_freeresult($result);
1072 1072
 
1073 1073
 		$sql = 'SELECT 	comment_link_id, COUNT(comment_id) AS nb_comment
1074
-			FROM ' . DIR_COMMENT_TABLE . '
1075
-			WHERE comment_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . '
1074
+			FROM ' . DIR_COMMENT_TABLE.'
1075
+			WHERE comment_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.'
1076 1076
 			GROUP BY comment_link_id';
1077 1077
 		$result = $this->db->sql_query($sql);
1078 1078
 		while ($tmp = $this->db->sql_fetchrow($result))
1079 1079
 		{
1080
-			$sql = 'UPDATE ' . DIR_LINK_TABLE . '
1081
-				SET link_comment = ' . (int) $tmp['nb_comment'] . '
1080
+			$sql = 'UPDATE '.DIR_LINK_TABLE.'
1081
+				SET link_comment = ' . (int) $tmp['nb_comment'].'
1082 1082
 				WHERE link_id = ' . (int) $tmp['comment_link_id'];
1083 1083
 			$this->db->sql_query($sql);
1084 1084
 		}
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 
1104 1104
 			foreach ($img_ary as $img)
1105 1105
 			{
1106
-				$img = $path . $img;
1106
+				$img = $path.$img;
1107 1107
 				$selected = '';
1108 1108
 
1109 1109
 				if (strlen($img) > 255)
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
 					$selected = ' selected="selected"';
1117 1117
 				}
1118 1118
 
1119
-				$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
1119
+				$filename_list .= '<option value="'.htmlspecialchars($img).'"'.$selected.'>'.$img.'</option>';
1120 1120
 			}
1121 1121
 		}
1122 1122
 
Please login to merge, or discard this patch.
controller/acp/main.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
 	protected $u_action;
32 32
 
33 33
 	/**
34
-	* Constructor
35
-	*
36
-	* @param \phpbb\db\driver\driver_interface 		$db			Database object
37
-	* @param \phpbb\request\request					$request	Request object
38
-	* @param \phpbb\template\template				$template	Template object
39
-	* @param \phpbb\user							$user		User object
40
-	* @param \ernadoo\phpbbdirectory\core\helper	$dir_helper	PhpBB Directory extension helper object
41
-	*/
34
+	 * Constructor
35
+	 *
36
+	 * @param \phpbb\db\driver\driver_interface 		$db			Database object
37
+	 * @param \phpbb\request\request					$request	Request object
38
+	 * @param \phpbb\template\template				$template	Template object
39
+	 * @param \phpbb\user							$user		User object
40
+	 * @param \ernadoo\phpbbdirectory\core\helper	$dir_helper	PhpBB Directory extension helper object
41
+	 */
42 42
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\helper $dir_helper)
43 43
 	{
44 44
 		$this->db			= $db;
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
 	}
50 50
 
51 51
 	/**
52
-	* Display confirm box
53
-	*
54
-	* @param	string $action Requested action
55
-	* @return	null
56
-	*/
52
+	 * Display confirm box
53
+	 *
54
+	 * @param	string $action Requested action
55
+	 * @return	null
56
+	 */
57 57
 	public function display_confirm($action)
58 58
 	{
59 59
 		switch ($action)
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
 	}
92 92
 
93 93
 	/**
94
-	* Display phpBB Directory statistics
95
-	*
96
-	* @return null
97
-	*/
94
+	 * Display phpBB Directory statistics
95
+	 *
96
+	 * @return null
97
+	 */
98 98
 	public function display_stats()
99 99
 	{
100 100
 		// Count number of categories
@@ -181,11 +181,11 @@  discard block
 block discarded – undo
181 181
 	}
182 182
 
183 183
 	/**
184
-	* Execute action requested
185
-	*
186
-	* @param	string $action Requested action
187
-	* @return	null
188
-	*/
184
+	 * Execute action requested
185
+	 *
186
+	 * @param	string $action Requested action
187
+	 * @return	null
188
+	 */
189 189
 	public function exec_action($action)
190 190
 	{
191 191
 		switch ($action)
@@ -260,23 +260,23 @@  discard block
 block discarded – undo
260 260
 	}
261 261
 
262 262
 	/**
263
-	* Set page url
264
-	*
265
-	* @param	string $u_action Custom form action
266
-	* @return	null
267
-	* @access	public
268
-	*/
263
+	 * Set page url
264
+	 *
265
+	 * @param	string $u_action Custom form action
266
+	 * @return	null
267
+	 * @access	public
268
+	 */
269 269
 	public function set_page_url($u_action)
270 270
 	{
271 271
 		$this->u_action = $u_action;
272 272
 	}
273 273
 
274 274
 	/**
275
-	* Get orphan banners
276
-	*
277
-	* @param	bool		$delete	True if we want to delete banners, else false
278
-	* @return	null|int	Number of orphan files, else null
279
-	*/
275
+	 * Get orphan banners
276
+	 *
277
+	 * @param	bool		$delete	True if we want to delete banners, else false
278
+	 * @return	null|int	Number of orphan files, else null
279
+	 */
280 280
 	private function _orphan_files($delete = false)
281 281
 	{
282 282
 		$banner_path = $this->dir_helper->get_banner_path();
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
 	*/
42 42
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\helper $dir_helper)
43 43
 	{
44
-		$this->db			= $db;
45
-		$this->template		= $template;
46
-		$this->user			= $user;
47
-		$this->request		= $request;
48
-		$this->dir_helper	= $dir_helper;
44
+		$this->db = $db;
45
+		$this->template = $template;
46
+		$this->user = $user;
47
+		$this->request = $request;
48
+		$this->dir_helper = $dir_helper;
49 49
 	}
50 50
 
51 51
 	/**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 			{
152 152
 				if ($file[0] != '.' && $file[0] != '..' && strpos($file, 'index.') === false && strpos($file, '.db') === false)
153 153
 				{
154
-					$banners_dir_size += filesize($banners_path . $file);
154
+					$banners_dir_size += filesize($banners_path.$file);
155 155
 				}
156 156
 			}
157 157
 			closedir($banners_dir);
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 			'U_ACTION'			=> $this->u_action,
171 171
 
172 172
 			'TOTAL_CATS'		=> $total_cats,
173
-			'TOTAL_LINKS'		=> $total_links-$waiting_links,
173
+			'TOTAL_LINKS'		=> $total_links - $waiting_links,
174 174
 			'WAITING_LINKS'		=> $waiting_links,
175 175
 			'TOTAL_COMMENTS'	=> $total_comments,
176 176
 			'TOTAL_VOTES'		=> $total_votes,
@@ -195,15 +195,15 @@  discard block
 block discarded – undo
195 195
 				{
196 196
 					case 'sqlite':
197 197
 					case 'firebird':
198
-						$this->db->sql_query('DELETE FROM ' . DIR_VOTE_TABLE);
198
+						$this->db->sql_query('DELETE FROM '.DIR_VOTE_TABLE);
199 199
 					break;
200 200
 
201 201
 					default:
202
-						$this->db->sql_query('TRUNCATE TABLE ' . DIR_VOTE_TABLE);
202
+						$this->db->sql_query('TRUNCATE TABLE '.DIR_VOTE_TABLE);
203 203
 					break;
204 204
 				}
205 205
 
206
-				$sql = 'UPDATE ' . DIR_LINK_TABLE . '
206
+				$sql = 'UPDATE '.DIR_LINK_TABLE.'
207 207
 					SET link_vote = 0, link_note = 0';
208 208
 				$this->db->sql_query($sql);
209 209
 
@@ -218,15 +218,15 @@  discard block
 block discarded – undo
218 218
 				{
219 219
 					case 'sqlite':
220 220
 					case 'firebird':
221
-						$this->db->sql_query('DELETE FROM ' . DIR_COMMENT_TABLE);
221
+						$this->db->sql_query('DELETE FROM '.DIR_COMMENT_TABLE);
222 222
 					break;
223 223
 
224 224
 					default:
225
-						$this->db->sql_query('TRUNCATE TABLE ' . DIR_COMMENT_TABLE);
225
+						$this->db->sql_query('TRUNCATE TABLE '.DIR_COMMENT_TABLE);
226 226
 					break;
227 227
 				}
228 228
 
229
-				$sql = 'UPDATE ' . DIR_LINK_TABLE . '
229
+				$sql = 'UPDATE '.DIR_LINK_TABLE.'
230 230
 					SET link_comment = 0';
231 231
 				$this->db->sql_query($sql);
232 232
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 				break;
239 239
 
240 240
 			case 'clicks':
241
-				$sql = 'UPDATE ' . DIR_LINK_TABLE . '
241
+				$sql = 'UPDATE '.DIR_LINK_TABLE.'
242 242
 					SET link_view = 0';
243 243
 				$this->db->sql_query($sql);
244 244
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 			{
293 293
 				$physical_files[] = $img;
294 294
 			}
295
-			$sql = 'SELECT link_banner FROM ' . DIR_LINK_TABLE . '
295
+			$sql = 'SELECT link_banner FROM '.DIR_LINK_TABLE.'
296 296
 				WHERE link_banner <> \'\'';
297 297
 			$result = $this->db->sql_query($sql);
298 298
 
Please login to merge, or discard this patch.
controller/acp/settings.php 2 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -37,14 +37,14 @@  discard block
 block discarded – undo
37 37
 	private $display_vars;
38 38
 
39 39
 	/**
40
-	* Constructor
41
-	*
42
-	* @param \phpbb\config\config		$config		Config object
43
-	* @param \phpbb\log\log				$log		Log object
44
-	* @param \phpbb\request\request		$request	Request object
45
-	* @param \phpbb\template\template	$template	Template object
46
-	* @param \phpbb\user				$user		User object
47
-	*/
40
+	 * Constructor
41
+	 *
42
+	 * @param \phpbb\config\config		$config		Config object
43
+	 * @param \phpbb\log\log				$log		Log object
44
+	 * @param \phpbb\request\request		$request	Request object
45
+	 * @param \phpbb\template\template	$template	Template object
46
+	 * @param \phpbb\user				$user		User object
47
+	 */
48 48
 	public function __construct(\phpbb\config\config $config, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
49 49
 	{
50 50
 		$this->config	= $config;
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
 	}
58 58
 
59 59
 	/**
60
-	* Display config page
61
-	*
62
-	* @return null
63
-	*/
60
+	 * Display config page
61
+	 *
62
+	 * @return null
63
+	 */
64 64
 	public function display_config()
65 65
 	{
66 66
 		// Output relevant page
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
 	}
107 107
 
108 108
 	/**
109
-	* Validate config vars and update config table if needed
110
-	*
111
-	* @return null
112
-	*/
109
+	 * Validate config vars and update config table if needed
110
+	 *
111
+	 * @return null
112
+	 */
113 113
 	public function process()
114 114
 	{
115 115
 		$submit	= ($this->request->is_set_post('submit')) ? true : false;
@@ -162,22 +162,22 @@  discard block
 block discarded – undo
162 162
 	}
163 163
 
164 164
 	/**
165
-	* Set page url
166
-	*
167
-	* @param	string $u_action Custom form action
168
-	* @return	null
169
-	* @access	public
170
-	*/
165
+	 * Set page url
166
+	 *
167
+	 * @param	string $u_action Custom form action
168
+	 * @return	null
169
+	 * @access	public
170
+	 */
171 171
 	public function set_page_url($u_action)
172 172
 	{
173 173
 		$this->u_action = $u_action;
174 174
 	}
175 175
 
176 176
 	/**
177
-	* Build config matrice
178
-	*
179
-	* @return null
180
-	*/
177
+	 * Build config matrice
178
+	 *
179
+	 * @return null
180
+	 */
181 181
 	private function _generate_config()
182 182
 	{
183 183
 		$this->display_vars = array(
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
 	*/
48 48
 	public function __construct(\phpbb\config\config $config, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
49 49
 	{
50
-		$this->config	= $config;
51
-		$this->log		= $log;
52
-		$this->template	= $template;
53
-		$this->user		= $user;
54
-		$this->request	= $request;
50
+		$this->config = $config;
51
+		$this->log = $log;
52
+		$this->template = $template;
53
+		$this->user = $user;
54
+		$this->request = $request;
55 55
 
56 56
 		$this->_generate_config();
57 57
 	}
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 			}
91 91
 			else if ($vars['explain'])
92 92
 			{
93
-				$l_explain = (isset($this->user->lang[$vars['lang'] . '_EXPLAIN'])) ? $this->user->lang[$vars['lang'] . '_EXPLAIN'] : '';
93
+				$l_explain = (isset($this->user->lang[$vars['lang'].'_EXPLAIN'])) ? $this->user->lang[$vars['lang'].'_EXPLAIN'] : '';
94 94
 			}
95 95
 
96 96
 			$this->template->assign_block_vars('options', array(
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	*/
113 113
 	public function process()
114 114
 	{
115
-		$submit	= ($this->request->is_set_post('submit')) ? true : false;
115
+		$submit = ($this->request->is_set_post('submit')) ? true : false;
116 116
 
117 117
 		$this->new_config = $this->config;
118 118
 		$cfg_array = ($this->request->is_set('config')) ? $this->request->variable('config', array('' => ''), true) : $this->new_config;
@@ -153,12 +153,12 @@  discard block
 block discarded – undo
153 153
 		{
154 154
 			$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'DIR_CONFIG_SETTINGS');
155 155
 
156
-			trigger_error($this->user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
156
+			trigger_error($this->user->lang['CONFIG_UPDATED'].adm_back_link($this->u_action));
157 157
 		}
158 158
 
159 159
 		$this->template->assign_vars(array(
160 160
 			'L_TITLE'			=> $this->user->lang[$this->display_vars['title']],
161
-			'L_TITLE_EXPLAIN'	=> $this->user->lang[$this->display_vars['title'] . '_EXPLAIN'],
161
+			'L_TITLE_EXPLAIN'	=> $this->user->lang[$this->display_vars['title'].'_EXPLAIN'],
162 162
 
163 163
 			'S_ERROR'			=> (sizeof($error)) ? true : false,
164 164
 			'ERROR_MSG'			=> implode('<br />', $error),
@@ -194,45 +194,45 @@  discard block
 block discarded – undo
194 194
 				'dir_banner_width'					=> '',
195 195
 				'dir_banner_height'					=> '',
196 196
 
197
-				'dir_mail'							=> array('lang' => 'DIR_MAIL_VALIDATION',	'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => false),
198
-				'dir_activ_checkurl'				=> array('lang' => 'DIR_ACTIVE_CHECK',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
199
-				'dir_activ_flag'					=> array('lang' => 'DIR_ACTIV_FLAG',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => false),
200
-				'dir_activ_rss'						=> array('lang' => 'DIR_ACTIV_RSS',			'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
201
-				'dir_activ_pagerank'				=> array('lang' => 'DIR_ACTIV_PAGERANK',	'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
202
-				'dir_show'							=> array('lang' => 'DIR_SHOW',				'validate' => 'int:1:9999', 'type' => 'number:1:9999',	'explain' => false),
203
-				'dir_length_describe'				=> array('lang' => 'DIR_MAX_DESC',			'validate' => 'int:1:999',	'type' => 'number:1:999',	'explain' => false),
204
-				'dir_new_time'						=> array('lang' => 'DIR_NEW_TIME',			'validate' => 'int:1:999', 	'type' => 'number:1:999',	'explain' => true),
205
-				'dir_default_order'					=> array('lang' => 'DIR_DEFAULT_ORDER',		'validate' => 'string', 	'type' => 'select',			'explain' => false, 'method' => 'get_order_list', 'params' => array('{CONFIG_VALUE}')),
197
+				'dir_mail'							=> array('lang' => 'DIR_MAIL_VALIDATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
198
+				'dir_activ_checkurl'				=> array('lang' => 'DIR_ACTIVE_CHECK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
199
+				'dir_activ_flag'					=> array('lang' => 'DIR_ACTIV_FLAG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
200
+				'dir_activ_rss'						=> array('lang' => 'DIR_ACTIV_RSS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
201
+				'dir_activ_pagerank'				=> array('lang' => 'DIR_ACTIV_PAGERANK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
202
+				'dir_show'							=> array('lang' => 'DIR_SHOW', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false),
203
+				'dir_length_describe'				=> array('lang' => 'DIR_MAX_DESC', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false),
204
+				'dir_new_time'						=> array('lang' => 'DIR_NEW_TIME', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true),
205
+				'dir_default_order'					=> array('lang' => 'DIR_DEFAULT_ORDER', 'validate' => 'string', 'type' => 'select', 'explain' => false, 'method' => 'get_order_list', 'params' => array('{CONFIG_VALUE}')),
206 206
 
207 207
 				'legend2'							=> 'DIR_RECENT_GUEST',
208
-				'dir_recent_block'					=> array('lang' => 'DIR_RECENT_ENABLE',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
209
-				'dir_recent_rows'					=> array('lang' => 'DIR_RECENT_ROWS',		'validate' => 'int:1:999',	'type' => 'number:1:999',	'explain' => false),
210
-				'dir_recent_columns'				=> array('lang' => 'DIR_RECENT_COLUMNS',	'validate' => 'int:1:999',	'type' => 'number:1:999',	'explain' => false),
211
-				'dir_recent_exclude'				=> array('lang' => 'DIR_RECENT_EXCLUDE',	'validate' => 'string',		'type' => 'text:6:99',		'explain' => true),
208
+				'dir_recent_block'					=> array('lang' => 'DIR_RECENT_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
209
+				'dir_recent_rows'					=> array('lang' => 'DIR_RECENT_ROWS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false),
210
+				'dir_recent_columns'				=> array('lang' => 'DIR_RECENT_COLUMNS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false),
211
+				'dir_recent_exclude'				=> array('lang' => 'DIR_RECENT_EXCLUDE', 'validate' => 'string', 'type' => 'text:6:99', 'explain' => true),
212 212
 
213 213
 				'legend3'							=> 'DIR_ADD_GUEST',
214
-				'dir_visual_confirm'				=> array('lang' => 'DIR_VISUAL_CONFIRM',	'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
215
-				'dir_visual_confirm_max_attempts'	=> array('lang' => 'DIR_MAX_ADD_ATTEMPTS',	'validate' => 'int:0:9999',	'type' => 'number:0:9999',	'explain' => true),
214
+				'dir_visual_confirm'				=> array('lang' => 'DIR_VISUAL_CONFIRM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
215
+				'dir_visual_confirm_max_attempts'	=> array('lang' => 'DIR_MAX_ADD_ATTEMPTS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
216 216
 
217 217
 				'legend4'							=> 'DIR_THUMB_PARAM',
218
-				'dir_activ_thumb'					=> array('lang' => 'DIR_ACTIVE_THUMB',			'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => false),
219
-				'dir_activ_thumb_remote'			=> array('lang' => 'DIR_ACTIVE_THUMB_REMOTE',	'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
220
-				'dir_thumb_service'					=> array('lang' => 'DIR_THUMB_SERVICE',			'validate' => 'string', 'type' => 'select',			'explain' => true, 'method' => 'get_thumb_service_list', 'params' => array('{CONFIG_VALUE}')),
221
-				'dir_thumb_service_reverse'			=> array('lang' => 'DIR_THUMB_SERVICE_REVERSE',	'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
218
+				'dir_activ_thumb'					=> array('lang' => 'DIR_ACTIVE_THUMB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
219
+				'dir_activ_thumb_remote'			=> array('lang' => 'DIR_ACTIVE_THUMB_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
220
+				'dir_thumb_service'					=> array('lang' => 'DIR_THUMB_SERVICE', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_thumb_service_list', 'params' => array('{CONFIG_VALUE}')),
221
+				'dir_thumb_service_reverse'			=> array('lang' => 'DIR_THUMB_SERVICE_REVERSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
222 222
 
223 223
 				'legend5'							=> 'DIR_COMM_PARAM',
224
-				'dir_allow_bbcode'					=> array('lang' => 'DIR_ALLOW_BBCODE',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => false),
225
-				'dir_allow_flash'					=> array('lang' => 'DIR_ALLOW_FLASH',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => false),
226
-				'dir_allow_links'					=> array('lang' => 'DIR_ALLOW_LINKS',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => false),
227
-				'dir_allow_smilies'					=> array('lang' => 'DIR_ALLOW_SMILIES',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => false),
228
-				'dir_length_comments'				=> array('lang' => 'DIR_LENGTH_COMMENTS',	'validate' => 'int:1:999',	'type' => 'number:1:999',	'explain' => true),
229
-				'dir_comments_per_page'				=> array('lang' => 'DIR_COMM_PER_PAGE',		'validate' => 'int:1:9999',	'type' => 'number:1:9999',	'explain' => false),
224
+				'dir_allow_bbcode'					=> array('lang' => 'DIR_ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
225
+				'dir_allow_flash'					=> array('lang' => 'DIR_ALLOW_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
226
+				'dir_allow_links'					=> array('lang' => 'DIR_ALLOW_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
227
+				'dir_allow_smilies'					=> array('lang' => 'DIR_ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
228
+				'dir_length_comments'				=> array('lang' => 'DIR_LENGTH_COMMENTS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true),
229
+				'dir_comments_per_page'				=> array('lang' => 'DIR_COMM_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false),
230 230
 
231 231
 				'legend6'							=> 'DIR_BANN_PARAM',
232
-				'dir_activ_banner'					=> array('lang' => 'DIR_ACTIV_BANNER',		'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => false),
233
-				'dir_banner'						=> array('lang' => 'DIR_MAX_BANN',			'validate' => 'int:0',	'type' => 'dimension:0',	'explain' => true, 'append' => ' ' . $this->user->lang['PIXEL']),
234
-				'dir_banner_filesize'				=> array('lang' => 'DIR_MAX_SIZE',			'validate' => 'string',	'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
235
-				'dir_storage_banner'				=> array('lang' => 'DIR_STORAGE_BANNER',	'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
232
+				'dir_activ_banner'					=> array('lang' => 'DIR_ACTIV_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
233
+				'dir_banner'						=> array('lang' => 'DIR_MAX_BANN', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' '.$this->user->lang['PIXEL']),
234
+				'dir_banner_filesize'				=> array('lang' => 'DIR_MAX_SIZE', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
235
+				'dir_storage_banner'				=> array('lang' => 'DIR_STORAGE_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
236 236
 			)
237 237
 		);
238 238
 	}
Please login to merge, or discard this patch.
controller/acp/validation.php 2 patches
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -67,22 +67,22 @@  discard block
 block discarded – undo
67 67
 	private $links_data;
68 68
 
69 69
 	/**
70
-	* Constructor
71
-	*
72
-	* @param \phpbb\config\config								$config				Config object
73
-	* @param \phpbb\db\driver\driver_interface 					$db					Database object
74
-	* @param \phpbb\pagination									$pagination			Pagination object
75
-	* @param \phpbb\log\log										$log				Log object
76
-	* @param \phpbb\notification\manager						$notification		Notification object
77
-	* @param \phpbb\request\request								$request			Request object
78
-	* @param \phpbb\template\template							$template			Template object
79
-	* @param \phpbb\user										$user				User object
80
-	* @param \ernadoo\phpbbdirectory\core\categorie				$categorie			PhpBB Directory extension categorie object
81
-	* @param \ernadoo\phpbbdirectory\core\helper				$dir_helper			PhpBB Directory extension helper object
82
-	* @param \ernadoo\phpbbdirectory\core\link					$link				PhpBB Directory extension link object
83
-	* @param string												$root_path			phpBB root path
84
-	* @param string												$php_ext   			phpEx
85
-	*/
70
+	 * Constructor
71
+	 *
72
+	 * @param \phpbb\config\config								$config				Config object
73
+	 * @param \phpbb\db\driver\driver_interface 					$db					Database object
74
+	 * @param \phpbb\pagination									$pagination			Pagination object
75
+	 * @param \phpbb\log\log										$log				Log object
76
+	 * @param \phpbb\notification\manager						$notification		Notification object
77
+	 * @param \phpbb\request\request								$request			Request object
78
+	 * @param \phpbb\template\template							$template			Template object
79
+	 * @param \phpbb\user										$user				User object
80
+	 * @param \ernadoo\phpbbdirectory\core\categorie				$categorie			PhpBB Directory extension categorie object
81
+	 * @param \ernadoo\phpbbdirectory\core\helper				$dir_helper			PhpBB Directory extension helper object
82
+	 * @param \ernadoo\phpbbdirectory\core\link					$link				PhpBB Directory extension link object
83
+	 * @param string												$root_path			phpBB root path
84
+	 * @param string												$php_ext   			phpEx
85
+	 */
86 86
 	public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, \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\helper $dir_helper, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext)
87 87
 	{
88 88
 		$this->config		= $config;
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
 	}
104 104
 
105 105
 	/**
106
-	* Display confirm box
107
-	*
108
-	* @param	array $mark Website selected for (dis)approval
109
-	* @return	null
110
-	*/
106
+	 * Display confirm box
107
+	 *
108
+	 * @param	array $mark Website selected for (dis)approval
109
+	 * @return	null
110
+	 */
111 111
 	public function display_confirm($mark)
112 112
 	{
113 113
 		$s_hidden_fields = array(
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
119 119
 	}
120 120
 
121 121
 	/**
122
-	* Display website list for (dis)approval
123
-	*
124
-	* @return null
125
-	*/
122
+	 * Display website list for (dis)approval
123
+	 *
124
+	 * @return null
125
+	 */
126 126
 	public function display_websites()
127 127
 	{
128 128
 		global $phpbb_admin_path;
@@ -226,11 +226,11 @@  discard block
 block discarded – undo
226 226
 	}
227 227
 
228 228
 	/**
229
-	* Get link's information and call appropriate action
230
-	*
231
-	* @param	array $mark Website selected for (dis)approval
232
-	* @return	null
233
-	*/
229
+	 * Get link's information and call appropriate action
230
+	 *
231
+	 * @param	array $mark Website selected for (dis)approval
232
+	 * @return	null
233
+	 */
234 234
 	public function exec_action($mark)
235 235
 	{
236 236
 		$this->_get_infos_links($mark);
@@ -253,10 +253,10 @@  discard block
 block discarded – undo
253 253
 	}
254 254
 
255 255
 	/**
256
-	* Notify users which had submitted their websites
257
-	*
258
-	* @return null
259
-	*/
256
+	 * Notify users which had submitted their websites
257
+	 *
258
+	 * @return null
259
+	 */
260 260
 	public function notifiy_submiters()
261 261
 	{
262 262
 		if (!class_exists('messenger'))
@@ -300,22 +300,22 @@  discard block
 block discarded – undo
300 300
 	}
301 301
 
302 302
 	/**
303
-	* Set page url
304
-	*
305
-	* @param	string $u_action Custom form action
306
-	* @return	null
307
-	* @access	public
308
-	*/
303
+	 * Set page url
304
+	 *
305
+	 * @param	string $u_action Custom form action
306
+	 * @return	null
307
+	 * @access	public
308
+	 */
309 309
 	public function set_page_url($u_action)
310 310
 	{
311 311
 		$this->u_action = $u_action;
312 312
 	}
313 313
 
314 314
 	/**
315
-	* Approve action
316
-	*
317
-	* @return null
318
-	*/
315
+	 * Approve action
316
+	 *
317
+	 * @return null
318
+	 */
319 319
 	private function _action_approved()
320 320
 	{
321 321
 		foreach ($this->links_data as $row)
@@ -344,10 +344,10 @@  discard block
 block discarded – undo
344 344
 	}
345 345
 
346 346
 	/**
347
-	* Disapprove action
348
-	*
349
-	* @return null
350
-	*/
347
+	 * Disapprove action
348
+	 *
349
+	 * @return null
350
+	 */
351 351
 	private function _action_disapproved()
352 352
 	{
353 353
 		foreach ($this->links_data as $row)
@@ -368,11 +368,11 @@  discard block
 block discarded – undo
368 368
 	}
369 369
 
370 370
 	/**
371
-	* Get informations about links selected
372
-	*
373
-	* @param	$mark Website selected for (dis)approval
374
-	* @return	null
375
-	*/
371
+	 * Get informations about links selected
372
+	 *
373
+	 * @param	$mark Website selected for (dis)approval
374
+	 * @return	null
375
+	 */
376 376
 	private function _get_infos_links($mark)
377 377
 	{
378 378
 		$sql_array = array(
@@ -407,11 +407,11 @@  discard block
 block discarded – undo
407 407
 	}
408 408
 
409 409
 	/**
410
-	* Notify users which watch categories
411
-	*
412
-	* @param	$row Informations about website
413
-	* @return	null
414
-	*/
410
+	 * Notify users which watch categories
411
+	 *
412
+	 * @param	$row Informations about website
413
+	 * @return	null
414
+	 */
415 415
 	private function _notify_suscribers($row)
416 416
 	{
417 417
 		$notification_data = array(
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -85,21 +85,21 @@  discard block
 block discarded – undo
85 85
 	*/
86 86
 	public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, \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\helper $dir_helper, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext)
87 87
 	{
88
-		$this->config		= $config;
89
-		$this->db			= $db;
90
-		$this->pagination	= $pagination;
88
+		$this->config = $config;
89
+		$this->db = $db;
90
+		$this->pagination = $pagination;
91 91
 		$this->phpbb_log	= $log;
92
-		$this->notification	= $notification;
93
-		$this->request		= $request;
92
+		$this->notification = $notification;
93
+		$this->request = $request;
94 94
 		$this->template		= $template;
95 95
 		$this->user			= $user;
96 96
 		$this->categorie	= $categorie;
97
-		$this->dir_helper	= $dir_helper;
97
+		$this->dir_helper = $dir_helper;
98 98
 		$this->link			= $link;
99 99
 		$this->root_path	= $root_path;
100
-		$this->php_ext		= $php_ext;
100
+		$this->php_ext = $php_ext;
101 101
 
102
-		$this->action		= $this->request->variable('action', '');
102
+		$this->action = $this->request->variable('action', '');
103 103
 	}
104 104
 
105 105
 	/**
@@ -128,14 +128,14 @@  discard block
 block discarded – undo
128 128
 		global $phpbb_admin_path;
129 129
 
130 130
 		// Sort keys
131
-		$sort_days	= $this->request->variable('st', 0);
131
+		$sort_days = $this->request->variable('st', 0);
132 132
 		$sort_key	= $this->request->variable('sk', 't');
133 133
 		$sort_dir	= $this->request->variable('sd', 'd');
134 134
 
135 135
 		// Number of entries to display
136 136
 		$per_page = $this->request->variable('links_per_page', (int) $this->config['dir_show']);
137 137
 
138
-		$start	= $this->request->variable('start', 0);
138
+		$start = $this->request->variable('start', 0);
139 139
 
140 140
 		// Categorie ordering options
141 141
 		$limit_days		= array(0 => $this->user->lang['SEE_ALL'], 1 => $this->user->lang['1_DAY'], 7 => $this->user->lang['7_DAYS'], 14 => $this->user->lang['2_WEEKS'], 30 => $this->user->lang['1_MONTH'], 90 => $this->user->lang['3_MONTHS'], 180 => $this->user->lang['6_MONTHS'], 365 => $this->user->lang['1_YEAR']);
@@ -151,15 +151,15 @@  discard block
 block discarded – undo
151 151
 
152 152
 		if (is_array($sort_by_sql[$sort_key]))
153 153
 		{
154
-			$sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
154
+			$sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction;
155 155
 		}
156 156
 		else
157 157
 		{
158
-			$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
158
+			$sql_sort_order = $sort_by_sql[$sort_key].' '.$direction;
159 159
 		}
160 160
 
161 161
 		$sql = 'SELECT COUNT(1) AS total_links
162
-			FROM ' . DIR_LINK_TABLE . '
162
+			FROM ' . DIR_LINK_TABLE.'
163 163
 			WHERE link_active = 0' .
164 164
 				(($sql_where) ? " AND link_time >= $sql_where" : '');
165 165
 		$result = $this->db->sql_query($sql);
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 					'ON'	=> 'u.user_id = l.link_user_id'
184 184
 				)
185 185
 			),
186
-			'WHERE'		=> 'l.link_active = 0' . (($sql_where) ? " AND l.link_time >= $sql_where" : ''),
186
+			'WHERE'		=> 'l.link_active = 0'.(($sql_where) ? " AND l.link_time >= $sql_where" : ''),
187 187
 			'ORDER_BY'	=> $sql_sort_order);
188 188
 
189 189
 		$sql = $this->db->sql_build_query('SELECT', $sql_array);
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 
211 211
 		$option_ary = array('approved' => 'DIR_LINK_ACTIVATE', 'disapproved' => 'DIR_LINK_DELETE');
212 212
 
213
-		$base_url = $this->u_action . "&amp;$u_sort_param&amp;links_per_page=$per_page";
213
+		$base_url = $this->u_action."&amp;$u_sort_param&amp;links_per_page=$per_page";
214 214
 		$this->pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_links, $per_page, $start);
215 215
 
216 216
 		$this->template->assign_vars(array(
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 			'S_SORT_DIR'		=> $s_sort_dir,
222 222
 			'LINKS_PER_PAGE'	=> $per_page,
223 223
 
224
-			'U_ACTION'			=> $this->u_action . "&amp;$u_sort_param&amp;links_per_page=$per_page&amp;start=$start",
224
+			'U_ACTION'			=> $this->u_action."&amp;$u_sort_param&amp;links_per_page=$per_page&amp;start=$start",
225 225
 		));
226 226
 	}
227 227
 
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 				return;
250 250
 		}
251 251
 
252
-		$this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_LINK_' . strtoupper($this->action), time(), array(implode(', ', $this->affected_link_name)));
252
+		$this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_LINK_'.strtoupper($this->action), time(), array(implode(', ', $this->affected_link_name)));
253 253
 	}
254 254
 
255 255
 	/**
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	{
262 262
 		if (!class_exists('messenger'))
263 263
 		{
264
-			include($this->root_path . 'includes/functions_messenger.' . $this->php_ext);
264
+			include($this->root_path.'includes/functions_messenger.'.$this->php_ext);
265 265
 		}
266 266
 		$messenger = new \messenger(false);
267 267
 
@@ -328,15 +328,15 @@  discard block
 block discarded – undo
328 328
 				'link_cat'		=> (int) $row['link_cat'],
329 329
 			);
330 330
 
331
-			$sql = 'UPDATE ' . DIR_LINK_TABLE . '
332
-							SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
331
+			$sql = 'UPDATE '.DIR_LINK_TABLE.'
332
+							SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).'
333 333
 							WHERE link_id = ' . (int) $row['link_id'];
334 334
 			$this->db->sql_query($sql);
335 335
 		}
336 336
 
337 337
 		foreach ($this->cat_data as $cat_id => $count)
338 338
 		{
339
-			$sql = 'UPDATE ' . DIR_CAT_TABLE . '
339
+			$sql = 'UPDATE '.DIR_CAT_TABLE.'
340 340
 							SET cat_links = cat_links + '.$count.'
341 341
 							WHERE cat_id = ' . (int) $cat_id;
342 342
 			$this->db->sql_query($sql);
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 				}
363 363
 			}
364 364
 
365
-			$sql = 'DELETE FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int) $row['link_id'];
365
+			$sql = 'DELETE FROM '.DIR_LINK_TABLE.' WHERE link_id = '.(int) $row['link_id'];
366 366
 			$this->db->sql_query($sql);
367 367
 		}
368 368
 	}
Please login to merge, or discard this patch.
controller/categories.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -43,19 +43,19 @@  discard block
 block discarded – undo
43 43
 	protected $link;
44 44
 
45 45
 	/**
46
-	* Constructor
47
-	*
48
-	* @param \phpbb\db\driver\driver_interface					$db			Database object
49
-	* @param \phpbb\config\config								$config		Config object
50
-	* @param \phpbb\template\template							$template	Template object
51
-	* @param \phpbb\user										$user		User object
52
-	* @param \phpbb\controller\helper							$helper		Controller helper object
53
-	* @param \phpbb\request\request								$request	Request object
54
-	* @param \phpbb\auth\auth									$auth		Auth object
55
-	* @param \phpbb\pagination									$pagination	Pagination object
56
-	* @param \ernadoo\phpbbdirectory\core\categorie				$categorie	PhpBB Directory extension categorie object
57
-	* @param \ernadoo\phpbbdirectory\core\link					$link		PhpBB Directory extension link object
58
-	*/
46
+	 * Constructor
47
+	 *
48
+	 * @param \phpbb\db\driver\driver_interface					$db			Database object
49
+	 * @param \phpbb\config\config								$config		Config object
50
+	 * @param \phpbb\template\template							$template	Template object
51
+	 * @param \phpbb\user										$user		User object
52
+	 * @param \phpbb\controller\helper							$helper		Controller helper object
53
+	 * @param \phpbb\request\request								$request	Request object
54
+	 * @param \phpbb\auth\auth									$auth		Auth object
55
+	 * @param \phpbb\pagination									$pagination	Pagination object
56
+	 * @param \ernadoo\phpbbdirectory\core\categorie				$categorie	PhpBB Directory extension categorie object
57
+	 * @param \ernadoo\phpbbdirectory\core\link					$link		PhpBB Directory extension link object
58
+	 */
59 59
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \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)
60 60
 	{
61 61
 		$this->db			= $db;
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 	}
79 79
 
80 80
 	/**
81
-	* Base controller to be accessed with the URL /directory
82
-	*
83
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
84
-	*/
81
+	 * Base controller to be accessed with the URL /directory
82
+	 *
83
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
84
+	 */
85 85
 	public function base()
86 86
 	{
87 87
 		$this->categorie->display();
@@ -91,17 +91,17 @@  discard block
 block discarded – undo
91 91
 	}
92 92
 
93 93
 	/**
94
-	* View controller for display a category
95
-	*
96
-	* @param	int		$cat_id		The category ID
97
-	* @param	int		$page		Page number taken from the URL
98
-	* @param	int		$sort_days	Specifies the maximum amount of days a link may be old
99
-	* @param	string	$sort_key	is the key of $sort_by_sql for the selected sorting: a|t|r|s|v|p
100
-	* @param	string	$sort_dir	is either a or d representing ASC and DESC (ascending|descending)
101
-	* @param	string	$mode		watch|unwatch
102
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
103
-	* @throws	\phpbb\exception\http_exception
104
-	*/
94
+	 * View controller for display a category
95
+	 *
96
+	 * @param	int		$cat_id		The category ID
97
+	 * @param	int		$page		Page number taken from the URL
98
+	 * @param	int		$sort_days	Specifies the maximum amount of days a link may be old
99
+	 * @param	string	$sort_key	is the key of $sort_by_sql for the selected sorting: a|t|r|s|v|p
100
+	 * @param	string	$sort_dir	is either a or d representing ASC and DESC (ascending|descending)
101
+	 * @param	string	$mode		watch|unwatch
102
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
103
+	 * @throws	\phpbb\exception\http_exception
104
+	 */
105 105
 	public function view($cat_id, $page, $sort_days, $sort_key, $sort_dir, $mode = '')
106 106
 	{
107 107
 		if (false === $this->categorie->get($cat_id))
@@ -361,11 +361,11 @@  discard block
 block discarded – undo
361 361
 	}
362 362
 
363 363
 	/**
364
-	* date controller for return a date
365
-	*
366
-	* @return	\phpbb\json_response	A Json Response
367
-	* @throws	\phpbb\exception\http_exception
368
-	*/
364
+	 * date controller for return a date
365
+	 *
366
+	 * @return	\phpbb\json_response	A Json Response
367
+	 * @throws	\phpbb\exception\http_exception
368
+	 */
369 369
 	public function return_date()
370 370
 	{
371 371
 		if (!$this->request->is_ajax())
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
 	*/
59 59
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \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)
60 60
 	{
61
-		$this->db			= $db;
61
+		$this->db = $db;
62 62
 		$this->config		= $config;
63
-		$this->template		= $template;
63
+		$this->template = $template;
64 64
 		$this->user			= $user;
65 65
 		$this->helper		= $helper;
66
-		$this->request		= $request;
66
+		$this->request = $request;
67 67
 		$this->auth			= $auth;
68
-		$this->pagination	= $pagination;
69
-		$this->categorie	= $categorie;
68
+		$this->pagination = $pagination;
69
+		$this->categorie = $categorie;
70 70
 		$this->link			= $link;
71 71
 
72 72
 		$this->user->add_lang_ext('ernadoo/phpbbdirectory', 'directory');
@@ -111,18 +111,18 @@  discard block
 block discarded – undo
111 111
 
112 112
 		$start = ($page - 1) * $this->config['dir_show'];
113 113
 
114
-		$default_sort_days	= 0;
114
+		$default_sort_days = 0;
115 115
 		$default_sort_key	= (string) substr($this->config['dir_default_order'], 0, 1);
116 116
 		$default_sort_dir	= (string) substr($this->config['dir_default_order'], 2);
117 117
 
118 118
 		$sort_days	= (!$sort_days) ? $this->request->variable('st', $default_sort_days) : $sort_days;
119 119
 		$sort_key 	= (!$sort_key) ? $this->request->variable('sk', $default_sort_key) : $sort_key;
120
-		$sort_dir	= (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir;
120
+		$sort_dir = (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir;
121 121
 		$link_list = $rowset = array();
122 122
 
123 123
 		// Categorie ordering options
124 124
 		$limit_days		= array(0 => $this->user->lang['SEE_ALL'], 1 => $this->user->lang['1_DAY'], 7 => $this->user->lang['7_DAYS'], 14 => $this->user->lang['2_WEEKS'], 30 => $this->user->lang['1_MONTH'], 90 => $this->user->lang['3_MONTHS'], 180 => $this->user->lang['6_MONTHS'], 365 => $this->user->lang['1_YEAR']);
125
-		$sort_by_text	= array('a' => $this->user->lang['AUTHOR'], 't' => $this->user->lang['POST_TIME'], 'r' => $this->user->lang['DIR_COMMENTS_ORDER'], 's' =>  $this->user->lang['DIR_NAME_ORDER'], 'v' => $this->user->lang['DIR_NB_CLICKS_ORDER']);
125
+		$sort_by_text = array('a' => $this->user->lang['AUTHOR'], 't' => $this->user->lang['POST_TIME'], 'r' => $this->user->lang['DIR_COMMENTS_ORDER'], 's' =>  $this->user->lang['DIR_NAME_ORDER'], 'v' => $this->user->lang['DIR_NB_CLICKS_ORDER']);
126 126
 		$sort_by_sql	= array('a' => 'u.username_clean', 't' => array('l.link_time', 'l.link_id'), 'r' => 'l.link_comment', 's' => 'LOWER(l.link_name)', 'v' => 'l.link_view');
127 127
 
128 128
 		if ($this->config['dir_activ_pagerank'])
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 			$min_post_time = time() - ($sort_days * 86400);
162 162
 
163 163
 			$sql = 'SELECT COUNT(link_id) AS nb_links
164
-				FROM ' . DIR_LINK_TABLE . '
165
-				WHERE link_cat = ' . (int) $cat_id . '
164
+				FROM ' . DIR_LINK_TABLE.'
165
+				WHERE link_cat = ' . (int) $cat_id.'
166 166
 					AND link_time >= ' . $min_post_time;
167 167
 			$result = $this->db->sql_query($sql);
168 168
 			$nb_links = (int) $this->db->sql_fetchfield('nb_links');
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		else
178 178
 		{
179 179
 			$sql_limit_time = '';
180
-			$nb_links		= (int) $this->categorie->data['cat_links'];
180
+			$nb_links = (int) $this->categorie->data['cat_links'];
181 181
 		}
182 182
 
183 183
 		// Make sure $start is set to the last page if it exceeds the amount
@@ -237,11 +237,11 @@  discard block
 block discarded – undo
237 237
 
238 238
 		if (is_array($sort_by_sql[$sort_key]))
239 239
 		{
240
-			$sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
240
+			$sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction;
241 241
 		}
242 242
 		else
243 243
 		{
244
-			$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
244
+			$sql_sort_order = $sort_by_sql[$sort_key].' '.$direction;
245 245
 		}
246 246
 
247 247
 		// Grab just the sorted link ids
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 						),
285 285
 						array(
286 286
 							'FROM'	=> array(DIR_VOTE_TABLE => 'v'),
287
-							'ON'	=> 'l.link_id = v.vote_link_id AND v.vote_user_id = ' . $this->user->data['user_id']
287
+							'ON'	=> 'l.link_id = v.vote_link_id AND v.vote_user_id = '.$this->user->data['user_id']
288 288
 						)
289 289
 				),
290 290
 				'WHERE'		=> $this->db->sql_in_set('l.link_id', $link_list)
@@ -301,8 +301,8 @@  discard block
 block discarded – undo
301 301
 
302 302
 			$link_list = ($store_reverse) ? array_reverse($link_list) : $link_list;
303 303
 
304
-			$votes_status 		= ($this->categorie->data['cat_allow_votes']) ? true : false;
305
-			$comments_status 	= ($this->categorie->data['cat_allow_comments']) ? true : false;
304
+			$votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false;
305
+			$comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false;
306 306
 
307 307
 			foreach ($link_list as $link_id)
308 308
 			{
@@ -312,11 +312,11 @@  discard block
 block discarded – undo
312 312
 				$s_note		= $this->link->display_note($site['link_note'], $site['link_vote'], $votes_status);
313 313
 				$s_thumb	= $this->link->display_thumb($site);
314 314
 				$s_vote		= $this->link->display_vote($site);
315
-				$s_banner	= $this->link->display_bann($site);
316
-				$s_pr		= $this->link->display_pagerank($site);
317
-				$s_rss		= $this->link->display_rss($site);
315
+				$s_banner = $this->link->display_bann($site);
316
+				$s_pr = $this->link->display_pagerank($site);
317
+				$s_rss = $this->link->display_rss($site);
318 318
 
319
-				$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'))));
319
+				$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'))));
320 320
 				$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'))));
321 321
 
322 322
 				$this->template->assign_block_vars('site', array(
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 			$this->template->assign_block_vars('no_draw_link', array());
354 354
 		}
355 355
 
356
-		$page_title = $this->user->lang['DIRECTORY'] . ' - ' . $this->categorie->data['cat_name'];
356
+		$page_title = $this->user->lang['DIRECTORY'].' - '.$this->categorie->data['cat_name'];
357 357
 
358 358
 		$this->categorie->display();
359 359
 
Please login to merge, or discard this patch.
controller/comments.php 3 patches
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -56,22 +56,22 @@  discard block
 block discarded – undo
56 56
 	protected $php_ext;
57 57
 
58 58
 	/**
59
-	* Constructor
60
-	*
61
-	* @param \phpbb\db\driver\driver_interface					$db					Database object
62
-	* @param \phpbb\config\config								$config				Config object
63
-	* @param \phpbb\template\template							$template			Template object
64
-	* @param \phpbb\user										$user				User object
65
-	* @param \phpbb\controller\helper							$helper				Controller helper object
66
-	* @param \phpbb\request\request								$request			Request object
67
-	* @param \phpbb\auth\auth									$auth				Auth object
68
-	* @param \phpbb\pagination									$pagination			Pagination object
69
-	* @param \phpbb\captcha\factory								$captcha_factory	Captcha object
70
-	* @param \ernadoo\phpbbdirectory\core\categorie				$categorie			PhpBB Directory extension categorie object
71
-	* @param \ernadoo\phpbbdirectory\core\comment				$comment			PhpBB Directory extension comment object
72
-	* @param string												$root_path			phpBB root path
73
-	* @param string												$php_ext			phpEx
74
-	*/
59
+	 * Constructor
60
+	 *
61
+	 * @param \phpbb\db\driver\driver_interface					$db					Database object
62
+	 * @param \phpbb\config\config								$config				Config object
63
+	 * @param \phpbb\template\template							$template			Template object
64
+	 * @param \phpbb\user										$user				User object
65
+	 * @param \phpbb\controller\helper							$helper				Controller helper object
66
+	 * @param \phpbb\request\request								$request			Request object
67
+	 * @param \phpbb\auth\auth									$auth				Auth object
68
+	 * @param \phpbb\pagination									$pagination			Pagination object
69
+	 * @param \phpbb\captcha\factory								$captcha_factory	Captcha object
70
+	 * @param \ernadoo\phpbbdirectory\core\categorie				$categorie			PhpBB Directory extension categorie object
71
+	 * @param \ernadoo\phpbbdirectory\core\comment				$comment			PhpBB Directory extension comment object
72
+	 * @param string												$root_path			phpBB root path
73
+	 * @param string												$php_ext			phpEx
74
+	 */
75 75
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \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)
76 76
 	{
77 77
 		$this->db				= $db;
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
 	}
107 107
 
108 108
 	/**
109
-	* Populate form when an error occurred
110
-	*
111
-	* @param	int		$link_id		The link ID
112
-	* @param	int		$comment_id		The comment ID
113
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
114
-	* @throws	\phpbb\exception\http_exception
115
-	*/
109
+	 * Populate form when an error occurred
110
+	 *
111
+	 * @param	int		$link_id		The link ID
112
+	 * @param	int		$comment_id		The comment ID
113
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
114
+	 * @throws	\phpbb\exception\http_exception
115
+	 */
116 116
 	public function delete_comment($link_id, $comment_id)
117 117
 	{
118 118
 		$this->_check_comments_enable($link_id);
@@ -151,13 +151,13 @@  discard block
 block discarded – undo
151 151
 	}
152 152
 
153 153
 	/**
154
-	* Edit a comment
155
-	*
156
-	* @param	int		$link_id		The category ID
157
-	* @param	int		$comment_id		The comment ID
158
-	* @return	null|\Symfony\Component\HttpFoundation\Response	A Symfony Response object
159
-	* @throws	\phpbb\exception\http_exception
160
-	*/
154
+	 * Edit a comment
155
+	 *
156
+	 * @param	int		$link_id		The category ID
157
+	 * @param	int		$comment_id		The comment ID
158
+	 * @return	null|\Symfony\Component\HttpFoundation\Response	A Symfony Response object
159
+	 * @throws	\phpbb\exception\http_exception
160
+	 */
161 161
 	public function edit_comment($link_id, $comment_id)
162 162
 	{
163 163
 		$this->_check_comments_enable($link_id);
@@ -188,12 +188,12 @@  discard block
 block discarded – undo
188 188
 	}
189 189
 
190 190
 	/**
191
-	* Post a new comment
192
-	*
193
-	* @param	int	$link_id		The category ID
194
-	* @return	null
195
-	* @throws	\phpbb\exception\http_exception
196
-	*/
191
+	 * Post a new comment
192
+	 *
193
+	 * @param	int	$link_id		The category ID
194
+	 * @return	null
195
+	 * @throws	\phpbb\exception\http_exception
196
+	 */
197 197
 	public function new_comment($link_id)
198 198
 	{
199 199
 		$this->_check_comments_enable($link_id);
@@ -219,14 +219,14 @@  discard block
 block discarded – undo
219 219
 	}
220 220
 
221 221
 	/**
222
-	* Display popup comment
223
-	*
224
-	* @param	int		$link_id		The category ID
225
-	* @param	int		$page			Page number taken from the URL
226
-	* @param	string	$mode			add|edit
227
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
228
-	* @throws	\phpbb\exception\http_exception
229
-	*/
222
+	 * Display popup comment
223
+	 *
224
+	 * @param	int		$link_id		The category ID
225
+	 * @param	int		$page			Page number taken from the URL
226
+	 * @param	string	$mode			add|edit
227
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
228
+	 * @throws	\phpbb\exception\http_exception
229
+	 */
230 230
 	public function view($link_id, $page, $mode = 'new')
231 231
 	{
232 232
 		$this->_check_comments_enable($link_id);
@@ -319,13 +319,13 @@  discard block
 block discarded – undo
319 319
 	}
320 320
 
321 321
 	/**
322
-	* Routine
323
-	*
324
-	* @param	int		$link_id		The link ID
325
-	* @param	int		$comment_id		The comment ID
326
-	* @param	string	$mode			new|edit
327
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
328
-	*/
322
+	 * Routine
323
+	 *
324
+	 * @param	int		$link_id		The link ID
325
+	 * @param	int		$comment_id		The comment ID
326
+	 * @param	string	$mode			new|edit
327
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
328
+	 */
329 329
 	private function _data_processing($link_id, $comment_id = 0, $mode = 'new')
330 330
 	{
331 331
 		if (!check_form_key('dir_form_comment'))
@@ -413,12 +413,12 @@  discard block
 block discarded – undo
413 413
 	}
414 414
 
415 415
 	/**
416
-	* Check if comments are enable in a category
417
-	*
418
-	* @param	int		$link_id		The link ID
419
-	* @return	null					Retun null if comments are allowed, http_exception if not
420
-	* @throws	\phpbb\exception\http_exception
421
-	*/
416
+	 * Check if comments are enable in a category
417
+	 *
418
+	 * @param	int		$link_id		The link ID
419
+	 * @return	null					Retun null if comments are allowed, http_exception if not
420
+	 * @throws	\phpbb\exception\http_exception
421
+	 */
422 422
 	private function _check_comments_enable($link_id)
423 423
 	{
424 424
 		$sql = 'SELECT link_cat
@@ -444,12 +444,12 @@  discard block
 block discarded – undo
444 444
 	}
445 445
 
446 446
 	/**
447
-	* Populate form when an error occurred
448
-	*
449
-	* @param	int		$link_id		The link ID
450
-	* @param	string	$mode			add|edit
451
-	* @return	null
452
-	*/
447
+	 * Populate form when an error occurred
448
+	 *
449
+	 * @param	int		$link_id		The link ID
450
+	 * @param	string	$mode			add|edit
451
+	 * @return	null
452
+	 */
453 453
 	private function _populate_form($link_id, $mode)
454 454
 	{
455 455
 		if (!$this->user->data['is_registered'] && $this->config['dir_visual_confirm'] && $mode != 'edit')
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@
 block discarded – undo
191 191
 	* Post a new comment
192 192
 	*
193 193
 	* @param	int	$link_id		The category ID
194
-	* @return	null
194
+	* @return	\Symfony\Component\HttpFoundation\Response|null
195 195
 	* @throws	\phpbb\exception\http_exception
196 196
 	*/
197 197
 	public function new_comment($link_id)
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -74,15 +74,15 @@  discard block
 block discarded – undo
74 74
 	*/
75 75
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \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)
76 76
 	{
77
-		$this->db				= $db;
77
+		$this->db = $db;
78 78
 		$this->config			= $config;
79
-		$this->template			= $template;
79
+		$this->template = $template;
80 80
 		$this->user				= $user;
81 81
 		$this->helper			= $helper;
82
-		$this->request			= $request;
82
+		$this->request = $request;
83 83
 		$this->auth				= $auth;
84
-		$this->pagination		= $pagination;
85
-		$this->captcha_factory 	= $captcha_factory;
84
+		$this->pagination = $pagination;
85
+		$this->captcha_factory = $captcha_factory;
86 86
 		$this->categorie		= $categorie;
87 87
 		$this->comment			= $comment;
88 88
 		$this->root_path		= $root_path;
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		}
125 125
 
126 126
 		$sql = 'SELECT *
127
-			FROM ' . DIR_COMMENT_TABLE . '
127
+			FROM ' . DIR_COMMENT_TABLE.'
128 128
 			WHERE comment_id = ' . (int) $comment_id;
129 129
 		$result = $this->db->sql_query($sql);
130 130
 		$value = $this->db->sql_fetchrow($result);
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id));
142 142
 			meta_refresh(3, $meta_info);
143 143
 			$message = $this->user->lang['DIR_COMMENT_DELETE_OK'];
144
-			$message = $message . '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>');
144
+			$message = $message.'<br /><br />'.$this->user->lang('DIR_CLICK_RETURN_COMMENT', '<a href="'.$meta_info.'">', '</a>');
145 145
 			return $this->helper->message($message);
146 146
 		}
147 147
 		else
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		$this->_check_comments_enable($link_id);
164 164
 
165 165
 		$sql = 'SELECT *
166
-			FROM ' . DIR_COMMENT_TABLE . '
166
+			FROM ' . DIR_COMMENT_TABLE.'
167 167
 			WHERE comment_id = ' . (int) $comment_id;
168 168
 		$result = $this->db->sql_query($sql);
169 169
 		$value = $this->db->sql_fetchrow($result);
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 		$comment_text = generate_text_for_edit($value['comment_text'], $value['comment_uid'], $value['comment_flags']);
177 177
 		$this->s_comment = $comment_text['text'];
178 178
 
179
-		$submit	= $this->request->is_set_post('update_comment') ? true : false;
179
+		$submit = $this->request->is_set_post('update_comment') ? true : false;
180 180
 
181 181
 		// If form is done
182 182
 		if ($submit)
@@ -232,15 +232,15 @@  discard block
 block discarded – undo
232 232
 		$this->_check_comments_enable($link_id);
233 233
 
234 234
 		$comment_id = $this->request->variable('c', 0);
235
-		$view 		= $this->request->variable('view', '');
236
-		$start 		= ($page - 1) * $this->config['dir_comments_per_page'];
235
+		$view = $this->request->variable('view', '');
236
+		$start = ($page - 1) * $this->config['dir_comments_per_page'];
237 237
 
238 238
 		$this->s_hidden_fields = array_merge($this->s_hidden_fields, array('page' => $page));
239 239
 
240 240
 		$this->_populate_form($link_id, $mode);
241 241
 
242 242
 		$sql = 'SELECT COUNT(comment_id) AS nb_comments
243
-			FROM ' . DIR_COMMENT_TABLE . '
243
+			FROM ' . DIR_COMMENT_TABLE.'
244 244
 			WHERE comment_link_id = ' . (int) $link_id;
245 245
 		$result = $this->db->sql_query($sql);
246 246
 		$nb_comments = (int) $this->db->sql_fetchfield('nb_comments');
@@ -260,10 +260,10 @@  discard block
 block discarded – undo
260 260
 					),
261 261
 					array(
262 262
 						'FROM'	=> array(ZEBRA_TABLE => 'z'),
263
-						'ON'	=> 'z.user_id = ' . $this->user->data['user_id'] . ' AND z.zebra_id = a.comment_user_id'
263
+						'ON'	=> 'z.user_id = '.$this->user->data['user_id'].' AND z.zebra_id = a.comment_user_id'
264 264
 					)
265 265
 			),
266
-			'WHERE'		=> 'a.comment_link_id = ' . (int) $link_id,
266
+			'WHERE'		=> 'a.comment_link_id = '.(int) $link_id,
267 267
 			'ORDER_BY'	=> 'a.comment_date DESC');
268 268
 		$sql = $this->db->sql_build_query('SELECT', $sql_array);
269 269
 		$result = $this->db->sql_query_limit($sql, $this->config['dir_comments_per_page'], $start);
@@ -292,12 +292,12 @@  discard block
 block discarded – undo
292 292
 				'S_COMMENT'			=> generate_text_for_display($comments['comment_text'], $comments['comment_uid'], $comments['comment_bitfield'], $comments['comment_flags']),
293 293
 				'S_ID'				=> $comments['comment_id'],
294 294
 
295
-				'U_EDIT'			=> ($edit_allowed) 		? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '',
296
-				'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())) : '',
295
+				'U_EDIT'			=> ($edit_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '',
296
+				'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())) : '',
297 297
 
298 298
 				'S_IGNORE_POST'		=> ($comments['foe'] && ($view != 'show' || $comment_id != $comments['comment_id'])) ? true : false,
299 299
 				'L_IGNORE_POST'		=> ($comments['foe']) ? $this->user->lang('POST_BY_FOE', get_username_string('full', $comments['comment_user_id'], $comments['username'], $comments['user_colour']), '<a href="'.$this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '',
300
-				'L_POST_DISPLAY'	=> ($comments['foe']) ? $this->user->lang('POST_DISPLAY', '<a class="display_post" data-post-id="' . $comments['comment_id'] . '" href="' . $this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?c='.(int) $comments['comment_id'] . '&view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '',
300
+				'L_POST_DISPLAY'	=> ($comments['foe']) ? $this->user->lang('POST_DISPLAY', '<a class="display_post" data-post-id="'.$comments['comment_id'].'" href="'.$this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?c='.(int) $comments['comment_id'].'&view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '',
301 301
 
302 302
 				'S_INFO'			=> $this->auth->acl_get('m_info'),
303 303
 			));
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 
338 338
 		if (!function_exists('validate_data'))
339 339
 		{
340
-			include($this->root_path . 'includes/functions_user.' . $this->php_ext);
340
+			include($this->root_path.'includes/functions_user.'.$this->php_ext);
341 341
 		}
342 342
 
343 343
 		$error = validate_data(
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id));
400 400
 			meta_refresh(3, $meta_info);
401 401
 			$message = $this->user->lang['DIR_'.strtoupper($mode).'_COMMENT_OK'];
402
-			$message = $message . '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>');
402
+			$message = $message.'<br /><br />'.$this->user->lang('DIR_CLICK_RETURN_COMMENT', '<a href="'.$meta_info.'">', '</a>');
403 403
 			return $this->helper->message($message);
404 404
 		}
405 405
 		else
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 	private function _check_comments_enable($link_id)
423 423
 	{
424 424
 		$sql = 'SELECT link_cat
425
-			FROM ' . DIR_LINK_TABLE . '
425
+			FROM ' . DIR_LINK_TABLE.'
426 426
 			WHERE link_id = ' . (int) $link_id;
427 427
 		$result = $this->db->sql_query($sql);
428 428
 		$cat_id = (int) $this->db->sql_fetchfield('link_cat');
@@ -464,11 +464,11 @@  discard block
 block discarded – undo
464 464
 
465 465
 		if (!function_exists('generate_smilies'))
466 466
 		{
467
-			include($this->root_path . 'includes/functions_posting.' . $this->php_ext);
467
+			include($this->root_path.'includes/functions_posting.'.$this->php_ext);
468 468
 		}
469 469
 		if (!function_exists('display_custom_bbcodes'))
470 470
 		{
471
-			include($this->root_path . 'includes/functions_display.' . $this->php_ext);
471
+			include($this->root_path.'includes/functions_display.'.$this->php_ext);
472 472
 		}
473 473
 
474 474
 		generate_smilies('inline', 0);
@@ -478,11 +478,11 @@  discard block
 block discarded – undo
478 478
 		$this->template->assign_vars(array(
479 479
 			'S_AUTH_COMM' 		=> $this->auth->acl_get('u_comment_dir'),
480 480
 
481
-			'BBCODE_STATUS'		=> ($this->config['dir_allow_bbcode']) 	? $this->user->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->user->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'),
482
-			'IMG_STATUS'		=> ($this->config['dir_allow_bbcode']) 	? $this->user->lang['IMAGES_ARE_ON'] : $this->user->lang['IMAGES_ARE_OFF'],
483
-			'SMILIES_STATUS'	=> ($this->config['dir_allow_smilies'])	? $this->user->lang['SMILIES_ARE_ON'] : $this->user->lang['SMILIES_ARE_OFF'],
484
-			'URL_STATUS'		=> ($this->config['dir_allow_links'])	? $this->user->lang['URL_IS_ON'] : $this->user->lang['URL_IS_OFF'],
485
-			'FLASH_STATUS'		=> ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash'])	? $this->user->lang['FLASH_IS_ON'] : $this->user->lang['FLASH_IS_OFF'],
481
+			'BBCODE_STATUS'		=> ($this->config['dir_allow_bbcode']) ? $this->user->lang('BBCODE_IS_ON', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>') : $this->user->lang('BBCODE_IS_OFF', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>'),
482
+			'IMG_STATUS'		=> ($this->config['dir_allow_bbcode']) ? $this->user->lang['IMAGES_ARE_ON'] : $this->user->lang['IMAGES_ARE_OFF'],
483
+			'SMILIES_STATUS'	=> ($this->config['dir_allow_smilies']) ? $this->user->lang['SMILIES_ARE_ON'] : $this->user->lang['SMILIES_ARE_OFF'],
484
+			'URL_STATUS'		=> ($this->config['dir_allow_links']) ? $this->user->lang['URL_IS_ON'] : $this->user->lang['URL_IS_OFF'],
485
+			'FLASH_STATUS'		=> ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash']) ? $this->user->lang['FLASH_IS_ON'] : $this->user->lang['FLASH_IS_OFF'],
486 486
 
487 487
 			'L_DIR_REPLY_EXP'	=> $this->user->lang('DIR_REPLY_EXP', $this->config['dir_length_comments']),
488 488
 
Please login to merge, or discard this patch.
controller/links.php 2 patches
Indentation   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -68,22 +68,22 @@  discard block
 block discarded – undo
68 68
 	protected $php_ext;
69 69
 
70 70
 	/**
71
-	* Constructor
72
-	*
73
-	* @param \phpbb\db\driver\driver_interface 		$db					Database object
74
-	* @param \phpbb\config\config					$config				Config object
75
-	* @param \phpbb\template\template				$template			Template object
76
-	* @param \phpbb\user							$user				User object
77
-	* @param \phpbb\controller\helper				$helper				Controller helper object
78
-	* @param \phpbb\request\request					$request			Request object
79
-	* @param \phpbb\auth\auth						$auth				Auth object
80
-	* @param \phpbb\captcha\factory					$captcha_factory	Captcha object
81
-	* @param \ernadoo\phpbbdirectory\core\categorie	$categorie			PhpBB Directory extension categorie object
82
-	* @param \ernadoo\phpbbdirectory\core\link		$link				PhpBB Directory extension link object
83
-	* @param \ernadoo\phpbbdirectory\core\helper	$dir_helper			PhpBB Directory extension helper object
84
-	* @param string									$root_path			phpBB root path
85
-	* @param string									$php_ext   			phpEx
86
-	*/
71
+	 * Constructor
72
+	 *
73
+	 * @param \phpbb\db\driver\driver_interface 		$db					Database object
74
+	 * @param \phpbb\config\config					$config				Config object
75
+	 * @param \phpbb\template\template				$template			Template object
76
+	 * @param \phpbb\user							$user				User object
77
+	 * @param \phpbb\controller\helper				$helper				Controller helper object
78
+	 * @param \phpbb\request\request					$request			Request object
79
+	 * @param \phpbb\auth\auth						$auth				Auth object
80
+	 * @param \phpbb\captcha\factory					$captcha_factory	Captcha object
81
+	 * @param \ernadoo\phpbbdirectory\core\categorie	$categorie			PhpBB Directory extension categorie object
82
+	 * @param \ernadoo\phpbbdirectory\core\link		$link				PhpBB Directory extension link object
83
+	 * @param \ernadoo\phpbbdirectory\core\helper	$dir_helper			PhpBB Directory extension helper object
84
+	 * @param string									$root_path			phpBB root path
85
+	 * @param string									$php_ext   			phpEx
86
+	 */
87 87
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \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, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext)
88 88
 	{
89 89
 		$this->db				= $db;
@@ -109,12 +109,12 @@  discard block
 block discarded – undo
109 109
 	}
110 110
 
111 111
 	/**
112
-	* Delete a link
113
-	*
114
-	* @param	int	$cat_id		The category ID
115
-	* @param	int	$link_id		The link ID
116
-	* @return	null|\Symfony\Component\HttpFoundation\Response	A Symfony Response object
117
-	*/
112
+	 * Delete a link
113
+	 *
114
+	 * @param	int	$cat_id		The category ID
115
+	 * @param	int	$link_id		The link ID
116
+	 * @return	null|\Symfony\Component\HttpFoundation\Response	A Symfony Response object
117
+	 */
118 118
 	public function delete_link($cat_id, $link_id)
119 119
 	{
120 120
 		if ($this->request->is_set_post('cancel'))
@@ -157,13 +157,13 @@  discard block
 block discarded – undo
157 157
 	}
158 158
 
159 159
 	/**
160
-	* Edit a link
161
-	*
162
-	* @param	int	$cat_id		The category ID
163
-	* @param	int	$link_id	The link ID
164
-	* @return	null|\Symfony\Component\HttpFoundation\Response	A Symfony Response object
165
-	* @throws	\phpbb\exception\http_exception
166
-	*/
160
+	 * Edit a link
161
+	 *
162
+	 * @param	int	$cat_id		The category ID
163
+	 * @param	int	$link_id	The link ID
164
+	 * @return	null|\Symfony\Component\HttpFoundation\Response	A Symfony Response object
165
+	 * @throws	\phpbb\exception\http_exception
166
+	 */
167 167
 	public function edit_link($cat_id, $link_id)
168 168
 	{
169 169
 		$sql = 'SELECT link_user_id
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
 	}
239 239
 
240 240
 	/**
241
-	* Display add form
242
-	*
243
-	* @param	int	$cat_id		The category ID
244
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
245
-	* @throws	\phpbb\exception\http_exception
246
-	*/
241
+	 * Display add form
242
+	 *
243
+	 * @param	int	$cat_id		The category ID
244
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
245
+	 * @throws	\phpbb\exception\http_exception
246
+	 */
247 247
 	public function new_link($cat_id)
248 248
 	{
249 249
 		if (!$this->auth->acl_get('u_submit_dir'))
@@ -285,23 +285,23 @@  discard block
 block discarded – undo
285 285
 	}
286 286
 
287 287
 	/**
288
-	* View link controller
289
-	*
290
-	* @param	int	$link_id		The link ID
291
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
292
-	*/
288
+	 * View link controller
289
+	 *
290
+	 * @param	int	$link_id		The link ID
291
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
292
+	 */
293 293
 	public function view_link($link_id)
294 294
 	{
295 295
 		return $this->link->view($link_id);
296 296
 	}
297 297
 
298 298
 	/**
299
-	* Vote for a link
300
-	*
301
-	* @param	int $cat_id		The category ID
302
-	* @param	int $link_id	The link ID
303
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
304
-	*/
299
+	 * Vote for a link
300
+	 *
301
+	 * @param	int $cat_id		The category ID
302
+	 * @param	int $link_id	The link ID
303
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
304
+	 */
305 305
 	public function vote_link($cat_id, $link_id)
306 306
 	{
307 307
 		$this->categorie->get($cat_id);
@@ -337,14 +337,14 @@  discard block
 block discarded – undo
337 337
 	}
338 338
 
339 339
 	/**
340
-	* Routine
341
-	*
342
-	* @param	int		$cat_id		The category ID
343
-	* @param	int		$link_id	The link ID
344
-	* @param	string	$mode		add|edit
345
-	* @return	null|\Symfony\Component\HttpFoundation\Response	A Symfony Response object
346
-	* @throws	\phpbb\exception\http_exception
347
-	*/
340
+	 * Routine
341
+	 *
342
+	 * @param	int		$cat_id		The category ID
343
+	 * @param	int		$link_id	The link ID
344
+	 * @param	string	$mode		add|edit
345
+	 * @return	null|\Symfony\Component\HttpFoundation\Response	A Symfony Response object
346
+	 * @throws	\phpbb\exception\http_exception
347
+	 */
348 348
 	private function _data_processing($cat_id, $link_id = 0, $mode = 'new')
349 349
 	{
350 350
 		if (($mode == 'edit' && !$this->auth->acl_get('m_edit_dir') && !$this->auth->acl_get('u_edit_dir')) || ($mode == 'new' && !$this->auth->acl_get('u_submit_dir')))
@@ -434,8 +434,8 @@  discard block
 block discarded – undo
434 434
 		if (!$error)
435 435
 		{
436 436
 			/**
437
-			* No errrors, we execute heavy tasks wich need a valid url
438
-			*/
437
+			 * No errrors, we execute heavy tasks wich need a valid url
438
+			 */
439 439
 
440 440
 			// Banner
441 441
 			$this->link->banner_process($this->banner, $error);
@@ -518,11 +518,11 @@  discard block
 block discarded – undo
518 518
 	}
519 519
 
520 520
 	/**
521
-	* Display a banner
522
-	*
523
-	* @param	string $banner_img		Path to banner file
524
-	* @return	Response object
525
-	*/
521
+	 * Display a banner
522
+	 *
523
+	 * @param	string $banner_img		Path to banner file
524
+	 * @return	Response object
525
+	 */
526 526
 	public function return_banner($banner_img)
527 527
 	{
528 528
 		if (!function_exists('file_gc'))
@@ -555,13 +555,13 @@  discard block
 block discarded – undo
555 555
 	}
556 556
 
557 557
 	/**
558
-	* Populate form when an error occurred
559
-	*
560
-	* @param	int		$cat_id		The category ID
561
-	* @param	string	$mode		add|edit
562
-	* @param	string	$title		Page title (depends of $mode)
563
-	* @return	null
564
-	*/
558
+	 * Populate form when an error occurred
559
+	 *
560
+	 * @param	int		$cat_id		The category ID
561
+	 * @param	string	$mode		add|edit
562
+	 * @param	string	$title		Page title (depends of $mode)
563
+	 * @return	null
564
+	 */
565 565
 	private function _populate_form($cat_id, $mode, $title)
566 566
 	{
567 567
 		global $phpbb_extension_manager;
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -86,19 +86,19 @@  discard block
 block discarded – undo
86 86
 	*/
87 87
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \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, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext)
88 88
 	{
89
-		$this->db				= $db;
89
+		$this->db = $db;
90 90
 		$this->config			= $config;
91
-		$this->template			= $template;
91
+		$this->template = $template;
92 92
 		$this->user				= $user;
93 93
 		$this->helper			= $helper;
94
-		$this->request			= $request;
94
+		$this->request = $request;
95 95
 		$this->auth				= $auth;
96
-		$this->captcha_factory 	= $captcha_factory;
96
+		$this->captcha_factory = $captcha_factory;
97 97
 		$this->categorie		= $categorie;
98 98
 		$this->link				= $link;
99
-		$this->dir_helper		= $dir_helper;
99
+		$this->dir_helper = $dir_helper;
100 100
 		$this->root_path		= $root_path;
101
-		$this->php_ext			= $php_ext;
101
+		$this->php_ext = $php_ext;
102 102
 
103 103
 		$this->user->add_lang_ext('ernadoo/phpbbdirectory', 'directory');
104 104
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		}
125 125
 
126 126
 		$sql = 'SELECT link_user_id
127
-			FROM ' . DIR_LINK_TABLE . '
127
+			FROM ' . DIR_LINK_TABLE.'
128 128
 			WHERE link_id = ' . (int) $link_id;
129 129
 		$result = $this->db->sql_query($sql);
130 130
 		$link_data = $this->db->sql_fetchrow($result);
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 
148 148
 			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id));
149 149
 			meta_refresh(3, $meta_info);
150
-			$message = $this->user->lang['DIR_DELETE_OK'] . '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)) . '">', '</a>');
150
+			$message = $this->user->lang['DIR_DELETE_OK'].'<br /><br />'.$this->user->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)).'">', '</a>');
151 151
 			return $this->helper->message($message);
152 152
 		}
153 153
 		else
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	public function edit_link($cat_id, $link_id)
168 168
 	{
169 169
 		$sql = 'SELECT link_user_id
170
-			FROM ' . DIR_LINK_TABLE . '
170
+			FROM ' . DIR_LINK_TABLE.'
171 171
 			WHERE link_id = ' . (int) $link_id;
172 172
 		$result = $this->db->sql_query($sql);
173 173
 		$link_data = $this->db->sql_fetchrow($result);
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		$cat_id		= $this->request->variable('id', $cat_id);
184 184
 		$submit		= $this->request->is_set_post('submit') ? true : false;
185 185
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
186
-		$title		= $this->user->lang['DIR_EDIT_SITE'];
186
+		$title = $this->user->lang['DIR_EDIT_SITE'];
187 187
 
188 188
 		$this->template->assign_block_vars('dir_navlinks', array(
189 189
 			'FORUM_NAME'	=> $title,
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 		else
204 204
 		{
205 205
 			$sql = 'SELECT link_id, link_uid, link_flags, link_bitfield, link_cat, link_url, link_description, link_guest_email, link_name, link_rss, link_back, link_banner, link_flag, link_cat, link_time
206
-				FROM ' . DIR_LINK_TABLE . '
206
+				FROM ' . DIR_LINK_TABLE.'
207 207
 				WHERE link_id = ' . (int) $link_id;
208 208
 			$result = $this->db->sql_query($sql);
209 209
 
@@ -219,15 +219,15 @@  discard block
 block discarded – undo
219 219
 				'old_banner'	=> $site['link_banner'],
220 220
 			);
221 221
 
222
-			$site_description		= generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']);
223
-			$site['link_banner'] 	= (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : '';
222
+			$site_description = generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']);
223
+			$site['link_banner'] = (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : '';
224 224
 
225
-			$this->url			= $site['link_url'];
226
-			$this->site_name	= $site['link_name'];
225
+			$this->url = $site['link_url'];
226
+			$this->site_name = $site['link_name'];
227 227
 			$this->description	= $site_description['text'];
228 228
 			$this->guest_email	= $site['link_guest_email'];
229
-			$this->rss			= $site['link_rss'];
230
-			$this->banner 		= $site['link_banner'];
229
+			$this->rss = $site['link_rss'];
230
+			$this->banner = $site['link_banner'];
231 231
 			$this->back			= $site['link_back'];
232 232
 			$this->flag 		= $site['link_flag'];
233 233
 		}
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 		$cat_id		= $this->request->variable('id', $cat_id);
255 255
 		$submit		= $this->request->is_set_post('submit') ? true : false;
256 256
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
257
-		$title		= $this->user->lang['DIR_NEW_SITE'];
257
+		$title = $this->user->lang['DIR_NEW_SITE'];
258 258
 
259 259
 		$this->template->assign_block_vars('dir_navlinks', array(
260 260
 			'FORUM_NAME'	=> $title,
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
 		// We check if user had already vot for this website.
320 320
 		$sql = 'SELECT vote_link_id
321
-			FROM ' . DIR_VOTE_TABLE . '
321
+			FROM ' . DIR_VOTE_TABLE.'
322 322
 			WHERE ' . $this->db->sql_build_array('SELECT', $data);
323 323
 		$result = $this->db->sql_query($sql);
324 324
 		$data = $this->db->sql_fetchrow($result);
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
 		$meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id));
334 334
 		meta_refresh(3, $meta_info);
335
-		$message = $this->user->lang['DIR_VOTE_OK'] . '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $meta_info . '">', '</a>');
335
+		$message = $this->user->lang['DIR_VOTE_OK'].'<br /><br />'.$this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$meta_info.'">', '</a>');
336 336
 		return $this->helper->message($message);
337 337
 	}
338 338
 
@@ -357,18 +357,18 @@  discard block
 block discarded – undo
357 357
 			return $this->helper->message('FORM_INVALID');
358 358
 		}
359 359
 
360
-		$this->url			= $this->request->variable('url', '');
361
-		$this->site_name	= $this->request->variable('site_name', '', true);
360
+		$this->url = $this->request->variable('url', '');
361
+		$this->site_name = $this->request->variable('site_name', '', true);
362 362
 		$this->description	= $this->request->variable('description', '', true);
363 363
 		$this->guest_email	= $this->request->variable('guest_email', '');
364
-		$this->rss			= $this->request->variable('rss', '');
365
-		$this->banner 		= $this->request->variable('banner', '');
364
+		$this->rss = $this->request->variable('rss', '');
365
+		$this->banner = $this->request->variable('banner', '');
366 366
 		$this->back			= $this->request->variable('back', '');
367 367
 		$this->flag 		= $this->request->variable('flag', '');
368 368
 
369 369
 		if (!function_exists('validate_data'))
370 370
 		{
371
-			include($this->root_path . 'includes/functions_user.' . $this->php_ext);
371
+			include($this->root_path.'includes/functions_user.'.$this->php_ext);
372 372
 		}
373 373
 
374 374
 		// We define variables to check
@@ -391,17 +391,17 @@  discard block
 block discarded – undo
391 391
 			'site_name' =>			array(
392 392
 				array('string', false, 1, 100)),
393 393
 			'website'		=>		array(
394
-				array('string',	false, 12, 255),
395
-				array('match',	true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
394
+				array('string', false, 12, 255),
395
+				array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
396 396
 			'description'	=>		array(
397 397
 				array('string', !$this->categorie->data['cat_must_describe'], 1, $this->config['dir_length_describe'])),
398 398
 			'rss'			=>		array(
399 399
 				array('string', true, 12, 255),
400
-				array('match',	empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
400
+				array('match', empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
401 401
 			'banner'		=>		array(
402 402
 				array('string', true, 5, 255)),
403 403
 			'back'			=>		array(
404
-				array('string',	!$this->categorie->data['cat_link_back'], 12, 255),
404
+				array('string', !$this->categorie->data['cat_link_back'], 12, 255),
405 405
 				array(array($this->link, 'link_back'), true)),
406 406
 			'cat'			=>		array(
407 407
 				array('num', '', 1))
@@ -450,8 +450,8 @@  discard block
 block discarded – undo
450 450
 		// Still no errors?? So let's go!
451 451
 		if (!$error)
452 452
 		{
453
-			$this->banner	= (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
454
-			$this->url		= $this->link->clean_url($this->url);
453
+			$this->banner = (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
454
+			$this->url = $this->link->clean_url($this->url);
455 455
 
456 456
 			$data_edit = array(
457 457
 				'link_user_id'		=> $this->link_user_id,
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id));
501 501
 			meta_refresh(3, $meta_info);
502 502
 			$message	= ($need_approval) ? $this->user->lang['DIR_'.strtoupper($mode).'_SITE_ACTIVE'] : $this->user->lang['DIR_'.strtoupper($mode).'_SITE_OK'];
503
-			$message	= $message . '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)) . '">', '</a>');
503
+			$message	= $message.'<br /><br />'.$this->user->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)).'">', '</a>');
504 504
 			return $this->helper->message($message);
505 505
 		}
506 506
 		else
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 	{
530 530
 		if (!function_exists('file_gc'))
531 531
 		{
532
-			include($this->root_path . 'includes/functions_download.' . $this->php_ext);
532
+			include($this->root_path.'includes/functions_download.'.$this->php_ext);
533 533
 		}
534 534
 
535 535
 		$file_path = $this->dir_helper->get_banner_path($banner_img);
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 
584 584
 		if (!function_exists('display_custom_bbcodes'))
585 585
 		{
586
-			include($this->root_path . 'includes/functions_display.' . $this->php_ext);
586
+			include($this->root_path.'includes/functions_display.'.$this->php_ext);
587 587
 		}
588 588
 		display_custom_bbcodes();
589 589
 		add_form_key('dir_form');
@@ -592,17 +592,17 @@  discard block
 block discarded – undo
592 592
 		$flag_path = $ext_path.'images/flags/';
593 593
 
594 594
 		$s_guest	= (!$this->user->data['is_registered'] || !empty($this->guest_email));
595
-		$s_rss		= $this->config['dir_activ_rss'];
596
-		$s_banner	= $this->config['dir_activ_banner'];
595
+		$s_rss = $this->config['dir_activ_rss'];
596
+		$s_banner = $this->config['dir_activ_banner'];
597 597
 		$s_back		= $this->categorie->data['cat_link_back'];
598 598
 		$s_flag		= $this->config['dir_activ_flag'];
599 599
 
600 600
 		$this->template->assign_vars(array(
601
-			'BBCODE_STATUS'			=> ($this->config['allow_bbcode']) 	? $this->user->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->user->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'),
602
-			'IMG_STATUS'			=> ($this->config['allow_bbcode'])	? $this->user->lang['IMAGES_ARE_ON'] : $this->user->lang['IMAGES_ARE_OFF'],
601
+			'BBCODE_STATUS'			=> ($this->config['allow_bbcode']) ? $this->user->lang('BBCODE_IS_ON', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>') : $this->user->lang('BBCODE_IS_OFF', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>'),
602
+			'IMG_STATUS'			=> ($this->config['allow_bbcode']) ? $this->user->lang['IMAGES_ARE_ON'] : $this->user->lang['IMAGES_ARE_OFF'],
603 603
 			'SMILIES_STATUS'		=> ($this->config['allow_smilies']) ? $this->user->lang['SMILIES_ARE_ON'] : $this->user->lang['SMILIES_ARE_OFF'],
604 604
 			'URL_STATUS'			=> ($this->config['allow_post_links']) ? $this->user->lang['URL_IS_ON'] : $this->user->lang['URL_IS_OFF'],
605
-			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash'])	? $this->user->lang['FLASH_IS_ON'] : $this->user->lang['FLASH_IS_OFF'],
605
+			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->user->lang['FLASH_IS_ON'] : $this->user->lang['FLASH_IS_OFF'],
606 606
 
607 607
 			'L_TITLE'				=> $title,
608 608
 			'L_DIR_DESCRIPTION_EXP'	=> $this->user->lang('DIR_DESCRIPTION_EXP', $this->config['dir_length_describe']),
Please login to merge, or discard this patch.
controller/search.php 2 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -47,20 +47,20 @@  discard block
 block discarded – undo
47 47
 	protected $link;
48 48
 
49 49
 	/**
50
-	* Constructor
51
-	*
52
-	* @param \phpbb\db\driver\driver_interface 					$db				Database object
53
-	* @param \phpbb\config\config 								$config			Config object
54
-	* @param \phpbb\template\template 							$template		Template object
55
-	* @param \phpbb\user 										$user			User object
56
-	* @param \phpbb\controller\helper 							$helper			Controller helper object
57
-	* @param \phpbb\request\request 							$request		Request object
58
-	* @param \phpbb\auth\auth 									$auth			Auth object
59
-	* @param \phpbb\pagination 									$pagination		Pagination object
60
-	* @param \ernadoo\phpbbdirectory\search\fulltext_directory	$search			PhpBB Directory extension search object
61
-	* @param \ernadoo\phpbbdirectory\core\categorie				$categorie		PhpBB Directory extension categorie object
62
-	* @param \ernadoo\phpbbdirectory\core\link					$link			PhpBB Directory extension link object
63
-	*/
50
+	 * Constructor
51
+	 *
52
+	 * @param \phpbb\db\driver\driver_interface 					$db				Database object
53
+	 * @param \phpbb\config\config 								$config			Config object
54
+	 * @param \phpbb\template\template 							$template		Template object
55
+	 * @param \phpbb\user 										$user			User object
56
+	 * @param \phpbb\controller\helper 							$helper			Controller helper object
57
+	 * @param \phpbb\request\request 							$request		Request object
58
+	 * @param \phpbb\auth\auth 									$auth			Auth object
59
+	 * @param \phpbb\pagination 									$pagination		Pagination object
60
+	 * @param \ernadoo\phpbbdirectory\search\fulltext_directory	$search			PhpBB Directory extension search object
61
+	 * @param \ernadoo\phpbbdirectory\core\categorie				$categorie		PhpBB Directory extension categorie object
62
+	 * @param \ernadoo\phpbbdirectory\core\link					$link			PhpBB Directory extension link object
63
+	 */
64 64
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \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)
65 65
 	{
66 66
 		$this->db			= $db;
@@ -85,12 +85,12 @@  discard block
 block discarded – undo
85 85
 	}
86 86
 
87 87
 	/**
88
-	* Search controller
89
-	*
90
-	* @param	int	$page	Page number taken from the URL
91
-	* @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
92
-	* @throws	\phpbb\exception\http_exception
93
-	*/
88
+	 * Search controller
89
+	 *
90
+	 * @param	int	$page	Page number taken from the URL
91
+	 * @return	\Symfony\Component\HttpFoundation\Response	A Symfony Response object
92
+	 * @throws	\phpbb\exception\http_exception
93
+	 */
94 94
 	public function main($page)
95 95
 	{
96 96
 		if (!$this->auth->acl_get('u_search_dir'))
@@ -314,11 +314,11 @@  discard block
 block discarded – undo
314 314
 	}
315 315
 
316 316
 	/**
317
-	*
318
-	* @param	array	$search_category
319
-	* @param	bool	$search_child
320
-	* @return	array	Categories to exclude from search
321
-	*/
317
+	 *
318
+	 * @param	array	$search_category
319
+	 * @param	bool	$search_child
320
+	 * @return	array	Categories to exclude from search
321
+	 */
322 322
 	private function _get_exclude_categories(&$search_category, $search_child)
323 323
 	{
324 324
 		$sql = 'SELECT cat_id, parent_id, right_id
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -63,17 +63,17 @@  discard block
 block discarded – undo
63 63
 	*/
64 64
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \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)
65 65
 	{
66
-		$this->db			= $db;
66
+		$this->db = $db;
67 67
 		$this->config		= $config;
68
-		$this->template		= $template;
68
+		$this->template = $template;
69 69
 		$this->user			= $user;
70 70
 		$this->helper		= $helper;
71
-		$this->request		= $request;
71
+		$this->request = $request;
72 72
 		$this->auth			= $auth;
73
-		$this->pagination	= $pagination;
74
-		$this->search		= $search;
75
-		$this->categorie	= $categorie;
76
-		$this->link			= $link;
73
+		$this->pagination = $pagination;
74
+		$this->search = $search;
75
+		$this->categorie = $categorie;
76
+		$this->link = $link;
77 77
 
78 78
 		$this->user->add_lang_ext('ernadoo/phpbbdirectory', array('directory'));
79 79
 		$this->user->add_lang('search');
@@ -98,24 +98,24 @@  discard block
 block discarded – undo
98 98
 			throw new \phpbb\exception\http_exception(403, 'DIR_ERROR_NOT_AUTH');
99 99
 		}
100 100
 
101
-		$cat_id				= $this->request->variable('cat_id', 0);
102
-		$keywords			= $this->request->variable('keywords', '', true);
101
+		$cat_id = $this->request->variable('cat_id', 0);
102
+		$keywords = $this->request->variable('keywords', '', true);
103 103
 		$search_terms		= $this->request->variable('terms', 'all');
104
-		$search_category	= $this->request->variable('cid', array(0));
105
-		$search_fields		= $this->request->variable('sf', 'all');
104
+		$search_category = $this->request->variable('cid', array(0));
105
+		$search_fields = $this->request->variable('sf', 'all');
106 106
 		$search_child		= $this->request->variable('sc', true);
107
-		$sort_days			= $this->request->variable('st', 0);
107
+		$sort_days = $this->request->variable('st', 0);
108 108
 		$sort_key			= $this->request->variable('sk', 't');
109 109
 		$sort_dir			= $this->request->variable('sd', 'd');
110
-		$start				= ($page - 1) * (int) $this->config['dir_show'];
110
+		$start = ($page - 1) * (int) $this->config['dir_show'];
111 111
 
112
-		$default_sort_days	= 0;
112
+		$default_sort_days = 0;
113 113
 		$default_sort_key	= (string) substr($this->config['dir_default_order'], 0, 1);
114 114
 		$default_sort_dir	= (string) substr($this->config['dir_default_order'], 2);
115 115
 
116 116
 		// Categorie ordering options
117 117
 		$limit_days		= array(0 => $this->user->lang['ALL_RESULTS'], 1 => $this->user->lang['1_DAY'], 7 => $this->user->lang['7_DAYS'], 14 => $this->user->lang['2_WEEKS'], 30 => $this->user->lang['1_MONTH'], 90 => $this->user->lang['3_MONTHS'], 180 => $this->user->lang['6_MONTHS'], 365 => $this->user->lang['1_YEAR']);
118
-		$sort_by_text	= array('a' => $this->user->lang['AUTHOR'], 't' => $this->user->lang['POST_TIME'], 'r' => $this->user->lang['DIR_COMMENTS_ORDER'], 's' =>  $this->user->lang['DIR_NAME_ORDER'], 'v' => $this->user->lang['DIR_NB_CLICKS_ORDER']);
118
+		$sort_by_text = array('a' => $this->user->lang['AUTHOR'], 't' => $this->user->lang['POST_TIME'], 'r' => $this->user->lang['DIR_COMMENTS_ORDER'], 's' =>  $this->user->lang['DIR_NAME_ORDER'], 'v' => $this->user->lang['DIR_NB_CLICKS_ORDER']);
119 119
 		$sort_by_sql	= array('a' => 'u.username_clean', 't' => array('l.link_time', 'l.link_id'), 'r' => 'l.link_comment', 's' => 'LOWER(l.link_name)', 'v' => 'l.link_view');
120 120
 
121 121
 		if ($this->config['dir_activ_pagerank'])
@@ -164,12 +164,12 @@  discard block
 block discarded – undo
164 164
 
165 165
 			$u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit)));
166 166
 
167
-			($u_hilit) 					? $u_search['keywords']		= urlencode(htmlspecialchars_decode($keywords)) : '';
168
-			($search_terms != 'all') 	? $u_search['terms']		= $search_terms : '';
169
-			($cat_id)					? $u_search['cat_id']		= $cat_id : '';
170
-			($search_category)			? $u_search['cid']			= $search_category : '';
171
-			(!$search_child)			? $u_search['sc']			= 0 : '';
172
-			($search_fields != 'all')	? $u_search['sf'] 			= $search_fields : '';
167
+			($u_hilit) ? $u_search['keywords'] = urlencode(htmlspecialchars_decode($keywords)) : '';
168
+			($search_terms != 'all') ? $u_search['terms'] = $search_terms : '';
169
+			($cat_id) ? $u_search['cat_id'] = $cat_id : '';
170
+			($search_category) ? $u_search['cid'] = $search_category : '';
171
+			(!$search_child) ? $u_search['sc'] = 0 : '';
172
+			($search_fields != 'all') ? $u_search['sf'] = $search_fields : '';
173 173
 
174 174
 			$base_url = array(
175 175
 				'routes'	=> 'ernadoo_phpbbdirectory_search_controller',
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 
244 244
 					foreach ($rowset as $data)
245 245
 					{
246
-						$s_banner	= $this->link->display_bann($data);
246
+						$s_banner = $this->link->display_bann($data);
247 247
 						$s_thumb	= $this->link->display_thumb($data);
248 248
 						$s_flag		= $this->link->display_flag($data);
249 249
 
@@ -251,8 +251,8 @@  discard block
 block discarded – undo
251 251
 
252 252
 						if ($hilit)
253 253
 						{
254
-							$data['link_name'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_name']);
255
-							$data['link_description'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_description']);
254
+							$data['link_name'] = preg_replace('#(?!<.*)(?<!\w)('.$hilit.')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_name']);
255
+							$data['link_description'] = preg_replace('#(?!<.*)(?<!\w)('.$hilit.')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_description']);
256 256
 						}
257 257
 
258 258
 						$this->template->assign_block_vars('results', array(
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 	private function _get_exclude_categories(&$search_category, $search_child)
323 323
 	{
324 324
 		$sql = 'SELECT cat_id, parent_id, right_id
325
-				FROM ' . DIR_CAT_TABLE . '
325
+				FROM ' . DIR_CAT_TABLE.'
326 326
 				ORDER BY left_id';
327 327
 		$result = $this->db->sql_query($sql);
328 328
 
Please login to merge, or discard this patch.