Passed
Push — master ( d062e1...de1c6e )
by Stanislav
13:42 queued 10:45
created
core/album/display.php 1 patch
Braces   +15 added lines, -25 removed lines patch added patch discarded remove patch
@@ -226,8 +226,7 @@  discard block
 block discarded – undo
226 226
 					SET album_parents = '" . $this->db->sql_escape($album_data['album_parents']) . "'
227 227
 					WHERE parent_id = " . (int) $album_data['parent_id'];
228 228
 				$this->db->sql_query($sql);
229
-			}
230
-			else
229
+			} else
231 230
 			{
232 231
 				$album_parents = unserialize($album_data['album_parents']);
233 232
 			}
@@ -295,16 +294,14 @@  discard block
 block discarded – undo
295 294
 			if (!empty($row['user_id']))
296 295
 			{
297 296
 				$album_moderators[$a_id][] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
298
-			}
299
-			else
297
+			} else
300 298
 			{
301 299
 				$group_name = (($row['group_type'] == GROUP_SPECIAL) ? $this->language->lang('G_' . $row['group_name']) : $row['group_name']);
302 300
 
303 301
 				if ($this->user->data['user_id'] != ANONYMOUS && !$this->auth->acl_get('u_viewprofile'))
304 302
 				{
305 303
 					$album_moderators[$a_id][] = '<span' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . '>' . $group_name . '</span>';
306
-				}
307
-				else
304
+				} else
308 305
 				{
309 306
 					$album_moderators[$a_id][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid($this->root_path . 'memberlist.' . $this->php_ext, 'mode=group&amp;g=' . $row['group_id']) . '">' . $group_name . '</a>';
310 307
 				}
@@ -348,8 +345,7 @@  discard block
 block discarded – undo
348 345
 			}
349 346
 			$root_data = array('album_id' => (int) \phpbbgallery\core\block::PUBLIC_ALBUM);
350 347
 			$sql_where = 'a.album_user_id = ' . (int) \phpbbgallery\core\block::PUBLIC_ALBUM;
351
-		}
352
-		else if ($root_data == 'personal')
348
+		} else if ($root_data == 'personal')
353 349
 		{
354 350
 			if ($mark_read == 'albums')
355 351
 			{
@@ -366,8 +362,7 @@  discard block
 block discarded – undo
366 362
 				{
367 363
 					$sql_where .= ' AND u.username_clean NOT ' . $this->db->sql_like_expression(chr($i) . $this->db->any_char);
368 364
 				}
369
-			}
370
-			else if ($first_char)
365
+			} else if ($first_char)
371 366
 			{
372 367
 				$sql_where .= ' AND u.username_clean ' . $this->db->sql_like_expression(substr($first_char, 0, 1) . $this->db->any_char);
373 368
 			}
@@ -411,8 +406,7 @@  discard block
 block discarded – undo
411 406
 					'phpbbgallery_core_search_recent_page',),
412 407
 					'params' => array()), 'pagination', 'page', $num_pegas, $limit, $start
413 408
 			);*/
414
-		}
415
-		else
409
+		} else
416 410
 		{
417 411
 			$sql_where = 'a.left_id > ' . $root_data['left_id'] . ' AND a.left_id < ' . $root_data['right_id'] . ' AND a.album_user_id = ' . $root_data['album_user_id'];
418 412
 		}
@@ -500,10 +494,12 @@  discard block
 block discarded – undo
500 494
 				continue;
501 495
 			}
502 496
 
503
-			if (false)//@todo !$this->gallery_auth->acl_check('a_list', $album_id, $row['album_user_id']))
497
+			if (false) {
498
+				//@todo !$this->gallery_auth->acl_check('a_list', $album_id, $row['album_user_id']))
504 499
 			{
505 500
 				// if the user does not have permissions to list this album, skip everything until next branch
506 501
 				$right_id = $row['right_id'];
502
+			}
507 503
 				continue;
508 504
 			}
509 505
 
@@ -528,8 +524,7 @@  discard block
 block discarded – undo
528 524
 				$album_rows[$parent_id]['album_type_last_image'] = $row['album_type'];
