Passed
Push — master ( 950b1e...f203d3 )
by Stanislav
21:06 queued 06:06
created
core/image/image.php 3 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -190,13 +190,13 @@  discard block
 block discarded – undo
190 190
 		}
191 191
 
192 192
 		/**
193
-		* Event delete images
194
-		*
195
-		* @event phpbbgallery.core.image.delete_images
196
-		* @var	array	images			array of the image ids we are deleting
197
-		* @var	array	filenames		array of the image filenames
198
-		* @since 1.2.0
199
-		*/
193
+		 * Event delete images
194
+		 *
195
+		 * @event phpbbgallery.core.image.delete_images
196
+		 * @var	array	images			array of the image ids we are deleting
197
+		 * @var	array	filenames		array of the image filenames
198
+		 * @since 1.2.0
199
+		 */
200 200
 		$vars = array('images', 'filenames');
201 201
 		extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.delete_images', compact($vars)));
202 202
 
@@ -256,11 +256,11 @@  discard block
 block discarded – undo
256 256
 	}
257 257
 
258 258
 	/**
259
-	* Get the real filenames, so we can load/delete/edit the image-file.
260
-	*
261
-	* @param	mixed		$images		Array or integer with the image_id(s)
262
-	* @return	array		Format: $image_id => $filename
263
-	*/
259
+	 * Get the real filenames, so we can load/delete/edit the image-file.
260
+	 *
261
+	 * @param	mixed		$images		Array or integer with the image_id(s)
262
+	 * @return	array		Format: $image_id => $filename
263
+	 */
264 264
 	public function get_filenames($images)
265 265
 	{
266 266
 		if (empty($images))
@@ -375,13 +375,13 @@  discard block
 block discarded – undo
375 375
 				$tpl = '{CONTENT}';
376 376
 
377 377
 				/**
378
-				* Event generate link
379
-				*
380
-				* @event phpbbgallery.core.image.generate_link
381
-				* @var	string	mode	type of link
382
-				* @var	string	tpl		html to be outputed
383
-				* @since 1.2.0
384
-				*/
378
+				 * Event generate link
379
+				 *
380
+				 * @event phpbbgallery.core.image.generate_link
381
+				 * @var	string	mode	type of link
382
+				 * @var	string	tpl		html to be outputed
383
+				 * @since 1.2.0
384
+				 */
385 385
 				$vars = array('mode', 'tpl');
386 386
 				extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.generate_link', compact($vars)));//@todo: Correctly identify the event
387 387
 			break;
@@ -391,12 +391,12 @@  discard block
 block discarded – undo
391 391
 	}
392 392
 
393 393
 	/**
394
-	* Handle user- & total image_counter
395
-	*
396
-	* @param	array	$image_id_ary	array with the image_ids which changed their status
397
-	* @param	bool	$add			are we adding or removing the images
398
-	* @param	bool	$readd			is it possible that there are images which aren't really changed
399
-	*/
394
+	 * Handle user- & total image_counter
395
+	 *
396
+	 * @param	array	$image_id_ary	array with the image_ids which changed their status
397
+	 * @param	bool	$add			are we adding or removing the images
398
+	 * @param	bool	$readd			is it possible that there are images which aren't really changed
399
+	 */
400 400
 	public function handle_counter($image_id_ary, $add, $readd = false)
401 401
 	{
402 402
 		if (empty($image_id_ary))
@@ -467,11 +467,11 @@  discard block
 block discarded – undo
467 467
 	}
468 468
 
469 469
 	/**
470
-	* Approve image
471
-	* @param (array)	$image_id_ary	The image ID array to be approved
472
-	* @param (int)		$album_id	The album image is approved to (just save some queries for log)
473
-	* return 0 on success
474
-	*/
470
+	 * Approve image
471
+	 * @param (array)	$image_id_ary	The image ID array to be approved
472
+	 * @param (int)		$album_id	The album image is approved to (just save some queries for log)
473
+	 * return 0 on success
474
+	 */
475 475
 	public function approve_images($image_id_ary, $album_id)
476 476
 	{
477 477
 		$sql = 'SELECT image_id, image_name, image_user_id
@@ -507,10 +507,10 @@  discard block
 block discarded – undo
507 507
 	}
508 508
 
509 509
 	/**
510
-	* UnApprove image
511
-	* @param (array)	$image_id_ary	The image ID array to be unapproved
512
-	* @param (int)		$album_id	The album image is approved to (just save some queries for log)
513
-	*/
510
+	 * UnApprove image
511
+	 * @param (array)	$image_id_ary	The image ID array to be unapproved
512
+	 * @param (int)		$album_id	The album image is approved to (just save some queries for log)
513
+	 */
514 514
 	public function unapprove_images($image_id_ary, $album_id)
515 515
 	{
516 516
 		self::handle_counter($image_id_ary, false);
@@ -563,10 +563,10 @@  discard block
 block discarded – undo
563 563
 	}
564 564
 
565 565
 	/**
566
-	* Lock images
567
-	* @param (array)	$image_id_ary	Array of images we want to lock
568
-	* @param (int)		$album_id		Album id, so we can log the action
569
-	*/
566
+	 * Lock images
567
+	 * @param (array)	$image_id_ary	Array of images we want to lock
568
+	 * @param (int)		$album_id		Album id, so we can log the action
569
+	 */
570 570
 	public function lock_images($image_id_ary, $album_id)
