Exemplo n.º 1
0
if (phpbb_gallery_config::get('allow_comments') && phpbb_gallery::$auth->acl_check('c_post', $album_id, $album_data['album_user_id']) && $album_data['album_status'] != ITEM_LOCKED && ($image_data['image_status'] != phpbb_gallery_image::STATUS_LOCKED || phpbb_gallery::$auth->acl_check('m_status', $album_id, $album_data['album_user_id']))) {
    $user->add_lang('posting');
    phpbb_gallery_url::_include('functions_posting', 'phpbb');
    $bbcode_status = $config['allow_bbcode'] ? true : false;
    $smilies_status = $config['allow_smilies'] ? true : false;
    $img_status = $bbcode_status ? true : false;
    $url_status = $config['allow_post_links'] ? true : false;
    $flash_status = false;
    $quote_status = true;
    // Build custom bbcodes array
    display_custom_bbcodes();
    // Build smilies array
    generate_smilies('inline', 0);
    $s_hide_comment_input = time() < $album_data['contest_start'] + $album_data['contest_end'] ? true : false;
    $template->assign_vars(array('S_ALLOWED_TO_COMMENT' => true, 'S_HIDE_COMMENT_INPUT' => $s_hide_comment_input, 'CONTEST_COMMENTS' => sprintf($user->lang['CONTEST_COMMENTS_STARTS'], $user->format_date($album_data['contest_start'] + $album_data['contest_end'], false, true)), 'BBCODE_STATUS' => $bbcode_status ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . phpbb_gallery_url::append_sid('phpbb', 'faq', 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . phpbb_gallery_url::append_sid('phpbb', 'faq', 'mode=bbcode') . '">', '</a>'), 'IMG_STATUS' => $img_status ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => $flash_status ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], 'SMILIES_STATUS' => $smilies_status ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], 'URL_STATUS' => $bbcode_status && $url_status ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'], 'S_BBCODE_ALLOWED' => $bbcode_status, 'S_SMILIES_ALLOWED' => $smilies_status, 'S_LINKS_ALLOWED' => $url_status, 'S_BBCODE_IMG' => $img_status, 'S_BBCODE_URL' => $url_status, 'S_BBCODE_FLASH' => $flash_status, 'S_BBCODE_QUOTE' => $quote_status, 'L_COMMENT_LENGTH' => sprintf($user->lang['COMMENT_LENGTH'], phpbb_gallery_config::get('comment_length'))));
    if (phpbb_gallery_misc::display_captcha('comment')) {
        // Get the captcha instance
        phpbb_gallery_url::_include('captcha/captcha_factory', 'phpbb');
        $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
        $captcha->init(CONFIRM_POST);
        $template->assign_vars(array('S_CONFIRM_CODE' => true, 'CAPTCHA_TEMPLATE' => $captcha->get_template()));
    }
    // Different link, when we rate and dont comment
    if (!$s_hide_comment_input) {
        $template->assign_var('S_COMMENT_ACTION', phpbb_gallery_url::append_sid('posting', "album_id={$album_id}&amp;image_id={$image_id}&amp;mode=comment&amp;submode=add"));
    }
}
/**
* Listing comment
*/
if (phpbb_gallery_config::get('allow_comments') && phpbb_gallery::$auth->acl_check('c_read', $album_id, $album_data['album_user_id']) && time() > $album_data['contest_start'] + $album_data['contest_end']) {
Exemplo n.º 2
0
 /**
  * Display albums
  *
  * borrowed from phpBB3
  * @author: phpBB Group
  * @function: display_forums
  */
 public static function display_albums($root_data = '', $display_moderators = true, $return_moderators = false)
 {
     global $auth, $db, $template, $user;
     $album_rows = $subalbums = $album_ids = $album_ids_moderator = $album_moderators = $active_album_ary = array();
     $parent_id = $visible_albums = 0;
     $sql_from = '';
     $mode = request_var('mode', '');
     // Mark albums read?
     $mark_read = request_var('mark', '');
     if ($mark_read == 'all') {
         $mark_read = '';
     }
     if (!$root_data) {
         if ($mark_read == 'albums') {
             $mark_read = 'all';
         }
         $root_data = array('album_id' => self::PUBLIC_ALBUM);
         $sql_where = 'a.album_user_id = ' . self::PUBLIC_ALBUM;
     } else {
         if ($root_data == 'personal') {
             if ($mark_read == 'albums') {
                 $mark_read = 'all';
             }
             $root_data = array('album_id' => 0);
             //@todo: I think this is incorrect!?
             $sql_where = 'a.album_user_id > ' . self::PUBLIC_ALBUM;
             $num_pegas = phpbb_gallery_config::get('num_pegas');
             $first_char = request_var('first_char', '');
             if ($first_char == 'other') {
                 // Loop the ASCII: a-z
                 for ($i = 97; $i < 123; $i++) {
                     $sql_where .= ' AND u.username_clean NOT ' . $db->sql_like_expression(chr($i) . $db->any_char);
                 }
             } else {
                 if ($first_char) {
                     $sql_where .= ' AND u.username_clean ' . $db->sql_like_expression(substr($first_char, 0, 1) . $db->any_char);
                 }
             }
             if ($first_char) {
                 // We do not view all personal albums, so we need to recount, for the pagination.
                 $sql_array = array('SELECT' => 'count(a.album_id) as pgalleries', 'FROM' => array(GALLERY_ALBUMS_TABLE => 'a'), 'LEFT_JOIN' => array(array('FROM' => array(USERS_TABLE => 'u'), 'ON' => 'u.user_id = a.album_user_id')), 'WHERE' => 'a.parent_id = 0 AND ' . $sql_where);
                 $sql = $db->sql_build_query('SELECT', $sql_array);
                 $result = $db->sql_query($sql);
                 $num_pegas = $db->sql_fetchfield('pgalleries');
                 $db->sql_freeresult($result);
             }
             $mode_personal = true;
             $start = request_var('start', 0);
             $limit = phpbb_gallery_config::get('pegas_per_page');
             $template->assign_vars(array('PAGINATION' => generate_pagination(phpbb_gallery_url::append_sid('index', 'mode=' . $mode . ($first_char ? '&amp;first_char=' . $first_char : '')), $num_pegas, $limit, $start), 'TOTAL_PGALLERIES_SHORT' => sprintf($user->lang['TOTAL_PGALLERIES_SHORT'], $num_pegas), 'PAGE_NUMBER' => on_page($num_pegas, $limit, $start)));
         } else {
             $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'];
         }
     }
     $sql_array = array('SELECT' => 'a.*, at.mark_time', 'FROM' => array(GALLERY_ALBUMS_TABLE => 'a'), 'LEFT_JOIN' => array(array('FROM' => array(GALLERY_ATRACK_TABLE => 'at'), 'ON' => 'at.user_id = ' . $user->data['user_id'] . ' AND a.album_id = at.album_id')), 'ORDER_BY' => 'a.album_user_id, a.left_id');
     if (isset($mode_personal)) {
         $sql_array['LEFT_JOIN'][] = array('FROM' => array(USERS_TABLE => 'u'), 'ON' => 'u.user_id = a.album_user_id');
         $sql_array['ORDER_BY'] = 'u.username_clean, a.left_id';
     }
     $sql_array['LEFT_JOIN'][] = array('FROM' => array(GALLERY_CONTESTS_TABLE => 'c'), 'ON' => 'c.contest_album_id = a.album_id');
     $sql_array['SELECT'] = $sql_array['SELECT'] . ', c.contest_marked';
     $sql = $db->sql_build_query('SELECT', array('SELECT' => $sql_array['SELECT'], 'FROM' => $sql_array['FROM'], 'LEFT_JOIN' => $sql_array['LEFT_JOIN'], 'WHERE' => $sql_where, 'ORDER_BY' => $sql_array['ORDER_BY']));
     $result = $db->sql_query($sql);
     $album_tracking_info = array();
     $branch_root_id = $root_data['album_id'];
     while ($row = $db->sql_fetchrow($result)) {
         $album_id = $row['album_id'];
         // Mark albums read?
         if ($mark_read == 'albums' || $mark_read == 'all') {
             if (phpbb_gallery::$auth->acl_check('a_list', $album_id, $row['album_user_id'])) {
                 $album_ids[] = $album_id;
                 continue;
             }
         }
         // Category with no members
         if (!$row['album_type'] && $row['left_id'] + 1 == $row['right_id']) {
             continue;
         }
         // Skip branch
         if (isset($right_id)) {
             if ($row['left_id'] < $right_id) {
                 continue;
             }
             unset($right_id);
         }
         if (!phpbb_gallery::$auth->acl_check('a_list', $album_id, $row['album_user_id'])) {
             // if the user does not have permissions to list this album, skip everything until next branch
             $right_id = $row['right_id'];
             continue;
         }
         $album_tracking_info[$album_id] = !empty($row['mark_time']) ? $row['mark_time'] : phpbb_gallery::$user->data('user_lastmark');
         $row['album_images'] = $row['album_images'];
         $row['album_images_real'] = $row['album_images_real'];
         if ($row['parent_id'] == $root_data['album_id'] || $row['parent_id'] == $branch_root_id) {
             if ($row['album_type']) {
                 $album_ids_moderator[] = (int) $album_id;
             }
             // Direct child of current branch
             $parent_id = $album_id;
             $album_rows[$album_id] = $row;
             if (!$row['album_type'] && $row['parent_id'] == $root_data['album_id']) {
                 $branch_root_id = $album_id;
             }
             $album_rows[$parent_id]['album_id_last_image'] = $row['album_id'];
             $album_rows[$parent_id]['album_type_last_image'] = $row['album_type'];
             $album_rows[$parent_id]['album_contest_marked'] = $row['contest_marked'];
             $album_rows[$parent_id]['orig_album_last_image_time'] = $row['album_last_image_time'];
         } else {
             if ($row['album_type']) {
                 $subalbums[$parent_id][$album_id]['display'] = $row['display_on_index'] ? true : false;
                 $subalbums[$parent_id][$album_id]['name'] = $row['album_name'];
                 $subalbums[$parent_id][$album_id]['orig_album_last_image_time'] = $row['album_last_image_time'];
                 $subalbums[$parent_id][$album_id]['children'] = array();
                 if (isset($subalbums[$parent_id][$row['parent_id']]) && !$row['display_on_index']) {
                     $subalbums[$parent_id][$row['parent_id']]['children'][] = $album_id;
                 }
                 $album_rows[$parent_id]['album_images'] += $row['album_images'];
                 $album_rows[$parent_id]['album_images_real'] += $row['album_images_real'];
                 if ($row['album_last_image_time'] > $album_rows[$parent_id]['album_last_image_time']) {
                     $album_rows[$parent_id]['album_last_image_id'] = $row['album_last_image_id'];
                     $album_rows[$parent_id]['album_last_image_name'] = $row['album_last_image_name'];
                     $album_rows[$parent_id]['album_last_image_time'] = $row['album_last_image_time'];
                     $album_rows[$parent_id]['album_last_user_id'] = $row['album_last_user_id'];
                     $album_rows[$parent_id]['album_last_username'] = $row['album_last_username'];
                     $album_rows[$parent_id]['album_last_user_colour'] = $row['album_last_user_colour'];
                     $album_rows[$parent_id]['album_type_last_image'] = $row['album_type'];
                     $album_rows[$parent_id]['album_contest_marked'] = $row['contest_marked'];
                     $album_rows[$parent_id]['album_id_last_image'] = $album_id;
                 }
             }
         }
     }
     $db->sql_freeresult($result);
     // Handle marking albums
     if ($mark_read == 'albums' || $mark_read == 'all') {
         $redirect = build_url('mark', 'hash');
         $token = request_var('hash', '');
         if (check_link_hash($token, 'global')) {
             if ($mark_read == 'all') {
                 phpbb_gallery_misc::markread('all');
                 $message = sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>');
             } else {
                 phpbb_gallery_misc::markread('albums', $album_ids);
                 $message = sprintf($user->lang['RETURN_ALBUM'], '<a href="' . $redirect . '">', '</a>');
             }
             meta_refresh(3, $redirect);
             trigger_error($user->lang['ALBUMS_MARKED'] . '<br /><br />' . $message);
         } else {
             $message = sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>');
             meta_refresh(3, $redirect);
             trigger_error($message);
         }
     }
     // Grab moderators ... if necessary
     if ($display_moderators) {
         if ($return_moderators) {
             $album_ids_moderator[] = $root_data['album_id'];
         }
         self::get_moderators($album_moderators, $album_ids_moderator);
     }
     // Used to tell whatever we have to create a dummy category or not.
     $last_catless = true;
     foreach ($album_rows as $row) {
         // Empty category
         if ($row['parent_id'] == $root_data['album_id'] && $row['album_type'] == self::TYPE_CAT) {
             $template->assign_block_vars('albumrow', array('S_IS_CAT' => true, 'ALBUM_ID' => $row['album_id'], 'ALBUM_NAME' => $row['album_name'], 'ALBUM_DESC' => generate_text_for_display($row['album_desc'], $row['album_desc_uid'], $row['album_desc_bitfield'], $row['album_desc_options']), 'ALBUM_FOLDER_IMG' => '', 'ALBUM_FOLDER_IMG_SRC' => '', 'ALBUM_IMAGE' => $row['album_image'] ? phpbb_gallery_url::path('phpbb') . $row['album_image'] : '', 'U_VIEWALBUM' => phpbb_gallery_url::append_sid('album', 'album_id=' . $row['album_id'])));
             continue;
         }
         $visible_albums++;
         if ($mode == 'personal' && ($visible_albums <= $start || $visible_albums > $start + $limit)) {
             continue;
         }
         $album_id = $row['album_id'];
         $album_unread = isset($album_tracking_info[$album_id]) && $row['orig_album_last_image_time'] > $album_tracking_info[$album_id] && $user->data['user_id'] != ANONYMOUS ? true : false;
         $folder_image = $folder_alt = $l_subalbums = '';
         $subalbums_list = array();
         // Generate list of subalbums if we need to
         if (isset($subalbums[$album_id])) {
             foreach ($subalbums[$album_id] as $subalbum_id => $subalbum_row) {
                 $subalbum_unread = isset($album_tracking_info[$subalbum_id]) && $subalbum_row['orig_album_last_image_time'] > $album_tracking_info[$subalbum_id] && $user->data['user_id'] != ANONYMOUS ? true : false;
                 if (!$subalbum_unread && !empty($subalbum_row['children']) && $user->data['user_id'] != ANONYMOUS) {
                     foreach ($subalbum_row['children'] as $child_id) {
                         if (isset($album_tracking_info[$child_id]) && $subalbums[$album_id][$child_id]['orig_album_last_image_time'] > $album_tracking_info[$child_id]) {
                             // Once we found an unread child album, we can drop out of this loop
                             $subalbum_unread = true;
                             break;
                         }
                     }
                 }
                 if ($subalbum_row['display'] && $subalbum_row['name']) {
                     $subalbums_list[] = array('link' => phpbb_gallery_url::append_sid('album', 'album_id=' . $subalbum_id), 'name' => $subalbum_row['name'], 'unread' => $subalbum_unread);
                 } else {
                     unset($subalbums[$album_id][$subalbum_id]);
                 }
                 if ($subalbum_unread) {
                     $album_unread = true;
                 }
             }
             $l_subalbums = sizeof($subalbums[$album_id]) == 1 ? $user->lang['SUBALBUM'] . ': ' : $user->lang['SUBALBUMS'] . ': ';
             $folder_image = $album_unread ? 'forum_unread_subforum' : 'forum_read_subforum';
         } else {
             $folder_alt = $album_unread ? 'NEW_IMAGES' : 'NO_NEW_IMAGES';
             $folder_image = $album_unread ? 'forum_unread' : 'forum_read';
         }
         if ($row['album_status'] == self::STATUS_LOCKED) {
             $folder_image = $album_unread ? 'forum_unread_locked' : 'forum_read_locked';
             $folder_alt = 'ALBUM_LOCKED';
         }
         // Create last post link information, if appropriate
         if ($row['album_last_image_id']) {
             $lastimage_name = $row['album_last_image_name'];
             $lastimage_time = $user->format_date($row['album_last_image_time']);
             $lastimage_image_id = $row['album_last_image_id'];
             $lastimage_album_id = $row['album_id_last_image'];
             $lastimage_album_type = $row['album_type_last_image'];
             $lastimage_contest_marked = $row['album_contest_marked'];
             $lastimage_uc_fake_thumbnail = phpbb_gallery_image::generate_link('fake_thumbnail', phpbb_gallery_config::get('link_thumbnail'), $lastimage_image_id, $lastimage_name, $lastimage_album_id);
             $lastimage_uc_thumbnail = phpbb_gallery_image::generate_link('thumbnail', phpbb_gallery_config::get('link_thumbnail'), $lastimage_image_id, $lastimage_name, $lastimage_album_id);
             $lastimage_uc_name = phpbb_gallery_image::generate_link('image_name', phpbb_gallery_config::get('link_image_name'), $lastimage_image_id, $lastimage_name, $lastimage_album_id);
             $lastimage_uc_icon = phpbb_gallery_image::generate_link('lastimage_icon', phpbb_gallery_config::get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id);
         } else {
             $lastimage_time = $lastimage_image_id = $lastimage_album_id = $lastimage_album_type = 0;
             $lastimage_name = $lastimage_uc_fake_thumbnail = $lastimage_uc_thumbnail = $lastimage_uc_name = $lastimage_uc_icon = '';
         }
         // Output moderator listing ... if applicable
         $l_moderator = $moderators_list = '';
         if ($display_moderators && !empty($album_moderators[$album_id])) {
             $l_moderator = sizeof($album_moderators[$album_id]) == 1 ? $user->lang['MODERATOR'] : $user->lang['MODERATORS'];
             $moderators_list = implode(', ', $album_moderators[$album_id]);
         }
         $s_subalbums_list = array();
         foreach ($subalbums_list as $subalbum) {
             $s_subalbums_list[] = '<a href="' . $subalbum['link'] . '" class="subforum ' . ($subalbum['unread'] ? 'unread' : 'read') . '" title="' . ($subalbum['unread'] ? $user->lang['NEW_IMAGES'] : $user->lang['NO_NEW_IMAGES']) . '">' . $subalbum['name'] . '</a>';
         }
         $s_subalbums_list = (string) implode(', ', $s_subalbums_list);
         $catless = $row['parent_id'] == $root_data['album_id'] ? true : false;
         $template->assign_block_vars('albumrow', array('S_IS_CAT' => false, 'S_NO_CAT' => $catless && !$last_catless, 'S_LOCKED_ALBUM' => $row['album_status'] == self::STATUS_LOCKED ? true : false, 'S_LIST_SUBALBUMS' => $row['display_subalbum_list'] ? true : false, 'S_SUBALBUMS' => sizeof($subalbums_list) ? true : false, 'ALBUM_ID' => $row['album_id'], 'ALBUM_NAME' => $row['album_name'], 'ALBUM_DESC' => generate_text_for_display($row['album_desc'], $row['album_desc_uid'], $row['album_desc_bitfield'], $row['album_desc_options']), 'IMAGES' => $row['album_images'], 'UNAPPROVED_IMAGES' => phpbb_gallery::$auth->acl_check('m_status', $album_id, $row['album_user_id']) ? $row['album_images_real'] - $row['album_images'] : 0, 'ALBUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt), 'ALBUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'), 'ALBUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '', 'ALBUM_IMAGE' => $row['album_image'] ? phpbb_gallery_url::path('phpbb') . $row['album_image'] : '', 'LAST_IMAGE_TIME' => $lastimage_time, 'LAST_USER_FULL' => $lastimage_album_type == self::TYPE_CONTEST && ($lastimage_contest_marked && !phpbb_gallery::$auth->acl_check('m_status', $album_id, $row['album_user_id'])) ? $user->lang['CONTEST_USERNAME'] : get_username_string('full', $row['album_last_user_id'], $row['album_last_username'], $row['album_last_user_colour']), 'UC_THUMBNAIL' => phpbb_gallery_config::get('mini_thumbnail_disp') ? $lastimage_uc_thumbnail : '', 'UC_FAKE_THUMBNAIL' => phpbb_gallery_config::get('mini_thumbnail_disp') ? $lastimage_uc_fake_thumbnail : '', 'UC_IMAGE_NAME' => $lastimage_uc_name, 'UC_LASTIMAGE_ICON' => $lastimage_uc_icon, 'ALBUM_COLOUR' => get_username_string('colour', $row['album_last_user_id'], $row['album_last_username'], $row['album_last_user_colour']), 'MODERATORS' => $moderators_list, 'SUBALBUMS' => $s_subalbums_list, 'L_SUBALBUM_STR' => $l_subalbums, 'L_ALBUM_FOLDER_ALT' => $folder_alt, 'L_MODERATOR_STR' => $l_moderator, 'U_VIEWALBUM' => phpbb_gallery_url::append_sid('album', 'album_id=' . $row['album_id'])));
         // Assign subforums loop for style authors
         foreach ($subalbums_list as $subalbum) {
             $template->assign_block_vars('albumrow.subalbum', array('U_SUBALBUM' => $subalbum['link'], 'SUBALBUM_NAME' => $subalbum['name'], 'S_UNREAD' => $subalbum['unread']));
         }
         $last_catless = $catless;
     }
     $template->assign_vars(array('U_MARK_ALBUMS' => $user->data['is_registered'] ? phpbb_gallery_url::append_sid('album', 'hash=' . generate_link_hash('global') . '&amp;album_id=' . $root_data['album_id'] . '&amp;mark=albums') : '', 'S_HAS_SUBALBUM' => $visible_albums ? true : false, 'L_SUBFORUM' => $visible_albums == 1 ? $user->lang['SUBALBUM'] : $user->lang['SUBALBUMS'], 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), 'FAKE_THUMB_SIZE' => phpbb_gallery_config::get('mini_thumbnail_size')));
     if ($return_moderators) {
         return array($active_album_ary, $album_moderators);
     }
     return array($active_album_ary, array());
 }
