Passed
Pull Request — master (#326)
by
unknown
04:30
created
core/album/manage.php 1 patch
Braces   +26 added lines, -52 removed lines patch added patch discarded remove patch
@@ -216,8 +216,7 @@  discard block
 block discarded – undo
216 216
 			if ($this->user->data['user_timezone'] == '')
217 217
 			{
218 218
 				$timezone = 'UTC';
219
-			}
220
-			else
219
+			} else
221 220
 			{
222 221
 				$timezone = $this->user->data['user_timezone'];
223 222
 			}
@@ -229,8 +228,7 @@  discard block
 block discarded – undo
229 228
 			{
230 229
 				$errors[] = sprintf($this->language->lang('CONTEST_START_INVALID'), $contest_data['contest_start']);
231 230
 				$start_date_error = true;
232
-			}
233
-			else
231
+			} else
234 232
 			{
235 233
 				$contest_data['contest_start'] = gmmktime((int) $m[4], (int) $m[5], 0, (int) $m[2], (int) $m[3], (int) $m[1]) - $time->getOffset();// - $offset;
236 234
 			}
@@ -238,8 +236,7 @@  discard block
 block discarded – undo
238 236
 			{
239 237
 				$errors[] = sprintf($this->language->lang('CONTEST_RATING_INVALID'), $contest_data['contest_rating']);
240 238
 				$date_error = true;
241
-			}
242
-			else if (!$start_date_error)
239
+			} else if (!$start_date_error)
243 240
 			{
244 241
 				$contest_data['contest_rating'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset();//- $offset;
245 242
 			}
@@ -247,8 +244,7 @@  discard block
 block discarded – undo
247 244
 			{
248 245
 				$errors[] = sprintf($this->language->lang('CONTEST_END_INVALID'), $contest_data['contest_end']);
249 246
 				$date_error = true;
250
-			}
251
-			else if (!$start_date_error)
247
+			} else if (!$start_date_error)
252 248
 			{
253 249
 				$contest_data['contest_end'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset();//- $offset;
254 250
 			}
@@ -336,8 +332,7 @@  discard block
 block discarded – undo
336 332
 
337 333
 					$album_data_sql['left_id'] = $row['right_id'];
338 334
 					$album_data_sql['right_id'] = $row['right_id'] + 1;
339
-				}
340
-				else
335
+				} else
341 336
 				{
342 337
 					$sql = 'UPDATE ' . $this->albums_table . ' 
343 338
 						SET left_id = left_id + 2, right_id = right_id + 2
@@ -354,8 +349,7 @@  discard block
 block discarded – undo
354 349
 					$album_data_sql['left_id'] = $row['left_id'] + 1;
355 350
 					$album_data_sql['right_id'] = $row['left_id'] + 2;
356 351
 				}
357
-			}
358
-			else
352
+			} else
359 353
 			{
360 354
 				if (!$add_on_top)
361 355
 				{
@@ -368,8 +362,7 @@  discard block
 block discarded – undo
368 362
 
369 363
 					$album_data_sql['left_id'] = $row['right_id'] + 1;
370 364
 					$album_data_sql['right_id'] = $row['right_id'] + 2;
371
-				}
372
-				else
365
+				} else
373 366
 				{
374 367
 					$sql = 'UPDATE ' . $this->albums_table . ' 
375 368
 						SET left_id = left_id + 2, right_id = right_id + 2
@@ -402,8 +395,7 @@  discard block
 block discarded – undo
402 395
 				$this->db->sql_query($sql);
403 396
 			}
404 397
 			$this->gallery_log->add_log('admin', 'add', $album_data['album_id'], 0, array('LOG_ALBUM_ADD', $album_data['album_name']));