571 571
 	{
572 572
 		self::handle_counter($image_id_ary, false);
@@ -590,9 +590,9 @@  discard block
 block discarded – undo
590 590
 	}
591 591
 
592 592
 	/**
593
-	* Get last image id
594
-	* Return (int) image_id
595
-	**/
593
+	 * Get last image id
594
+	 * Return (int) image_id
595
+	 **/
596 596
 	public function get_last_image()
597 597
 	{
598 598
 		$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 				* @since 1.2.0
384 384
 				*/
385 385
 				$vars = array('mode', 'tpl');
386
-				extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.generate_link', compact($vars)));//@todo: Correctly identify the event
386
+				extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.generate_link', compact($vars))); //@todo: Correctly identify the event
387 387
 			break;
388 388
 		}
389 389
 
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 
407 407
 		$num_images = $num_comments = 0;
408 408
 		$sql = 'SELECT SUM(image_comments) as comments
409
-			FROM ' . $this->table_images .'
409
+			FROM ' . $this->table_images . '
410 410
 			WHERE image_status ' . (($readd) ? '=' : '<>') . ' ' . \phpbbgallery\core\block::STATUS_UNAPPROVED . '
411 411
 				AND ' . $this->db->sql_in_set('image_id', $image_id_ary) . '
412 412
 			GROUP BY image_user_id';
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 		$this->db->sql_freeresult($result);
416 416
 
417 417
 		$sql = 'SELECT COUNT(image_id) images, image_user_id
418
-			FROM ' . $this->table_images .' 
418
+			FROM ' . $this->table_images . ' 
419 419
 			WHERE image_status ' . (($readd) ? '=' : '<>') . ' ' . \phpbbgallery\core\block::STATUS_UNAPPROVED . '
420 420
 				AND ' . $this->db->sql_in_set('image_id', $image_id_ary) . '
421 421
 			GROUP BY image_user_id';
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 			return;
456 456
 		}
457 457
 
458
-		$sql = 'SELECT * FROM ' . $this->table_images .' WHERE image_id = ' . (int) $image_id;
458
+		$sql = 'SELECT * FROM ' . $this->table_images . ' WHERE image_id = ' . (int) $image_id;
459 459
 		$result = $this->db->sql_query($sql);
460 460
 		$row = $this->db->sql_fetchrow($result);
461 461
 		$this->db->sql_freeresult($result);
@@ -515,14 +515,14 @@  discard block
 block discarded – undo
515 515
 	{
516 516
 		self::handle_counter($image_id_ary, false);
517 517
 
518
-		$sql = 'UPDATE ' . $this->table_images .' 
518
+		$sql = 'UPDATE ' . $this->table_images . ' 
519 519
 			SET image_status = ' . \phpbbgallery\core\block::STATUS_UNAPPROVED . '
520 520
 			WHERE image_status <> ' . \phpbbgallery\core\block::STATUS_ORPHAN . '
521 521
 				AND ' . $this->db->sql_in_set('image_id', $image_id_ary);
522 522
 		$this->db->sql_query($sql);
523 523
 
524 524
 		$sql = 'SELECT image_id, image_name
525
-			FROM ' . $this->table_images .' 
525
+			FROM ' . $this->table_images . ' 
526 526
 			WHERE image_status <> ' . \phpbbgallery\core\block::STATUS_ORPHAN . '
527 527
 				AND ' . $this->db->sql_in_set('image_id', $image_id_ary);
528 528
 		$result = $this->db->sql_query($sql);
@@ -704,14 +704,14 @@  discard block
 block discarded – undo
704 704
 			'U_USER_IP'		=> $show_ip && $this->gallery_auth->acl_check('m_status', $image_data['image_album_id'], $image_data['album_user_id']) ? $image_data['image_user_ip'] : false,
705 705
 
706 706
 			'S_IMAGE_REPORTED'		=> $image_data['image_reported'],
707
-			'U_IMAGE_REPORTED'		=> '',//($image_data['image_reported']) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=report_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_reported']) : '',
707
+			'U_IMAGE_REPORTED'		=> '', //($image_data['image_reported']) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=report_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_reported']) : '',
708 708
 			'S_STATUS_APPROVED'		=> ($image_data['image_status'] == \phpbbgallery\core\block::STATUS_APPROVED),
709 709
 			'S_STATUS_UNAPPROVED'	=> ($this->gallery_auth->acl_check('m_status', $image_data['image_album_id'], $image_data['album_user_id']) && $image_data['image_status'] == \phpbbgallery\core\block::STATUS_UNAPPROVED) ? true : false,
710 710
 			'S_STATUS_UNAPPROVED_ACTION'	=> ($this->gallery_auth->acl_check('m_status', $image_data['image_album_id'], $image_data['album_user_id']) && $image_data['image_status'] == \phpbbgallery\core\block::STATUS_UNAPPROVED) ? $this->helper->route('phpbbgallery_core_moderate_image_approve', array('image_id' => (int) $image_data['image_id'])) : '',
711 711
 			'S_STATUS_LOCKED'		=> ($image_data['image_status'] == \phpbbgallery\core\block::STATUS_LOCKED),
712 712
 
713 713
 			'U_REPORT'	=> ($this->gallery_auth->acl_check('m_report', $image_data['image_album_id'], $image_data['album_user_id']) && $image_data['image_reported']) ? '123'/*$this->url->append_sid('mcp', "mode=report_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_reported'])*/ : '',
714
-			'U_STATUS'	=> '',//($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id)) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=queue_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_id']) : '',
714
+			'U_STATUS'	=> '', //($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id)) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=queue_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_id']) : '',
715 715
 			'L_STATUS'	=> ($image_data['image_status'] == \phpbbgallery\core\block::STATUS_UNAPPROVED) ? $this->language->lang('APPROVE_IMAGE') : (($image_data['image_status'] == \phpbbgallery\core\block::STATUS_APPROVED) ? $this->language->lang('CHANGE_IMAGE_STATUS') : $this->language->lang('UNLOCK_IMAGE')),
716 716
 		));
