Passed
Pull Request — master (#340)
by
unknown
02:34
created
core/report.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
 	}
141 141
 
142 142
 	/**
143
-	* Delete reports for given report_ids
144
-	*
145
-	* @param	mixed	$report_ids		Array or integer with report_id.
146
-	*/
143
+	 * Delete reports for given report_ids
144
+	 *
145
+	 * @param	mixed	$report_ids		Array or integer with report_id.
146
+	 */
147 147
 	public function delete($report_ids)
148 148
 	{
149 149
 		$report_ids = self::cast_mixed_int2array($report_ids);
@@ -163,10 +163,10 @@  discard block
 block discarded – undo
163 163
 
164 164
 
165 165
 	/**
166
-	* Delete reports for given image_ids
167
-	*
168
-	* @param	mixed	$image_ids		Array or integer with image_id.
169
-	*/
166
+	 * Delete reports for given image_ids
167
+	 *
168
+	 * @param	mixed	$image_ids		Array or integer with image_id.
169
+	 */
170 170
 	public function delete_images($image_ids)
171 171
 	{
172 172
 		$image_ids = self::cast_mixed_int2array($image_ids);
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
 
195 195
 
196 196
 	/**
197
-	* Delete reports for given album_ids
198
-	*
199
-	* @param	mixed	$album_ids		Array or integer with album_id.
200
-	*/
197
+	 * Delete reports for given album_ids
198
+	 *
199
+	 * @param	mixed	$album_ids		Array or integer with album_id.
200
+	 */
201 201
 	public function delete_albums($album_ids)
202 202
 	{
203 203
 		$album_ids = self::cast_mixed_int2array($album_ids);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	protected $reports_table;
65 65
 
66 66
 	public function __construct(\phpbbgallery\core\log $gallery_log, \phpbbgallery\core\auth\auth $gallery_auth, \phpbb\user $user,
67
-		\phpbb\language\language $language, \phpbb\db\driver\driver_interface $db,	\phpbb\user_loader $user_loader,
67
+		\phpbb\language\language $language, \phpbb\db\driver\driver_interface $db, \phpbb\user_loader $user_loader,
68 68
 		\phpbbgallery\core\album\album $album, \phpbb\template\template $template, \phpbb\controller\helper $helper,
69 69
 		\phpbbgallery\core\config $gallery_config, \phpbb\pagination $pagination, \phpbbgallery\core\notification\helper $notification_helper,
70 70
 		$images_table, $reports_table)
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 				'REPORT_TIME'	=> $this->user->format_date($VAR['report_time']),
364 364
 			));
365 365
 			unset($album_tmp);
366
-			$reported_images_count ++;
366
+			$reported_images_count++;
367 367
 		}