405
-		}
406
-		else
398
+		} else
407 399
 		{
408 400
 			$row = $this->gallery_album->get_info($album_data_sql['album_id']);
409 401
 			$reset_marked_images = false;
@@ -414,22 +406,19 @@  discard block
 block discarded – undo
414 406
 				// Changing a contest to category? No!
415 407
 				$errors[] = $this->language->lang('ALBUM_WITH_CONTEST_NO_TYPE_CHANGE');
416 408
 				return $errors;
417
-			}
418
-			else if ($row['album_type'] != \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST)
409
+			} else if ($row['album_type'] != \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST)
419 410
 			{
420 411
 				// Changing a album to contest? No!
421 412
 				// Changing a category to contest? No!
422 413
 				$errors[] = $this->language->lang('ALBUM_NO_TYPE_CHANGE_TO_CONTEST');
423 414
 				return $errors;
424
-			}
425
-			else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CAT && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_UPLOAD)
415
+			} else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CAT && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_UPLOAD)
426 416
 			{
427 417
 				// Changing a category to a album? Yes!
428 418
 				// Reset the data (you couldn't upload directly in a cat, you must use a album)
429 419
 				$album_data_sql['album_images'] = $album_data_sql['album_images_real'] = $album_data_sql['album_last_image_id'] = $album_data_sql['album_last_user_id'] = $album_data_sql['album_last_image_time'] = $album_data_sql['album_contest'] = 0;
430 420
 				$album_data_sql['album_last_username'] = $album_data_sql['album_last_user_colour'] = $album_data_sql['album_last_image_name'] = '';
431
-			}
432
-			else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_UPLOAD && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CAT)
421
+			} else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_UPLOAD && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CAT)
433 422
 			{
434 423
 				// Changing a album to a category? Yes!
435 424
 				// we're turning a uploadable album into a non-uploadable album
@@ -440,22 +429,18 @@  discard block
 block discarded – undo
440 429
 					if ($to_album_id)
441 430
 					{
442 431
 						$errors = $this->move_album_content($album_data_sql['album_id'], $to_album_id);
443
-					}
444
-					else
432
+					} else
445 433
 					{
446 434
 						return array($this->language->lang('NO_DESTINATION_ALBUM'));
447 435
 					}
448
-				}
449
-				else if ($album_data_sql['type_action'] == 'delete')
436
+				} else if ($album_data_sql['type_action'] == 'delete')
450 437
 				{
451 438
 					$errors = $this->delete_album_content($album_data_sql['album_id']);
452
-				}
453
-				else
439
+				} else
454 440
 				{
455 441
 					return array($this->language->lang('NO_ALBUM_ACTION'));
456 442
 				}
457
-			}
458
-			else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST)
443
+			} else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST)
459 444
 			{
460 445
 				// Changing a contest to contest? Yes!
461 446
 				// We need to check for the contest_data
@@ -483,8 +468,7 @@  discard block
 block discarded – undo
483 468
 				if ($row['album_id'] != $album_data_sql['parent_id'])
484 469
 				{
485 470
 					$errors = $this->move_album($album_data_sql['album_id'], $album_data_sql['parent_id']);
486
-				}
487
-				else
471
+				} else
488 472
 				{
489 473
 					$album_data_sql['parent_id'] = $row['parent_id'];
490 474
 				}
@@ -627,13 +611,11 @@  discard block
 block discarded – undo
627 611
 			if ($to_data['right_id'] > $from_data['right_id'])
628 612
 			{
629 613
 				$diff = '+ ' . ($to_data['right_id'] - $from_data['right_id'] - 1);
630
-			}
631
-			else
614
+			} else
632 615
 			{
633 616
 				$diff = '- ' . abs($to_data['right_id'] - $from_data['right_id'] - 1);
634 617
 			}
