Completed
Push — master ( ad69f5...b9932d )
by Erwan
01:29
created
acp/main_module.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -462,6 +462,9 @@
 block discarded – undo
462 462
 		}
463 463
 	}
464 464
 
465
+	/**
466
+	 * @return string
467
+	 */
465 468
 	protected function qte_move($attr_row, $action = 'move_up', $steps = 1)
466 469
 	{
467 470
 		global $db, $table_prefix;
Please login to merge, or discard this patch.
qte.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -69,16 +69,16 @@  discard block
 block discarded – undo
69 69
 	*/
70 70
 	public function __construct(\phpbb\request\request $request, \phpbb\cache\driver\driver_interface $cache, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user, \phpbb\log\log $log, $root_path, $php_ext, $table_prefix)
71 71
 	{
72
-		$this->request		= $request;
73
-		$this->cache		= $cache;
74
-		$this->config		= $config;
75
-		$this->db			= $db;
76
-		$this->template		= $template;
77
-		$this->user			= $user;
78
-		$this->log			= $log;
79
-
80
-		$this->root_path	= $root_path;
81
-		$this->php_ext		= $php_ext;
72
+		$this->request = $request;
73
+		$this->cache = $cache;
74
+		$this->config = $config;
75
+		$this->db = $db;
76
+		$this->template = $template;
77
+		$this->user = $user;
78
+		$this->log = $log;
79
+
80
+		$this->root_path = $root_path;
81
+		$this->php_ext = $php_ext;
82 82
 		$this->table_prefix = $table_prefix;
83 83
 
84 84
 		$this->_get_attributes();
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 			$result = $this->db->sql_query($sql);
145 145
 
146 146
 			$this->_name = array();
147
-			while ( $row = $this->db->sql_fetchrow($result) )
147
+			while ($row = $this->db->sql_fetchrow($result))
148 148
 			{
149 149
 				$this->_name[$row['user_id']] = array(
150 150
 					'user_id'		=> (int) $row['user_id'],
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 			$a_class_name = preg_replace('#[^a-z0-9 _-]#', '', strtolower($a_name));
718 718
 		}
719 719
 
720
-		return ' class="qte-attr ' . (isset($a_class_name) ?  $a_class_name : '') . '"' . (!empty($a_colour) ? ' style="color:#' . $a_colour . '; font-weight:bold;"' : '');
720
+		return ' class="qte-attr ' . (isset($a_class_name) ? $a_class_name : '') . '"' . (!empty($a_colour) ? ' style="color:#' . $a_colour . '; font-weight:bold;"' : '');
721 721
 	}
722 722
 
723 723
 	/**
Please login to merge, or discard this patch.
Indentation   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -54,19 +54,19 @@  discard block
 block discarded – undo
54 54
 	private $_name = array();
55 55
 
56 56
 	/**
57
-	* Constructor
58
-	*
59
-	* @param \phpbb\request\request					$request			Request object
60
-	* @param \phpbb\cache\driver\driver_interface	$cache				Cache object
61
-	* @param \phpbb\config\config					$config				Config object
62
-	* @param \phpbb\db\driver\driver_interface 		$db					Database object
63
-	* @param \phpbb\template\template				$template			Template object
64
-	* @param \phpbb\user							$user				User object
65
-	* @param \phpbb\log\log							$log				Log object
66
-	* @param string									$root_path			phpBB root path
67
-	* @param string									$php_ext   			phpEx
68
-	* @param string									$table_prefix   	Prefix tables
69
-	*/
57
+	 * Constructor
58
+	 *
59
+	 * @param \phpbb\request\request					$request			Request object
60
+	 * @param \phpbb\cache\driver\driver_interface	$cache				Cache object
61
+	 * @param \phpbb\config\config					$config				Config object
62
+	 * @param \phpbb\db\driver\driver_interface 		$db					Database object
63
+	 * @param \phpbb\template\template				$template			Template object
64
+	 * @param \phpbb\user							$user				User object
65
+	 * @param \phpbb\log\log							$log				Log object
66
+	 * @param string									$root_path			phpBB root path
67
+	 * @param string									$php_ext   			phpEx
68
+	 * @param string									$table_prefix   	Prefix tables
69
+	 */
70 70
 	public function __construct(\phpbb\request\request $request, \phpbb\cache\driver\driver_interface $cache, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user, \phpbb\log\log $log, $root_path, $php_ext, $table_prefix)
71 71
 	{
72 72
 		$this->request		= $request;
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
 	}
87 87
 
88 88
 	/**
89
-	* Get topic attributes username
90
-	*
91
-	* @param	array	$topic_list	Topic ids
92
-	*
93
-	* @return	null
94
-	*/
89
+	 * Get topic attributes username
90
+	 *
91
+	 * @param	array	$topic_list	Topic ids
92
+	 *
93
+	 * @return	null
94
+	 */
95 95
 	public function get_users_by_topic_id($topic_list)
96 96
 	{
97 97
 		if (!empty($topic_list))
@@ -116,24 +116,24 @@  discard block
 block discarded – undo
116 116
 	}
117 117
 
118 118
 	/**
119
-	* Get attribute name
120
-	*
121
-	* @param	int		$attr_id	The attribute id
122
-	*
123
-	* @return	string
124
-	*/
119
+	 * Get attribute name
120
+	 *
121
+	 * @param	int		$attr_id	The attribute id
122
+	 *
123
+	 * @return	string
124
+	 */
125 125
 	public function get_attr_name_by_id($attr_id)
126 126
 	{
127 127
 		return $this->_attr[$attr_id]['attr_name'];
128 128
 	}
129 129
 
130 130
 	/**
131
-	* Get attribute author
132
-	*
133
-	* @param	int		$user_id	User id
134
-	*
135
-	* @return	string
136
-	*/
131
+	 * Get attribute author
132
+	 *
133
+	 * @param	int		$user_id	User id
134
+	 *
135
+	 * @return	string
136
+	 */
137 137
 	public function get_users_by_user_id($user_id)
138 138
 	{
139 139
 		if (!isset($this->_name[$user_id]))
@@ -157,16 +157,16 @@  discard block
 block discarded – undo
157 157
 	}
158 158
 
159 159
 	/**
160
-	* Generate a list of attributes based on permissions
161
-	*
162
-	* @param	int		$forum_id		Forum id
163
-	* @param	int		$author_id		Topic author id
164
-	* @param	int		$attribute_id	Current attribute id
165
-	* @param	array	$hide_attr		Groups which can't delete attribute in this forum
166
-	* @param	string	$viewtopic_url	Topic's url
167
-	*
168
-	* @return	null
169
-	*/
160
+	 * Generate a list of attributes based on permissions
161
+	 *
162
+	 * @param	int		$forum_id		Forum id
163
+	 * @param	int		$author_id		Topic author id
164
+	 * @param	int		$attribute_id	Current attribute id
165
+	 * @param	array	$hide_attr		Groups which can't delete attribute in this forum
166
+	 * @param	string	$viewtopic_url	Topic's url
167
+	 *
168
+	 * @return	null
169
+	 */
170 170
 	public function attr_select($forum_id = 0, $author_id = 0, $attribute_id = 0, $hide_attr = array(), $viewtopic_url = '')
171 171
 	{
172 172
 		// get current time once !
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
 	}
236 236
 
237 237
 	/**
238
-	* Generate a list of all attributes for search page
239
-	*
240
-	* @return	null
241
-	*/
238
+	 * Generate a list of all attributes for search page
239
+	 *
240
+	 * @return	null
241
+	 */
242 242
 	public function attr_search()
243 243
 	{
244 244
 		$show_select = false;
@@ -269,13 +269,13 @@  discard block
 block discarded – undo
269 269
 	}
270 270
 
271 271
 	/**
272
-	* Generate a list of attributes for viewforum page
273
-	*
274
-	* @param	int		$forum_id		Forum id
275
-	* @param	int		$attribute_id	Current attribute id
276
-	*
277
-	* @return	null
278
-	*/
272
+	 * Generate a list of attributes for viewforum page
273
+	 *
274
+	 * @param	int		$forum_id		Forum id
275
+	 * @param	int		$attribute_id	Current attribute id
276
+	 *
277
+	 * @return	null
278
+	 */
279 279
 	public function attr_sort($forum_id = 0, $attribute_id = 0)
280 280
 	{
281 281
 		$show_select = false;
@@ -329,13 +329,13 @@  discard block
 block discarded – undo
329 329
 	}
330 330
 
331 331
 	/**
332
-	* Generate a default attribute list for a forum
333
-	*
334
-	* @param	int		$forum_id		Forum id
335
-	* @param	int		$attribute_id	Current attribute id
336
-	*
337
-	* @return	null
338
-	*/
332
+	 * Generate a default attribute list for a forum
333
+	 *
334
+	 * @param	int		$forum_id		Forum id
335
+	 * @param	int		$attribute_id	Current attribute id
336
+	 *
337
+	 * @return	null
338
+	 */
339 339
 	public function attr_default($forum_id = 0, $attribute_id = 0)
340 340
 	{
341 341
 		$show_select = false;
@@ -389,14 +389,14 @@  discard block
 block discarded – undo
389 389
 	}
390 390
 
391 391
 	/**
392
-	* Generate attribute for topic title
393
-	*
394
-	* @param	int		$attribute_id	Current attribute id
395
-	* @param	int		$user_id		Current attribute user id
396
-	* @param	int		$timestamp		Attribute timestamp
397
-	*
398
-	* @return	string					Attribute html code
399
-	*/
392
+	 * Generate attribute for topic title
393
+	 *
394
+	 * @param	int		$attribute_id	Current attribute id
395
+	 * @param	int		$user_id		Current attribute user id
396
+	 * @param	int		$timestamp		Attribute timestamp
397
+	 *
398
+	 * @return	string					Attribute html code
399
+	 */
400 400
 	public function attr_display($attribute_id = 0, $user_id = 0, $timestamp = 0)
401 401
 	{
402 402
 		if (empty($attribute_id) || empty($user_id) || empty($timestamp))
@@ -426,14 +426,14 @@  discard block
 block discarded – undo
426 426
 	}
427 427
 
428 428
 	/**
429
-	* Generate attribute for page title
430
-	*
431
-	* @param	int		$attribute_id	Current attribute id
432
-	* @param	int		$user_id		Current attribute user id
433
-	* @param	int		$timestamp		Attribute timestamp
434
-	*
435
-	* @return	string					attribute html code
436
-	*/
429
+	 * Generate attribute for page title
430
+	 *
431
+	 * @param	int		$attribute_id	Current attribute id
432
+	 * @param	int		$user_id		Current attribute user id
433
+	 * @param	int		$timestamp		Attribute timestamp
434
+	 *
435
+	 * @return	string					attribute html code
436
+	 */
437 437
 	public function attr_title($attribute_id = 0, $user_id = 0, $timestamp = 0)
438 438
 	{
439 439
 		if (empty($attribute_id) || empty($user_id) || empty($timestamp))
@@ -460,16 +460,16 @@  discard block
 block discarded – undo
460 460
 
461 461
 
462 462
 	/**
463
-	* Change topic attribute
464
-	*
465
-	* @param	int		$attribute_id		New attribute id
466
-	* @param	int		$topic_id			The id of the topic
467
-	* @param	int		$forum_id			The id of the forum
468
-	* @param	int		$topic_attribute	Current attribute id
469
-	* @param	array	$hide_attr			Groups which can't delete attribute in this forum
470
-	*
471
-	* @return	null
472
-	*/
463
+	 * Change topic attribute
464
+	 *
465
+	 * @param	int		$attribute_id		New attribute id
466
+	 * @param	int		$topic_id			The id of the topic
467
+	 * @param	int		$forum_id			The id of the forum
468
+	 * @param	int		$topic_attribute	Current attribute id
469
+	 * @param	array	$hide_attr			Groups which can't delete attribute in this forum
470
+	 *
471
+	 * @return	null
472
+	 */
473 473
 	public function attr_apply($attribute_id = 0, $topic_id = 0, $forum_id = 0, $topic_attribute = 0, $hide_attr = array())
474 474
 	{
475 475
 		if (empty($topic_id) || empty($forum_id) || empty($attribute_id))
@@ -547,13 +547,13 @@  discard block
 block discarded – undo
547 547
 	}
548 548
 
549 549
 	/**
550
-	* Change topic attribute in mcp
551
-	*
552
-	* @param	int		$attribute_id		New attribute id
553
-	* @param	array	$topic_ids			Topics ids
554
-	*
555
-	* @return	null
556
-	*/
550
+	 * Change topic attribute in mcp
551
+	 *
552
+	 * @param	int		$attribute_id		New attribute id
553
+	 * @param	array	$topic_ids			Topics ids
554
+	 *
555
+	 * @return	null
556
+	 */
557 557
 	public function mcp_attr_apply($attribute_id = 0, $topic_ids = array())
558 558
 	{
559 559
 		if (!sizeof($topic_ids))
@@ -638,24 +638,24 @@  discard block
 block discarded – undo
638 638
 	}
639 639
 
640 640
 	/**
641
-	* Getter...
642
-	*
643
-	* @return	array
644
-	*/
641
+	 * Getter...
642
+	 *
643
+	 * @return	array
644
+	 */
645 645
 	public function getAttr()
646 646
 	{
647 647
 		return $this->_attr;
648 648
 	}
649 649
 
650 650
 	/**
651
-	* Generate list of groups
652
-	*
653
-	* @param int		$group_ids		The default groups id to mark as selected
654
-	* @param array|bool	$exclude_ids	The group ids to exclude from the list, false (default) if you whish to exclude no id
655
-	* @param bool		$manage_founder If set to false (default) all groups are returned, if 0 only those groups returned not being managed by founders only, if 1 only those groups returned managed by founders only.
656
-	*
657
-	* @return string The list of options.
658
-	*/
651
+	 * Generate list of groups
652
+	 *
653
+	 * @param int		$group_ids		The default groups id to mark as selected
654
+	 * @param array|bool	$exclude_ids	The group ids to exclude from the list, false (default) if you whish to exclude no id
655
+	 * @param bool		$manage_founder If set to false (default) all groups are returned, if 0 only those groups returned not being managed by founders only, if 1 only those groups returned managed by founders only.
656
+	 *
657
+	 * @return string The list of options.
658
+	 */
659 659
 	public function qte_group_select($group_ids, $exclude_ids = array(), $manage_founder = false)
660 660
 	{
661 661
 		$exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE ' . $this->db->sql_in_set('group_id', array_map('intval', $exclude_ids), true) : '';
@@ -688,12 +688,12 @@  discard block
 block discarded – undo
688 688
 	}
689 689
 
690 690
 	/**
691
-	* Build class and style attribute
692
-	*
693
-	* @param	string	$a_name			Attribute name
694
-	* @param	string	$a_colour		Attribute color
695
-	* @return	string					html code
696
-	*/
691
+	 * Build class and style attribute
692
+	 *
693
+	 * @param	string	$a_name			Attribute name
694
+	 * @param	string	$a_colour		Attribute color
695
+	 * @return	string					html code
696
+	 */
697 697
 	public function attr_colour($a_name, $a_colour)
698 698
 	{
699 699
 		if ($a_name != $this->user->lang($a_name))
@@ -705,14 +705,14 @@  discard block
 block discarded – undo
705 705
 	}
706 706
 
707 707
 	/**
708
-	* Check if user can apply an attribute
709
-	*
710
-	* @param	array	$attr_auth		Forum auth
711
-	* @param	int		$forum_id		Forum id
712
-	* @param	array	$user_groups	User's groups
713
-	* @param	int		$author_id		Topic author id
714
-	* @return	bool
715
-	*/
708
+	 * Check if user can apply an attribute
709
+	 *
710
+	 * @param	array	$attr_auth		Forum auth
711
+	 * @param	int		$forum_id		Forum id
712
+	 * @param	array	$user_groups	User's groups
713
+	 * @param	int		$author_id		Topic author id
714
+	 * @return	bool
715
+	 */
716 716
 	private function _check_auth_attribute($attr_auth, $forum_id, $user_groups, $author_id)
717 717
 	{
718 718
 		$forum_ids = $attr_auth['forums_ids'];
@@ -730,12 +730,12 @@  discard block
 block discarded – undo
730 730
 	}
731 731
 
732 732
 	/**
733
-	* Check if user can delete an attribute
734
-	*
735
-	* @param	array	$user_groups	User's groups
736
-	* @param	array	$hide_attr		Groups which can't delete attribute in a forum
737
-	* @return	bool
738
-	*/
733
+	 * Check if user can delete an attribute
734
+	 *
735
+	 * @param	array	$user_groups	User's groups
736
+	 * @param	array	$hide_attr		Groups which can't delete attribute in a forum
737
+	 * @return	bool
738
+	 */
739 739
 	private function _check_auth_remove_attr(&$user_groups, $hide_attr)
740 740
 	{
741 741
 		// include that file !
@@ -761,10 +761,10 @@  discard block
 block discarded – undo
761 761
 	}
762 762
 
763 763
 	/**
764
-	* Get attributes from database
765
-	*
766
-	* @return	null
767
-	*/
764
+	 * Get attributes from database
765
+	 *
766
+	 * @return	null
767
+	 */
768 768
 	private function _get_attributes()
769 769
 	{
770 770
 		if (($this->_attr = $this->cache->get('_attr')) === false)
Please login to merge, or discard this patch.
search/fulltext_attribute.php 4 patches
Doc Comments   -12 removed lines patch added patch discarded remove patch
@@ -33,18 +33,6 @@
 block discarded – undo
33 33
 	/**
34 34
 	* Performs a search on keywords depending on display specific params. You have to run split_keywords() first
35 35
 	*
36
-	* @param	array		$keywords_ary		contains each words to search
37
-	* @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)
38
-	* @param	array		$sort_by_sql		contains SQL code for the ORDER BY part of a query
39
-	* @param	string		$sort_key			is the key of $sort_by_sql for the selected sorting
40
-	* @param	string		$sort_dir			is either a or d representing ASC and DESC
41
-	* @param	string		$sort_days			specifies the maximum amount of days a post may be old
42
-	* @param	array		$ex_cid_ary			specifies an array of category ids which should not be searched
43
-	* @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
44
-	* @param	array		&$id_ary			passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
45
-	* @param	int			$start				indicates the first index of the page
46
-	* @param	int			$per_page			number of ids each page is supposed to contain
47
-	* @return	int								total number of results
48 36
 	*/
49 37
 	public function attribute_search($attribute_id, $type, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page)
50 38
 	{
Please login to merge, or discard this patch.
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@  discard block
 block discarded – undo
19 19
 	protected $db;
20 20
 
21 21
 	/**
22
-	* Constructor
23
-	*
24
-	* @param \phpbb\config\config				$config Config object
25
-	* @param \phpbb\db\driver\driver_interface	$db		Database object
26
-	*/
22
+	 * Constructor
23
+	 *
24
+	 * @param \phpbb\config\config				$config Config object
25
+	 * @param \phpbb\db\driver\driver_interface	$db		Database object
26
+	 */
27 27
 	public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db)
28 28
 	{
29 29
 		$this->config	= $config;
@@ -31,21 +31,21 @@  discard block
 block discarded – undo
31 31
 	}
32 32
 
33 33
 	/**
34
-	* Performs a search on keywords depending on display specific params. You have to run split_keywords() first
35
-	*
36
-	* @param	array		$keywords_ary		contains each words to search
37
-	* @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)
38
-	* @param	array		$sort_by_sql		contains SQL code for the ORDER BY part of a query
39
-	* @param	string		$sort_key			is the key of $sort_by_sql for the selected sorting
40
-	* @param	string		$sort_dir			is either a or d representing ASC and DESC
41
-	* @param	string		$sort_days			specifies the maximum amount of days a post may be old
42
-	* @param	array		$ex_cid_ary			specifies an array of category ids which should not be searched
43
-	* @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
44
-	* @param	array		&$id_ary			passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
45
-	* @param	int			$start				indicates the first index of the page
46
-	* @param	int			$per_page			number of ids each page is supposed to contain
47
-	* @return	int								total number of results
48
-	*/
34
+	 * Performs a search on keywords depending on display specific params. You have to run split_keywords() first
35
+	 *
36
+	 * @param	array		$keywords_ary		contains each words to search
37
+	 * @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)
38
+	 * @param	array		$sort_by_sql		contains SQL code for the ORDER BY part of a query
39
+	 * @param	string		$sort_key			is the key of $sort_by_sql for the selected sorting
40
+	 * @param	string		$sort_dir			is either a or d representing ASC and DESC
41
+	 * @param	string		$sort_days			specifies the maximum amount of days a post may be old
42
+	 * @param	array		$ex_cid_ary			specifies an array of category ids which should not be searched
43
+	 * @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
44
+	 * @param	array		&$id_ary			passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
45
+	 * @param	int			$start				indicates the first index of the page
46
+	 * @param	int			$per_page			number of ids each page is supposed to contain
47
+	 * @return	int								total number of results
48
+	 */
49 49
 	public function attribute_search($attribute_id, $type, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page)
50 50
 	{
51 51
 		// generate a search_key from all the options to identify the results
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	*/
27 27
 	public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db)
28 28
 	{
29
-		$this->config	= $config;
30
-		$this->db		= $db;
29
+		$this->config = $config;
30
+		$this->db = $db;
31 31
 	}
32 32
 
33 33
 	/**
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
 		$id_ary = array();
82 82
 
83 83
 		// Create some display specific sql strings
84
-		$sql_attribute	= 't.topic_attr_id = ' . (int) $attribute_id;
84
+		$sql_attribute = 't.topic_attr_id = ' . (int) $attribute_id;
85 85
 		$sql_fora		= (sizeof($ex_fid_ary)) ? ' AND ' . $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
86
-		$sql_topic_id	= ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : '';
86
+		$sql_topic_id = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : '';
87 87
 		$sql_time		= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
88
-		$sql_firstpost	= ' AND p.post_id = t.topic_first_post_id';
88
+		$sql_firstpost = ' AND p.post_id = t.topic_first_post_id';
89 89
 
90 90
 		// Build sql strings for sorting
91 91
 		$sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
 		switch ($sql_sort[0])
94 94
 		{
95 95
 			case 'u':
96
-				$sql_sort_table	= USERS_TABLE . ' u, ';
97
-				$sql_sort_join	= ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster ';
96
+				$sql_sort_table = USERS_TABLE . ' u, ';
97
+				$sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster ';
98 98
 			break;
99 99
 
100 100
 			case 'f':
101
-				$sql_sort_table	= FORUMS_TABLE . ' f, ';
102
-				$sql_sort_join	= ' AND f.forum_id = p.forum_id ';
101
+				$sql_sort_table = FORUMS_TABLE . ' f, ';
102
+				$sql_sort_join = ' AND f.forum_id = p.forum_id ';
103 103
 			break;
104 104
 		}
105 105
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 		// Build the query for really selecting the post_ids
112 112
 		if ($type == 'posts')
113 113
 		{
114
-			$sql = "SELECT {$calc_results}p.post_id
114
+			$sql = "select {$calc_results}p.post_id
115 115
 				FROM " . $sql_sort_table . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t ' . "
116 116
 				WHERE $sql_attribute
117 117
 					$sql_topic_id
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 		}
126 126
 		else
127 127
 		{
128
-			$sql = "SELECT {$calc_results}t.topic_id
128
+			$sql = "select {$calc_results}t.topic_id
129 129
 				FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
130 130
 				WHERE $sql_attribute
131 131
 					$sql_topic_id
Please login to merge, or discard this patch.
event/search_listener.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
 
37 37
 	public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\qte\qte $qte, \ernadoo\qte\search\fulltext_attribute $qte_search)
38 38
 	{
39
-		$this->request		= $request;
40
-		$this->template		= $template;
41
-		$this->user			= $user;
42
-		$this->qte			= $qte;
43
-		$this->qte_search	= $qte_search;
39
+		$this->request = $request;
40
+		$this->template = $template;
41
+		$this->user = $user;
42
+		$this->qte = $qte;
43
+		$this->qte_search = $qte_search;
44 44
 	}
45 45
 
46 46
 	static public function getSubscribedEvents()
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 	{
128 128
 		if ($this->searc_attr)
129 129
 		{
130
-			$keywords	= utf8_normalize_nfc($this->request->variable('keywords', '', true));
131
-			$author		= $this->request->variable('author', '', true);
130
+			$keywords = utf8_normalize_nfc($this->request->variable('keywords', '', true));
131
+			$author = $this->request->variable('author', '', true);
132 132
 
133 133
 			if (!$keywords && !$author)
134 134
 			{
Please login to merge, or discard this patch.
event/main_listener.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	public function viewtopic_attr_apply($event)
103 103
 	{
104 104
 		$attr_id = (int) $this->request->variable('attr_id', 0);
105
-		if ( $attr_id )
105
+		if ($attr_id)
106 106
 		{
107 107
 			$this->qte->get_users_by_topic_id(array($event['topic_id']));
108 108
 			$this->qte->attr_apply($attr_id, $event['topic_id'], $event['forum_id'], $event['topic_data']['topic_attr_id'], (array) unserialize(trim($event['topic_data']['hide_attr'])));
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
 				if ($topic_attribute != \ernadoo\qte\qte::KEEP)
125 125
 				{
126
-					$post_data['topic_attr_id']		= (int) $topic_attribute;
126
+					$post_data['topic_attr_id'] = (int) $topic_attribute;
127 127
 					$post_data['topic_attr_user']	= (int) $this->user->data['user_id'];
128 128
 					$post_data['topic_attr_time']	= time();
129 129
 
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
 
147 147
 		if ($event['post_data']['force_attr'])
148 148
 		{
149
-			if ($post_data['attr_id'] == \ernadoo\qte\qte::REMOVE && ($event['mode'] == 'post' || ($event['mode'] == 'edit' && $event['post_data']['topic_first_post_id'] == $event['post_id'])) )
149
+			if ($post_data['attr_id'] == \ernadoo\qte\qte::REMOVE && ($event['mode'] == 'post' || ($event['mode'] == 'edit' && $event['post_data']['topic_first_post_id'] == $event['post_id'])))
150 150
 			{
151 151
 				$error = $event['error'];
152 152
 				$error[] = $this->user->lang['QTE_ATTRIBUTE_UNSELECTED'];
153
-				$event['error'] = $error ;
153
+				$event['error'] = $error;
154 154
 
155 155
 				// init the value
156 156
 				$post_data['attr_id'] = 0;
Please login to merge, or discard this patch.
event/mcp_listener.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	{
71 71
 		$sql_ary = $event['sql_ary'];
72 72
 
73
-		$sql_ary['topic_attr_id']	= $event['topic_row']['topic_attr_id'];
73
+		$sql_ary['topic_attr_id'] = $event['topic_row']['topic_attr_id'];
74 74
 		$sql_ary['topic_attr_user'] = $event['topic_row']['topic_attr_user'];
75 75
 		$sql_ary['topic_attr_time'] = $event['topic_row']['topic_attr_time'];
76 76
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	{
82 82
 		$shadow = $event['shadow'];
83 83
 
84
-		$shadow['topic_attr_id']	= $event['row']['topic_attr_id'];
84
+		$shadow['topic_attr_id'] = $event['row']['topic_attr_id'];
85 85
 		$shadow['topic_attr_user']	= $event['row']['topic_attr_user'];
86 86
 		$shadow['topic_attr_time']	= $event['row']['topic_attr_time'];
87 87
 
Please login to merge, or discard this patch.