717 717
 	}
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -363,8 +363,7 @@  discard block
 block discarded – undo
363 363
 				{
364 364
 					$url = $this->url->append_sid('image_page', "album_id=$album_id&amp;image_id=$next_image{$additional_parameters}");
365 365
 					$tpl = '<a href="{IMAGE_URL}" title="{IMAGE_NAME}">{CONTENT}</a>';
366
-				}
367
-				else
366
+				} else
368 367
 				{
369 368
 					$tpl = '{CONTENT}';
370 369
 				}
@@ -440,8 +439,7 @@  discard block
 block discarded – undo
440 439
 		{
441 440
 			$this->gallery_config->inc('num_images', (int) $num_images);
442 441
 			$this->gallery_config->inc('num_comments', (int) $num_comments);
443
-		}
444
-		else
442
+		} else
445 443
 		{
446 444
 			$this->gallery_config->dec('num_images', (int) $num_images);
447 445
 			$this->gallery_config->dec('num_comments', (int) $num_comments);
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 3 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 	}
99 99
 
100 100
 	/**
101
-	* Image File Controller
102
-	*	Route: gallery/image/{image_id}/source
103
-	*
104
-	* @param	int		$image_id
105
-	* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
106
-	*/
101
+	 * Image File Controller
102
+	 *	Route: gallery/image/{image_id}/source
103
+	 *
104
+	 * @param	int		$image_id
105
+	 * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
106
+	 */
107 107
 	public function source($image_id)
108 108
 	{
109 109
 		$this->auth->load_user_premissions($this->user->data['user_id']);
@@ -155,12 +155,12 @@  discard block
 block discarded – undo
155 155
 	}
156 156
 
157 157
 	/**
158
-	* Image File Controller
159
-	*	Route: gallery/image/{image_id}/medium
160
-	*
161
-	* @param	int		$image_id
162
-	* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
163
-	*/
158
+	 * Image File Controller
159
+	 *	Route: gallery/image/{image_id}/medium
160
+	 *
161
+	 * @param	int		$image_id
162
+	 * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
163
+	 */
164 164
 	public function medium($image_id)
165 165
 	{
166 166
 
@@ -190,12 +190,12 @@  discard block
 block discarded – undo
190 190
 	}
191 191
 
192 192
 	/**
193
-	* Image File Controller
194
-	*	Route: gallery/image/{image_id}/mini
195
-	*
196
-	* @param	int		$image_id
197
-	* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
198
-	*/
193
+	 * Image File Controller
194
+	 *	Route: gallery/image/{image_id}/mini
195
+	 *
196
+	 * @param	int		$image_id
197
+	 * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
198
+	 */
199 199
 	public function mini($image_id)
200 200
 	{
201 201
 		$this->path = $this->path_mini;
@@ -354,11 +354,11 @@  discard block
 block discarded – undo
354 354
 	}
355 355
 
356 356
 	/**
357
-	* Image File Controller
358
-	*	Route: gallery/image/{image_id}/x
359
-	*
360
-	* @return \Symfony\Component\HttpFoundation\BinaryFileResponseResponse A Symfony Response object
361
-	*/
357
+	 * Image File Controller
358
+	 *	Route: gallery/image/{image_id}/x
359
+	 *
360
+	 * @return \Symfony\Component\HttpFoundation\BinaryFileResponseResponse A Symfony Response object
361
+	 */
362 362
 	public function display()
363 363
 	{
364 364
 		$this->tool->set_last_modified($this->gallery_user->get_data('user_permissions_changed'));
Please login to merge, or discard this patch.
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.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -232,8 +232,7 @@  discard block
 block discarded – undo
232 232
 			$this->data['album_user_id'] = 1;
233 233
 			$this->data['image_filemissing'] = 0;
234 234
 			$this->data['album_watermark'] = 0;
235
-		}
236
-		else
235
+		} else
237 236
 		{
238 237
 			$sql = 'SELECT *
239 238
 				FROM ' . $this->table_images . ' i
@@ -394,8 +393,7 @@  discard block
 block discarded – undo
394 393
 			{
395 394
 				$response->headers->set('expires', '-1');
396 395
 			}
397
-		}
398
-		else
396
+		} else
399 397
 		{
400 398
 			$response->headers->set('Content-Disposition', 'inline; ' . $this->tool->header_filename(htmlspecialchars_decode($this->tool->image_name)) . '.' . ($this->tool->image_type == 'jpeg' ? 'jpg' : $this->tool->image_type));
401 399
 			if ($this->tool->is_ie_greater7($this->user->browser))
Please login to merge, or discard this patch.
core/controller/upload.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -249,8 +249,7 @@  discard block
 block discarded – undo
249 249
 					'last_image'	=> end($process->images),
250 250
 				);
251 251
 				$this->notification_helper->new_image($data);