635
-		}
636
-		else
618
+		} else
637 619
 		{
638 620
 			$sql = 'SELECT MAX(right_id) AS right_id
639 621
 				FROM ' . $this->albums_table . ' 
@@ -679,14 +661,12 @@  discard block
 block discarded – undo
679 661
 		{
680 662
 			$log_action_images = 'IMAGES';
681 663
 			$errors = array_merge($errors, $this->delete_album_content($album_id));
682
-		}
683
-		else if ($action_images == 'move')
664
+		} else if ($action_images == 'move')
684 665
 		{
685 666
 			if (!$images_to_id)
686 667
 			{
687 668
 				$errors[] = $this->language->lang('NO_DESTINATION_ALBUM');
688
-			}
689
-			else
669
+			} else
690 670
 			{
691 671
 				$log_action_images = 'MOVE_IMAGES';
692 672
 
@@ -700,8 +680,7 @@  discard block
 block discarded – undo
700 680
 				if (!$row)
701 681
 				{
702 682
 					$errors[] = $this->language->lang('NO_ALBUM');
703
-				}
704
-				else
683
+				} else
705 684
 				{
706 685
 					$images_to_name = $row['album_name'];
707 686
 					$errors = array_merge($errors, $this->move_album_content($album_id, $images_to_id));
@@ -735,14 +714,12 @@  discard block
 block discarded – undo
735 714
 			$sql = 'DELETE FROM ' . $this->albums_table . ' 
736 715
 				WHERE ' . $this->db->sql_in_set('album_id', $album_ids);
737 716
 			$this->db->sql_query($sql);
738
-		}
739
-		else if ($action_subalbums == 'move')
717
+		} else if ($action_subalbums == 'move')
740 718
 		{
741 719
 			if (!$subalbums_to_id)
742 720
 			{
743 721
 				$errors[] = $this->language->lang('NO_DESTINATION_ALBUM');
744
-			}
745
-			else
722
+			} else
746 723
 			{
747 724
 				$log_action_albums = 'MOVE_ALBUMS';
748 725
 
@@ -756,8 +733,7 @@  discard block
 block discarded – undo
756 733
 				if (!$row)
757 734
 				{
758 735
 					$errors[] = $this->language->lang('NO_ALBUM');
759
-				}
760
-				else
736
+				} else
761 737
 				{
762 738
 					$subalbums_to_name = $row['album_name'];
763 739
 
@@ -792,8 +768,7 @@  discard block
 block discarded – undo
792 768
 			{
793 769
 				return $errors;
794 770
 			}
795
-		}
796
-		else
771
+		} else
797 772
 		{
798 773
 			$diff = 2;
799 774
 			$sql = 'DELETE FROM ' . $this->albums_table . '  
@@ -1087,8 +1062,7 @@  discard block
 block discarded – undo
1087 1062
 
1088 1063
 			$move_up_left = $album_row['left_id'];
1089 1064
 			$move_up_right = $album_row['right_id'];
1090
-		}
1091
-		else
1065
+		} else
1092 1066
 		{
1093 1067
 			$left_id = $album_row['left_id'];
1094 1068
 			$right_id = $target['right_id'];
Please login to merge, or discard this patch.
core/acp/albums_module.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -324,8 +324,7 @@  discard block
 block discarded – undo
324 324
 					if (!$update)
325 325
 					{
326 326
 						$album_data = $row;
327
-					}
328
-					else
327
+					} else
329 328
 					{
330 329
 						$album_data['left_id'] = $row['left_id'];
331 330
 						$album_data['right_id'] = $row['right_id'];
@@ -333,8 +332,7 @@  discard block
 block discarded – undo
333 332
 					if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST)
334 333
 					{
335 334
 						$contest_data = $phpbb_gallery_contest->get_contest($album_id, 'album');
336
-					}
337
-					else
335
+					} else
338 336
 					{
339 337
 						// Default values, 3 days later rate and 7 for the end of the contest
340 338
 						$contest_data = array(
@@ -356,8 +354,7 @@  discard block
 block discarded – undo
356 354
 					/*
357 355
 					$album_data['album_password_confirm'] = $album_data['album_password'];
358 356
 					*/
359
-				}
360
-				else
357
+				} else
361 358
 				{
362 359
 					$this->page_title = 'CREATE_ALBUM';
363 360
 
@@ -494,8 +491,7 @@  discard block
 block discarded – undo
494 491
 						'S_HAS_SUBALBUMS'		=> ($album_data['right_id'] - $album_data['left_id'] > 1) ? true : false,
495 492
 						'S_ALBUMS_LIST'			=> $albums_list,
496 493
 					));
497
-				}
498
-				else if ($uploadable_album_exists)
494
+				} else if ($uploadable_album_exists)
499 495
 				{
500 496
 					$template->assign_vars(array(
501 497
 						'S_MOVE_ALBUM_OPTIONS'		=> $phpbb_ext_gallery_core_album->get_albumbox(true, '', $album_data['parent_id'], false, $album_id, 0, \phpbbgallery\core\block::TYPE_UPLOAD),
@@ -635,8 +631,7 @@  discard block
 block discarded – undo
635 631
 		if (!$this->parent_id)
636 632
 		{
637 633
 			$navigation = $user->lang['GALLERY_INDEX'];
638
-		}
639
-		else
634
+		} else
640 635
 		{
641 636
 			$navigation = '<a href="' . $this->u_action . '">' . $user->lang['GALLERY_INDEX'] . '</a>';
642 637
 
@@ -646,8 +641,7 @@  discard block
 block discarded – undo
646 641
 				if ($row['album_id'] == $this->parent_id)
647 642
 				{
648 643
 					$navigation .= ' -&gt; ' . $row['album_name'];
649
-				}
650
-				else
644
+				} else
651 645
 				{
652 646
 					$navigation .= ' -&gt; <a href="' . $this->u_action . '&amp;parent_id=' . $row['album_id'] . '">' . $row['album_name'] . '</a>';
653 647
 				}
@@ -678,8 +672,7 @@  discard block
 block discarded – undo
678 672
 				if ($row['album_status'] == (int) \phpbbgallery\core\block::ALBUM_LOCKED)
679 673
 				{
680 674
 					$folder_image = '<img src="images/icon_folder_lock.gif" alt="' . $user->lang['LOCKED'] . '" />';
681
-				}
682
-				else
675
+				} else
683 676
 				{
684 677
 					$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="' . $user->lang['SUBALBUM'] . '" />' : '<img src="images/icon_folder.gif" alt="' . $user->lang['FOLDER'] . '" />';
685 678
 				}
@@ -705,8 +698,7 @@  discard block
 block discarded – undo
705 698
 				);
