@@ -89,8 +89,7 @@ |
||
| 89 | 89 | if (is_dir($file)) |
| 90 | 90 | { |
| 91 | 91 | $this->recursiveRemoveDirectory($file); |
| 92 | - } |
|
| 93 | - else |
|
| 92 | + } else |
|
| 94 | 93 | { |
| 95 | 94 | unlink($file); |
| 96 | 95 | } |
@@ -14,11 +14,11 @@ discard block |
||
| 14 | 14 | 'phpbbgallery/acpcleanup', |
| 15 | 15 | ); |
| 16 | 16 | /** |
| 17 | - * Single enable step that installs any included migrations |
|
| 18 | - * |
|
| 19 | - * @param mixed $old_state State returned by previous call of this method |
|
| 20 | - * @return mixed Returns false after last step, otherwise temporary state |
|
| 21 | - */ |
|
| 17 | + * Single enable step that installs any included migrations |
|
| 18 | + * |
|
| 19 | + * @param mixed $old_state State returned by previous call of this method |
|
| 20 | + * @return mixed Returns false after last step, otherwise temporary state |
|
| 21 | + */ |
|
| 22 | 22 | function enable_step($old_state) |
| 23 | 23 | { |
| 24 | 24 | switch ($old_state) |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * Single disable step that does nothing |
|
| 56 | - * |
|
| 57 | - * @param mixed $old_state State returned by previous call of this method |
|
| 58 | - * @return mixed Returns false after last step, otherwise temporary state |
|
| 59 | - */ |
|
| 55 | + * Single disable step that does nothing |
|
| 56 | + * |
|
| 57 | + * @param mixed $old_state State returned by previous call of this method |
|
| 58 | + * @return mixed Returns false after last step, otherwise temporary state |
|
| 59 | + */ |
|
| 60 | 60 | function disable_step($old_state) |
| 61 | 61 | { |
| 62 | 62 | switch ($old_state) |
@@ -87,21 +87,21 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | - * Single purge step that reverts any included and installed migrations |
|
| 91 | - * |
|
| 92 | - * @param mixed $old_state State returned by previous call of this method |
|
| 93 | - * @return mixed Returns false after last step, otherwise temporary state |
|
| 94 | - */ |
|
| 90 | + * Single purge step that reverts any included and installed migrations |
|
| 91 | + * |
|
| 92 | + * @param mixed $old_state State returned by previous call of this method |
|
| 93 | + * @return mixed Returns false after last step, otherwise temporary state |
|
| 94 | + */ |
|
| 95 | 95 | function purge_step($old_state) |
| 96 | 96 | { |
| 97 | 97 | switch ($old_state) |
| 98 | 98 | { |
| 99 | 99 | case '': // Empty means nothing has run yet |
| 100 | 100 | /** |
| 101 | - * @todo Remove this try/catch condition once purge_notifications is fixed |
|
| 102 | - * in the core to work with disabled extensions without fatal errors. |
|
| 103 | - * https://tracker.phpbb.com/browse/PHPBB3-12435 |
|
| 104 | - */ |
|
| 101 | + * @todo Remove this try/catch condition once purge_notifications is fixed |
|
| 102 | + * in the core to work with disabled extensions without fatal errors. |
|
| 103 | + * https://tracker.phpbb.com/browse/PHPBB3-12435 |
|
| 104 | + */ |
|
| 105 | 105 | try |
| 106 | 106 | { |
| 107 | 107 | // Purge board rules notifications |
@@ -111,8 +111,7 @@ |
||
| 111 | 111 | $phpbb_notifications->purge_notifications('phpbbgallery.core.notification.new_image'); |
| 112 | 112 | $phpbb_notifications->purge_notifications('phpbbgallery.core.notification.new_comment'); |
| 113 | 113 | $phpbb_notifications->purge_notifications('phpbbgallery.core.notification.new_report'); |
| 114 | - } |
|
| 115 | - catch (\phpbb\notification\exception $e) |
|
| 114 | + } catch (\phpbb\notification\exception $e) |
|
| 116 | 115 | { |
| 117 | 116 | // continue |
| 118 | 117 | } |
@@ -147,8 +147,7 @@ discard block |
||
| 147 | 147 | if (isset($this->config['phpbb_gallery_' . $option])) |
| 148 | 148 | { |
| 149 | 149 | $config_ary[$option] = $this->config['phpbb_gallery_' . $option]; |
| 150 | - } |
|
| 151 | - else |
|
| 150 | + } else |
|
| 152 | 151 | { |
| 153 | 152 | $config_ary[$option] = $default; |
| 154 | 153 | } |
@@ -161,8 +160,7 @@ discard block |
||
| 161 | 160 | if (isset($this->config['phpbb_gallery_' . $key])) |
| 162 | 161 | { |
| 163 | 162 | return $this->config['phpbb_gallery_' . $key]; |
| 164 | - } |
|
| 165 | - else |
|
| 163 | + } else |
|
| 166 | 164 | { |
| 167 | 165 | return $this->configs_array[$key]; |
| 168 | 166 | } |
@@ -222,8 +222,7 @@ discard block |
||
| 222 | 222 | SET album_parents = '" . $this->db->sql_escape($album_data['album_parents']) . "' |
| 223 | 223 | WHERE parent_id = " . (int) $album_data['parent_id']; |
| 224 | 224 | $this->db->sql_query($sql); |
| 225 | - } |
|
| 226 | - else |
|
| 225 | + } else |
|
| 227 | 226 | { |
| 228 | 227 | $album_parents = unserialize($album_data['album_parents']); |
| 229 | 228 | } |
@@ -291,16 +290,14 @@ discard block |
||
| 291 | 290 | if (!empty($row['user_id'])) |
| 292 | 291 | { |
| 293 | 292 | $album_moderators[$a_id][] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']); |
| 294 | - } |
|
| 295 | - else |
|
| 293 | + } else |
|
| 296 | 294 | { |
| 297 | 295 | $group_name = (($row['group_type'] == GROUP_SPECIAL) ? $this->language->lang('G_' . $row['group_name']) : $row['group_name']); |
| 298 | 296 | |
| 299 | 297 | if ($this->user->data['user_id'] != ANONYMOUS && !$this->auth->acl_get('u_viewprofile')) |
| 300 | 298 | { |
| 301 | 299 | $album_moderators[$a_id][] = '<span' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . '>' . $group_name . '</span>'; |
| 302 | - } |
|
| 303 | - else |
|
| 300 | + } else |
|
| 304 | 301 | { |
| 305 | 302 | $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>'; |
| 306 | 303 | } |
@@ -344,8 +341,7 @@ discard block |
||
| 344 | 341 | } |
| 345 | 342 | $root_data = array('album_id' => \phpbbgallery\core\block::PUBLIC_ALBUM); |
| 346 | 343 | $sql_where = 'a.album_user_id = ' . \phpbbgallery\core\block::PUBLIC_ALBUM; |
| 347 | - } |
|
| 348 | - else if ($root_data == 'personal') |
|
| 344 | + } else if ($root_data == 'personal') |
|
| 349 | 345 | { |
| 350 | 346 | if ($mark_read == 'albums') |
| 351 | 347 | { |
@@ -362,8 +358,7 @@ discard block |
||
| 362 | 358 | { |
| 363 | 359 | $sql_where .= ' AND u.username_clean NOT ' . $this->db->sql_like_expression(chr($i) . $this->db->any_char); |
| 364 | 360 | } |
| 365 | - } |
|
| 366 | - else if ($first_char) |
|
| 361 | + } else if ($first_char) |
|
| 367 | 362 | { |
| 368 | 363 | $sql_where .= ' AND u.username_clean ' . $this->db->sql_like_expression(substr($first_char, 0, 1) . $this->db->any_char); |
| 369 | 364 | } |
@@ -407,8 +402,7 @@ discard block |
||
| 407 | 402 | 'phpbbgallery_core_search_recent_page',), |
| 408 | 403 | 'params' => array()), 'pagination', 'page', $num_pegas, $limit, $start |
| 409 | 404 | );*/ |
| 410 | - } |
|
| 411 | - else |
|
| 405 | + } else |
|
| 412 | 406 | { |
| 413 | 407 | $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']; |
| 414 | 408 | } |
@@ -496,10 +490,12 @@ discard block |
||
| 496 | 490 | continue; |
| 497 | 491 | } |
| 498 | 492 | |
| 499 | - if (false)//@todo !$this->gallery_auth->acl_check('a_list', $album_id, $row['album_user_id'])) |
|
| 493 | + if (false) { |
|
| 494 | + //@todo !$this->gallery_auth->acl_check('a_list', $album_id, $row['album_user_id'])) |
|
| 500 | 495 | { |
| 501 | 496 | // if the user does not have permissions to list this album, skip everything until next branch |
| 502 | 497 | $right_id = $row['right_id']; |
| 498 | + } |
|
| 503 | 499 | continue; |
| 504 | 500 | } |
| 505 | 501 | |
@@ -524,8 +520,7 @@ discard block |
||
| 524 | 520 | $album_rows[$parent_id]['album_type_last_image'] = $row['album_type']; |
| 525 | 521 | $album_rows[$parent_id]['album_contest_marked'] = $row['contest_marked']; |
| 526 | 522 | $album_rows[$parent_id]['orig_album_last_image_time'] = $row['album_last_image_time']; |
| 527 | - } |
|
| 528 | - else if ($row['album_type']) |
|
| 523 | + } else if ($row['album_type']) |
|
| 529 | 524 | { |
| 530 | 525 | $subalbums[$parent_id][$album_id]['display'] = ($row['display_on_index']) ? true : false; |
| 531 | 526 | $subalbums[$parent_id][$album_id]['name'] = $row['album_name']; |
@@ -567,16 +562,14 @@ discard block |
||
| 567 | 562 | { |
| 568 | 563 | $this->misc->markread('all'); |
| 569 | 564 | $message = $this->language->lang('RETURN_INDEX', '<a href="' . $redirect . '">', '</a>'); |
| 570 | - } |
|
| 571 | - else |
|
| 565 | + } else |
|
| 572 | 566 | { |
| 573 | 567 | $this->misc->markread('albums', $album_ids); |
| 574 | 568 | $message = $this->language->lang('RETURN_ALBUM', '<a href="' . $redirect . '">', '</a>'); |
| 575 | 569 | } |
| 576 | 570 | meta_refresh(3, $redirect); |
| 577 | 571 | trigger_error($this->language->lang('ALBUMS_MARKED') . '<br /><br />' . $message); |
| 578 | - } |
|
| 579 | - else |
|
| 572 | + } else |
|
| 580 | 573 | { |
| 581 | 574 | $message = $this->language->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>'); |
| 582 | 575 | meta_refresh(3, $redirect); |
@@ -654,8 +647,7 @@ discard block |
||
| 654 | 647 | 'name' => $subalbum_row['name'], |
| 655 | 648 | 'unread' => $subalbum_unread, |
| 656 | 649 | ); |
| 657 | - } |
|
| 658 | - else |
|
| 650 | + } else |
|
| 659 | 651 | { |
| 660 | 652 | unset($subalbums[$album_id][$subalbum_id]); |
| 661 | 653 | } |
@@ -668,8 +660,7 @@ discard block |
||
| 668 | 660 | |
| 669 | 661 | $l_subalbums = (sizeof($subalbums[$album_id]) == 1) ? $this->language->lang('SUBALBUM') : $this->language->lang('SUBALBUMS'); |
| 670 | 662 | $folder_image = ($album_unread) ? 'forum_unread_subforum' : 'forum_read_subforum'; |
| 671 | - } |
|
| 672 | - else |
|
| 663 | + } else |
|
| 673 | 664 | { |
| 674 | 665 | $folder_alt = ($album_unread) ? 'NEW_IMAGES' : 'NO_NEW_IMAGES'; |
| 675 | 666 | $folder_image = ($album_unread) ? 'forum_unread' : 'forum_read'; |
@@ -694,8 +685,7 @@ discard block |
||
| 694 | 685 | $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); |
| 695 | 686 | // 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); |
| 696 | 687 | $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); |
| 697 | - } |
|
| 698 | - else |
|
| 688 | + } else |
|
| 699 | 689 | { |
| 700 | 690 | $lastimage_time = $lastimage_album_type = $lastimage_contest_marked = 0; |
| 701 | 691 | $lastimage_uc_fake_thumbnail = $lastimage_uc_thumbnail = $lastimage_uc_name = $lastimage_uc_icon = ''; |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | $sql = 'SELECT a2.* |
| 96 | 96 | FROM ' . $this->table_albums . ' a1 |
| 97 | - LEFT JOIN ' . $this->table_albums . ' a2 ON (' . $condition .') AND a2.album_user_id = ' . (int) $branch_user_id .' |
|
| 97 | + LEFT JOIN ' . $this->table_albums . ' a2 ON (' . $condition . ') AND a2.album_user_id = ' . (int) $branch_user_id . ' |
|
| 98 | 98 | WHERE a1.album_id = ' . (int) $album_id . ' |
| 99 | 99 | AND a1.album_user_id = ' . (int) $branch_user_id . ' |
| 100 | 100 | ORDER BY a2.left_id ' . (($order == 'descending') ? 'ASC' : 'DESC'); |
@@ -177,9 +177,9 @@ discard block |
||
| 177 | 177 | 'ALBUM_ID' => $album_data['album_id'], |
| 178 | 178 | 'ALBUM_NAME' => $album_data['album_name'], |
| 179 | 179 | 'ALBUM_DESC' => generate_text_for_display($album_data['album_desc'], $album_data['album_desc_uid'], $album_data['album_desc_bitfield'], $album_data['album_desc_options']), |
| 180 | - 'ALBUM_CONTEST_START' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_START' . ((($album_data['contest_start']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start']), false, true)) : '', |
|
| 181 | - 'ALBUM_CONTEST_RATING' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_RATING_START' . ((($album_data['contest_start'] + $album_data['contest_rating']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_rating']), false, true)) : '', |
|
| 182 | - 'ALBUM_CONTEST_END' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_END' . ((($album_data['contest_start'] + $album_data['contest_end']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_end']), false, true)) : '', |
|
| 180 | + 'ALBUM_CONTEST_START' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_START' . ((($album_data['contest_start']) < time()) ? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start']), false, true)) : '', |
|
| 181 | + 'ALBUM_CONTEST_RATING' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_RATING_START' . ((($album_data['contest_start'] + $album_data['contest_rating']) < time()) ? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_rating']), false, true)) : '', |
|
| 182 | + 'ALBUM_CONTEST_END' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_END' . ((($album_data['contest_start'] + $album_data['contest_end']) < time()) ? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_end']), false, true)) : '', |
|
| 183 | 183 | 'U_VIEW_ALBUM' => $this->helper->route('phpbbgallery_core_album', array('album_id' => (int) $album_data['album_id'])), |
| 184 | 184 | )); |
| 185 | 185 | |
@@ -691,9 +691,9 @@ discard block |
||
| 691 | 691 | // phpbb_ext_gallery_core_image::generate_link('thumbnail', $phpbb_ext_gallery->config->get('link_thumbnail'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
| 692 | 692 | $lastimage_uc_thumbnail = $row['album_image'] ? generate_board_url() . '/' . $row['album_image'] : $this->helper->route('phpbbgallery_core_image_file_mini', array('image_id' => $row['album_last_image_id'])); |
| 693 | 693 | // 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); |
| 694 | - $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); |
|
| 694 | + $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); |
|
| 695 | 695 | // 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); |
| 696 | - $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); |
|
| 696 | + $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); |
|
| 697 | 697 | } |
| 698 | 698 | else |
| 699 | 699 | { |
@@ -40,12 +40,12 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * Load the data of an album |
|
| 44 | - * |
|
| 45 | - * @param int $album_id |
|
| 46 | - * @return bool True if the album was loaded |
|
| 47 | - * @throws \OutOfBoundsException if the album does not exist |
|
| 48 | - */ |
|
| 43 | + * Load the data of an album |
|
| 44 | + * |
|
| 45 | + * @param int $album_id |
|
| 46 | + * @return bool True if the album was loaded |
|
| 47 | + * @throws \OutOfBoundsException if the album does not exist |
|
| 48 | + */ |
|
| 49 | 49 | public function load($album_id) |
| 50 | 50 | { |
| 51 | 51 | $sql_array = array( |
@@ -107,13 +107,13 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | - * Check whether the album_user is the user who wants to do something |
|
| 111 | - * |
|
| 112 | - * @param int $album_id |
|
| 113 | - * @param mixed $user_id If false the current user will be compared |
|
| 114 | - * @return bool True if the user is the owner of the album |
|
| 115 | - * @throws \DomainException if the user is not the owner of the album |
|
| 116 | - */ |
|
| 110 | + * Check whether the album_user is the user who wants to do something |
|
| 111 | + * |
|
| 112 | + * @param int $album_id |
|
| 113 | + * @param mixed $user_id If false the current user will be compared |
|
| 114 | + * @return bool True if the user is the owner of the album |
|
| 115 | + * @throws \DomainException if the user is not the owner of the album |
|
| 116 | + */ |
|
| 117 | 117 | public function validate_owner($album_id, $user_id = false) |
| 118 | 118 | { |
| 119 | 119 | $album_id = (int) $album_id; |
@@ -751,8 +751,8 @@ discard block |
||
| 751 | 751 | $log_action = implode('_', array($log_action_images, $log_action_albums)); |
| 752 | 752 | |
| 753 | 753 | /** |
| 754 | - * Log what we did |
|
| 755 | - */ |
|
| 754 | + * Log what we did |
|
| 755 | + */ |
|
| 756 | 756 | switch ($log_action) |
| 757 | 757 | { |
| 758 | 758 | case 'MOVE_IMAGES_MOVE_ALBUMS': |
@@ -842,14 +842,14 @@ discard block |
||
| 842 | 842 | $this->gallery_notification->delete_albums($from_id); |
| 843 | 843 | |
| 844 | 844 | /** |
| 845 | - * Event related to moving album content |
|
| 846 | - * |
|
| 847 | - * @event phpbbgallery.core.album.manage.move_album_content |
|
| 848 | - * @var int from_id Album we are moving from |
|
| 849 | - * @var int to_id Album we are moving to |
|
| 850 | - * @var bool sync Should we sync the albums data |
|
| 851 | - * @since 1.2.0 |
|
| 852 | - */ |
|
| 845 | + * Event related to moving album content |
|
| 846 | + * |
|
| 847 | + * @event phpbbgallery.core.album.manage.move_album_content |
|
| 848 | + * @var int from_id Album we are moving from |
|
| 849 | + * @var int to_id Album we are moving to |
|
| 850 | + * @var bool sync Should we sync the albums data |
|
| 851 | + * @since 1.2.0 |
|
| 852 | + */ |
|
| 853 | 853 | $vars = array('from_id', 'to_id', 'sync'); |
| 854 | 854 | extract($this->dispatcher->trigger_event('phpbbgallery.core.album.manage.move_album_content', compact($vars))); |
| 855 | 855 | |
@@ -951,12 +951,12 @@ discard block |
||
| 951 | 951 | $this->gallery_config->set('num_comments', $row['num_comments']); |
| 952 | 952 | |
| 953 | 953 | /** |
| 954 | - * Event delete album content |
|
| 955 | - * |
|
| 956 | - * @event phpbbgallery.core.album.manage.delete_album_content |
|
| 957 | - * @var int album_id Album we are deleting |
|
| 958 | - * @since 1.2.0 |
|
| 959 | - */ |
|
| 954 | + * Event delete album content |
|
| 955 | + * |
|
| 956 | + * @event phpbbgallery.core.album.manage.delete_album_content |
|
| 957 | + * @var int album_id Album we are deleting |
|
| 958 | + * @since 1.2.0 |
|
| 959 | + */ |
|
| 960 | 960 | $vars = array('album_id'); |
| 961 | 961 | extract($this->dispatcher->trigger_event('phpbbgallery.core.album.manage.delete_album_content', compact($vars))); |
| 962 | 962 | |
@@ -979,11 +979,11 @@ discard block |
||
| 979 | 979 | public function move_album_by($album_row, $action = 'move_up', $steps = 1) |
| 980 | 980 | { |
| 981 | 981 | /** |
| 982 | - * Fetch all the siblings between the module's current spot |
|
| 983 | - * and where we want to move it to. If there are less than $steps |
|
| 984 | - * siblings between the current spot and the target then the |
|
| 985 | - * module will move as far as possible |
|
| 986 | - */ |
|
| 982 | + * Fetch all the siblings between the module's current spot |
|
| 983 | + * and where we want to move it to. If there are less than $steps |
|
| 984 | + * siblings between the current spot and the target then the |
|
| 985 | + * module will move as far as possible |
|
| 986 | + */ |
|
| 987 | 987 | $sql = 'SELECT album_id, album_name, left_id, right_id |
| 988 | 988 | FROM ' . $this->albums_table . ' |
| 989 | 989 | WHERE parent_id = ' . (int) $album_row['parent_id'] . ' |
@@ -1005,12 +1005,12 @@ discard block |
||
| 1005 | 1005 | } |
| 1006 | 1006 | |
| 1007 | 1007 | /** |
| 1008 | - * $left_id and $right_id define the scope of the nodes that are affected by the move. |
|
| 1009 | - * $diff_up and $diff_down are the values to substract or add to each node's left_id |
|
| 1010 | - * and right_id in order to move them up or down. |
|
| 1011 | - * $move_up_left and $move_up_right define the scope of the nodes that are moving |
|
| 1012 | - * up. Other nodes in the scope of ($left_id, $right_id) are considered to move down. |
|
| 1013 | - */ |
|
| 1008 | + * $left_id and $right_id define the scope of the nodes that are affected by the move. |
|
| 1009 | + * $diff_up and $diff_down are the values to substract or add to each node's left_id |
|
| 1010 | + * and right_id in order to move them up or down. |
|
| 1011 | + * $move_up_left and $move_up_right define the scope of the nodes that are moving |
|
| 1012 | + * up. Other nodes in the scope of ($left_id, $right_id) are considered to move down. |
|
| 1013 | + */ |
|
| 1014 | 1014 | if ($action == 'move_up') |
| 1015 | 1015 | { |
| 1016 | 1016 | $left_id = $target['left_id']; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | } |
| 167 | 167 | else |
| 168 | 168 | { |
| 169 | - $contest_data['contest_start'] = gmmktime((int) $m[4], (int) $m[5], 0, (int) $m[2], (int) $m[3], (int) $m[1]) - $time->getOffset();// - $offset; |
|
| 169 | + $contest_data['contest_start'] = gmmktime((int) $m[4], (int) $m[5], 0, (int) $m[2], (int) $m[3], (int) $m[1]) - $time->getOffset(); // - $offset; |
|
| 170 | 170 | } |
| 171 | 171 | if (!preg_match('#(\\d{4})-(\\d{1,2})-(\\d{1,2}) (\\d{1,2}):(\\d{2})#', $contest_data['contest_rating'], $m)) |
| 172 | 172 | { |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | } |
| 176 | 176 | else if (!$start_date_error) |
| 177 | 177 | { |
| 178 | - $contest_data['contest_rating'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset();//- $offset; |
|
| 178 | + $contest_data['contest_rating'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset(); //- $offset; |
|
| 179 | 179 | } |
| 180 | 180 | if (!preg_match('#(\\d{4})-(\\d{1,2})-(\\d{1,2}) (\\d{1,2}):(\\d{2})#', $contest_data['contest_end'], $m)) |
| 181 | 181 | { |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | else if (!$start_date_error) |
| 186 | 186 | { |
| 187 | - $contest_data['contest_end'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset();//- $offset; |
|
| 187 | + $contest_data['contest_end'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset(); //- $offset; |
|
| 188 | 188 | } |
| 189 | 189 | if (!$start_date_error && !$date_error) |
| 190 | 190 | { |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | $album_data = $this->gallery_album->get_info($album_id); |
| 711 | 711 | |
| 712 | 712 | $sql = 'UPDATE ' . $this->albums_table . ' |
| 713 | - SET parent_id = ' . (int) $subalbums_to_id .' |
|
| 713 | + SET parent_id = ' . (int) $subalbums_to_id . ' |
|
| 714 | 714 | WHERE parent_id = ' . (int) $album_id . ' |
| 715 | 715 | AND album_user_id = ' . (int) $this->user_id; |
| 716 | 716 | $this->db->sql_query($sql); |
@@ -738,13 +738,13 @@ discard block |
||
| 738 | 738 | // Resync tree |
| 739 | 739 | $sql = 'UPDATE ' . $this->albums_table . ' |
| 740 | 740 | SET right_id = right_id - ' . (int) $diff . ' |
| 741 | - WHERE left_id < ' . (int) $album_data['right_id'] . ' AND right_id > ' . (int) $album_data['right_id']. ' |
|
| 741 | + WHERE left_id < ' . (int) $album_data['right_id'] . ' AND right_id > ' . (int) $album_data['right_id'] . ' |
|
| 742 | 742 | AND album_user_id = ' . (int) $this->user_id; |
| 743 | 743 | $this->db->sql_query($sql); |
| 744 | 744 | |
| 745 | 745 | $sql = 'UPDATE ' . $this->albums_table . ' |
| 746 | 746 | SET left_id = left_id - ' . (int) $diff . ', right_id = right_id - ' . (int) $diff . ' |
| 747 | - WHERE left_id > ' . (int) $album_data['right_id']. ' |
|
| 747 | + WHERE left_id > ' . (int) $album_data['right_id'] . ' |
|
| 748 | 748 | AND album_user_id = ' . (int) $this->user_id; |
| 749 | 749 | $this->db->sql_query($sql); |
| 750 | 750 | |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | // Now do the dirty job |
| 1038 | 1038 | $sql = 'UPDATE ' . $this->albums_table . ' |
| 1039 | 1039 | SET left_id = left_id + CASE |
| 1040 | - WHEN left_id BETWEEN ' . (int) $move_up_left . ' AND ' . (int) $move_up_right . ' THEN -' .(int) $diff_up . ' |
|
| 1040 | + WHEN left_id BETWEEN ' . (int) $move_up_left . ' AND ' . (int) $move_up_right . ' THEN -' . (int) $diff_up . ' |
|
| 1041 | 1041 | ELSE ' .(int) $diff_down . ' |
| 1042 | 1042 | END, |
| 1043 | 1043 | right_id = right_id + CASE |
@@ -150,8 +150,7 @@ discard block |
||
| 150 | 150 | if ($this->user->data['user_timezone'] == '') |
| 151 | 151 | { |
| 152 | 152 | $timezone = 'UTC'; |
| 153 | - } |
|
| 154 | - else |
|
| 153 | + } else |
|
| 155 | 154 | { |
| 156 | 155 | $timezone = $this->user->data['user_timezone']; |
| 157 | 156 | } |
@@ -163,8 +162,7 @@ discard block |
||
| 163 | 162 | { |
| 164 | 163 | $errors[] = sprintf($this->language->lang('CONTEST_START_INVALID'), $contest_data['contest_start']); |
| 165 | 164 | $start_date_error = true; |
| 166 | - } |
|
| 167 | - else |
|
| 165 | + } else |
|
| 168 | 166 | { |
| 169 | 167 | $contest_data['contest_start'] = gmmktime((int) $m[4], (int) $m[5], 0, (int) $m[2], (int) $m[3], (int) $m[1]) - $time->getOffset();// - $offset; |
| 170 | 168 | } |
@@ -172,8 +170,7 @@ discard block |
||
| 172 | 170 | { |
| 173 | 171 | $errors[] = sprintf($this->language->lang('CONTEST_RATING_INVALID'), $contest_data['contest_rating']); |
| 174 | 172 | $date_error = true; |
| 175 | - } |
|
| 176 | - else if (!$start_date_error) |
|
| 173 | + } else if (!$start_date_error) |
|
| 177 | 174 | { |
| 178 | 175 | $contest_data['contest_rating'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset();//- $offset; |
| 179 | 176 | } |
@@ -181,8 +178,7 @@ discard block |
||
| 181 | 178 | { |
| 182 | 179 | $errors[] = sprintf($this->language->lang('CONTEST_END_INVALID'), $contest_data['contest_end']); |
| 183 | 180 | $date_error = true; |
| 184 | - } |
|
| 185 | - else if (!$start_date_error) |
|
| 181 | + } else if (!$start_date_error) |
|
| 186 | 182 | { |
| 187 | 183 | $contest_data['contest_end'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset();//- $offset; |
| 188 | 184 | } |
@@ -270,8 +266,7 @@ discard block |
||
| 270 | 266 | |
| 271 | 267 | $album_data_sql['left_id'] = $row['right_id']; |
| 272 | 268 | $album_data_sql['right_id'] = $row['right_id'] + 1; |
| 273 | - } |
|
| 274 | - else |
|
| 269 | + } else |
|
| 275 | 270 | { |
| 276 | 271 | $sql = 'UPDATE ' . $this->albums_table . ' |
| 277 | 272 | SET left_id = left_id + 2, right_id = right_id + 2 |
@@ -288,8 +283,7 @@ discard block |
||
| 288 | 283 | $album_data_sql['left_id'] = $row['left_id'] + 1; |
| 289 | 284 | $album_data_sql['right_id'] = $row['left_id'] + 2; |
| 290 | 285 | } |
| 291 | - } |
|
| 292 | - else |
|
| 286 | + } else |
|
| 293 | 287 | { |
| 294 | 288 | if (!$add_on_top) |
| 295 | 289 | { |
@@ -302,8 +296,7 @@ discard block |
||
| 302 | 296 | |
| 303 | 297 | $album_data_sql['left_id'] = $row['right_id'] + 1; |
| 304 | 298 | $album_data_sql['right_id'] = $row['right_id'] + 2; |
| 305 | - } |
|
| 306 | - else |
|
| 299 | + } else |
|
| 307 | 300 | { |
| 308 | 301 | $sql = 'UPDATE ' . $this->albums_table . ' |
| 309 | 302 | SET left_id = left_id + 2, right_id = right_id + 2 |
@@ -336,8 +329,7 @@ discard block |
||
| 336 | 329 | $this->db->sql_query($sql); |
| 337 | 330 | } |
| 338 | 331 | $this->gallery_log->add_log('admin', 'add', $album_data['album_id'], 0, array('LOG_ALBUM_ADD', $album_data['album_name'])); |
| 339 | - } |
|
| 340 | - else |
|
| 332 | + } else |
|
| 341 | 333 | { |
| 342 | 334 | $row = $this->gallery_album->get_info($album_data_sql['album_id']); |
| 343 | 335 | $reset_marked_images = false; |
@@ -348,22 +340,19 @@ discard block |
||
| 348 | 340 | // Changing a contest to category? No! |
| 349 | 341 | $errors[] = $this->language->lang('ALBUM_WITH_CONTEST_NO_TYPE_CHANGE'); |
| 350 | 342 | return $errors; |
| 351 | - } |
|
| 352 | - else if ($row['album_type'] != \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) |
|
| 343 | + } else if ($row['album_type'] != \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) |
|
| 353 | 344 | { |
| 354 | 345 | // Changing a album to contest? No! |
| 355 | 346 | // Changing a category to contest? No! |
| 356 | 347 | $errors[] = $this->language->lang('ALBUM_NO_TYPE_CHANGE_TO_CONTEST'); |
| 357 | 348 | return $errors; |
| 358 | - } |
|
| 359 | - else if ($row['album_type'] == \phpbbgallery\core\block::TYPE_CAT && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_UPLOAD) |
|
| 349 | + } else if ($row['album_type'] == \phpbbgallery\core\block::TYPE_CAT && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_UPLOAD) |
|
| 360 | 350 | { |
| 361 | 351 | // Changing a category to a album? Yes! |
| 362 | 352 | // Reset the data (you couldn't upload directly in a cat, you must use a album) |
| 363 | 353 | $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; |
| 364 | 354 | $album_data_sql['album_last_username'] = $album_data_sql['album_last_user_colour'] = $album_data_sql['album_last_image_name'] = ''; |
| 365 | - } |
|
| 366 | - else if ($row['album_type'] == \phpbbgallery\core\block::TYPE_UPLOAD && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_CAT) |
|
| 355 | + } else if ($row['album_type'] == \phpbbgallery\core\block::TYPE_UPLOAD && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_CAT) |
|
| 367 | 356 | { |
| 368 | 357 | // Changing a album to a category? Yes! |
| 369 | 358 | // we're turning a uploadable album into a non-uploadable album |
@@ -374,22 +363,18 @@ discard block |
||
| 374 | 363 | if ($to_album_id) |
| 375 | 364 | { |
| 376 | 365 | $errors = $this->move_album_content($album_data_sql['album_id'], $to_album_id); |
| 377 | - } |
|
| 378 | - else |
|
| 366 | + } else |
|
| 379 | 367 | { |
| 380 | 368 | return array($this->language->lang('NO_DESTINATION_ALBUM')); |
| 381 | 369 | } |
| 382 | - } |
|
| 383 | - else if ($album_data_sql['type_action'] == 'delete') |
|
| 370 | + } else if ($album_data_sql['type_action'] == 'delete') |
|
| 384 | 371 | { |
| 385 | 372 | $errors = $this->delete_album_content($album_data_sql['album_id']); |
| 386 | - } |
|
| 387 | - else |
|
| 373 | + } else |
|
| 388 | 374 | { |
| 389 | 375 | return array($this->language->lang('NO_ALBUM_ACTION')); |
| 390 | 376 | } |
| 391 | - } |
|
| 392 | - else if ($row['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) |
|
| 377 | + } else if ($row['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) |
|
| 393 | 378 | { |
| 394 | 379 | // Changing a contest to contest? Yes! |
| 395 | 380 | // We need to check for the contest_data |
@@ -417,8 +402,7 @@ discard block |
||
| 417 | 402 | if ($row['album_id'] != $album_data_sql['parent_id']) |
| 418 | 403 | { |
| 419 | 404 | $errors = $this->move_album($album_data_sql['album_id'], $album_data_sql['parent_id']); |
| 420 | - } |
|
| 421 | - else |
|
| 405 | + } else |
|
| 422 | 406 | { |
| 423 | 407 | $album_data_sql['parent_id'] = $row['parent_id']; |
| 424 | 408 | } |
@@ -561,13 +545,11 @@ discard block |
||
| 561 | 545 | if ($to_data['right_id'] > $from_data['right_id']) |
| 562 | 546 | { |
| 563 | 547 | $diff = '+ ' . ($to_data['right_id'] - $from_data['right_id'] - 1); |
| 564 | - } |
|
| 565 | - else |
|
| 548 | + } else |
|
| 566 | 549 | { |
| 567 | 550 | $diff = '- ' . abs($to_data['right_id'] - $from_data['right_id'] - 1); |
| 568 | 551 | } |
| 569 | - } |
|
| 570 | - else |
|
| 552 | + } else |
|
| 571 | 553 | { |
| 572 | 554 | $sql = 'SELECT MAX(right_id) AS right_id |
| 573 | 555 | FROM ' . $this->albums_table . ' |
@@ -613,14 +595,12 @@ discard block |
||
| 613 | 595 | { |
| 614 | 596 | $log_action_images = 'IMAGES'; |
| 615 | 597 | $errors = array_merge($errors, $this->delete_album_content($album_id)); |
| 616 | - } |
|
| 617 | - else if ($action_images == 'move') |
|
| 598 | + } else if ($action_images == 'move') |
|
| 618 | 599 | { |
| 619 | 600 | if (!$images_to_id) |
| 620 | 601 | { |
| 621 | 602 | $errors[] = $this->language->lang('NO_DESTINATION_ALBUM'); |
| 622 | - } |
|
| 623 | - else |
|
| 603 | + } else |
|
| 624 | 604 | { |
| 625 | 605 | $log_action_images = 'MOVE_IMAGES'; |
| 626 | 606 | |
@@ -634,8 +614,7 @@ discard block |
||
| 634 | 614 | if (!$row) |
| 635 | 615 | { |
| 636 | 616 | $errors[] = $this->language->lang('NO_ALBUM'); |
| 637 | - } |
|
| 638 | - else |
|
| 617 | + } else |
|
| 639 | 618 | { |
| 640 | 619 | $images_to_name = $row['album_name']; |
| 641 | 620 | $errors = array_merge($errors, $this->move_album_content($album_id, $images_to_id)); |
@@ -669,14 +648,12 @@ discard block |
||
| 669 | 648 | $sql = 'DELETE FROM ' . $this->albums_table . ' |
| 670 | 649 | WHERE ' . $this->db->sql_in_set('album_id', $album_ids); |
| 671 | 650 | $this->db->sql_query($sql); |
| 672 | - } |
|
| 673 | - else if ($action_subalbums == 'move') |
|
| 651 | + } else if ($action_subalbums == 'move') |
|
| 674 | 652 | { |
| 675 | 653 | if (!$subalbums_to_id) |
| 676 | 654 | { |
| 677 | 655 | $errors[] = $this->language->lang('NO_DESTINATION_ALBUM'); |
| 678 | - } |
|
| 679 | - else |
|
| 656 | + } else |
|
| 680 | 657 | { |
| 681 | 658 | $log_action_albums = 'MOVE_ALBUMS'; |
| 682 | 659 | |
@@ -690,8 +667,7 @@ discard block |
||
| 690 | 667 | if (!$row) |
| 691 | 668 | { |
| 692 | 669 | $errors[] = $this->language->lang('NO_ALBUM'); |
| 693 | - } |
|
| 694 | - else |
|
| 670 | + } else |
|
| 695 | 671 | { |
| 696 | 672 | $subalbums_to_name = $row['album_name']; |
| 697 | 673 | |
@@ -726,8 +702,7 @@ discard block |
||
| 726 | 702 | { |
| 727 | 703 | return $errors; |
| 728 | 704 | } |
| 729 | - } |
|
| 730 | - else |
|
| 705 | + } else |
|
| 731 | 706 | { |
| 732 | 707 | $diff = 2; |
| 733 | 708 | $sql = 'DELETE FROM ' . $this->albums_table . ' |
@@ -1021,8 +996,7 @@ discard block |
||
| 1021 | 996 | |
| 1022 | 997 | $move_up_left = $album_row['left_id']; |
| 1023 | 998 | $move_up_right = $album_row['right_id']; |
| 1024 | - } |
|
| 1025 | - else |
|
| 999 | + } else |
|
| 1026 | 1000 | { |
| 1027 | 1001 | $left_id = $album_row['left_id']; |
| 1028 | 1002 | $right_id = $target['right_id']; |
@@ -213,9 +213,9 @@ |
||
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
| 216 | - * Get all recent images the user has access to |
|
| 217 | - * return (int) $images_count |
|
| 218 | - */ |
|
| 216 | + * Get all recent images the user has access to |
|
| 217 | + * return (int) $images_count |
|
| 218 | + */ |
|
| 219 | 219 | public function recent_count() |
| 220 | 220 | { |
| 221 | 221 | $this->gallery_auth->load_user_premissions($this->user->data['user_id']); |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | $this->template->assign_block_vars('commentrow', array( |
| 311 | 311 | 'COMMENT_ID' => (int) $var['comment_id'], |
| 312 | 312 | 'U_DELETE' => ($this->gallery_auth->acl_check('m_comments', $album_tmp['album_id'], $album_tmp['album_user_id']) || ($this->gallery_auth->acl_check('c_delete', $album_tmp['album_id'], $album_tmp['album_user_id']) && ($var['comment_user_id'] == $this->user->data['user_id']) && $this->user->data['is_registered'])) ? $this->helper->route('phpbbgallery_core_comment_delete', array('image_id' => $var['comment_image_id'], 'comment_id' => $var['comment_id'])) : false, |
| 313 | - 'U_EDIT' => $this->gallery_auth->acl_check('c_edit', $album_tmp['album_id'], $album_tmp['album_user_id'])? $this->helper->route('phpbbgallery_core_comment_edit', array('image_id' => $var['comment_image_id'], 'comment_id' => $var['comment_id'])) : false, |
|
| 313 | + 'U_EDIT' => $this->gallery_auth->acl_check('c_edit', $album_tmp['album_id'], $album_tmp['album_user_id']) ? $this->helper->route('phpbbgallery_core_comment_edit', array('image_id' => $var['comment_image_id'], 'comment_id' => $var['comment_id'])) : false, |
|
| 314 | 314 | 'U_QUOTE' => ($this->gallery_auth->acl_check('c_post', $album_tmp['album_id'], $album_tmp['album_user_id'])) ? $this->helper->route('phpbbgallery_core_comment_add', array('image_id' => $var['comment_image_id'], 'comment_id' => $var['comment_id'])) : false, |
| 315 | 315 | 'U_COMMENT' => $this->helper->route('phpbbgallery_core_image', array('image_id' => $var['comment_image_id'])) . '#comment_' . $var['comment_id'], |
| 316 | 316 | 'POST_AUTHOR_FULL' => $this->user_loader->get_username($var['comment_user_id'], 'full'), |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | if ($user > 0) |
| 444 | 444 | { |
| 445 | 445 | $this->template->assign_block_vars('imageblock', array( |
| 446 | - 'BLOCK_NAME' => $block_name ? $block_name : '' , |
|
| 446 | + 'BLOCK_NAME' => $block_name ? $block_name : '', |
|
| 447 | 447 | 'U_BLOCK' => $u_block ? $u_block : $this->helper->route('phpbbgallery_core_search_egosearch'), |
| 448 | 448 | )); |
| 449 | 449 | } |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | $this->db->sql_freeresult($result); |
| 544 | 544 | $count = $row['count']; |
| 545 | 545 | $sql_array['SELECT'] = '* , a.album_name, a.album_status, a.album_user_id, a.album_id'; |
| 546 | - $sql_array['LEFT_JOIN'] = array( |
|
| 546 | + $sql_array['LEFT_JOIN'] = array( |
|
| 547 | 547 | array( |
| 548 | 548 | 'FROM' => array($this->albums_table => 'a'), |
| 549 | 549 | 'ON' => 'a.album_id = i.image_album_id', |
@@ -149,8 +149,7 @@ discard block |
||
| 149 | 149 | if (!$sql_limit) |
| 150 | 150 | { |
| 151 | 151 | $result = $this->db->sql_query($sql); |
| 152 | - } |
|
| 153 | - else |
|
| 152 | + } else |
|
| 154 | 153 | { |
| 155 | 154 | $result = $this->db->sql_query_limit($sql, $sql_limit); |
| 156 | 155 | } |
@@ -446,8 +445,7 @@ discard block |
||
| 446 | 445 | 'BLOCK_NAME' => $block_name ? $block_name : '' , |
| 447 | 446 | 'U_BLOCK' => $u_block ? $u_block : $this->helper->route('phpbbgallery_core_search_egosearch'), |
| 448 | 447 | )); |
| 449 | - } |
|
| 450 | - else |
|
| 448 | + } else |
|
| 451 | 449 | { |
| 452 | 450 | $this->template->assign_block_vars('imageblock', array( |
| 453 | 451 | 'BLOCK_NAME' => $block_name ? $block_name : $this->language->lang('RECENT_IMAGES'), |
@@ -505,8 +503,7 @@ discard block |
||
| 505 | 503 | 'phpbbgallery_core_search_egosearch_page',), |
| 506 | 504 | 'params' => array()), 'pagination', 'page', $count, $limit, $start |
| 507 | 505 | ); |
| 508 | - } |
|
| 509 | - else |
|
| 506 | + } else |
|
| 510 | 507 | { |
| 511 | 508 | $this->template->assign_vars(array( |
| 512 | 509 | 'TOTAL_IMAGES' => $this->language->lang('VIEW_ALBUM_IMAGES', $count), |
@@ -231,9 +231,9 @@ discard block |
||
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /** |
| 234 | - * We need to disable the "last-modified" caching for guests and in cases of image-errors, |
|
| 235 | - * so that they can view them, if they logged in or the error was fixed. |
|
| 236 | - */ |
|
| 234 | + * We need to disable the "last-modified" caching for guests and in cases of image-errors, |
|
| 235 | + * so that they can view them, if they logged in or the error was fixed. |
|
| 236 | + */ |
|
| 237 | 237 | public function disable_browser_cache() |
| 238 | 238 | { |
| 239 | 239 | $this->browser_cache = false; |
@@ -460,12 +460,12 @@ discard block |
||
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | /** |
| 463 | - * Delete file from disc. |
|
| 464 | - * |
|
| 465 | - * @param mixed $files String with filename or an array of filenames |
|
| 466 | - * Array-Format: $image_id => $filename |
|
| 467 | - * @param array $locations Array of valid url::path()s where the image should be deleted from |
|
| 468 | - */ |
|
| 463 | + * Delete file from disc. |
|
| 464 | + * |
|
| 465 | + * @param mixed $files String with filename or an array of filenames |
|
| 466 | + * Array-Format: $image_id => $filename |
|
| 467 | + * @param array $locations Array of valid url::path()s where the image should be deleted from |
|
| 468 | + */ |
|
| 469 | 469 | public function delete($files, $locations = array('thumbnail', 'medium', 'upload')) |
| 470 | 470 | { |
| 471 | 471 | if (!is_array($files)) |
@@ -294,13 +294,13 @@ |
||
| 294 | 294 | |
| 295 | 295 | if (($this->image_size['height'] / $max_height) > ($this->image_size['width'] / $max_width)) |
| 296 | 296 | { |
| 297 | - $this->thumb_height = $max_height; |
|
| 298 | - $this->thumb_width = round($max_width * (($this->image_size['width'] / $max_width) / ($this->image_size['height'] / $max_height))); |
|
| 297 | + $this->thumb_height = $max_height; |
|
| 298 | + $this->thumb_width = round($max_width * (($this->image_size['width'] / $max_width) / ($this->image_size['height'] / $max_height))); |
|
| 299 | 299 | } |
| 300 | 300 | else |
| 301 | 301 | { |
| 302 | - $this->thumb_height = round($max_height * (($this->image_size['height'] / $max_height) / ($this->image_size['width'] / $max_width))); |
|
| 303 | - $this->thumb_width = $max_width; |
|
| 302 | + $this->thumb_height = round($max_height * (($this->image_size['height'] / $max_height) / ($this->image_size['width'] / $max_width))); |
|
| 303 | + $this->thumb_width = $max_width; |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | $image_copy = (($this->gd_version == self::GDLIB1) ? @imagecreate($this->thumb_width, $this->thumb_height + $additional_height) : @imagecreatetruecolor($this->thumb_width, $this->thumb_height + $additional_height)); |
@@ -161,8 +161,7 @@ discard block |
||
| 161 | 161 | if (isset($this->image_size['file'])) |
| 162 | 162 | { |
| 163 | 163 | $file_size = $this->image_size['file']; |
| 164 | - } |
|
| 165 | - else if ($force_filesize) |
|
| 164 | + } else if ($force_filesize) |
|
| 166 | 165 | { |
| 167 | 166 | $file_size = @filesize($this->image_source); |
| 168 | 167 | } |
@@ -296,8 +295,7 @@ discard block |
||
| 296 | 295 | { |
| 297 | 296 | $this->thumb_height = $max_height; |
| 298 | 297 | $this->thumb_width = round($max_width * (($this->image_size['width'] / $max_width) / ($this->image_size['height'] / $max_height))); |
| 299 | - } |
|
| 300 | - else |
|
| 298 | + } else |
|
| 301 | 299 | { |
| 302 | 300 | $this->thumb_height = round($max_height * (($this->image_size['height'] / $max_height) / ($this->image_size['width'] / $max_width))); |
| 303 | 301 | $this->thumb_width = $max_width; |
@@ -407,8 +405,7 @@ discard block |
||
| 407 | 405 | { |
| 408 | 406 | $this->image_source = $get_wm_name; |
| 409 | 407 | $this->read_image(); |
| 410 | - } |
|
| 411 | - else |
|
| 408 | + } else |
|
| 412 | 409 | { |
| 413 | 410 | $this->watermark_size = getimagesize($this->watermark_source); |
| 414 | 411 | switch ($this->watermark_size['mime']) |
@@ -437,16 +434,14 @@ discard block |
||
| 437 | 434 | if ($watermark_position & $phpbb_gallery_constants::WATERMARK_LEFT) |
| 438 | 435 | { |
| 439 | 436 | $dst_x = 5; |
| 440 | - } |
|
| 441 | - else if ($watermark_position & $phpbb_gallery_constants::WATERMARK_RIGHT) |
|
| 437 | + } else if ($watermark_position & $phpbb_gallery_constants::WATERMARK_RIGHT) |
|
| 442 | 438 | { |
| 443 | 439 | $dst_x = ($this->image_size['width'] - $this->watermark_size[0] - 5); |
| 444 | 440 | } |
| 445 | 441 | if ($watermark_position & $phpbb_gallery_constants::WATERMARK_TOP) |
| 446 | 442 | { |
| 447 | 443 | $dst_y = 5; |
| 448 | - } |
|
| 449 | - else if ($watermark_position & $phpbb_gallery_constants::WATERMARK_MIDDLE) |
|
| 444 | + } else if ($watermark_position & $phpbb_gallery_constants::WATERMARK_MIDDLE) |
|
| 450 | 445 | { |
| 451 | 446 | $dst_y = (($this->image_size['height'] * 0.5) - ($this->watermark_size[1] * 0.5)); |
| 452 | 447 | } |
@@ -122,13 +122,13 @@ |
||
| 122 | 122 | } |
| 123 | 123 | if ($recent) |
| 124 | 124 | { |
| 125 | - $block_name = $this->language->lang('RECENT_IMAGES'); |
|
| 125 | + $block_name = $this->language->lang('RECENT_IMAGES'); |
|
| 126 | 126 | $u_block = ' '; |
| 127 | 127 | $this->gallery_search->recent($this->gallery_config->get('rrc_profile_items'), -1, $event['member']['user_id'], 'rrc_profile_display', $block_name, $u_block); |
| 128 | 128 | } |
| 129 | 129 | if ($random) |
| 130 | 130 | { |
| 131 | - $block_name = $this->language->lang('RANDOM_IMAGES'); |
|
| 131 | + $block_name = $this->language->lang('RANDOM_IMAGES'); |
|
| 132 | 132 | $u_block = ' '; |
| 133 | 133 | $this->gallery_search->random($this->gallery_config->get('rrc_profile_items'), $event['member']['user_id'], 'rrc_profile_display', $block_name, $u_block); |
| 134 | 134 | } |
@@ -146,8 +146,7 @@ |
||
| 146 | 146 | 'U_GALLERY_IMAGES_ALLOW' => true, |
| 147 | 147 | 'U_GALLERY_IMAGES' => $user_info['user_images'], |
| 148 | 148 | )); |
| 149 | - } |
|
| 150 | - else |
|
| 149 | + } else |
|
| 151 | 150 | { |
| 152 | 151 | $this->template->assign_vars(array( |
| 153 | 152 | 'U_GALLERY_IMAGES_ALLOW' => true, |