368 368
 		$this->template->assign_vars(array(
369 369
 			'TOTAL_IMAGES_REPORTED' => $status == 1 ? $this->language->lang('WAITING_REPORTED_IMAGE', (int) $count) : $this->language->lang('WAITING_REPORTED_DONE', (int) $count),
Please login to merge, or discard this patch.
core/upload.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 			include_once($this->root_path . 'includes/message_parser.' . $this->php_ext);
280 280
 		}
281 281
 		$message_parser = new \parse_message();
282
-		$message_parser->message	= utf8_normalize_nfc($this->get_description());
282
+		$message_parser->message = utf8_normalize_nfc($this->get_description());
283 283
 		if ($message_parser->message)
284 284
 		{
285 285
 			$message_parser->parse(true, true, true, true, false, true, true, true);
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 
335 335
 		$sql_ary = array_merge($sql_ary, $additional_sql_data);
336 336
 
337
-		$sql = 'UPDATE ' . $this->images_table. ' 
337
+		$sql = 'UPDATE ' . $this->images_table . ' 
338 338
 			SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
339 339
 			WHERE image_id = ' . (int) $image_id;
340 340
 		$this->db->sql_query($sql);
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 		// Rotate the image
453 453
 		if ($this->gallery_config->get('allow_rotate') && $this->get_rotating())
454 454
 		{
455
-			$this->tools->rotate_image($this->get_rotating(),$this->gallery_config->get('allow_resize'));
455
+			$this->tools->rotate_image($this->get_rotating(), $this->gallery_config->get('allow_resize'));
456 456
 			if ($this->tools->rotated)
457 457
 			{
458 458
 				$this->tools->write_image($this->tools->image_source, $this->gallery_config->get('jpg_quality'), true);
Please login to merge, or discard this patch.
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -15,94 +15,94 @@  discard block
 block discarded – undo
15 15
 class upload
16 16
 {
17 17
 	/**
18
-	* @var \phpbb\user
19
-	*/
18
+	 * @var \phpbb\user
19
+	 */
20 20
 	protected $user;
21 21
 
22 22
 	/**
23
-	* @var \phpbb\language\language
24
-	*/
23
+	 * @var \phpbb\language\language
24
+	 */
25 25
 	protected $language;
26 26
 
27 27
 	/**
28
-	* @var \phpbb\db\driver\driver_interface
29
-	*/
28
+	 * @var \phpbb\db\driver\driver_interface
29
+	 */
30 30
 	protected $db;
31 31
 
32 32
 	/**
33
-	* @var \phpbb\event\dispatcher_interface
34
-	*/
33
+	 * @var \phpbb\event\dispatcher_interface
34
+	 */
35 35
 	protected $phpbb_dispatcher;
36 36
 
37 37
 	/**
38
-	* @var \phpbb\request\request
39
-	*/
38
+	 * @var \phpbb\request\request
39
+	 */
40 40
 	protected $request;
41 41
 
42 42
 	/**
43
-	* @var \phpbb\files\upload
44
-	*/
43
+	 * @var \phpbb\files\upload
44
+	 */
45 45
 	protected $file_upload;
46 46
 
47 47
 	/**
48
-	* @var \phpbbgallery\core\image\image
49
-	*/
48
+	 * @var \phpbbgallery\core\image\image
49
+	 */
50 50
 	protected $gallery_image;
51 51
 
52 52
 	/**
53
-	* @var \phpbbgallery\core\config
54
-	*/
53
+	 * @var \phpbbgallery\core\config
54
+	 */
55 55
 	protected $gallery_config;
56 56
 
57 57
 	/**
58
-	* @var \phpbbgallery\core\url
59
-	*/
58
+	 * @var \phpbbgallery\core\url
59
+	 */
60 60
 	protected $gallery_url;
61 61
 
62 62
 	/**
63
-	* @var \phpbbgallery\core\block
64
-	*/
63
+	 * @var \phpbbgallery\core\block
64
+	 */
65 65
 	protected $block;
66 66
 
67 67
 	/**
68
-	* @var \phpbbgallery\core\file\file
69
-	*/
68
+	 * @var \phpbbgallery\core\file\file
69
+	 */
70 70
 	protected $tools;
71 71
 
72 72
 	/**
73
-	* @var string
74
-	*/
73
+	 * @var string
74
+	 */
75 75
 	protected $images_table;
76 76
 
77 77
 	/**
78
-	* @var string
79
-	*/
78
+	 * @var string
79
+	 */
80 80
 	protected $root_path;
81 81
 
82 82
 	/**
83
-	* @var string
84
-	*/
83
+	 * @var string
84
+	 */
85 85
 	protected $php_ext;
86 86
 
87 87
 	/**
88
-	* Number of Files per Directory
89
-	*
90
-	* If this constant is set to a value >0 the gallery will create a new directory,
91
-	* when the current directory has more files in it than set here.
92
-	*/
88
+	 * Number of Files per Directory
89
+	 *
90
+	 * If this constant is set to a value >0 the gallery will create a new directory,
91
+	 * when the current directory has more files in it than set here.
92
+	 */
93 93
 	const NUM_FILES_PER_DIR = 0;
94 94
 
95 95
 	/**
96
-	* Objects: phpBB Upload, 2 Files and Image-Functions
97
-	*/
96
+	 * Objects: phpBB Upload, 2 Files and Image-Functions
97
+	 */
98 98
 	private $upload = null;
99 99
 	private $file = null;
100 100
 	private $zip_file = null;
101 101
 	//private $tools = null;
102 102
 
103 103
 	/**
104
-	* Basic variables...
105
-	*/
104
+	 * Basic variables...
105
+	 */
106 106
 	public $loaded_files = 0;
107 107
 	public $uploaded_files = 0;
108 108
 	public $errors = array();
@@ -230,8 +230,8 @@  discard block
 block discarded – undo
230 230
 	}
231 231
 
232 232
 	/**
233
-	* Upload a zip file and save the images into the import/ directory.
234
-	*/
233
+	 * Upload a zip file and save the images into the import/ directory.
234
+	 */
235 235
 	public function upload_zip()
236 236
 	{
237 237
 		if (!class_exists('compress_zip'))
@@ -379,14 +379,14 @@  discard block
 block discarded – undo
379 379
 		$file_link = $this->gallery_url->path('upload') . $this->image_data[$image_id]['image_filename'];
380 380
 
381 381
 		/**
382
-		* Event upload image before
383
-		*
384
-		* @event phpbbgallery.core.upload.update_image_before
385
-		* @var	array	additional_sql_data		array of additional settings
386
-		* @var	array	image_data				array of image_data
387
-		* @var	string	file_link				link to file
388
-		* @since 1.2.0
389
-		*/
382
+		 * Event upload image before
383
+		 *
384
+		 * @event phpbbgallery.core.upload.update_image_before
385
+		 * @var	array	additional_sql_data		array of additional settings
386
+		 * @var	array	image_data				array of image_data
387
+		 * @var	string	file_link				link to file
388
+		 * @since 1.2.0
389
+		 */
390 390
 		$vars = array('additional_sql_data', 'image_data', 'file_link');
391 391
 		extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.upload.update_image_before', compact($vars)));
392 392
 
@@ -394,12 +394,12 @@  discard block
 block discarded – undo
394 394
 		if (!$this->prepare_file_update($image_id))
395 395
 		{
396 396
 			/**
397
-			* Event upload image update
398
-			*
399
-			* @event phpbbgallery.core.upload.update_image_nofilechange
400
-			* @var	array	additional_sql_data		array of additional settings
401
-			* @since 1.2.0
402
-			*/
397
+			 * Event upload image update
398
+			 *
399
+			 * @event phpbbgallery.core.upload.update_image_nofilechange
400
+			 * @var	array	additional_sql_data		array of additional settings
401
+			 * @since 1.2.0
402
+			 */
403 403
 			$vars = array('additional_sql_data');
404 404
 			extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.upload.update_image_nofilechange', compact($vars)));
405 405
 		}
@@ -415,8 +415,8 @@  discard block
 block discarded – undo
415 415
 	}
416 416
 
417 417
 	/**
418
-	* Prepare file on upload: rotate and resize
419
-	*/
418
+	 * Prepare file on upload: rotate and resize
419
+	 */
420 420
 	public function prepare_file()
421 421
 	{
422 422
 		$upload_dir = $this->get_current_upload_dir();
@@ -446,13 +446,13 @@  discard block
 block discarded – undo
446 446
 		$file = $this->file;
447 447
 
448 448
 		/**
449
-		* Event upload image update
450
-		*
451
-		* @event phpbbgallery.core.upload.prepare_file_before
452
-		* @var	array	additional_sql_data		array of additional settings
453
-		* @var	array	file					File object
454
-		* @since 1.2.0
455
-		*/
449
+		 * Event upload image update
450
+		 *
451
+		 * @event phpbbgallery.core.upload.prepare_file_before
452
+		 * @var	array	additional_sql_data		array of additional settings
453
+		 * @var	array	file					File object
454
+		 * @since 1.2.0
455
+		 */
456 456
 		$vars = array('additional_sql_data', 'file');
457 457
 		extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.upload.prepare_file_before', compact($vars)));
458 458
 
@@ -804,8 +804,8 @@  discard block
 block discarded – undo
804 804
 	}
805 805
 
806 806
 	/**
807
-	* Generate some kind of check so users only complete the upload for their images
808
-	*/
807
+	 * Generate some kind of check so users only complete the upload for their images
808
+	 */
809 809
 	public function generate_hidden_fields()
810 810
 	{
811 811
 		$checks = array();
Please login to merge, or discard this patch.
core/contest.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -34,18 +34,18 @@  discard block
 block discarded – undo
34 34
 	const NUM_IMAGES = 3;
35 35
 
36 36
 	/**
37
-	* There are different modes to calculate who won the contest.
38
-	* This value should be one of the constant-names below.
39
-	*/
37
+	 * There are different modes to calculate who won the contest.
38
+	 * This value should be one of the constant-names below.
39
+	 */
40 40
 	static public $mode = self::MODE_AVERAGE;
41 41
 
42 42
 	/**
43
-	* The image with the highest average wins.
44
-	*/
43
+	 * The image with the highest average wins.
44
+	 */
45 45
 	const MODE_AVERAGE = 1;
46 46
 	/**
47
-	* The image with the highest number of total points wins.
48
-	*/
47
+	 * The image with the highest number of total points wins.
48
+	 */
49 49
 	const MODE_SUM = 2;
50 50
 
51 51
 	public function __construct(\phpbb\db\driver\driver_interface $db,
@@ -59,14 +59,14 @@  discard block
 block discarded – undo
59 59
 	}
60 60
 
61 61
 	/**
62
-	* Get the contest row from the table
63
-	*
64
-	* @param	int		$id				ID of the contest or album, depending on second parameter
65
-	* @param	string	$mode			contest or album ID to get the contest.
66
-	* @param	bool	$throw_error	Shall we throw an error if the contest was not found?
67
-	*
68
-	* @return	mixed	Either the array or boolean false if contest does not exist
69
-	*/
62
+	 * Get the contest row from the table
63
+	 *
64
+	 * @param	int		$id				ID of the contest or album, depending on second parameter
65
+	 * @param	string	$mode			contest or album ID to get the contest.
66
+	 * @param	bool	$throw_error	Shall we throw an error if the contest was not found?
67
+	 *
68
+	 * @return	mixed	Either the array or boolean false if contest does not exist
69
+	 */
70 70
 	public function get_contest($id, $mode = 'contest', $throw_error = true)
71 71
 	{
72 72
 		$sql = 'SELECT *
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -190,9 +190,9 @@
 block discarded – undo
190 190
 		$this->db->sql_freeresult($result);
191 191
 
192 192
 		$sql = 'UPDATE ' . $this->contest_table . '
193
-			SET contest_first = ' . (int) $first .',
194
-				contest_second = ' . (int) $second .',
195
-				contest_third = ' . (int) $third .'
193
+			SET contest_first = ' . (int) $first . ',
194
+				contest_second = ' . (int) $second . ',
195
+				contest_third = ' . (int) $third . '
196 196
 			WHERE contest_album_id = ' . (int) $album_id;
197 197
 		$this->db->sql_query($sql);
198 198
 
Please login to merge, or discard this patch.
core/rating.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	*/
159 159
 	public function display_box()
160 160
 	{
161
-		$this->template->assign_var('GALLERY_RATING', self::MODE_SELECT);//@todo: phpbb_ext_gallery_core_config::get('rating_mode'));
161
+		$this->template->assign_var('GALLERY_RATING', self::MODE_SELECT); //@todo: phpbb_ext_gallery_core_config::get('rating_mode'));
162 162
 
163 163
 		switch (self::MODE_SELECT)//@todo: phpbb_ext_gallery_core_config::get('rating_mode'))
164 164
 		{
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 */
202 202
 	public function get_image_rating($user_rating = false, $display_contest_end = true)
203 203
 	{
204
-		$this->template->assign_var('GALLERY_RATING', self::MODE_SELECT);//@todo: phpbb_ext_gallery_core_config::get('rating_mode'));
204
+		$this->template->assign_var('GALLERY_RATING', self::MODE_SELECT); //@todo: phpbb_ext_gallery_core_config::get('rating_mode'));
205 205
 
206 206
 		switch (self::MODE_SELECT)//@todo: phpbb_ext_gallery_core_config::get('rating_mode'))
207 207
 		{
Please login to merge, or discard this patch.
Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -13,91 +13,91 @@  discard block
 block discarded – undo
13 13
 class rating
14 14
 {
15 15
 	/**
16
-	* @var \phpbb\db\driver\driver_interface
17
-	*/
16
+	 * @var \phpbb\db\driver\driver_interface
17
+	 */
18 18
 	protected $db;
19 19
 
20 20
 	/**
21
-	* @var \phpbb\template\template
22
-	*/
21
+	 * @var \phpbb\template\template
22
+	 */
23 23
 	protected $template;
24 24
 
25 25
 	/**
26
-	* @var \phpbb\user
27
-	*/
26
+	 * @var \phpbb\user
27
+	 */
28 28
 	protected $user;
29 29
 
30 30
 	/**
31
-	* @var \phpbb\language\language
32
-	*/
31
+	 * @var \phpbb\language\language
32
+	 */
33 33
 	protected $language;
34 34
 
35 35
 	/**
36
-	* @var \phpbb\request\request
37
-	*/
36
+	 * @var \phpbb\request\request
37
+	 */
38 38
 	protected $request;
39 39
 
40 40
 	/**
41
-	* @var \phpbbgallery\core\config
42
-	*/
41
+	 * @var \phpbbgallery\core\config
42
+	 */
43 43
 	protected $gallery_config;
44 44
 
45 45
 	/**
46
-	* @var \phpbbgallery\core\auth\auth
47
-	*/
46
+	 * @var \phpbbgallery\core\auth\auth
47
+	 */
48 48
 	protected $gallery_auth;
49 49
 
50 50
 	/**
51
-	* @var string
52
-	*/
51
+	 * @var string
52
+	 */
53 53
 	protected $images_table;
54 54
 
55 55
 	/**
56
-	* @var string
57
-	*/
56
+	 * @var string
57
+	 */
58 58
 	protected $albums_table;
59 59
 
60 60
 	/**
61
-	* @var string
62
-	*/
61
+	 * @var string
62
+	 */
63 63
 	protected $rates_table;
64 64
 
65 65
 	/**
66
-	* The image ID we want to rate
67
-	*/
66
+	 * The image ID we want to rate
67
+	 */
68 68
 	public $image_id = 0;
69 69
 
70 70
 	/**
71
-	* Private objects with the values for the image/album from the database
72
-	*/
71
+	 * Private objects with the values for the image/album from the database
72
+	 */
73 73
 	private $image_data = null;
74 74
 	private $album_data = null;
75 75
 
76 76
 	/**
77
-	* Rating the user gave the image.
78
-	*/
77
+	 * Rating the user gave the image.
78
+	 */
79 79
 	public $user_rating = null;
80 80
 
81 81
 	/**
82
-	* Is rating currently possible?
83
-	* Might be blocked because of contest-settings.
84
-	*/
82
+	 * Is rating currently possible?
83
+	 * Might be blocked because of contest-settings.
84
+	 */
85 85
 	public $rating_enabled = false;
86 86
 
87 87
 	/**
88
-	* Classic-rating box with a dropdown.
89
-	*/
88
+	 * Classic-rating box with a dropdown.
89
+	 */
90 90
 	const MODE_SELECT = 1;
91 91
 
92 92
 	/**
93
-	* Rating with stars, like the old-system from youtube.
93
+	 * Rating with stars, like the old-system from youtube.
94 94
 	//@todo: const MODE_STARS = 2;
95
-	*/
95
+	 */
96 96
 
97 97
 	/**
98
-	* Simple thumbs up or down.
98
+	 * Simple thumbs up or down.
99 99
 	//@todo: const MODE_THUMB = 3;
100
-	*/
100
+	 */
101 101
 
102 102
 	/**
103 103
 	 * Constructor
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
 	}
205 205
 
206 206
 	/**
207
-	* Displays the box where the user can rate the image.
208
-	*/
207
+	 * Displays the box where the user can rate the image.
208
+	 */
209 209
 	public function display_box()
210 210
 	{
211 211
 		$this->template->assign_var('GALLERY_RATING', self::MODE_SELECT);//@todo: phpbb_ext_gallery_core_config::get('rating_mode'));
@@ -280,8 +280,8 @@  discard block
 block discarded – undo
280 280
 	}
281 281
 
282 282
 	/**
283
-	* Get rated value for a image
284
-	*/
283
+	 * Get rated value for a image
284
+	 */
285 285
 	private function get_image_rating_value()
286 286
 	{
287 287
 		/*if (phpbb_ext_gallery_core_contest::$mode == phpbb_ext_gallery_core_contest::MODE_SUM)
@@ -295,14 +295,14 @@  discard block
 block discarded – undo
295 295
 	}
296 296
 
297 297
 	/**
298
-	* Is the user allowed to rate?
299
-	* Following statements must be true:
300
-	*	- User must have permissions.
301
-	*	- User is neither owner of the image nor guest.
302
-	*	- Album and image are not locked.
303
-	*
304
-	* @return	bool
305
-	*/
298
+	 * Is the user allowed to rate?
299
+	 * Following statements must be true:
300
+	 *	- User must have permissions.
301
+	 *	- User is neither owner of the image nor guest.
302
+	 *	- Album and image are not locked.
303
+	 *
304
+	 * @return	bool
305
+	 */
306 306
 	public function is_allowed()
307 307
 	{
308 308
 		return $this->gallery_auth->acl_check('i_rate', $this->album_data('album_id'), $this->album_data('album_user_id')) &&
@@ -311,25 +311,25 @@  discard block
 block discarded – undo
311 311
 	}
312 312
 
313 313
 	/**
314
-	* Is the user able to rate?
315
-	* Following statements must be true:
316
-	*	- User must be allowed to rate
317
-	*	- If the image is in a contest, it must be in the rating timespan
318
-	*
319
-	* @return	bool
320
-	*/
314
+	 * Is the user able to rate?
315
+	 * Following statements must be true:
316
+	 *	- User must be allowed to rate
317
+	 *	- If the image is in a contest, it must be in the rating timespan
318
+	 *
319
+	 * @return	bool
320
+	 */
321 321
 	public function is_able()
322 322
 	{
323 323
 		return $this->is_allowed(); //&& phpbb_ext_gallery_core_contest::is_step('rate', $this->album_data(true));
324 324
 	}
325 325
 
326 326
 	/**
327
-	* Get rating from a user for a given image
328
-	*
329
-	* @param	int		$user_id
330
-	*
331
-	* @return	mixed	False if the user did not rate or is guest, otherwise int the points.
332
-	*/
327
+	 * Get rating from a user for a given image
328
+	 *
329
+	 * @param	int		$user_id
330
+	 *
331
+	 * @return	mixed	False if the user did not rate or is guest, otherwise int the points.
332
+	 */
333 333
 	public function get_user_rating($user_id)
334 334
 	{
335 335
 		if (isset($this->user_rating[$user_id]))
@@ -405,10 +405,10 @@  discard block
 block discarded – undo
405 405
 	}
406 406
 
407 407
 	/**
408
-	* Recalculate the average image-rating and such stuff.
409
-	*
410
-	* @param	mixed	$image_ids	Array or integer with image_id where we recalculate the rating.
411
-	*/
408
+	 * Recalculate the average image-rating and such stuff.
409
+	 *
410
+	 * @param	mixed	$image_ids	Array or integer with image_id where we recalculate the rating.
411
+	 */
412 412
 	public function recalc_image_rating($image_ids)
413 413
 	{
414 414
 		if (is_array($image_ids))
@@ -439,11 +439,11 @@  discard block
 block discarded – undo
439 439
 	}
440 440
 
441 441
 	/**
442
-	* Delete all ratings for given image_ids
443
-	*
444
-	* @param	mixed	$image_ids		Array or integer with image_id where we delete the rating.
445
-	* @param	bool	$reset_average	Shall we also reset the average? We can save that query, when the images are deleted anyway.
446
-	*/
442
+	 * Delete all ratings for given image_ids
443
+	 *
444
+	 * @param	mixed	$image_ids		Array or integer with image_id where we delete the rating.
445
+	 * @param	bool	$reset_average	Shall we also reset the average? We can save that query, when the images are deleted anyway.
446
+	 */
447 447
 	public function delete_ratings($image_ids, $reset_average = false)
448 448
 	{
449 449
 		if (is_array($image_ids))
Please login to merge, or discard this patch.
core/block.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,13 +23,13 @@  discard block
 block discarded – undo
23 23
 	 *
24 24
 	 * Constants defining some album properties
25 25
 	 */
26
-	const PUBLIC_ALBUM		= 0;
26
+	const PUBLIC_ALBUM = 0;
27 27
 
28
-	const TYPE_CAT			= 0;
29
-	const TYPE_UPLOAD		= 1;
28
+	const TYPE_CAT = 0;
29
+	const TYPE_UPLOAD = 1;
30 30
 	const TYPE_CONTEST		= 2;
31 31
 
32
-	const ALBUM_OPEN		= 0;
32
+	const ALBUM_OPEN = 0;
33 33
 	const ALBUM_LOCKED		= 1;
34 34
 
35 35
 	/**
@@ -58,22 +58,22 @@  discard block
 block discarded – undo
58 58
 	/**
59 59
 	 * Only visible for moderators.
60 60
 	 */
61
-	const STATUS_UNAPPROVED	= 0;
61
+	const STATUS_UNAPPROVED = 0;
62 62
 
63 63
 	/**
64 64
 	 * Visible for everyone with the i_view-permissions
65 65
 	 */
66
-	const STATUS_APPROVED	= 1;
66
+	const STATUS_APPROVED = 1;
67 67
 
68 68
 	/**
69 69
 	 * Visible for everyone with the i_view-permissions, but only moderators can comment.
70 70
 	 */
71
-	const STATUS_LOCKED		= 2;
71
+	const STATUS_LOCKED = 2;
72 72
 
73 73
 	/**
74 74
 	 * Orphan files are only visible for their author, because they're not yet ready uploaded.
75 75
 	 */
76
-	const STATUS_ORPHAN		= 3;
76
+	const STATUS_ORPHAN = 3;
77 77
 
78 78
 	/**
79 79
 	 * Constants regarding the image contest relation
Please login to merge, or discard this patch.
core/controller/file.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -316,7 +316,7 @@
 block discarded – undo
316 316
 
317 317
 	public function generate_image_src()
318 318
 	{
319
-		$this->image_src = $this->path  . $this->data['image_filename'];
319
+		$this->image_src = $this->path . $this->data['image_filename'];
320 320
 
321 321
 		if ($this->data['image_filemissing'] || !file_exists($this->path_source . $this->data['image_filename']))
322 322
 		{
Please login to merge, or discard this patch.
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
 	}
105 105
 
106 106
 	/**
107
-	* Image File Controller
108
-	*	Route: gallery/image/{image_id}/source
109
-	*
110
-	* @param	int		$image_id
111
-	* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
112
-	*/
107
+	 * Image File Controller
108
+	 *	Route: gallery/image/{image_id}/source
109
+	 *
110
+	 * @param	int		$image_id
111
+	 * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
112
+	 */
113 113
 	public function source($image_id)
114 114
 	{
115 115
 		$this->auth->load_user_permissions($this->user->data['user_id']);
@@ -160,12 +160,12 @@  discard block
 block discarded – undo
160 160
 	}
161 161
 
162 162
 	/**
163
-	* Image File Controller
164
-	*	Route: gallery/image/{image_id}/medium
165
-	*
166
-	* @param	int		$image_id
167
-	* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
168
-	*/
163
+	 * Image File Controller
164
+	 *	Route: gallery/image/{image_id}/medium
165
+	 *
166
+	 * @param	int		$image_id
167
+	 * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
168
+	 */
169 169
 	public function medium($image_id)
170 170
 	{
171 171
 
@@ -195,12 +195,12 @@  discard block
 block discarded – undo
195 195
 	}
196 196
 
197 197
 	/**
198
-	* Image File Controller
199
-	*	Route: gallery/image/{image_id}/mini
200
-	*
201
-	* @param	int		$image_id
202
-	* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
203
-	*/
198
+	 * Image File Controller
199
+	 *	Route: gallery/image/{image_id}/mini
200
+	 *
201
+	 * @param	int		$image_id
202
+	 * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
203
+	 */
204 204
 	public function mini($image_id)
205 205
 	{
206 206
 		$this->path = $this->path_mini;
@@ -356,11 +356,11 @@  discard block
 block discarded – undo
356 356
 	}
357 357
 
358 358
 	/**
359
-	* Image File Controller
360
-	*	Route: gallery/image/{image_id}/x
361
-	*
362
-	* @return \Symfony\Component\HttpFoundation\BinaryFileResponseResponse A Symfony Response object
363
-	*/
359
+	 * Image File Controller
360
+	 *	Route: gallery/image/{image_id}/x
361
+	 *
362
+	 * @return \Symfony\Component\HttpFoundation\BinaryFileResponseResponse A Symfony Response object
363
+	 */
364 364
 	public function display()
365 365
 	{
366 366
 		$this->tool->set_last_modified($this->gallery_user->get_data('user_permissions_changed'));
Please login to merge, or discard this patch.
core/controller/search.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
 		$this->language->add_lang(array('gallery'), 'phpbbgallery/core');
166 166
 		$this->language->add_lang('search');
167 167
 		/**
168
-		* Build the sort options
169
-		*/
168
+		 * Build the sort options
169
+		 */
170 170
 		$limit_days = array(0 => $this->language->lang('ALL_IMAGES'), 1 => $this->language->lang('1_DAY'), 7 => $this->language->lang('7_DAYS'), 14 => $this->language->lang('2_WEEKS'), 30 => $this->language->lang('1_MONTH'), 90 => $this->language->lang('3_MONTHS'), 180 => $this->language->lang('6_MONTHS'), 365 => $this->language->lang('1_YEAR'));
171 171
 		$sort_by_text = array('t' => $this->language->lang('TIME'), 'n' => $this->language->lang('IMAGE_NAME'), 'u' => $this->language->lang('SORT_USERNAME'), 'vc' => $this->language->lang('GALLERY_VIEWS'));
172 172
 		$sort_by_sql = array('t' => 'image_time', 'n' => 'image_name_clean', 'u' => 'image_username_clean', 'vc' => 'image_view_count');
@@ -369,11 +369,11 @@  discard block
 block discarded – undo
369 369
 	}
370 370
 
371 371
 	/**
372
-	* Index Controller
373
-	*	Route: gallery/search/random
374
-	*
375
-	* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
376
-	*/
372
+	 * Index Controller
373
+	 *	Route: gallery/search/random
374
+	 *
375
+	 * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
376
+	 */
377 377
 	public function random()
378 378
 	{
379 379
 		$this->language->add_lang(array('gallery'), 'phpbbgallery/core');
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -141,10 +141,10 @@  discard block
 block discarded – undo
141 141
 
142 142
 	public function base($page = 1)
143 143
 	{
144
-		$search_id		= $this->request->variable('search_id', '');
144
+		$search_id = $this->request->variable('search_id', '');
145 145
 		$image_id		= $this->request->variable('image_id', 0);
146 146
 
147
-		$submit			= $this->request->variable('submit', false);
147
+		$submit = $this->request->variable('submit', false);
148 148
 		$keywords		= utf8_normalize_nfc($this->request->variable('keywords', '', true));
149 149
 		$add_keywords	= utf8_normalize_nfc($this->request->variable('add_keywords', '', true));
150 150
 		$username		= $this->request->variable('username', '', true);
@@ -152,13 +152,13 @@  discard block
 block discarded – undo
152 152
 		$search_terms	= $this->request->variable('terms', 'all');
153 153
 		$search_album	= $this->request->variable('aid', array(0));
154 154
 		$search_child	= $this->request->variable('sc', true);
155
-		$search_fields	= $this->request->variable('sf', 'all');
156
-		$sort_days		= $this->request->variable('st', 0);
155
+		$search_fields = $this->request->variable('sf', 'all');
156
+		$sort_days = $this->request->variable('st', 0);
157 157
 		$sort_key		= $this->request->variable('sk', 't');
158 158
 		$sort_dir		= $this->request->variable('sd', 'd');
159 159
 		$filtered		= $this->request->variable('filtered', false);
160 160
 
161
-		$start 			= ($page - 1) * $this->gallery_config->get('items_per_page');
161
+		$start = ($page - 1) * $this->gallery_config->get('items_per_page');
162 162
 		if ($filtered)
163 163
 		{
164 164
 			$submit = true;
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		if ($this->gallery_config->get('allow_rates'))
176 176
 		{
177 177
 			$sort_by_text['ra'] = $this->language->lang('RATING');
178
-			$sort_by_sql['ra'] = 'image_rate_points';//@todo: (phpbb_gallery_contest::$mode == phpbb_gallery_contest::MODE_SUM) ? 'image_rate_points' : 'image_rate_avg';
178
+			$sort_by_sql['ra'] = 'image_rate_points'; //@todo: (phpbb_gallery_contest::$mode == phpbb_gallery_contest::MODE_SUM) ? 'image_rate_points' : 'image_rate_avg';
179 179
 			$sort_by_text['r'] = $this->language->lang('RATES_COUNT');
180 180
 			$sort_by_sql['r'] = 'image_rates';
181 181
 		}
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 				{
207 207
 					trigger_error(sprintf($this->language->lang('TOO_FEW_AUTHOR_CHARS'), $this->config['min_search_author_chars']));
208 208
 				}
209
-				$username_parsed = (strpos($username, '*') !== false) ? ' username_clean ' . $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), utf8_clean_string($this->db->sql_escape($username)))) : ' username_clean = \'' . $this->db->sql_escape(utf8_clean_string($username)) .'\'';
209
+				$username_parsed = (strpos($username, '*') !== false) ? ' username_clean ' . $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), utf8_clean_string($this->db->sql_escape($username)))) : ' username_clean = \'' . $this->db->sql_escape(utf8_clean_string($username)) . '\'';
210 210
 				$sql = 'SELECT user_id
211 211
 					FROM ' . USERS_TABLE . '
212 212
 					WHERE ' . $username_parsed . '
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 
225 225
 			if (!empty($user_id))
226 226
 			{
227
-				$sql_where[] =  $this->db->sql_in_set('i.image_user_id', $user_id);
227
+				$sql_where[] = $this->db->sql_in_set('i.image_user_id', $user_id);
228 228
 			}
229 229
 			// if we search in an existing search result just add the additional keywords. But we need to use "all search terms"-mode
230 230
 			// so we can keep the old keywords in their old mode, but add the new ones as required words
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 				else
238 238
 				{
239 239
 					$search_terms = 'all';
240
-					$keywords = preg_replace('#\s+#u', ' |', $keywords) . ' ' .$add_keywords;
240
+					$keywords = preg_replace('#\s+#u', ' |', $keywords) . ' ' . $add_keywords;
241 241
 				}
242 242
 			}
243 243
 			$keywords_ary = ($keywords) ? explode(' ', $keywords) : array();
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 				$match_search_query = '';
263 263
 				foreach ($matches as $match)
264 264
 				{
265
-					$match_search_query .= (($match_search_query) ? ' OR ' : '') . 'LOWER('. $match . ') ';
265
+					$match_search_query .= (($match_search_query) ? ' OR ' : '') . 'LOWER(' . $match . ') ';
266 266
 					$match_search_query .= $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), $this->db->get_any_char() . mb_strtolower($word) . $this->db->get_any_char()));
267 267
 				}
268 268
 				$search_query .= ((!$search_query) ? '' : (($search_terms == 'all') ? ' AND ' : ' OR ')) . '(' . $match_search_query . ')';
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 				trigger_error('NO_SEARCH_RESULTS');
292 292
 			}
293 293
 			$sql_array['SELECT'] = '*, a.album_name, a.album_status, a.album_user_id, a.album_id';
294
-			$sql_array['LEFT_JOIN']	= array(
294
+			$sql_array['LEFT_JOIN'] = array(
295 295
 				array(
296 296
 					'FROM'		=> array($this->albums_table => 'a'),
297 297
 					'ON'		=> 'a.album_id = i.image_album_id',
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 			{
320 320
 				$this->image->assign_block('imageblock.image', $row, $show_options, $thumbnail_link, $imagename_link);
321 321
 			}
322
-			$current_page = $page*$this->gallery_config->get('items_per_page');
322
+			$current_page = $page * $this->gallery_config->get('items_per_page');
323 323
 			$this->pagination->generate_template_pagination(array(
324 324
 				'routes' => array(
325 325
 					'phpbbgallery_core_search',
Please login to merge, or discard this patch.
core/controller/index.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -111,11 +111,11 @@
 block discarded – undo
111 111
 	}
112 112
 
113 113
 	/**
114
-	* Index Controller
115
-	*	Route: gallery
116
-	*
117
-	* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
118
-	*/
114
+	 * Index Controller
115
+	 *	Route: gallery
116
+	 *
117
+	 * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
118
+	 */
119 119
 	public function base()
120 120
 	{
121 121
 		// Display login box for guests and an error for users
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 				'U_IMAGENAME'	=> ($last_image['image_id'] > 0) ? $last_image['image_name'] : false,
168 168
 				'U_IMAGE_ACTION'	=> $action_image,
169 169
 				'U_IMAGENAME_ACTION'	=> $this->helper->route('phpbbgallery_core_image', array('image_id' => $last_image['image_id'])),
170
-				'U_TIME'	=> ($last_image['image_id'] > 0) ?  $this->user->format_date($last_image['image_time']) : false,
170
+				'U_TIME'	=> ($last_image['image_id'] > 0) ? $this->user->format_date($last_image['image_time']) : false,
171 171
 				'U_UPLOADER'	=> ($last_image['image_id'] > 0) ? get_username_string('full', $last_image['image_user_id'], $last_image['image_username'], $last_image['image_user_colour']) : false,
172 172
 				'ALPHABET_NAVIGATION' => implode(' ', $alpha_links),
173 173
 			));
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 			'TOTAL_IMAGES'		=> ($this->gallery_config->get('disp_statistic')) ? $this->language->lang('TOTAL_IMAGES_SPRINTF', $this->gallery_config->get('num_images')) : '',
328 328
 			'TOTAL_COMMENTS'	=> ($this->gallery_config->get('allow_comments')) ? $this->language->lang('TOTAL_COMMENTS_SPRINTF', $this->gallery_config->get('num_comments')) : '',
329 329
 			'TOTAL_PGALLERIES'	=> ($this->gallery_auth->acl_check('a_list', \phpbbgallery\core\auth\auth::PERSONAL_ALBUM)) ? $this->language->lang('TOTAL_PEGAS_SPRINTF', $this->gallery_config->get('num_pegas')) : '',
330
-			'NEWEST_PGALLERIES'	=> ($this->gallery_config->get('num_pegas')) ? sprintf($this->language->lang('NEWEST_PGALLERY'), '<a href="' . $this->helper->route('phpbbgallery_core_album', array('album_id' => $this->gallery_config->get('newest_pega_album_id'))) . '" '. ($this->gallery_config->get('newest_pega_user_colour') ? 'class="username-coloured" style="color: #' . $this->gallery_config->get('newest_pega_user_colour') . ';"' : 'class="username"') . '>' . $this->gallery_config->get('newest_pega_username') . '</a>') : '',
330
+			'NEWEST_PGALLERIES'	=> ($this->gallery_config->get('num_pegas')) ? sprintf($this->language->lang('NEWEST_PGALLERY'), '<a href="' . $this->helper->route('phpbbgallery_core_album', array('album_id' => $this->gallery_config->get('newest_pega_album_id'))) . '" ' . ($this->gallery_config->get('newest_pega_user_colour') ? 'class="username-coloured" style="color: #' . $this->gallery_config->get('newest_pega_user_colour') . ';"' : 'class="username"') . '>' . $this->gallery_config->get('newest_pega_username') . '</a>') : '',
331 331
 		));
332 332
 
333 333
 		$this->template->assign_vars(array(
@@ -425,9 +425,9 @@  discard block
 block discarded – undo
425 425
 
426 426
 			while ($row = $this->db->sql_fetchrow($result))
427 427
 			{
428
-				$birthday_username	= get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
429
-				$birthday_year		= (int) substr($row['user_birthday'], -4);
430
-				$birthday_age		= ($birthday_year) ? max(0, $now['year'] - $birthday_year) : '';
428
+				$birthday_username = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
429
+				$birthday_year = (int) substr($row['user_birthday'], -4);
430
+				$birthday_age = ($birthday_year) ? max(0, $now['year'] - $birthday_year) : '';
431 431
 
432 432
 				$this->template->assign_block_vars('birthdays', array(
433 433
 					'USERNAME'	=> $birthday_username,
Please login to merge, or discard this patch.
core/controller/comment.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -825,8 +825,8 @@
 block discarded – undo
825 825
 		generate_smilies('inline', 0);
826 826
 
827 827
 		/**
828
-		* Rating-System: now you can comment and rate in one form
829
-		*/
828
+		 * Rating-System: now you can comment and rate in one form
829
+		 */
830 830
 		$s_user_rated = false;
831 831
 		if ($this->gallery_config->get('allow_rates'))
832 832
 		{
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -197,8 +197,8 @@  discard block
 block discarded – undo
197 197
 			include_once($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext);
198 198
 		}
199 199
 
200
-		$bbcode_status	= ($this->config['allow_bbcode']) ? true : false;
201
-		$smilies_status	= ($this->config['allow_smilies']) ? true : false;
200
+		$bbcode_status = ($this->config['allow_bbcode']) ? true : false;
201
+		$smilies_status = ($this->config['allow_smilies']) ? true : false;
202 202
 		$img_status		= ($bbcode_status) ? true : false;
203 203
 		$url_status		= ($this->config['allow_post_links']) ? true : false;
204 204
 		$flash_status	= false;
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 			}
306 306
 
307 307
 			$message_parser = new \parse_message();
308
-			$message_parser->message	= utf8_normalize_nfc($comment_plain);
308
+			$message_parser->message = utf8_normalize_nfc($comment_plain);
309 309
 			if ($message_parser->message)
310 310
 			{
311 311
 				$message_parser->parse(true, true, true, true, false, true, true, true);
@@ -464,8 +464,8 @@  discard block
 block discarded – undo
464 464
 			include_once($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext);
465 465
 		}
466 466
 
467
-		$bbcode_status	= ($this->config['allow_bbcode']) ? true : false;
468
-		$smilies_status	= ($this->config['allow_smilies']) ? true : false;
467
+		$bbcode_status = ($this->config['allow_bbcode']) ? true : false;
468
+		$smilies_status = ($this->config['allow_smilies']) ? true : false;
469 469
 		$img_status		= ($bbcode_status) ? true : false;
470 470
 		$url_status		= ($this->config['allow_post_links']) ? true : false;
471 471
 		$flash_status	= false;
@@ -678,8 +678,8 @@  discard block
 block discarded – undo
678 678
 			include_once($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext);
679 679
 		}
680 680
 
681
-		$bbcode_status	= ($this->config['allow_bbcode']) ? true : false;
682
-		$smilies_status	= ($this->config['allow_smilies']) ? true : false;
681
+		$bbcode_status = ($this->config['allow_bbcode']) ? true : false;
682
+		$smilies_status = ($this->config['allow_smilies']) ? true : false;
683 683
 		$img_status		= ($bbcode_status) ? true : false;
684 684
 		$url_status		= ($this->config['allow_post_links']) ? true : false;
685 685
 		$flash_status	= false;
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 			'IMAGE_NAME'			=> $image_data['image_name'],
760 760
 
761 761
 			'S_SIGNATURE_CHECKED'	=> (isset($sig_checked) && $sig_checked) ? ' checked="checked"' : '',
762
-			'S_ALBUM_ACTION'		=> append_sid($this->url->path('full') . 'comment/' . (int) $image_id . '/edit/'. (int) $comment_id),
762
+			'S_ALBUM_ACTION'		=> append_sid($this->url->path('full') . 'comment/' . (int) $image_id . '/edit/' . (int) $comment_id),
763 763
 		));
764 764
 
765 765
 		if ($submit && !$error)
@@ -808,8 +808,8 @@  discard block
 block discarded – undo
808 808
 			include_once($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext);
809 809
 		}
810 810
 
811
-		$bbcode_status	= ($this->config['allow_bbcode']) ? true : false;
812
-		$smilies_status	= ($this->config['allow_smilies']) ? true : false;
811
+		$bbcode_status = ($this->config['allow_bbcode']) ? true : false;
812
+		$smilies_status = ($this->config['allow_smilies']) ? true : false;
813 813
 		$img_status		= ($bbcode_status) ? true : false;
814 814
 		$url_status		= ($this->config['allow_post_links']) ? true : false;
815 815
 		$flash_status	= false;
Please login to merge, or discard this patch.