706 699
 			}
707 700
 			while ($row = $db->sql_fetchrow($result));
708
-		}
709
-		else if ($this->parent_id)
701
+		} else if ($this->parent_id)
710 702
 		{
711 703
 			$row = $phpbb_ext_gallery_core_album->get_info($this->parent_id);
712 704
 
Please login to merge, or discard this patch.
core/controller/moderate.php 1 patch
Braces   +17 added lines, -34 removed lines patch added patch discarded remove patch
@@ -149,8 +149,7 @@  discard block
 block discarded – undo
149 149
 			{
150 150
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
151 151
 			}
152
-		}
153
-		else
152
+		} else
154 153
 		{
155 154
 			$album = $this->album->get_info($album_id);
156 155
 			if (!$this->gallery_auth->acl_check('m_', $album['album_id'], $album['album_user_id']))
@@ -211,8 +210,7 @@  discard block
 block discarded – undo
211 210
 			{
212 211
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
213 212
 			}
214
-		}
215
-		else
213
+		} else
216 214
 		{
217 215
 			$album = $this->album->get_info($album_id);
218 216
 			if (!$this->gallery_auth->acl_check('m_status', $album['album_id'], $album['album_user_id']))
@@ -257,8 +255,7 @@  discard block
 block discarded – undo
257 255
 					$this->url->meta_refresh(3, $back_link);
258 256
 					trigger_error($message);
259 257
 				}
260
-			}
261
-			else
258
+			} else
262 259
 			{
263 260
 				$s_hidden_fields = '<input type="hidden" name="action['.$action.']" value="' . $action . '" />';
264 261
 				$s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />';
@@ -307,8 +304,7 @@  discard block
 block discarded – undo
307 304
 			{
308 305
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
309 306
 			}
310
-		}
311
-		else
307
+		} else
312 308
 		{
313 309
 			$album = $this->album->get_info($album_id);
314 310
 			if (!$this->gallery_auth->acl_check('m_', $album['album_id'], $album['album_user_id']))
@@ -358,8 +354,7 @@  discard block
 block discarded – undo
358 354
 				$message = $this->language->lang('WAITING_REPORTED_DONE', count($report_ary));
359 355
 				$this->url->meta_refresh(3, $back_link);
360 356
 				trigger_error($message);
361
-			}
362
-			else
357
+			} else
363 358
 			{
364 359
 				$s_hidden_fields = '<input type="hidden" name="action['.$action.']" value="' . $action . '" />';
365 360
 				$s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />';
@@ -379,8 +374,7 @@  discard block
 block discarded – undo
379 374
 			{
380 375
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
381 376
 			}
382
-		}
383
-		else
377
+		} else
384 378
 		{
385 379
 			$album = $this->album->get_info($album_id);
386 380
 			if (!$this->gallery_auth->acl_check('m_report', $album['album_id'], $album['album_user_id']))
@@ -470,8 +464,7 @@  discard block
 block discarded – undo
470 464
 					$this->url->meta_refresh(3, $back_link);
471 465
 					trigger_error($message);
472 466
 				}
473
-			}
474
-			else
467
+			} else
475 468
 			{
476 469
 				$s_hidden_fields = '<input type="hidden" name="select_action" value="' . $action . '" />';
477 470
 				$s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />';
@@ -492,8 +485,7 @@  discard block
 block discarded – undo
492 485
 						'S_HIDDEN_FIELDS'	=> $s_hidden_fields,
493 486
 					));
494 487
 					return $this->helper->render('gallery/mcp_body.html', $this->language->lang('GALLERY'));
495
-				}
496
-				else
488
+				} else
497 489
 				{
498 490
 					confirm_box(false, $this->language->lang('QUEUES_A_' . strtoupper($action) . '2_CONFIRM'), $s_hidden_fields);
499 491
 				}