252
-			}
253
-			else
252
+			} else
254 253
 			{
255 254
 				$target = array(
256 255
 					'album_id'	=>	$album_id,
@@ -355,8 +354,7 @@  discard block
 block discarded – undo
355 354
 					{
356 355
 						$this->language->add_lang('ucp');
357 356
 						$error_array[] = $this->language->lang($result . '_USERNAME');
358
-					}
359
-					else
357
+					} else
360 358
 					{
361 359
 						$process->set_username($username);
362 360
 					}
@@ -375,8 +373,7 @@  discard block
 block discarded – undo
375 373
 				if (!$process->uploaded_files)
376 374
 				{
377 375
 					$process->new_error($this->language->lang('UPLOAD_NO_FILE'));
378
-				}
379
-				else
376
+				} else
380 377
 				{
381 378
 					$mode = 'upload_edit';
382 379
 					// Remove submit, so we get the first screen of step 2.
@@ -422,8 +419,7 @@  discard block
 block discarded – undo
422 419
 						if ($VAR == 'zip')
423 420
 						{
424 421
 							continue;
425
-						}
426
-						else
422
+						} else
427 423
 						{
428 424
 							$filetypes[] = $VAR;
429 425
 						}
@@ -523,8 +519,7 @@  discard block
 block discarded – undo
523 519
 						'last_image'	=> end($process->images),
524 520
 					);
525 521
 					$this->notification_helper->new_image($data);
526
-				}
527
-				else
522
+				} else
528 523
 				{
529 524
 					$target = array(
530 525
 						'album_id'	=>	(int) $album_id,
@@ -591,8 +586,7 @@  discard block
 block discarded – undo
591 586
 		if (file_exists($phpbbgallery_core_file) && is_writable($phpbbgallery_core_file) && file_exists($phpbbgallery_core_file_source) && is_writable($phpbbgallery_core_file_source) && file_exists($phpbbgallery_core_file_medium) && is_writable($phpbbgallery_core_file_medium) && file_exists($phpbbgallery_core_file_mini) && is_writable($phpbbgallery_core_file_mini))
592 587
 		{
593 588
 			return true;
594
-		}
595
-		else
589
+		} else
596 590
 		{
597 591
 			return false;
598 592
 		}
Please login to merge, or discard this patch.
core/controller/moderate.php 2 patches
Braces   +16 added lines, -32 removed lines patch added patch discarded remove patch
@@ -148,8 +148,7 @@  discard block
 block discarded – undo
148 148
 			{
149 149
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
150 150
 			}
151
-		}
152
-		else
151
+		} else
153 152
 		{
154 153
 			$album = $this->album->get_info($album_id);
155 154
 			if (!$this->gallery_auth->acl_check('m_', $album['album_id'], $album['album_user_id']))
@@ -207,8 +206,7 @@  discard block
 block discarded – undo
207 206
 			{
208 207
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
209 208
 			}
210
-		}
211
-		else
209
+		} else
212 210
 		{
213 211
 			$album = $this->album->get_info($album_id);
214 212
 			if (!$this->gallery_auth->acl_check('m_status', $album['album_id'], $album['album_user_id']))
@@ -253,8 +251,7 @@  discard block
 block discarded – undo
253 251
 					$this->url->meta_refresh(3, $back_link);
254 252
 					trigger_error($message);
255 253
 				}
256
-			}
257
-			else
254
+			} else
258 255
 			{
259 256
 				$s_hidden_fields = '<input type="hidden" name="action['.$action.']" value="' . $action . '" />';
260 257
 				$s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />';
@@ -303,8 +300,7 @@  discard block
 block discarded – undo
303 300
 			{
304 301
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
305 302
 			}
306
-		}
307
-		else
303
+		} else
308 304
 		{
309 305
 			$album = $this->album->get_info($album_id);
310 306
 			if (!$this->gallery_auth->acl_check('m_', $album['album_id'], $album['album_user_id']))
@@ -351,8 +347,7 @@  discard block
 block discarded – undo
351 347
 				$message = $this->language->lang('WAITING_REPORTED_DONE', count($report_ary));
352 348
 				$this->url->meta_refresh(3, $back_link);
353 349
 				trigger_error($message);
354
-			}
355
-			else
350
+			} else
356 351
 			{
357 352
 				$s_hidden_fields = '<input type="hidden" name="action['.$action.']" value="' . $action . '" />';
358 353
 				$s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />';
@@ -372,8 +367,7 @@  discard block
 block discarded – undo
372 367
 			{
373 368
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
374 369
 			}
375
-		}
376
-		else
370
+		} else
377 371
 		{
378 372
 			$album = $this->album->get_info($album_id);
379 373
 			if (!$this->gallery_auth->acl_check('m_report', $album['album_id'], $album['album_user_id']))
@@ -468,8 +462,7 @@  discard block
 block discarded – undo
468 462
 						trigger_error($message);
469 463
 					break;
470 464
 				}
471
-			}
472
-			else
465
+			} else
473 466
 			{
474 467
 				$s_hidden_fields = '<input type="hidden" name="select_action" value="' . $action . '" />';
475 468
 				$s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />';
@@ -490,8 +483,7 @@  discard block
 block discarded – undo
490 483
 						'S_HIDDEN_FIELDS'	=> $s_hidden_fields,
491 484
 					));
492 485
 					return $this->helper->render('gallery/mcp_body.html', $this->language->lang('GALLERY'));
493
-				}
494
-				else
486
+				} else
495 487
 				{
496 488
 					confirm_box(false, $this->language->lang('QUEUES_A_' . strtoupper($action) . '2_CONFIRM'), $s_hidden_fields);
497 489
 				}
