@@ -85,8 +85,7 @@ discard block |
||
85 | 85 | { |
86 | 86 | $mod_array[] = 0; |
87 | 87 | } |
88 | - } |
|
89 | - else |
|
88 | + } else |
|
90 | 89 | { |
91 | 90 | $mod_array = array($album); |
92 | 91 | } |
@@ -162,8 +161,7 @@ discard block |
||
162 | 161 | $this->template->assign_vars(array( |
163 | 162 | 'TOTAL_PAGES' => $this->lang->lang('PAGE_TITLE_NUMBER', $page + 1), |
164 | 163 | )); |
165 | - } |
|
166 | - else |
|
164 | + } else |
|
167 | 165 | { |
168 | 166 | $this->pagination->generate_template_pagination(array( |
169 | 167 | 'routes' => array( |
@@ -363,8 +363,7 @@ discard block |
||
363 | 363 | { |
364 | 364 | $url = $this->url->append_sid('image_page', "album_id=$album_id&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 |
||
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); |
@@ -223,14 +223,12 @@ discard block |
||
223 | 223 | } |
224 | 224 | |
225 | 225 | trigger_error($message_string . adm_back_link($this->u_action)); |
226 | - } |
|
227 | - else if ($delete || $prune || (isset($_POST['cancel']))) |
|
226 | + } else if ($delete || $prune || (isset($_POST['cancel']))) |
|
228 | 227 | { |
229 | 228 | if (isset($_POST['cancel'])) |
230 | 229 | { |
231 | 230 | trigger_error($user->lang['CLEAN_GALLERY_ABORT'] . adm_back_link($this->u_action), E_USER_WARNING); |
232 | - } |
|
233 | - else |
|
231 | + } else |
|
234 | 232 | { |
235 | 233 | $clean_gallery_confirm = $user->lang['CONFIRM_CLEAN']; |
236 | 234 | if ($missing_sources) |
@@ -261,8 +259,7 @@ discard block |
||
261 | 259 | if (in_array($row['album_user_id'], $personals_bad)) |
262 | 260 | { |
263 | 261 | $personals_bad_names[] = $row['album_name']; |
264 | - } |
|
265 | - else |
|
262 | + } else |
|
266 | 263 | { |
267 | 264 | $missing_personals_names[] = $row['album_name']; |
268 | 265 | } |
@@ -280,8 +277,7 @@ discard block |
||
280 | 277 | if ($prune && empty($prune_pattern)) |
281 | 278 | { |
282 | 279 | trigger_error($user->lang['CLEAN_PRUNE_NO_PATTERN'] . adm_back_link($this->u_action), E_USER_WARNING); |
283 | - } |
|
284 | - else if ($prune && $prune_pattern) |
|
280 | + } else if ($prune && $prune_pattern) |
|
285 | 281 | { |
286 | 282 | $clean_gallery_confirm = $user->lang('CONFIRM_PRUNE', $core_cleanup->lang_prune_pattern($prune_pattern)) . '<br />' . $clean_gallery_confirm; |
287 | 283 | } |
@@ -238,8 +238,7 @@ discard block |
||
238 | 238 | $this->data['album_user_id'] = 1; |
239 | 239 | $this->data['image_filemissing'] = 0; |
240 | 240 | $this->data['album_watermark'] = 0; |
241 | - } |
|
242 | - else |
|
241 | + } else |
|
243 | 242 | { |
244 | 243 | $sql = 'SELECT * |
245 | 244 | FROM ' . $this->table_images . ' i |
@@ -409,8 +408,7 @@ discard block |
||
409 | 408 | { |
410 | 409 | $response->headers->set('expires', '-1'); |
411 | 410 | } |
412 | - } |
|
413 | - else |
|
411 | + } else |
|
414 | 412 | { |
415 | 413 | $response->headers->set('Content-Disposition', 'inline; ' . $this->tool->header_filename(htmlspecialchars_decode($this->tool->image_name) . '.' . $this->tool->image_type)); |
416 | 414 | if ($this->tool->is_ie_greater7($this->user->browser)) |
@@ -226,8 +226,7 @@ discard block |
||
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 | } |
@@ -296,16 +295,14 @@ discard block |
||
296 | 295 | if (!empty($row['user_id'])) |
297 | 296 | { |
298 | 297 | $album_moderators[$a_id][] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']); |
299 | - } |
|
300 | - else |
|
298 | + } else |
|
301 | 299 | { |
302 | 300 | $group_name = (($row['group_type'] == GROUP_SPECIAL) ? $this->language->lang('G_' . $row['group_name']) : $row['group_name']); |
303 | 301 | |
304 | 302 | if ($this->user->data['user_id'] != ANONYMOUS && !$this->auth->acl_get('u_viewprofile')) |
305 | 303 | { |
306 | 304 | $album_moderators[$a_id][] = '<span' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . '>' . $group_name . '</span>'; |
307 | - } |
|
308 | - else |
|
305 | + } else |
|
309 | 306 | { |
310 | 307 | $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&g=' . $row['group_id']) . '">' . $group_name . '</a>'; |
311 | 308 | } |
@@ -349,8 +346,7 @@ discard block |
||
349 | 346 | } |
350 | 347 | $root_data = array('album_id' => (int) \phpbbgallery\core\block::PUBLIC_ALBUM); |
351 | 348 | $sql_where = 'a.album_user_id = ' . (int) \phpbbgallery\core\block::PUBLIC_ALBUM; |
352 | - } |
|
353 | - else if ($root_data == 'personal') |
|
349 | + } else if ($root_data == 'personal') |
|
354 | 350 | { |
355 | 351 | if ($mark_read == 'albums') |
356 | 352 | { |
@@ -368,8 +364,7 @@ discard block |
||
368 | 364 | { |
369 | 365 | $sql_where .= ' AND u.username_clean NOT ' . $this->db->sql_like_expression(chr($i) . $this->db->any_char); |
370 | 366 | } |
371 | - } |
|
372 | - else if ($first_char) |
|
367 | + } else if ($first_char) |
|
373 | 368 | { |
374 | 369 | $sql_where .= ' AND u.username_clean ' . $this->db->sql_like_expression(substr($first_char, 0, 1) . $this->db->any_char); |
375 | 370 | } |
@@ -413,8 +408,7 @@ discard block |
||
413 | 408 | 'phpbbgallery_core_search_recent_page',), |
414 | 409 | 'params' => array()), 'pagination', 'page', $num_pegas, $limit, $start |
415 | 410 | );*/ |
416 | - } |
|
417 | - else |
|
411 | + } else |
|
418 | 412 | { |
419 | 413 | $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']; |
420 | 414 | } |
@@ -502,10 +496,12 @@ discard block |
||
502 | 496 | continue; |
503 | 497 | } |
504 | 498 | |
505 | - if (false)//@todo !$this->gallery_auth->acl_check('a_list', $album_id, $row['album_user_id'])) |
|
499 | + if (false) { |
|
500 | + //@todo !$this->gallery_auth->acl_check('a_list', $album_id, $row['album_user_id'])) |
|
506 | 501 | { |
507 | 502 | // if the user does not have permissions to list this album, skip everything until next branch |
508 | 503 | $right_id = $row['right_id']; |
504 | + } |
|
509 | 505 | continue; |
510 | 506 | } |
511 | 507 | |
@@ -530,8 +526,7 @@ discard block |
||
530 | 526 | $album_rows[$parent_id]['album_type_last_image'] = $row['album_type']; |
531 | 527 | $album_rows[$parent_id]['album_contest_marked'] = $row['contest_marked']; |
532 | 528 | $album_rows[$parent_id]['orig_album_last_image_time'] = $row['album_last_image_time']; |
533 | - } |
|
534 | - else if ($row['album_type']) |
|
529 | + } else if ($row['album_type']) |
|
535 | 530 | { |
536 | 531 | $subalbums[$parent_id][$album_id]['display'] = ($row['display_on_index']) ? true : false; |
537 | 532 | $subalbums[$parent_id][$album_id]['name'] = $row['album_name']; |
@@ -573,16 +568,14 @@ discard block |
||
573 | 568 | { |
574 | 569 | $this->misc->markread('all'); |
575 | 570 | $message = $this->language->lang('RETURN_INDEX', '<a href="' . $redirect . '">', '</a>'); |
576 | - } |
|
577 | - else |
|
571 | + } else |
|
578 | 572 | { |
579 | 573 | $this->misc->markread('albums', $album_ids); |
580 | 574 | $message = $this->language->lang('RETURN_ALBUM', '<a href="' . $redirect . '">', '</a>'); |
581 | 575 | } |
582 | 576 | meta_refresh(3, $redirect); |
583 | 577 | trigger_error($this->language->lang('ALBUMS_MARKED') . '<br /><br />' . $message); |
584 | - } |
|
585 | - else |
|
578 | + } else |
|
586 | 579 | { |
587 | 580 | $message = $this->language->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>'); |
588 | 581 | meta_refresh(3, $redirect); |
@@ -660,8 +653,7 @@ discard block |
||
660 | 653 | 'name' => $subalbum_row['name'], |
661 | 654 | 'unread' => $subalbum_unread, |
662 | 655 | ); |
663 | - } |
|
664 | - else |
|
656 | + } else |
|
665 | 657 | { |
666 | 658 | unset($subalbums[$album_id][$subalbum_id]); |
667 | 659 | } |
@@ -674,8 +666,7 @@ discard block |
||
674 | 666 | |
675 | 667 | $l_subalbums = (sizeof($subalbums[$album_id]) == 1) ? $this->language->lang('SUBALBUM') : $this->language->lang('SUBALBUMS'); |
676 | 668 | $folder_image = ($album_unread) ? 'forum_unread_subforum' : 'forum_read_subforum'; |
677 | - } |
|
678 | - else |
|
669 | + } else |
|
679 | 670 | { |
680 | 671 | $folder_alt = ($album_unread) ? 'NEW_IMAGES' : 'NO_NEW_IMAGES'; |
681 | 672 | $folder_image = ($album_unread) ? 'forum_unread' : 'forum_read'; |
@@ -701,8 +692,7 @@ discard block |
||
701 | 692 | $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); |
702 | 693 | // 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); |
703 | 694 | $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); |
704 | - } |
|
705 | - else |
|
695 | + } else |
|
706 | 696 | { |
707 | 697 | $lastimage_time = $lastimage_album_type = $lastimage_contest_marked = 0; |
708 | 698 | $lastimage_uc_fake_thumbnail = $lastimage_uc_fake_thumbnail_url = $lastimage_uc_thumbnail = $lastimage_uc_name = $lastimage_uc_icon = ''; |
@@ -110,8 +110,7 @@ discard block |
||
110 | 110 | if ($this->status == self::DBSAVED) |
111 | 111 | { |
112 | 112 | $this->data = @unserialize($data); |
113 | - } |
|
114 | - else if (($this->status == self::AVAILABLE) || ($this->status == self::UNKNOWN)) |
|
113 | + } else if (($this->status == self::AVAILABLE) || ($this->status == self::UNKNOWN)) |
|
115 | 114 | { |
116 | 115 | $this->read(); |
117 | 116 | } |
@@ -137,8 +136,7 @@ discard block |
||
137 | 136 | if (!in_array($key, self::$allowed_groups)) |
138 | 137 | { |
139 | 138 | unset($this->data[$key]); |
140 | - } |
|
141 | - else |
|
139 | + } else |
|
142 | 140 | { |
143 | 141 | foreach ($this->data[$key] as $subkey => $array) |
144 | 142 | { |
@@ -152,8 +150,7 @@ discard block |
||
152 | 150 | |
153 | 151 | $this->serialized = serialize($this->data); |
154 | 152 | $this->status = self::DBSAVED; |
155 | - } |
|
156 | - else |
|
153 | + } else |
|
157 | 154 | { |
158 | 155 | $this->status = self::UNAVAILABLE; |
159 | 156 | } |
@@ -203,8 +200,7 @@ discard block |
||
203 | 200 | if (($num > $den) && $den) |
204 | 201 | { |
205 | 202 | $exif_exposure = $num / $den; |
206 | - } |
|
207 | - else if ($num) |
|
203 | + } else if ($num) |
|
208 | 204 | { |
209 | 205 | $exif_exposure = ' 1/' . $den / $num ; |
210 | 206 | } |
@@ -255,8 +251,7 @@ discard block |
||
255 | 251 | if (($num / $den) == 0) |
256 | 252 | { |
257 | 253 | $exif_exposure_bias = 0; |
258 | - } |
|
259 | - else |
|
254 | + } else |
|
260 | 255 | { |
261 | 256 | $exif_exposure_bias = $this->data["EXIF"]["ExposureBiasValue"]; |
262 | 257 | } |
@@ -149,8 +149,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -142,8 +142,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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')); |
@@ -216,8 +216,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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'] != (int) \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST) |
|
409 | + } else if ($row['album_type'] != (int) \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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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']; |