Completed
Push — master ( d5fbc8...4c9094 )
by Erwan
03:26
created
qte.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 	* Generate list of groups
681 681
 	*
682 682
 	* @param int	$group_ids		The default groups id to mark as selected
683
-	* @param array	$exclude_ids	The group ids to exclude from the list, false (default) if you whish to exclude no id
683
+	* @param boolean	$exclude_ids	The group ids to exclude from the list, false (default) if you whish to exclude no id
684 684
 	* @param int	$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.
685 685
 	*
686 686
 	* @return string The list of options.
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 	* @param	int		$forum_id		Forum id
754 754
 	* @param	array	$user_groups	User's groups
755 755
 	* @param	int		$author_id		Topic author id
756
-	* @return	bool
756
+	* @return	boolean|null
757 757
 	*/
758 758
 	private function _check_auth_attribute($attr_auth, $forum_id, $user_groups, $author_id)
759 759
 	{
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 	*
775 775
 	* @param	array	$user_groups	User's groups
776 776
 	* @param	array	$hide_attr		Groups which can't delete attribute in a forum
777
-	* @return	bool
777
+	* @return	boolean|null
778 778
 	*/
779 779
 	private function _check_auth_remove_attr(&$user_groups, $hide_attr)
780 780
 	{
Please login to merge, or discard this patch.
Indentation   +131 added lines, -131 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;
@@ -85,12 +85,12 @@  discard block
 block discarded – undo
85 85
 	}
86 86
 
87 87
 	/**
88
-	* Get topic attributes username
89
-	*
90
-	* @param	array	$topic_list	Topic ids
91
-	*
92
-	* @return	null
93
-	*/
88
+	 * Get topic attributes username
89
+	 *
90
+	 * @param	array	$topic_list	Topic ids
91
+	 *
92
+	 * @return	null
93
+	 */
94 94
 	public function get_users_by_topic_id($topic_list)
95 95
 	{
96 96
 		if (!empty($topic_list))
@@ -115,24 +115,24 @@  discard block
 block discarded – undo
115 115
 	}
116 116
 
117 117
 	/**
118
-	* Get attribute name
119
-	*
120
-	* @param	int		$attr_id	The attribute id
121
-	*
122
-	* @return	string
123
-	*/
118
+	 * Get attribute name
119
+	 *
120
+	 * @param	int		$attr_id	The attribute id
121
+	 *
122
+	 * @return	string
123
+	 */
124 124
 	public function get_attr_name_by_id($attr_id)
125 125
 	{
126 126
 		return $this->_attr[$attr_id]['attr_name'];
127 127
 	}
128 128
 
129 129
 	/**
130
-	* Get attribute author
131
-	*
132
-	* @param	int		$user_id	User id
133
-	*
134
-	* @return	string
135
-	*/
130
+	 * Get attribute author
131
+	 *
132
+	 * @param	int		$user_id	User id
133
+	 *
134
+	 * @return	string
135
+	 */
136 136
 	public function get_users_by_user_id($user_id)
137 137
 	{
138 138
 		$sql = 'SELECT user_id, username, user_colour
@@ -153,16 +153,16 @@  discard block
 block discarded – undo
153 153
 	}
154 154
 
155 155
 	/**
156
-	* Generate a list of attributes based on permissions
157
-	*
158
-	* @param	int		$forum_id		Forum id
159
-	* @param	int		$author_id		Topic author id
160
-	* @param	int		$attribute_id	Current attribute id
161
-	* @param	array	$hide_attr		Groups which can't delete attribute in this forum
162
-	* @param	string	$viewtopic_url	Topic's url
163
-	*
164
-	* @return	null
165
-	*/
156
+	 * Generate a list of attributes based on permissions
157
+	 *
158
+	 * @param	int		$forum_id		Forum id
159
+	 * @param	int		$author_id		Topic author id
160
+	 * @param	int		$attribute_id	Current attribute id
161
+	 * @param	array	$hide_attr		Groups which can't delete attribute in this forum
162
+	 * @param	string	$viewtopic_url	Topic's url
163
+	 *
164
+	 * @return	null
165
+	 */
166 166
 	public function attr_select($forum_id = 0, $author_id = 0, $attribute_id = 0, $hide_attr = array(), $viewtopic_url = '')
167 167
 	{
168 168
 		// load language
@@ -233,10 +233,10 @@  discard block
 block discarded – undo
233 233
 	}
234 234
 
235 235
 	/**
236
-	* Generate a list of all attributes for search page
237
-	*
238
-	* @return	null
239
-	*/
236
+	 * Generate a list of all attributes for search page
237
+	 *
238
+	 * @return	null
239
+	 */
240 240
 	public function attr_search()
241 241
 	{
242 242
 		// load language
@@ -286,13 +286,13 @@  discard block
 block discarded – undo
286 286
 	}
287 287
 
288 288
 	/**
289
-	* Generate a list of attributes for viewforum page
290
-	*
291
-	* @param	int		$forum_id		Forum id
292
-	* @param	int		$attribute_id	Current attribute id
293
-	*
294
-	* @return	null
295
-	*/
289
+	 * Generate a list of attributes for viewforum page
290
+	 *
291
+	 * @param	int		$forum_id		Forum id
292
+	 * @param	int		$attribute_id	Current attribute id
293
+	 *
294
+	 * @return	null
295
+	 */
296 296
 	public function attr_sort($forum_id = 0, $attribute_id = 0)
297 297
 	{
298 298
 		// load language
@@ -349,13 +349,13 @@  discard block
 block discarded – undo
349 349
 	}
350 350
 
351 351
 	/**
352
-	* Generate a default attribute list for a forum
353
-	*
354
-	* @param	int		$forum_id		Forum id
355
-	* @param	int		$attribute_id	Current attribute id
356
-	*
357
-	* @return	null
358
-	*/
352
+	 * Generate a default attribute list for a forum
353
+	 *
354
+	 * @param	int		$forum_id		Forum id
355
+	 * @param	int		$attribute_id	Current attribute id
356
+	 *
357
+	 * @return	null
358
+	 */
359 359
 	public function attr_default($forum_id = 0, $attribute_id = 0)
360 360
 	{
361 361
 		// load language
@@ -412,14 +412,14 @@  discard block
 block discarded – undo
412 412
 	}
413 413
 
414 414
 	/**
415
-	* Generate attribute for topic title
416
-	*
417
-	* @param	int		$attribute_id	Current attribute id
418
-	* @param	int		$user_id		Current attribute user id
419
-	* @param	int		$timestamp		Attribute timestamp
420
-	*
421
-	* @return	string					Attribute html code
422
-	*/
415
+	 * Generate attribute for topic title
416
+	 *
417
+	 * @param	int		$attribute_id	Current attribute id
418
+	 * @param	int		$user_id		Current attribute user id
419
+	 * @param	int		$timestamp		Attribute timestamp
420
+	 *
421
+	 * @return	string					Attribute html code
422
+	 */
423 423
 	public function attr_display($attribute_id = 0, $user_id = 0, $timestamp = 0)
424 424
 	{
425 425
 		if (empty($attribute_id) || empty($user_id) || empty($timestamp))
@@ -449,14 +449,14 @@  discard block
 block discarded – undo
449 449
 	}
450 450
 
451 451
 	/**
452
-	* Generate attribute for page title
453
-	*
454
-	* @param	int		$attribute_id	Current attribute id
455
-	* @param	int		$user_id		Current attribute user id
456
-	* @param	int		$timestamp		Attribute timestamp
457
-	*
458
-	* @return	string					attribute html code
459
-	*/
452
+	 * Generate attribute for page title
453
+	 *
454
+	 * @param	int		$attribute_id	Current attribute id
455
+	 * @param	int		$user_id		Current attribute user id
456
+	 * @param	int		$timestamp		Attribute timestamp
457
+	 *
458
+	 * @return	string					attribute html code
459
+	 */
460 460
 	public function attr_title($attribute_id = 0, $user_id = 0, $timestamp = 0)
461 461
 	{
462 462
 		if (empty($attribute_id) || empty($user_id) || empty($timestamp))
@@ -485,16 +485,16 @@  discard block
 block discarded – undo
485 485
 
486 486
 
487 487
 	/**
488
-	* Change topic attribute
489
-	*
490
-	* @param	int		$attribute_id		New attribute id
491
-	* @param	int		$topic_id			The id of the topic
492
-	* @param	int		$forum_id			The id of the forum
493
-	* @param	int		$topic_attribute	Current attribute id
494
-	* @param	array	$hide_attr			Groups which can't delete attribute in this forum
495
-	*
496
-	* @return	null
497
-	*/
488
+	 * Change topic attribute
489
+	 *
490
+	 * @param	int		$attribute_id		New attribute id
491
+	 * @param	int		$topic_id			The id of the topic
492
+	 * @param	int		$forum_id			The id of the forum
493
+	 * @param	int		$topic_attribute	Current attribute id
494
+	 * @param	array	$hide_attr			Groups which can't delete attribute in this forum
495
+	 *
496
+	 * @return	null
497
+	 */
498 498
 	public function attr_apply($attribute_id = 0, $topic_id = 0, $forum_id = 0, $topic_attribute = '', $hide_attr = array())
499 499
 	{
500 500
 		if (empty($topic_id) || empty($forum_id) || empty($attribute_id))
@@ -573,13 +573,13 @@  discard block
 block discarded – undo
573 573
 	}
574 574
 
575 575
 	/**
576
-	* Change topic attribute in mcp
577
-	*
578
-	* @param	int		$attribute_id		New attribute id
579
-	* @param	array	$topic_ids			Topics ids
580
-	*
581
-	* @return	null
582
-	*/
576
+	 * Change topic attribute in mcp
577
+	 *
578
+	 * @param	int		$attribute_id		New attribute id
579
+	 * @param	array	$topic_ids			Topics ids
580
+	 *
581
+	 * @return	null
582
+	 */
583 583
 	public function mcp_attr_apply($attribute_id = 0, $topic_ids = array())
584 584
 	{
585 585
 		// load language
@@ -667,24 +667,24 @@  discard block
 block discarded – undo
667 667
 	}
668 668
 
669 669
 	/**
670
-	* Getter...
671
-	*
672
-	* @return	array
673
-	*/
670
+	 * Getter...
671
+	 *
672
+	 * @return	array
673
+	 */
674 674
 	public function getAttr()
675 675
 	{
676 676
 		return $this->_attr;
677 677
 	}
678 678
 
679 679
 	/**
680
-	* Generate list of groups
681
-	*
682
-	* @param int	$group_ids		The default groups id to mark as selected
683
-	* @param array	$exclude_ids	The group ids to exclude from the list, false (default) if you whish to exclude no id
684
-	* @param int	$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.
685
-	*
686
-	* @return string The list of options.
687
-	*/
680
+	 * Generate list of groups
681
+	 *
682
+	 * @param int	$group_ids		The default groups id to mark as selected
683
+	 * @param array	$exclude_ids	The group ids to exclude from the list, false (default) if you whish to exclude no id
684
+	 * @param int	$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.
685
+	 *
686
+	 * @return string The list of options.
687
+	 */
688 688
 	public function qte_group_select($group_ids, $exclude_ids = array(), $manage_founder = false)
689 689
 	{
690 690
 		$exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE ' . $this->db->sql_in_set('group_id', array_map('intval', $exclude_ids), true) : '';
@@ -711,9 +711,9 @@  discard block
 block discarded – undo
711 711
 	}
712 712
 
713 713
 	/**
714
-	* borrowed from "Categories Hierarchy" : used to check if a language key exists
715
-	* @todo delete
716
-	*/
714
+	 * borrowed from "Categories Hierarchy" : used to check if a language key exists
715
+	 * @todo delete
716
+	 */
717 717
 	public function attr_lng_key($key)
718 718
 	{
719 719
 		// load language
@@ -729,12 +729,12 @@  discard block
 block discarded – undo
729 729
 	}
730 730
 
731 731
 	/**
732
-	* Build class and style attribute
733
-	*
734
-	* @param	string	$a_name			Attribute name
735
-	* @param	string	$a_colour		Attribute color
736
-	* @return	string					html code
737
-	*/
732
+	 * Build class and style attribute
733
+	 *
734
+	 * @param	string	$a_name			Attribute name
735
+	 * @param	string	$a_colour		Attribute color
736
+	 * @return	string					html code
737
+	 */
738 738
 	public function attr_colour($a_name, $a_colour)
739 739
 	{
740 740
 		$a_name = preg_replace("#[^a-z0-9 _-]#", '', strtolower($a_name));
@@ -747,14 +747,14 @@  discard block
 block discarded – undo
747 747
 	}
748 748
 
749 749
 	/**
750
-	* Check if user can apply an attribute
751
-	*
752
-	* @param	array	$attr_auth		Forum auth
753
-	* @param	int		$forum_id		Forum id
754
-	* @param	array	$user_groups	User's groups
755
-	* @param	int		$author_id		Topic author id
756
-	* @return	bool
757
-	*/
750
+	 * Check if user can apply an attribute
751
+	 *
752
+	 * @param	array	$attr_auth		Forum auth
753
+	 * @param	int		$forum_id		Forum id
754
+	 * @param	array	$user_groups	User's groups
755
+	 * @param	int		$author_id		Topic author id
756
+	 * @return	bool
757
+	 */
758 758
 	private function _check_auth_attribute($attr_auth, $forum_id, $user_groups, $author_id)
759 759
 	{
760 760
 		$forum_ids = $attr_auth['forums_ids'];
@@ -770,12 +770,12 @@  discard block
 block discarded – undo
770 770
 	}
771 771
 
772 772
 	/**
773
-	* Check if user can delete an attribute
774
-	*
775
-	* @param	array	$user_groups	User's groups
776
-	* @param	array	$hide_attr		Groups which can't delete attribute in a forum
777
-	* @return	bool
778
-	*/
773
+	 * Check if user can delete an attribute
774
+	 *
775
+	 * @param	array	$user_groups	User's groups
776
+	 * @param	array	$hide_attr		Groups which can't delete attribute in a forum
777
+	 * @return	bool
778
+	 */
779 779
 	private function _check_auth_remove_attr(&$user_groups, $hide_attr)
780 780
 	{
781 781
 		// include that file !
@@ -804,10 +804,10 @@  discard block
 block discarded – undo
804 804
 	}
805 805
 
806 806
 	/**
807
-	* Get attributes from database
808
-	*
809
-	* @return	null
810
-	*/
807
+	 * Get attributes from database
808
+	 *
809
+	 * @return	null
810
+	 */
811 811
 	private function _get_attributes()
812 812
 	{
813 813
 		if (($this->_attr = $this->cache->get('_attr')) === false)
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 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();
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
 		if (!empty($topic_list))
97 97
 		{
98 98
 			$sql = 'SELECT u.user_id, u.username, u.user_colour
99
-				FROM ' . USERS_TABLE . ' u
100
-				LEFT JOIN ' . TOPICS_TABLE . ' t ON (u.user_id = t.topic_attr_user)
101
-				WHERE ' . $this->db->sql_in_set('t.topic_id', array_map('intval', $topic_list)) . '
99
+				FROM ' . USERS_TABLE.' u
100
+				LEFT JOIN ' . TOPICS_TABLE.' t ON (u.user_id = t.topic_attr_user)
101
+				WHERE ' . $this->db->sql_in_set('t.topic_id', array_map('intval', $topic_list)).'
102 102
 					AND t.topic_attr_user <> ' . ANONYMOUS;
103 103
 			$result = $this->db->sql_query($sql);
104 104
 
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
 	public function get_users_by_user_id($user_id)
137 137
 	{
138 138
 		$sql = 'SELECT user_id, username, user_colour
139
-			FROM ' . USERS_TABLE . '
139
+			FROM ' . USERS_TABLE.'
140 140
 			WHERE user_id = ' . (int) $user_id;
141 141
 		$result = $this->db->sql_query($sql);
142 142
 
143 143
 		$this->name = array();
144
-		while ( $row = $this->db->sql_fetchrow($result) )
144
+		while ($row = $this->db->sql_fetchrow($result))
145 145
 		{
146 146
 			$this->name[$row['user_id']] = array(
147 147
 				'user_id'		=> (int) $row['user_id'],
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 				'S_QTE_EMPTY'		=> (empty($attribute_id) || ($attribute_id == -1) || ($attribute_id == -2)),
227 227
 				'S_QTE_SELECTED'	=> ($show_remove && ($attribute_id == -1)),
228 228
 
229
-				'L_QTE_SELECT'		=> $this->user->lang['QTE_ATTRIBUTE_' . (!empty($attribute_id) ? ($show_remove ? 'REMOVE' : 'RESTRICT') : 'ADD')],
229
+				'L_QTE_SELECT'		=> $this->user->lang['QTE_ATTRIBUTE_'.(!empty($attribute_id) ? ($show_remove ? 'REMOVE' : 'RESTRICT') : 'ADD')],
230 230
 				'U_QTE_URL'			=> !empty($viewtopic_url) ? append_sid($viewtopic_url, array('attr_id' => -1)) : false,
231 231
 			));
232 232
 		}
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 
445 445
 			$attribute_name = str_replace(array('%mod%', '%date%'), array($attribute_username, $attribute_date), $this->attr_lng_key($this->_attr[$attribute_id]['attr_name']));
446 446
 
447
-			return !$this->_attr[$attribute_id]['attr_type'] ? '<span' . $attribute_colour . '>' . $attribute_name . '</span>' : $this->attr_img_key($this->_attr[$attribute_id]['attr_img'], $attribute_name);
447
+			return !$this->_attr[$attribute_id]['attr_type'] ? '<span'.$attribute_colour.'>'.$attribute_name.'</span>' : $this->attr_img_key($this->_attr[$attribute_id]['attr_img'], $attribute_name);
448 448
 		}
449 449
 	}
450 450
 
@@ -527,13 +527,13 @@  discard block
 block discarded – undo
527 527
 			);
528 528
 		}