@@ -506,8 +498,7 @@  discard block
 block discarded – undo
506 498
 			{
507 499
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
508 500
 			}
509
-		}
510
-		else
501
+		} else
511 502
 		{
512 503
 			$album = $this->album->get_info($album_id);
513 504
 			if (!$this->gallery_auth->acl_check('m_', $album['album_id'], $album['album_user_id']))
@@ -581,8 +572,7 @@  discard block
 block discarded – undo
581 572
 					$message = $this->language->lang('WAITING_REPORTED_DONE', 1);
582 573
 					$this->url->meta_refresh(3, $back_link);
583 574
 					trigger_error($message);
584
-				}
585
-				else
575
+				} else
586 576
 				{
587 577
 					$s_hidden_fields = '<input type="hidden" name="action" value="reports_close" />';
588 578
 					confirm_box(false, $this->language->lang('REPORT_A_CLOSE2_CONFIRM'), $s_hidden_fields);
@@ -624,8 +614,7 @@  discard block
 block discarded – undo
624 614
 			{
625 615
 				$select_select .= '<option value="images_unapprove">' . $this->language->lang('QUEUE_A_UNAPPROVE') . '</option>';
626 616
 				$select_select .= '<option value="images_lock">' . $this->language->lang('QUEUE_A_LOCK') . '</option>';
627
-			}
628
-			else
617
+			} else
629 618
 			{
630 619
 				$select_select .= '<option value="images_approve">' . $this->language->lang('QUEUE_A_APPROVE') . '</option>';
631 620
 				$select_select .= '<option value="images_unapprove">' . $this->language->lang('QUEUE_A_UNAPPROVE') . '</option>';
@@ -644,8 +633,7 @@  discard block
 block discarded – undo
644 633
 			if ($open_report)
645 634
 			{
646 635
 				$select_select .= '<option value="reports_close">' . $this->language->lang('REPORT_A_CLOSE') . '</option>';
647
-			}
648
-			else
636
+			} else
649 637
 			{
650 638
 				$select_select .= '<option value="reports_open">' . $this->language->lang('REPORT_A_OPEN') . '</option>';
651 639
 			}
@@ -727,8 +715,7 @@  discard block
 block discarded – undo
727 715
 			));
728 716
 			return $this->helper->render('gallery/message.html', $this->language->lang('GALLERY'));
729 717
 			//trigger_error($message);
