コード例 #1
0
}
/**
* Check the permissions and approval
*/
if (!phpbb_gallery::$auth->acl_check('i_view', $album_id, $album_data['album_user_id'])) {
    if (!$user->data['is_registered']) {
        login_box(phpbb_gallery_url::append_sid('relative', 'image_page', "album_id={$album_id}&image_id={$image_id}"), $user->lang['LOGIN_INFO']);
    } else {
        trigger_error('NOT_AUTHORISED');
    }
}
if (!phpbb_gallery::$auth->acl_check('m_status', $album_id, $album_data['album_user_id']) && $image_data['image_status'] == phpbb_gallery_image::STATUS_UNAPPROVED) {
    trigger_error('NOT_AUTHORISED');
}
// Build the navigation
phpbb_gallery_album::generate_nav($album_data);
// Salting the form...yumyum ...
add_form_key('gallery');
/**
* Main work here...
*/
// Increase the counter, as we load the image with increment-blocker from this site it's no problem.
// We also copy some parts from topic_views here
if (isset($user->data['session_page']) && !$user->data['is_bot'] && (strpos($user->data['session_page'], '&image_id=' . $image_id) === false || isset($user->data['session_created']))) {
    $sql = 'UPDATE ' . GALLERY_IMAGES_TABLE . ' 
		SET image_view_count = image_view_count + 1
		WHERE image_id = ' . $image_id;
    $db->sql_query($sql);
}
$image_approval_sql = ' AND image_status <> ' . phpbb_gallery_image::STATUS_UNAPPROVED;
if (phpbb_gallery::$auth->acl_check('m_status', $album_id, $album_data['album_user_id'])) {