@@ -508,8 +500,7 @@  discard block
 block discarded – undo
508 500
 			{
509 501
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
510 502
 			}
511
-		}
512
-		else
503
+		} else
513 504
 		{
514 505
 			$album = $this->album->get_info($album_id);
515 506
 			if (!$this->gallery_auth->acl_check('m_', $album['album_id'], $album['album_user_id']))
@@ -583,8 +574,7 @@  discard block
 block discarded – undo
583 574
 					$message = $this->language->lang('WAITING_REPORTED_DONE', 1);
584 575
 					$this->url->meta_refresh(3, $back_link);
585 576
 					trigger_error($message);
586
-				}
587
-				else
577
+				} else
588 578
 				{
589 579
 					$s_hidden_fields = '<input type="hidden" name="action" value="reports_close" />';
590 580
 					confirm_box(false, $this->language->lang('REPORT_A_CLOSE2_CONFIRM'), $s_hidden_fields);
@@ -621,13 +611,11 @@  discard block
 block discarded – undo
621 611
 			{
622 612
 				$select_select .= '<option value="images_approve">' . $this->language->lang('QUEUE_A_APPROVE') . '</option>';
623 613
 				$select_select .= '<option value="images_lock">' . $this->language->lang('QUEUE_A_LOCK') . '</option>';
624
-			}
625
-			else if ($image_data['image_status'] == 1)
614
+			} else if ($image_data['image_status'] == 1)
626 615
 			{
627 616
 				$select_select .= '<option value="images_unapprove">' . $this->language->lang('QUEUE_A_UNAPPROVE') . '</option>';
628 617
 				$select_select .= '<option value="images_lock">' . $this->language->lang('QUEUE_A_LOCK') . '</option>';
629
-			}
630
-			else
618
+			} else
631 619
 			{
632 620
 				$select_select .= '<option value="images_approve">' . $this->language->lang('QUEUE_A_APPROVE') . '</option>';
633 621
 				$select_select .= '<option value="images_unapprove">' . $this->language->lang('QUEUE_A_UNAPPROVE') . '</option>';
@@ -646,8 +634,7 @@  discard block
 block discarded – undo
646 634
 			if ($open_report)
647 635
 			{
648 636
 				$select_select .= '<option value="reports_close">' . $this->language->lang('REPORT_A_CLOSE') . '</option>';
649
-			}
650
-			else
637
+			} else
651 638
 			{
652 639
 				$select_select .= '<option value="reports_open">' . $this->language->lang('REPORT_A_OPEN') . '</option>';
653 640
 			}
@@ -725,8 +712,7 @@  discard block
 block discarded – undo
725 712
 			$message = $this->language->lang('WAITING_APPROVED_IMAGE', 1);
726 713
 			meta_refresh($meta_refresh_time, $image_backlink);
727 714
 			trigger_error($message);
728
-		}
729
-		else
715
+		} else
730 716
 		{
731 717
 			$this->template->assign_vars(array(
732 718
 				'S_NOTIFY_POSTER'			=> $show_notify,
@@ -775,8 +761,7 @@  discard block
 block discarded – undo
775 761
 			$message = sprintf($this->language->lang('WAITING_UNAPPROVED_IMAGE', 1));
776 762
 			meta_refresh($meta_refresh_time, $image_backlink);
777 763
 			trigger_error($message);
778
-		}
779
-		else
764
+		} else
780 765
 		{
781 766
 			$s_hidden_fields = '';
782 767
 			confirm_box(false, 'QUEUE_A_UNAPPROVE2', $s_hidden_fields);
@@ -817,8 +802,7 @@  discard block
 block discarded – undo
817 802
 			$this->album->update_info($moving_target);
818 803
 			meta_refresh($meta_refresh_time, $image_backlink);
819 804
 			trigger_error($message);
820
-		}
821
-		else
805
+		} else
822 806
 		{
823 807
 			$category_select = $this->album->get_albumbox(false, 'moving_target', $album_id, 'm_move', $album_id);
824 808
 			$this->template->assign_vars(array(
@@ -862,8 +846,7 @@  discard block
 block discarded – undo
862 846
 			$message = sprintf($this->language->lang('WAITING_LOCKED_IMAGE',1));
863 847
 			meta_refresh($meta_refresh_time, $image_backlink);
864 848
 			trigger_error($message);
865
-		}
866
-		else
849
+		} else
867 850
 		{
868 851
 			$s_hidden_fields = '';
869 852
 			confirm_box(false, 'QUEUE_A_LOCK2', $s_hidden_fields);
Please login to merge, or discard this patch.
core/controller/album.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -142,8 +142,7 @@  discard block
 block discarded – undo
142 142
 		try
143 143
 		{
144 144
 			$this->loader->load($album_id);
145
-		}
146
-		catch (\Exception $e)
145
+		} catch (\Exception $e)
147 146
 		{
148 147
 			throw new \phpbb\exception\http_exception(404, 'ALBUM_NOT_EXIST');
149 148
 		}
@@ -203,8 +202,7 @@  discard block
 block discarded – undo
203 202
 					'phpbbgallery_core_album_upload',
204 203
 					array('album_id' => (int) $album_id)
205 204
 				));