529 529
 
530
-		$sql = 'UPDATE ' . TOPICS_TABLE . '
531
-			SET ' . $this->db->sql_build_array('UPDATE', $fields) . '
530
+		$sql = 'UPDATE '.TOPICS_TABLE.'
531
+			SET ' . $this->db->sql_build_array('UPDATE', $fields).'
532 532
 			WHERE topic_id = ' . (int) $topic_id;
533 533
 		$this->db->sql_query($sql);
534 534
 
535 535
 		$sql = 'SELECT topic_id
536
-			FROM ' . TOPICS_TABLE . '
536
+			FROM ' . TOPICS_TABLE.'
537 537
 			WHERE topic_moved_id = ' . (int) $topic_id;
538 538
 		$result = $this->db->sql_query($sql);
539 539
 		$shadow_topic_id = (int) $this->db->sql_fetchfield('topic_id');
@@ -541,8 +541,8 @@  discard block
 block discarded – undo
541 541
 
542 542
 		if (!empty($shadow_topic_id))
543 543
 		{
544
-			$sql = 'UPDATE ' . TOPICS_TABLE . '
545
-				SET ' . $this->db->sql_build_array('UPDATE', $fields) . '
544
+			$sql = 'UPDATE '.TOPICS_TABLE.'
545
+				SET ' . $this->db->sql_build_array('UPDATE', $fields).'
546 546
 				WHERE topic_id = ' . $shadow_topic_id;
547 547
 			$this->db->sql_query($sql);
548 548
 		}
