Exemplo n.º 1
0
$mode = request_var('mode', '');
switch ($mode) {
    case 'medium':
        $filesize_var = 'filesize_medium';
        $image_source_path = phpbb_gallery_url::path('medium');
        $possible_watermark = true;
        break;
    case 'thumbnail':
        $filesize_var = 'filesize_cache';
        $image_source_path = phpbb_gallery_url::path('thumbnail');
        $possible_watermark = false;
        break;
    default:
        $filesize_var = 'filesize_upload';
        if (!class_exists('phpbb_gallery_hookup')) {
            phpbb_gallery_url::_include_core('hookup');
        }
        if (!phpbb_gallery_hookup::view_image($user->data['user_id'])) {
            // Cash-MOD HookUp failed and denies to view the image
            //trigger_error('NOT_AUTHORISED');
            $image_error = 'not_authorised.jpg';
        }
        $image_source_path = phpbb_gallery_url::path('upload');
        $possible_watermark = true;
        // Increase the view count only for full images, if not already counted
        $view = request_var('view', '');
        if (!$user->data['is_bot'] && !$image_error && $view != 'no_count') {
            $sql = 'UPDATE ' . GALLERY_IMAGES_TABLE . '
				SET image_view_count = image_view_count + 1
				WHERE image_id = ' . $image_id;
            $db->sql_query($sql);