730
-		}
731
-		else
718
+		} else
732 719
 		{
733 720
 			$this->template->assign_vars(array(
734 721
 				'S_NOTIFY_POSTER'			=> $show_notify,
@@ -777,8 +764,7 @@  discard block
 block discarded – undo
777 764
 			$message = sprintf($this->language->lang('WAITING_UNAPPROVED_IMAGE', 1));
778 765
 			meta_refresh($meta_refresh_time, $image_backlink);
779 766
 			trigger_error($message);
780
-		}
781
-		else
767
+		} else
782 768
 		{
783 769
 			$s_hidden_fields = '';
784 770
 			confirm_box(false, 'QUEUE_A_UNAPPROVE2', $s_hidden_fields);
@@ -819,8 +805,7 @@  discard block
 block discarded – undo
819 805
 			$this->album->update_info($moving_target);
820 806
 			meta_refresh($meta_refresh_time, $image_backlink);
821 807
 			trigger_error($message);
822
-		}
823
-		else
808
+		} else
824 809
 		{
825 810
 			$category_select = $this->album->get_albumbox(false, 'moving_target', $album_id, 'm_move', $album_id);
826 811
 			$this->template->assign_vars(array(
@@ -864,8 +849,7 @@  discard block
 block discarded – undo
864 849
 			$message = sprintf($this->language->lang('WAITING_LOCKED_IMAGE',1));
865 850
 			meta_refresh($meta_refresh_time, $image_backlink);
866 851
 			trigger_error($message);
867
-		}
868
-		else
852
+		} else
869 853
 		{
870 854
 			$s_hidden_fields = '';
871 855
 			confirm_box(false, 'QUEUE_A_LOCK2', $s_hidden_fields);
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 			}
261 261
 			else
262 262
 			{
263
-				$s_hidden_fields = '<input type="hidden" name="action['.$action.']" value="' . $action . '" />';
263
+				$s_hidden_fields = '<input type="hidden" name="action[' . $action . ']" value="' . $action . '" />';
264 264
 				$s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />';
265 265
 				foreach ($approve_ary as $id => $var)
266 266
 				{
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 			}
362 362
 			else
363 363
 			{
364
-				$s_hidden_fields = '<input type="hidden" name="action['.$action.']" value="' . $action . '" />';
364
+				$s_hidden_fields = '<input type="hidden" name="action[' . $action . ']" value="' . $action . '" />';
365 365
 				$s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />';
366 366
 				foreach ($report_ary as $var)
367 367
 				{
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 			case 'reports_close':
584 584
 				if (confirm_box(true))
585 585
 				{
586
-					$back_link =  $this->helper->route('phpbbgallery_core_moderate_image', array('image_id' => $image_id));
586
+					$back_link = $this->helper->route('phpbbgallery_core_moderate_image', array('image_id' => $image_id));
587 587
 					$this->report->close_reports_by_image($image_id);
588 588
 					$message = $this->language->lang('WAITING_REPORTED_DONE', 1);
589 589
 					$this->url->meta_refresh(3, $back_link);
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
 				'REPORT_TIME'	=> $this->user->format_date($var['report_time']),
680 680
 				'REPORT_NOTE'	=> $var['report_note'],
681 681
 				'STATUS'		=> $var['report_status'],
682
-				'MANAGER'		=> $var['report_manager'] != 0 ?  $this->user_loader->get_username($var['report_manager'], 'full') : false,
682
+				'MANAGER'		=> $var['report_manager'] != 0 ? $this->user_loader->get_username($var['report_manager'], 'full') : false,
683 683
 			));
684 684
 		}
685 685
 		return $this->helper->render('gallery/moderate_image_overview.html', $this->language->lang('GALLERY'));
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
 		$image_data = $this->image->get_image_data($image_id);
805 805
 		$album_id = $image_data['image_album_id'];
806 806
 		//$user_id = $image_data['image_user_id'];
807
-		$album_data =  $this->album->get_info($album_id);
807
+		$album_data = $this->album->get_info($album_id);
808 808
 		$album_backlink = $this->helper->route('phpbbgallery_core_album', array('album_id' => $album_id));
809 809
 		$image_backlink = $this->helper->route('phpbbgallery_core_image', array('image_id' => $image_id));
810 810
 		$album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login');
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
 		$image_data = $this->image->get_image_data($image_id);
853 853
 		$album_id = $image_data['image_album_id'];
854 854
 		//$user_id = $image_data['image_user_id'];
855
-		$album_data =  $this->album->get_info($album_id);
855
+		$album_data = $this->album->get_info($album_id);
856 856
 		$album_backlink = $this->helper->route('phpbbgallery_core_album', array('album_id' => $album_id));
857 857
 		$image_backlink = $this->helper->route('phpbbgallery_core_image', array('image_id' => $image_id));
858 858
 		$album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login');
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 			$image_id_ary = array($image_id);
869 869
 			$this->image->lock_images($image_id_ary, $album_data['album_id']);
870 870
 			// To DO - add notification
871
-			$message = sprintf($this->language->lang('WAITING_LOCKED_IMAGE',1));
871
+			$message = sprintf($this->language->lang('WAITING_LOCKED_IMAGE', 1));
872 872
 			meta_refresh($meta_refresh_time, $image_backlink);
873 873
 			trigger_error($message);
874 874
 		}
Please login to merge, or discard this patch.
core/controller/search.php 3 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.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -232,8 +232,7 @@  discard block
 block discarded – undo
232 232
 				if ($search_terms == 'all')
233 233
 				{
234 234
 					$keywords .= ' ' . $add_keywords;
235
-				}
236
-				else
235
+				} else
237 236
 				{
238 237
 					$search_terms = 'all';
239 238
 					$keywords = preg_replace('#\s+#u', ' |', $keywords) . ' ' .$add_keywords;
@@ -271,8 +270,7 @@  discard block
 block discarded – undo
271 270
 			if (empty($search_album))
272 271
 			{
273 272
 				$sql_where[] = $this->db->sql_in_set('i.image_album_id', $this->gallery_auth->acl_album_ids('i_view'));
274
-			}
275
-			else
273
+			} else
276 274
 			{
277 275
 				$sql_where[] = $this->db->sql_in_set('i.image_album_id', $search_album);
278 276
 			}
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -141,24 +141,24 @@  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);
151
-		$user_id		= $this->request->variable('user_id', array(0));
151
+		$user_id = $this->request->variable('user_id', array(0));
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
 
160
-		$start 			= ($page - 1) * $this->gallery_config->get('items_per_page');
161
-		if ($keywords != '' && $add_keywords ='' )
160
+		$start = ($page - 1) * $this->gallery_config->get('items_per_page');
161
+		if ($keywords != '' && $add_keywords = '')
162 162
 		{
163 163
 			$submit = true;
164 164
 		}
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 		if ($this->gallery_config->get('allow_rates'))
175 175
 		{
176 176
 			$sort_by_text['ra'] = $this->language->lang('RATING');
177
-			$sort_by_sql['ra'] = 'image_rate_points';//@todo: (phpbb_gallery_contest::$mode == phpbb_gallery_contest::MODE_SUM) ? 'image_rate_points' : 'image_rate_avg';
177
+			$sort_by_sql['ra'] = 'image_rate_points'; //@todo: (phpbb_gallery_contest::$mode == phpbb_gallery_contest::MODE_SUM) ? 'image_rate_points' : 'image_rate_avg';
178 178
 			$sort_by_text['r'] = $this->language->lang('RATES_COUNT');
179 179
 			$sort_by_sql['r'] = 'image_rates';
180 180
 		}
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 				{
206 206
 					trigger_error(sprintf($this->language->lang('TOO_FEW_AUTHOR_CHARS'), $this->config['min_search_author_chars']));
207 207
 				}
208
-				$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)) .'\'';
208
+				$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 209
 				$sql = 'SELECT user_id
210 210
 					FROM ' . USERS_TABLE . '
211 211
 					WHERE ' . $username_parsed . '
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
 			if (!empty($user_id))
225 225
 			{
226
-				$sql_where[] =  $this->db->sql_in_set('i.image_user_id', $user_id);
226
+				$sql_where[] = $this->db->sql_in_set('i.image_user_id', $user_id);
227 227
 			}
228 228
 			// if we search in an existing search result just add the additional keywords. But we need to use "all search terms"-mode