@@ -554,8 +554,8 @@  discard block
 block discarded – undo
554 554
 		$this->user->add_lang('posting');
555 555
 		$this->user->add_lang_ext('ernadoo/qte', 'attributes');
556 556
 
557
-		$message = $this->user->lang['QTE_ATTRIBUTE_' . ($attribute_id == -1 ? 'REMOVED' : (empty($topic_attribute) ? 'ADDED' : 'UPDATED'))] . '<br /><br />' . sprintf($this->user->lang['VIEW_MESSAGE'], '<a href="' . $meta_url . '">', '</a>');
558
-		$message .= '<br /><br />' . sprintf($this->user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$this->root_path}viewforum.$this->php_ext", 'f=' . $forum_id) . '">', '</a>');
557
+		$message = $this->user->lang['QTE_ATTRIBUTE_'.($attribute_id == -1 ? 'REMOVED' : (empty($topic_attribute) ? 'ADDED' : 'UPDATED'))].'<br /><br />'.sprintf($this->user->lang['VIEW_MESSAGE'], '<a href="'.$meta_url.'">', '</a>');
558
+		$message .= '<br /><br />'.sprintf($this->user->lang['RETURN_FORUM'], '<a href="'.append_sid("{$this->root_path}viewforum.$this->php_ext", 'f='.$forum_id).'">', '</a>');
559 559
 