529 525
 				$album_rows[$parent_id]['album_contest_marked'] = $row['contest_marked'];
530 526
 				$album_rows[$parent_id]['orig_album_last_image_time'] = $row['album_last_image_time'];
531
-			}
532
-			else if ($row['album_type'])
527
+			} else if ($row['album_type'])
533 528
 			{
534 529
 				$subalbums[$parent_id][$album_id]['display'] = ($row['display_on_index']) ? true : false;
535 530
 				$subalbums[$parent_id][$album_id]['name'] = $row['album_name'];
@@ -571,16 +566,14 @@  discard block
 block discarded – undo
571 566
 				{
572 567
 					$this->misc->markread('all');
573 568
 					$message = $this->language->lang('RETURN_INDEX', '<a href="' . $redirect . '">', '</a>');
574
-				}
575
-				else
569
+				} else
576 570
 				{
577 571
 					$this->misc->markread('albums', $album_ids);
578 572
 					$message = $this->language->lang('RETURN_ALBUM', '<a href="' . $redirect . '">', '</a>');
579 573
 				}
580 574
 				meta_refresh(3, $redirect);
581 575
 				trigger_error($this->language->lang('ALBUMS_MARKED') . '<br /><br />' . $message);
582
-			}
583
-			else
576
+			} else
584 577
 			{
585 578
 				$message = $this->language->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');
586 579
 				meta_refresh(3, $redirect);
@@ -658,8 +651,7 @@  discard block
 block discarded – undo
658 651
 							'name'		=> $subalbum_row['name'],
659 652
 							'unread'	=> $subalbum_unread,
660 653
 						);
661
-					}
662
-					else
654
+					} else
663 655
 					{
664 656
 						unset($subalbums[$album_id][$subalbum_id]);
665 657
 					}
@@ -672,8 +664,7 @@  discard block
 block discarded – undo
672 664
 
673 665
 				$l_subalbums = (sizeof($subalbums[$album_id]) == 1) ? $this->language->lang('SUBALBUM') : $this->language->lang('SUBALBUMS');
674 666
 				$folder_image = ($album_unread) ? 'forum_unread_subforum' : 'forum_read_subforum';
675
-			}
676
-			else
667
+			} else
677 668
 			{
678 669
 				$folder_alt = ($album_unread) ? 'NEW_IMAGES' : 'NO_NEW_IMAGES';
679 670
 				$folder_image = ($album_unread) ? 'forum_unread' : 'forum_read';
@@ -699,8 +690,7 @@  discard block
 block discarded – undo
699 690
 				$lastimage_uc_name = '';//@todo phpbb_ext_gallery_core_image::generate_link('image_name', $phpbb_ext_gallery->config->get('link_image_name'), $lastimage_image_id, $lastimage_name, $lastimage_album_id);
700 691
 				// phpbb_ext_gallery_core_image::generate_link('lastimage_icon', $phpbb_ext_gallery->config->get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id);
701 692
 				$lastimage_uc_icon = '';//@todo phpbb_ext_gallery_core_image::generate_link('lastimage_icon', $phpbb_ext_gallery->config->get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id);
702
-			}
703
-			else
693
+			} else
704 694
 			{
705 695
 				$lastimage_time = $lastimage_album_type = $lastimage_contest_marked = 0;
706 696
 				$lastimage_uc_fake_thumbnail = $lastimage_uc_fake_thumbnail_url = $lastimage_uc_thumbnail = $lastimage_uc_name = $lastimage_uc_icon = '';
Please login to merge, or discard this patch.
core/controller/moderate.php 1 patch
Braces   +16 added lines, -32 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);
@@ -626,8 +616,7 @@  discard block
 block discarded – undo