206
-			}
207
-			else
205
+			} else
208 206
 			{
209 207
 				if ($album_data['contest_start'] + $album_data['contest_rating'] > time())
210 208
 				{
@@ -261,8 +259,7 @@  discard block
 block discarded – undo
261 259
 		{
262 260
 			$image_status_check = '';
263 261
 			$image_counter = $album_data['album_images_real'];
264
-		}
265
-		else
262
+		} else
266 263
 		{
267 264
 			$image_status_check = " AND (image_status <> " . (int) \phpbbgallery\core\block::STATUS_UNAPPROVED . " OR image_user_id = $user_id)";
268 265
 
@@ -279,8 +276,7 @@  discard block
 block discarded – undo
279 276
 		if (in_array($sort_key, array('r', 'ra')))
280 277
 		{
281 278
 			$sql_help_sort = ', image_id ' . (($sort_dir == 'd') ? 'ASC' : 'DESC');
282
-		}
283
-		else
279
+		} else
284 280
 		{
285 281
 			$sql_help_sort = ', image_id ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
286 282
 		}
@@ -471,8 +467,7 @@  discard block
 block discarded – undo
471 467
 				));
472 468
 				$this->url->meta_refresh(3, $back_link);
473 469
 				return $this->helper->render('gallery/message.html', $this->language->lang('GALLERY'));
474
-			}
475
-			else
470
+			} else
476 471
 			{
477 472
 				$this->notifications_helper->add_albums($album_id);
478 473
 				$this->template->assign_vars(array(
@@ -481,14 +476,12 @@  discard block
 block discarded – undo
481 476
 				$this->url->meta_refresh(3, $back_link);
482 477
 				return $this->helper->render('gallery/message.html', $this->language->lang('GALLERY'));
483 478
 			}
484
-		}
485
-		else
479
+		} else
486 480
 		{
487 481
 			if ($this->notifications_helper->get_watched_album($album_id) == 1)
488 482
 			{
489 483
 				$lang = $this->language->lang('UNWATCH_ALBUM');
490
-			}
491
-			else
484
+			} else
492 485
 			{
493 486
 				$lang = $this->language->lang('WATCH_ALBUM');
494 487
 			}
@@ -520,8 +513,7 @@  discard block
 block discarded – undo
520 513
 			if (!$this->user->data['is_registered'])
521 514
 			{
522 515
 				login_box();
523
-			}
524
-			else
516
+			} else
525 517
 			{
526 518
 				//return $this->error('NOT_AUTHORISED', 403);
527 519
 				trigger_error($this->language->lang('NOT_AUTHORISED'));
Please login to merge, or discard this patch.
core/acp/permissions_module.php 1 patch
Braces   +17 added lines, -34 removed lines patch added patch discarded remove patch
@@ -110,8 +110,7 @@  discard block
 block discarded – undo
110 110
 						if (!$submit)
111 111
 						{
112 112
 							$this->permissions_v_mask();
113
-						}
114
-						else
113
+						} else
115 114
 						{
116 115
 							$this->permissions_p_mask();
117 116
 						}
@@ -449,13 +448,11 @@  discard block
 block discarded – undo
449 448
 		if (!sizeof($group_id) && !sizeof($user_id))
450 449
 		{
451 450
 			trigger_error('NO_VICTIM_SELECTED', E_USER_WARNING);
452
-		}
453
-		else if (sizeof($group_id))
451
+		} else if (sizeof($group_id))
454 452
 		{
455 453
 			$victim_mode = 'group';
456 454
 			$victim_id = $group_id;
457
-		}
458
-		else
455
+		} else
459 456
 		{
460 457
 			$victim_mode = 'user';
461 458
 			$victim_id = $user_id;
@@ -487,8 +484,7 @@  discard block
 block discarded – undo
487 484
 				$victim_list[$row['group_id']] = $victim_row;
488 485
 			}