560 560
 		if ($this->request->is_ajax())
561 561
 		{
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 		$current_time = time();
600 600
 
601 601
 		$sql = 'SELECT topic_id, forum_id, topic_title, topic_attr_id
602
-			FROM ' . TOPICS_TABLE . '
602
+			FROM ' . TOPICS_TABLE.'
603 603
 			WHERE ' . $this->db->sql_in_set('topic_id', array_map('intval', $topic_ids));
604 604
 		$result = $this->db->sql_query($sql);
605 605
 
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 				'topic_id'	=> $row['topic_id'],
613 613
 				$row['topic_title'],
614 614
 			);
615
-			$this->log->add('mod', $this->user->data['user_id'], $this->user->ip, 'MCP_ATTRIBUTE_' . $message, $current_time, $additional_data);
615
+			$this->log->add('mod', $this->user->data['user_id'], $this->user->ip, 'MCP_ATTRIBUTE_'.$message, $current_time, $additional_data);
616 616
 		}
617 617
 		$this->db->sql_freeresult($result);
618 618
 
@@ -633,13 +633,13 @@  discard block
 block discarded – undo
633 633
 			);
634 634
 		}
635 635
 
636
-		$sql = 'UPDATE ' . TOPICS_TABLE . '
637
-			SET ' . $this->db->sql_build_array('UPDATE', $fields) . '
636
+		$sql = 'UPDATE '.TOPICS_TABLE.'
637
+			SET ' . $this->db->sql_build_array('UPDATE', $fields).'
638 638
 			WHERE ' . $this->db->sql_in_set('topic_id', array_map('intval', $topic_ids));