Exemplo n.º 3
0
    }
    // Is it a personal album, and does the user have permissions to create more?
    if ($album_data['album_user_id'] == $user->data['user_id']) {
        if (phpbb_gallery::$auth->acl_check('i_upload', phpbb_gallery_auth::OWN_ALBUM) && !phpbb_gallery::$auth->acl_check('album_unlimited', phpbb_gallery_auth::OWN_ALBUM)) {
            $sql = 'SELECT COUNT(album_id) albums
				FROM ' . GALLERY_ALBUMS_TABLE . '
				WHERE album_user_id = ' . $user->data['user_id'];
            $result = $db->sql_query($sql);
            $albums = (int) $db->sql_fetchfield('albums');
            $db->sql_freeresult($result);
            if ($albums < phpbb_gallery::$auth->acl_check('album_count', phpbb_gallery_auth::OWN_ALBUM)) {
                $allowed_create = true;
            }
        } elseif (phpbb_gallery::$auth->acl_check('album_unlimited', phpbb_gallery_auth::OWN_ALBUM)) {
            $allowed_create = true;
        }
    }
}
// End of "We have album_type so that there may be images ..."
// Page is ready loaded, mark album as "read"
phpbb_gallery_misc::markread('album', $album_id);
$template->assign_vars(array('S_IN_ALBUM' => true, 'S_IS_POSTABLE' => $album_data['album_type'] != phpbb_gallery_album::TYPE_CAT ? true : false, 'S_IS_LOCKED' => $album_data['album_status'] == phpbb_gallery_album::STATUS_LOCKED ? true : false, 'UPLOAD_IMG' => $album_data['album_status'] == phpbb_gallery_album::STATUS_LOCKED ? $user->img('button_topic_locked', 'ALBUM_LOCKED') : $user->img('button_upload_image', 'UPLOAD_IMAGE'), 'S_MODE' => $album_data['album_type'], 'L_MODERATORS' => $l_moderator, 'MODERATORS' => $moderators_list, 'U_UPLOAD_IMAGE' => (!$album_data['album_user_id'] || $album_data['album_user_id'] == $user->data['user_id']) && ($user->data['user_id'] == ANONYMOUS || phpbb_gallery::$auth->acl_check('i_upload', $album_id, $album_data['album_user_id'])) ? phpbb_gallery_url::append_sid('posting', "mode=image&amp;submode=upload&amp;album_id={$album_id}") : '', 'U_CREATE_ALBUM' => $album_data['album_user_id'] == $user->data['user_id'] && $allowed_create ? phpbb_gallery_url::append_sid('phpbb', 'ucp', "i=gallery&amp;mode=manage_albums&amp;action=create&amp;parent_id={$album_id}&amp;redirect=album") : '', 'U_EDIT_ALBUM' => $album_data['album_user_id'] == $user->data['user_id'] ? phpbb_gallery_url::append_sid('phpbb', 'ucp', "i=gallery&amp;mode=manage_albums&amp;action=edit&amp;album_id={$album_id}&amp;redirect=album") : '', 'U_SLIDE_SHOW' => sizeof(phpbb_gallery_plugins::$plugins) && phpbb_gallery_plugins::$slideshow ? phpbb_gallery_url::append_sid('album', "album_id={$album_id}&amp;mode=slide_show" . ($sort_key != phpbb_gallery_config::get('default_sort_key') ? "&amp;sk={$sort_key}" : '') . ($sort_dir != phpbb_gallery_config::get('default_sort_dir') ? "&amp;sd={$sort_dir}" : '')) : '', 'S_DISPLAY_SEARCHBOX' => $auth->acl_get('u_search') && $config['load_search'] ? true : false, 'S_SEARCHBOX_ACTION' => phpbb_gallery_url::append_sid('search', 'aid[]=' . $album_id), 'S_THUMBNAIL_SIZE' => phpbb_gallery_config::get('thumbnail_height') + 20 + (phpbb_gallery_config::get('thumbnail_infoline') ? phpbb_gallery_constants::THUMBNAIL_INFO_HEIGHT : 0), 'S_COLS' => phpbb_gallery_config::get('album_columns'), 'S_COL_WIDTH' => 100 / phpbb_gallery_config::get('album_columns') . '%', 'S_JUMPBOX_ACTION' => phpbb_gallery_url::append_sid('album'), 'S_ALBUM_ACTION' => phpbb_gallery_url::append_sid('album', "album_id={$album_id}"), 'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_KEY' => $s_sort_key, 'ALBUM_JUMPBOX' => phpbb_gallery_album::get_albumbox(false, '', $album_id), 'U_RETURN_LINK' => phpbb_gallery_url::append_sid('index'), 'S_RETURN_LINK' => $user->lang['GALLERY'], 'PAGINATION' => generate_pagination(phpbb_gallery_url::append_sid('album', "album_id={$album_id}&amp;sk={$sort_key}&amp;sd={$sort_dir}&amp;st={$sort_days}"), $image_counter, $images_per_page, $start), 'TOTAL_IMAGES' => $image_counter == 1 ? $user->lang['IMAGE_#'] : sprintf($user->lang['IMAGES_#'], $image_counter), 'PAGE_NUMBER' => on_page($image_counter, $images_per_page, $start), 'L_WATCH_TOPIC' => $album_data['watch_id'] ? $user->lang['UNWATCH_ALBUM'] : $user->lang['WATCH_ALBUM'], 'U_WATCH_TOPIC' => $album_data['album_type'] != phpbb_gallery_album::TYPE_CAT && $user->data['user_id'] != ANONYMOUS ? phpbb_gallery_url::append_sid('posting', "mode=album&amp;submode=" . ($album_data['watch_id'] ? 'unwatch' : 'watch') . "&amp;album_id={$album_id}") : '', 'S_WATCHING_TOPIC' => $album_data['watch_id'] ? true : false));
if (version_compare($config['version'], '3.0.5', '>')) {
    page_header($user->lang['VIEW_ALBUM'] . ' - ' . $album_data['album_name'], true, $album_id, 'album');
} else {
    // Backwards compatible
    cheat_phpbb_31975();
    page_header($user->lang['VIEW_ALBUM'] . ' - ' . $album_data['album_name']);
}
$template->set_filenames(array('body' => 'gallery/album_body.html'));
page_footer();