489 486
 			$db->sql_freeresult($result);
490
-		}
491
-		else
487
+		} else
492 488
 		{
493 489
 			// Get the user information
494 490
 			$sql = 'SELECT username, user_id, user_colour
@@ -571,12 +567,10 @@  discard block
 block discarded – undo
571 567
 								if (isset($roles[$role_id][$permission]) && ($roles[$role_id][$permission] == $phpbb_ext_gallery_core_auth::ACL_YES))
572 568
 								{
573 569
 									$acl_s_yes++;
574
-								}
575
-								else if (isset($roles[$role_id][$permission]) && ($roles[$role_id][$permission] == $phpbb_ext_gallery_core_auth::ACL_NEVER))
570
+								} else if (isset($roles[$role_id][$permission]) && ($roles[$role_id][$permission] == $phpbb_ext_gallery_core_auth::ACL_NEVER))
576 571
 								{
577 572
 									$acl_s_never++;
578
-								}
579
-								else if (isset($roles[$role_id][$permission]) && ($roles[$role_id][$permission] == $phpbb_ext_gallery_core_auth::ACL_NO))
573
+								} else if (isset($roles[$role_id][$permission]) && ($roles[$role_id][$permission] == $phpbb_ext_gallery_core_auth::ACL_NO))
580 574
 								{
581 575
 									$acl_s_no++;
582 576
 								}
@@ -607,8 +601,7 @@  discard block
 block discarded – undo
607 601
 					}
608 602
 				}
609 603
 			}
610
-		}
611
-		else
604
+		} else
612 605
 		{
613 606
 			$template->assign_block_vars('c_mask', array(
614 607
 				'C_MASK_ID'				=> $p_system,
@@ -686,13 +679,11 @@  discard block
 block discarded – undo
686 679
 		if (!sizeof($group_id) && !sizeof($user_id))
687 680
 		{
688 681
 			trigger_error('NO_VICTIM_SELECTED', E_USER_WARNING);
689
-		}
690
-		else if (sizeof($group_id))
682
+		} else if (sizeof($group_id))
691 683
 		{
692 684
 			$victim_mode = 'group';
693 685
 			$victim_id = $group_id;
694
-		}
695
-		else
686
+		} else
696 687
 		{
697 688
 			$victim_mode = 'user';
698 689
 			$victim_id = $user_id;
@@ -741,8 +732,7 @@  discard block
 block discarded – undo
741 732
 						if (substr($p_mask, -6, 6) == '_count')
742 733
 						{
743 734
 							$auth_settings[$c_mask][$v_mask][$p_mask] = $value;
744
-						}
745
-						else
735
+						} else
746 736
 						{
747 737
 							$auth_settings[$c_mask][$v_mask][$p_mask] = ($value == ACL_YES) ? $phpbb_ext_gallery_core_auth::ACL_YES : (($value == ACL_NEVER) ? $phpbb_ext_gallery_core_auth::ACL_NEVER : $phpbb_ext_gallery_core_auth::ACL_NO);
748 738
 							// Do we have moderators?
@@ -792,15 +782,13 @@  discard block
 block discarded – undo
792 782
 								}
793 783
 								// We take all permissions of another c_mask, so:
794 784
 								break;
795
-							}
796
-							else
785
+							} else
797 786
 							{
798 787
 								// The chosen option was disabled: Hacking attempt?!
799 788
 								trigger_error('HACKING_ATTEMPT', E_USER_WARNING);
800 789
 							}
801 790
 						}
802
-					}
803
-					else if ($i_mask)
791
+					} else if ($i_mask)
804 792
 					{
805 793
 						// Inherit permissions of one [c_mask][v_mask]
806 794
 						$v_mask = (int) $v_mask;
@@ -821,8 +809,7 @@  discard block
 block discarded – undo
821 809
 								}
822 810
 								$auth_settings[$c_mask][$v_mask] = $auth_settings[$ci_mask][$vi_mask];
823 811
 								$p_mask_storage[$auth_settings[$c_mask][$v_mask]]['usage'][] = array('c_mask' => $c_mask, 'v_mask' => $v_mask);
824
-							}
825
-							else
812
+							} else
826 813
 							{
827 814
 								// The chosen option was disabled: Hacking attempt?!
828 815
 								trigger_error('HACKING_ATTEMPT', E_USER_WARNING);
@@ -895,8 +882,7 @@  discard block
 block discarded – undo
895 882
 						$victim_names[$row['group_id']] = $row['group_name'];
896 883
 					}