639 639
 		$this->db->sql_query($sql);
640 640
 
641 641
 		$sql = 'SELECT topic_id
642
-			FROM ' . TOPICS_TABLE . '
642
+			FROM ' . TOPICS_TABLE.'
643 643
 			WHERE ' . $this->db->sql_in_set('topic_moved_id', array_map('intval', $topic_ids));
644 644
 		$result = $this->db->sql_query($sql);
645 645
 
@@ -652,8 +652,8 @@  discard block
 block discarded – undo
652 652
 
653 653
 		if (sizeof($shadow_topic_ids))
654 654
 		{
655
-			$sql = 'UPDATE ' . TOPICS_TABLE . '
656
-				SET ' . $this->db->sql_build_array('UPDATE', $fields) . '
655
+			$sql = 'UPDATE '.TOPICS_TABLE.'
656
+				SET ' . $this->db->sql_build_array('UPDATE', $fields).'
657 657
 				WHERE ' . $this->db->sql_in_set('topic_id', array_map('intval', $shadow_topic_ids));
658 658
 			$this->db->sql_query($sql);
659 659
 		}
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
 		$redirect = $this->request->variable('redirect', $this->user->data['session_page']);
662 662
 
663 663
 		meta_refresh(3, $redirect);
664
-		trigger_error($this->user->lang['QTE_TOPIC' . (sizeof($topic_ids) == 1 ? '' : 'S') . '_ATTRIBUTE_' . $message] . '<br /><br />' . sprintf($this->user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
664
+		trigger_error($this->user->lang['QTE_TOPIC'.(sizeof($topic_ids) == 1 ? '' : 'S').'_ATTRIBUTE_'.$message].'<br /><br />'.sprintf($this->user->lang['RETURN_PAGE'], '<a href="'.$redirect.'">', '</a>'));
665 665
 
666 666
 		return;
667 667
 	}
@@ -687,12 +687,12 @@  discard block
 block discarded – undo
687 687
 	*/
688 688
 	public function qte_group_select($group_ids, $exclude_ids = array(), $manage_founder = false)
689 689
 	{
690
-		$exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE ' . $this->db->sql_in_set('group_id', array_map('intval', $exclude_ids), true) : '';
691
-		$sql_and = !$this->config['coppa_enable'] ? ($exclude_sql ? ' AND ' : ' WHERE ') . "group_name <> 'REGISTERED_COPPA'" : '';
692
-		$sql_founder = ($manage_founder !== false) ? (($exclude_sql || $sql_and) ? ' AND ' : ' WHERE ') . 'group_founder_manage = ' . (int) $manage_founder : '';
690
+		$exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE '.$this->db->sql_in_set('group_id', array_map('intval', $exclude_ids), true) : '';
691
+		$sql_and = !$this->config['coppa_enable'] ? ($exclude_sql ? ' AND ' : ' WHERE ')."group_name <> 'REGISTERED_COPPA'" : '';
692
+		$sql_founder = ($manage_founder !== false) ? (($exclude_sql || $sql_and) ? ' AND ' : ' WHERE ').'group_founder_manage = '.(int) $manage_founder : '';
693 693
 
694 694
 		$sql = 'SELECT group_id, group_name, group_type
695
-			FROM ' . GROUPS_TABLE . "
695
+			FROM ' . GROUPS_TABLE."
696 696
 			$exclude_sql
697 697
 			$sql_and
698 698
 			$sql_founder
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 		while ($row = $this->db->sql_fetchrow($result))
704 704
 		{
705 705
 			$selected = in_array($row['group_id'], $group_ids) ? ' selected="selected"' : '';
706
-			$s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '"' . $selected . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $this->user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
706
+			$s_group_options .= '<option'.(($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '').' value="'.$row['group_id'].'"'.$selected.'>'.(($row['group_type'] == GROUP_SPECIAL) ? $this->user->lang['G_'.$row['group_name']] : $row['group_name']).'</option>';
707 707
 		}
708 708
 		$this->db->sql_freeresult($result);
709 709
 
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
 	// borrowed from "Categories Hierarchy" : used to check if a image key exists
726 726
 	public function attr_img_key($key, $alt)
727 727
 	{
728
-		return empty($key) ? '' : (preg_match('#^[a-z0-9_-]+$#i', $key) ? $this->user->img($key, $alt) : '<img src="' . (preg_match('#^(ht|f)tp[s]?\://#i', $key) ? $key : $this->root_path . $key) . '" alt="' . $alt . '" title="' . $alt . '" />');
728
+		return empty($key) ? '' : (preg_match('#^[a-z0-9_-]+$#i', $key) ? $this->user->img($key, $alt) : '<img src="'.(preg_match('#^(ht|f)tp[s]?\://#i', $key) ? $key : $this->root_path.$key).'" alt="'.$alt.'" title="'.$alt.'" />');
729 729
 	}
730 730
 
731 731
 	/**
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
 			$a_name .= '-qte';
744 744
 		}
745 745
 
746
-		return ' class="qte-attr ' . $a_name . '"' . (!empty($a_colour) ? ' style="color:#' . $a_colour . '; font-weight:bold;"' : '');
746
+		return ' class="qte-attr '.$a_name.'"'.(!empty($a_colour) ? ' style="color:#'.$a_colour.'; font-weight:bold;"' : '');
747 747
 	}
748 748
 
749 749
 	/**
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
 		// include that file !
782 782
 		if (!function_exists('group_memberships'))
783 783
 		{
784
-			include $this->root_path . 'includes/functions_user.' . $this->php_ext;
784
+			include $this->root_path.'includes/functions_user.'.$this->php_ext;
785 785
 		}
786 786
 
787 787
 		// get groups membership !
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
 		if (($this->_attr = $this->cache->get('_attr')) === false)
814 814
 		{
815 815
 			$sql = 'SELECT *
816
-				FROM ' . $this->table_prefix . 'topics_attr
816
+				FROM ' . $this->table_prefix.'topics_attr
817 817
 				ORDER BY left_id ASC';
818 818
 			$result = $this->db->sql_query($sql);
819 819
 
Please login to merge, or discard this patch.
event/main_listener.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	public function viewtopic_attr_apply($event)
95 95
 	{
96 96
 		$attr_id = (int) $this->request->variable('attr_id', 0);
97
-		if ( $attr_id )
97
+		if ($attr_id)
98 98
 		{
99 99
 			$this->qte->get_users_by_topic_id(array($event['topic_id']));
100 100
 			$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'])));
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 						$attr_name,
205 205
 					);
206 206
 
207
-					$this->log->add('mod', $this->user->data['user_id'], $this->user->ip, 'MCP_ATTRIBUTE_' . ($event['data']['attr_id'] == \ernadoo\qte\qte::REMOVE ? 'REMOVED' : 'UPDATED'), time(), $log_data);
207
+					$this->log->add('mod', $this->user->data['user_id'], $this->user->ip, 'MCP_ATTRIBUTE_'.($event['data']['attr_id'] == \ernadoo\qte\qte::REMOVE ? 'REMOVED' : 'UPDATED'), time(), $log_data);
208 208
 				}
209 209
 			}
210 210
 		}
Please login to merge, or discard this patch.