626 616
 			{
627 617
 				$select_select .= '<option value="images_unapprove">' . $this->language->lang('QUEUE_A_UNAPPROVE') . '</option>';
628 618
 				$select_select .= '<option value="images_lock">' . $this->language->lang('QUEUE_A_LOCK') . '</option>';
629
-			}
630
-			else
619
+			} else
631 620
 			{
632 621
 				$select_select .= '<option value="images_approve">' . $this->language->lang('QUEUE_A_APPROVE') . '</option>';
633 622
 				$select_select .= '<option value="images_unapprove">' . $this->language->lang('QUEUE_A_UNAPPROVE') . '</option>';
@@ -646,8 +635,7 @@  discard block
 block discarded – undo
646 635
 			if ($open_report)
647 636
 			{
648 637
 				$select_select .= '<option value="reports_close">' . $this->language->lang('REPORT_A_CLOSE') . '</option>';
649
-			}
650
-			else
638
+			} else
651 639
 			{
652 640
 				$select_select .= '<option value="reports_open">' . $this->language->lang('REPORT_A_OPEN') . '</option>';
653 641
 			}
@@ -725,8 +713,7 @@  discard block
 block discarded – undo
725 713
 			$message = $this->language->lang('WAITING_APPROVED_IMAGE', 1);
726 714
 			meta_refresh($meta_refresh_time, $image_backlink);
727 715
 			trigger_error($message);
728
-		}
729
-		else
716
+		} else
730 717
 		{
731 718
 			$this->template->assign_vars(array(
732 719
 				'S_NOTIFY_POSTER'			=> $show_notify,
@@ -775,8 +762,7 @@  discard block
 block discarded – undo
775 762
 			$message = sprintf($this->language->lang('WAITING_UNAPPROVED_IMAGE', 1));
776 763
 			meta_refresh($meta_refresh_time, $image_backlink);
777 764
 			trigger_error($message);
778
-		}
779
-		else
765
+		} else
780 766
 		{
781 767
 			$s_hidden_fields = '';
782 768
 			confirm_box(false, 'QUEUE_A_UNAPPROVE2', $s_hidden_fields);
@@ -817,8 +803,7 @@  discard block
 block discarded – undo
817 803
 			$this->album->update_info($moving_target);
818 804
 			meta_refresh($meta_refresh_time, $image_backlink);
819 805
 			trigger_error($message);
820
-		}
821
-		else
806
+		} else
822 807
 		{
823 808
 			$category_select = $this->album->get_albumbox(false, 'moving_target', $album_id, 'm_move', $album_id);
824 809
 			$this->template->assign_vars(array(
@@ -862,8 +847,7 @@  discard block
 block discarded – undo
862 847
 			$message = sprintf($this->language->lang('WAITING_LOCKED_IMAGE',1));
863 848
 			meta_refresh($meta_refresh_time, $image_backlink);
864 849
 			trigger_error($message);
865
-		}
866
-		else
850
+		} else
867 851
 		{
868 852
 			$s_hidden_fields = '';
869 853
 			confirm_box(false, 'QUEUE_A_LOCK2', $s_hidden_fields);
Please login to merge, or discard this patch.
core/controller/image.php 1 patch
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -250,8 +250,7 @@  discard block
 block discarded – undo
250 250
 			}
251 251
 
252 252
 			$this->loader->load($this->data['image_album_id']);
253
-		}
254
-		catch (\Exception $e)
253
+		} catch (\Exception $e)
255 254
 		{
256 255
 			throw new \phpbb\exception\http_exception(404, 'INVALID_IMAGE');
257 256
 		}
@@ -264,8 +263,7 @@  discard block
 block discarded – undo
264 263
 		if ($this->gallery_auth->acl_check('m_status', $album_id, $album_data['album_user_id']))
265 264
 		{
266 265
 			$image_status_check = '';
267
-		}
268
-		else
266
+		} else
269 267
 		{
270 268
 			$user_id = (int) $this->user->data['user_id'];
271 269
 			$image_status_check = ' AND (image_status = ' . \phpbbgallery\core\block::STATUS_APPROVED . ' OR image_user_id = ' . $user_id . ')';
@@ -322,8 +320,7 @@  discard block
 block discarded – undo
322 320
 		if (in_array($sort_key, array('r', 'ra')))
323 321
 		{
324 322
 			$sql_help_sort = ', image_id ' . (($sort_dir == 'd') ? 'ASC' : 'DESC');
325
-		}
326
-		else
323
+		} else
327 324
 		{
328 325
 			$sql_help_sort = ', image_id ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
329 326
 		}