229 229
 			// so we can keep the old keywords in their old mode, but add the new ones as required words
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 				else
237 237
 				{
238 238
 					$search_terms = 'all';
239
-					$keywords = preg_replace('#\s+#u', ' |', $keywords) . ' ' .$add_keywords;
239
+					$keywords = preg_replace('#\s+#u', ' |', $keywords) . ' ' . $add_keywords;
240 240
 				}
241 241
 			}
242 242
 			$keywords_ary = ($keywords) ? explode(' ', $keywords) : array();
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 				$match_search_query = '';
262 262
 				foreach ($matches as $match)
263 263
 				{
264
-					$match_search_query .= (($match_search_query) ? ' OR ' : '') . 'LOWER('. $match . ') ';
264
+					$match_search_query .= (($match_search_query) ? ' OR ' : '') . 'LOWER(' . $match . ') ';
265 265
 					$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()));
266 266
 				}
267 267
 				$search_query .= ((!$search_query) ? '' : (($search_terms == 'all') ? ' AND ' : ' OR ')) . '(' . $match_search_query . ')';
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 				trigger_error('NO_SEARCH_RESULTS');
291 291
 			}
292 292
 			$sql_array['SELECT'] = '*, a.album_name, a.album_status, a.album_user_id, a.album_id';
293
-			$sql_array['LEFT_JOIN']	= array(
293
+			$sql_array['LEFT_JOIN'] = array(
294 294
 				array(
295 295
 					'FROM'		=> array($this->albums_table => 'a'),
296 296
 					'ON'		=> 'a.album_id = i.image_album_id',
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 			{
319 319
 				$this->image->assign_block('imageblock.image', $row, $show_options, $thumbnail_link, $imagename_link);
320 320
 			}
321
-			$current_page = $page*$this->gallery_config->get('items_per_page');
321
+			$current_page = $page * $this->gallery_config->get('items_per_page');
322 322
 			$this->pagination->generate_template_pagination(array(
323 323
 				'routes' => array(
324 324
 					'phpbbgallery_core_search',
Please login to merge, or discard this patch.
core/controller/index.php 3 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
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 				'U_IMAGENAME'	=> ($last_image['image_id'] > 0) ? $last_image['image_name'] : false,
160 160
 				'U_IMAGE_ACTION'	=> $action_image,
161 161
 				'U_IMAGENAME_ACTION'	=> $this->helper->route('phpbbgallery_core_image', array('image_id' => $last_image['image_id'])),
162
-				'U_TIME'	=> ($last_image['image_id'] > 0) ?  $this->user->format_date($last_image['image_time']) : false,
162
+				'U_TIME'	=> ($last_image['image_id'] > 0) ? $this->user->format_date($last_image['image_time']) : false,
163 163
 				'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,
164 164
 			));
165 165
 			$this->gallery_user->set_user_id($this->user->data['user_id']);
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 			'TOTAL_IMAGES'		=> ($this->gallery_config->get('disp_statistic')) ? $this->language->lang('TOTAL_IMAGES_SPRINTF', $this->gallery_config->get('num_images')) : '',
319 319
 			'TOTAL_COMMENTS'	=> ($this->gallery_config->get('allow_comments')) ? $this->language->lang('TOTAL_COMMENTS_SPRINTF', $this->gallery_config->get('num_comments')) : '',
320 320
 			'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')) : '',
321
-			'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>') : '',
321
+			'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>') : '',
322 322
 		));
323 323
 
324 324
 		$this->template->assign_vars(array(
@@ -416,9 +416,9 @@  discard block
 block discarded – undo
416 416
 
417 417
 			while ($row = $this->db->sql_fetchrow($result))
418 418
 			{
419
-				$birthday_username	= get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
420
-				$birthday_year		= (int) substr($row['user_birthday'], -4);
421
-				$birthday_age		= ($birthday_year) ? max(0, $now['year'] - $birthday_year) : '';
419
+				$birthday_username = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
420
+				$birthday_year = (int) substr($row['user_birthday'], -4);
421
+				$birthday_age = ($birthday_year) ? max(0, $now['year'] - $birthday_year) : '';
422 422
 
423 423
 				$this->template->assign_block_vars('birthdays', array(
424 424
 					'USERNAME'	=> $birthday_username,
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -131,8 +131,7 @@  discard block
 block discarded – undo
131 131
 		if ($this->gallery_config->get('pegas_index_album'))
132 132
 		{
133 133
 			$this->display->display_albums('personal', $this->config['load_moderators']);
134
-		}
135
-		else
134
+		} else
136 135
 		{
137 136
 			$last_image = $this->image->get_last_image();
138 137
 			if (empty($last_image))
@@ -347,8 +346,7 @@  discard block
 block discarded – undo
347 346
 				FROM ' . GROUPS_TABLE . '
348 347
 				WHERE group_legend > 0
349 348
 				ORDER BY ' . $order_legend . ' ASC';
350
-		}
351
-		else
349
+		} else
352 350
 		{
353 351
 			$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_legend
354 352
 				FROM ' . GROUPS_TABLE . ' g
@@ -373,8 +371,7 @@  discard block
 block discarded – undo
373 371
 			if ($row['group_name'] == 'BOTS' || ($this->user->data['user_id'] != ANONYMOUS && !$this->auth->acl_get('u_viewprofile')))
374 372
 			{
375 373
 				$legend[] = '<span' . $colour_text . '>' . $group_name . '</span>';
376
-			}
377
-			else
374
+			} else
378 375
 			{
379 376
 				$legend[] = '<a' . $colour_text . ' href="' . append_sid($this->root_path . 'memberlist.' . $this->php_ext, 'mode=group&amp;g=' . $row['group_id']) . '">' . $group_name . '</a>';
380 377
 			}
Please login to merge, or discard this patch.
core/controller/comment.php 3 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.
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -213,8 +213,7 @@  discard block
 block discarded – undo
213 213
 		if (isset($album_data['contest_start']))
214 214
 		{
215 215
 			$s_hide_comment_input = (time() < ($album_data['contest_start'] + $album_data['contest_end'])) ? true : false;
216
-		}
217
-		else
216
+		} else
218 217
 		{
219 218
 			$s_hide_comment_input = false;
220 219
 		}
@@ -338,14 +337,12 @@  discard block
 block discarded – undo
338 337
 				$this->notification_helper->notify('new_comment', $data);
339 338
 				//$phpbb_gallery_notification->send_notification('image', $image_id, $image_data['image_name']);
340 339
 				$message .= $this->language->lang('COMMENT_STORED') . '<br />';
341
-			}
342
-			else if ($this->misc->display_captcha('comment'))
340
+			} else if ($this->misc->display_captcha('comment'))
343 341
 			{
344 342
 				$s_captcha_hidden_fields = ($captcha->is_solved()) ? build_hidden_fields($captcha->get_hidden_fields()) : '';
345 343
 			}