897 884
 					$db->sql_freeresult($result);
898
-				}
899
-				else
885
+				} else
900 886
 				{
901 887
 					// Get username's for the GALLERY_MODSCACHE_TABLE
902 888
 					$sql = 'SELECT user_id, username
@@ -962,8 +948,7 @@  discard block
 block discarded – undo
962 948
 									'group_id'		=> $usage['v_mask'],
963 949
 									'group_name'	=> $victim_names[$usage['v_mask']],
964 950
 								);
965
-							}
966
-							else
951
+							} else
967 952
 							{
968 953
 								$sql_moderators[] = array(
969 954
 									'album_id'		=> $usage['c_mask'],
@@ -972,8 +957,7 @@  discard block
 block discarded – undo
972 957
 								);
973 958
 							}
974 959
 						}
975
-					}
976
-					else
960
+					} else
977 961
 					{
978 962
 						$sql_permissions[] = array(
979 963
 							'perm_role_id'					=> $role_id,
@@ -1097,8 +1081,7 @@  discard block
 block discarded – undo
1097 1081
 				$phpbb_ext_gallery_core_auth->set_user_permissions('all', '');
1098 1082
 
1099 1083
 				trigger_error($this->language->lang('COPY_PERMISSIONS_SUCCESSFUL') . adm_back_link($this->u_action));
1100
-			}
1101
-			else
1084
+			} else
1102 1085
 			{
1103 1086
 				$s_hidden_fields = array(
1104 1087
 					'submit'			=> $submit,
Please login to merge, or discard this patch.
core/user.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -202,8 +202,7 @@  discard block
 block discarded – undo
202 202
 		if (isset($this->data[$key]))
203 203
 		{
204 204
 			return $this->data[$key];
205
-		}
206
-		else if ($default && $this->get_default_value($key) !== null)
205
+		} else if ($default && $this->get_default_value($key) !== null)
207 206
 		{
208 207
 			return $this->get_default_value($key);
209 208
 		}
@@ -401,12 +400,10 @@  discard block
 block discarded – undo
401 400
 		if (is_array($user_ids) && !empty($user_ids))
402 401
 		{
403 402
 			$sql_where = 'WHERE ' . $this->db->sql_in_set('user_id', array_map('intval', $user_ids));
404
-		}
405
-		else if ($user_ids == 'all')
403
+		} else if ($user_ids == 'all')
406 404
 		{
407 405
 			$sql_where = '';
408
-		}
409
-		else
406
+		} else
410 407
 		{
411 408
 			$sql_where = 'WHERE user_id = ' . (int) $user_ids;
412 409
 		}
@@ -437,8 +434,7 @@  discard block
 block discarded – undo
437 434
 					{
438 435
 						// While incrementing, the images might be lower than 0.
439 436
 						$validated_data[$name] = (int) $value;
440
-					}
441
-					else
437
+					} else
442 438
 					{
443 439
 						$validated_data[$name] = max(0, (int) $value);
444 440
 					}
@@ -584,8 +580,7 @@  discard block
 block discarded – undo
584 580
 					'warnings'            => 0,
585 581
 					'allow_pm'            => 0,
586 582
 				);
587
-			}
588
-			else
583
+			} else
589 584
 			{
590 585
 				$user_sig = '';
591 586
 				// We add the signature to every posters entry because enable_sig is post dependent
@@ -631,8 +626,7 @@  discard block
 block discarded – undo
631 626
 				if ((!empty($row['user_allow_viewemail']) && $this->auth->acl_get('u_sendemail')) || $this->auth->acl_get('a_email'))
632 627
 				{
633 628
 					$user_cache[$user_id]['email'] = ($this->config['board_email_form'] && $this->config['email_enable']) ? append_sid("{$this->root_path}memberlist.$this->php_ext", "mode=email&amp;u=$user_id") : (($this->config['board_hide_emails'] && !$this->auth->acl_get('a_email')) ? '' : 'mailto:' . $row['user_email']);
634
-				}
635
-				else
629
+				} else
636 630
 				{
637 631
 					$user_cache[$user_id]['email'] = '';
638 632
 				}
@@ -645,8 +639,7 @@  discard block
 block discarded – undo
645 639
 						if ($diff == 0)
646 640
 						{
647 641
 							$diff = ($now['mday'] - $bday_day < 0) ? 1 : 0;
648
-						}
649
-						else
642
+						} else
650 643
 						{
651 644
 							$diff = ($diff < 0) ? 1 : 0;
652 645
 						}
Please login to merge, or discard this patch.