@@ -551,8 +548,7 @@  discard block
 block discarded – undo
551 548
 			if (isset($album_data['contest_start']))
552 549
 			{
553 550
 				$s_hide_comment_input = (time() < ($album_data['contest_start'] + $album_data['contest_end'])) ? true : false;
554
-			}
555
-			else
551
+			} else
556 552
 			{
557 553
 				$s_hide_comment_input = false;
558 554
 			}
@@ -598,8 +594,7 @@  discard block
 block discarded – undo
598 594
 				//$this->template->assign_var('S_COMMENT_ACTION', append_sid($this->url->path('full') . 'comment/' . $image_id . '/add/0'));
599 595
 				$this->template->assign_var('S_COMMENT_ACTION', $this->helper->route('phpbbgallery_core_comment_add', array('image_id' => $image_id, 'comment_id' => 0)));
600 596
 			}
601
-		}
602
-		else if ($this->gallery_config->get('comment_user_control') && !$image_data['image_allow_comments'])
597
+		} else if ($this->gallery_config->get('comment_user_control') && !$image_data['image_allow_comments'])
603 598
 		{
604 599
 			$this->template->assign_var('S_COMMENTS_DISABLED', true);
605 600
 		}
@@ -790,8 +785,7 @@  discard block
 block discarded – undo
790 785
 								'NAME'      => $field_data['PROFILE_FIELD_NAME'],
791 786
 								'U_CONTACT' => $field_data['PROFILE_FIELD_CONTACT'],
792 787
 							));
793
-						}
794
-						else
788
+						} else
795 789
 						{
796 790
 							$this->template->assign_block_vars('commentrow.custom_fields', $field_data);
797 791
 						}
@@ -917,8 +911,7 @@  discard block
 block discarded – undo
917 911
 					{
918 912
 						$change_image_count = true;
919 913
 					}
920
-				}
921
-				else if ($this->request->variable('change_author', '', true))
914
+				} else if ($this->request->variable('change_author', '', true))
922 915
 				{
923 916
 					$errors[] = $this->language->lang('INVALID_USERNAME');
924 917
 				}
@@ -939,8 +932,7 @@  discard block
 block discarded – undo
939 932
 					{
940 933
 						$personal_album_id = $this->album->generate_personal_album($image_data['image_username'], $image_data['image_user_id'], $image_data['image_user_colour'], $image_user);
941 934
 					}
942
-				}
943
-				else
935
+				} else
944 936
 				{
945 937
 					$personal_album_id = $this->gallery_user->get_data('personal_album_id');
946 938
 					if (!$personal_album_id && $this->gallery_auth->acl_check('i_upload', $this->gallery_auth->get_own_album()))
@@ -1108,8 +1100,7 @@  discard block
 block discarded – undo
1108 1100
 			$this->notification_helper->read('approval', $album_id);
1109 1101
 			$this->url->meta_refresh(3, $album_backlink);
1110 1102
 			trigger_error($message);
1111
-		}
1112
-		else
1103
+		} else
1113 1104
 		{
1114 1105
 			if (isset($_POST['cancel']))
1115 1106
 			{
@@ -1117,8 +1108,7 @@  discard block
 block discarded – undo
1117 1108
 				$message .= '<br />' . sprintf($this->language->lang('CLICK_RETURN_IMAGE'), '<a href="' . $image_backlink . '">', '</a>');
1118 1109
 				$this->url->meta_refresh(3, $image_backlink);
1119 1110
 				trigger_error($message);
1120
-			}
1121
-			else
1111
+			} else
1122 1112
 			{
1123 1113
 				confirm_box(false, 'DELETE_IMAGE2', $s_hidden_fields);
1124 1114
 			}
@@ -1223,8 +1213,7 @@  discard block
 block discarded – undo
1223 1213
 			{
1224 1214
 				// @todo Add "redirect after login" url
1225 1215
 				login_box();
1226
-			}
1227
-			else
1216
+			} else
1228 1217
 			{
1229 1218
 				//return $this->error('NOT_AUTHORISED', 403);
1230 1219
 				redirect('gallery/album/' . $album_id);
Please login to merge, or discard this patch.
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/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.