346 344
 			$sig_checked = ($this->auth->acl_get('u_sig') && isset($_POST['attach_sig']));
347
-		}
348
-		else
345
+		} else
349 346
 		{
350 347
 			if ($comment_id != 0)
351 348
 			{
@@ -439,8 +436,7 @@  discard block
 block discarded – undo
439 436
 			$comment_data = $this->db->sql_fetchrow($result);
440 437
 			$this->db->sql_freeresult($result);
441 438
 			$image_id = (int) $comment_data['comment_image_id'];
442
-		}
443
-		else
439
+		} else
444 440
 		{
445 441
 			$this->misc->not_authorised($image_backlink, $image_loginlink);
446 442
 		}
@@ -451,8 +447,7 @@  discard block
 block discarded – undo
451 447
 			{
452 448
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
453 449
 			}
454
-		}
455
-		else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id']))
450
+		} else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id']))
456 451
 		{
457 452
 			$this->misc->not_authorised($image_backlink, $image_loginlink);
458 453
 		}
@@ -485,8 +480,7 @@  discard block
 block discarded – undo
485 480
 		if (isset($album_data['contest_start']))
486 481
 		{
487 482
 			$s_hide_comment_input = (time() < ($album_data['contest_start'] + $album_data['contest_end'])) ? true : false;
488
-		}
489
-		else
483
+		} else
490 484
 		{
491 485
 			$s_hide_comment_input = false;
492 486
 		}
@@ -578,8 +572,7 @@  discard block
 block discarded – undo
578 572
 					$this->gallery_log->add_log('moderator', 'c_edit', $image_data['image_album_id'], $image_data['image_id'], array('LOG_GALLERY_COMMENT_EDITED', $image_data['image_name']));
579 573
 				}
580 574
 			}
581
-		}
582
-		else
575
+		} else
583 576
 		{
584 577
 			$sig_checked = (bool) $comment_data['comment_signature'];
585 578
 
@@ -653,8 +646,7 @@  discard block
 block discarded – undo
653 646
 			$comment_data = $this->db->sql_fetchrow($result);
654 647
 			$this->db->sql_freeresult($result);
655 648
 			$image_id = (int) $comment_data['comment_image_id'];
656
-		}
657
-		else
649
+		} else
658 650
 		{
659 651
 			$this->misc->not_authorised($image_backlink, $image_loginlink);
660 652
 		}
@@ -665,8 +657,7 @@  discard block
 block discarded – undo
665 657
 			{
666 658
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
667 659
 			}
668
-		}
669
-		else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id']))
660
+		} else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id']))
670 661
 		{
671 662
 			$this->misc->not_authorised($image_backlink, $image_loginlink);
672 663
 		}
@@ -731,15 +722,13 @@  discard block
 block discarded – undo
731 722
 
732 723
 			$message = $this->language->lang('DELETED_COMMENT') . '<br />';
733 724
 			$submit = true;
734
-		}
735
-		else
725
+		} else
736 726
 		{
737 727
 			if (isset($_POST['cancel']))
738 728
 			{
739 729
 				$message = $this->language->lang('DELETED_COMMENT_NOT') . '<br />';
740 730
 				$submit = true;
741
-			}
742
-			else
731
+			} else
743 732
 			{
744 733
 				confirm_box(false, 'DELETE_COMMENT2', $s_hidden_fields);
745 734
 			}
Please login to merge, or discard this patch.
core/migrations/release_1_2_0_add_bbcode.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
 				{
54 54
 					$bbcode_id = NUM_CORE_BBCODES + 1;
55 55
 				}
56
-			}
57
-			else
56
+			} else
58 57
 			{
59 58
 				$bbcode_id = NUM_CORE_BBCODES + 1;
60 59
 			}
@@ -63,8 +62,7 @@  discard block
 block discarded – undo
63 62
 			if ($this->config['enable_mod_rewrite'])
64 63
 			{
65 64
 				$url .= 'gallery/image/';
66
-			}
67
-			else
65
+			} else
68 66
 			{
69 67
 				$url .= 'app.php/gallery/image/';
70 68
 			}
Please login to merge, or discard this patch.