Log in or register to post comments
Last post
can 2 different thumbnail settings be set in 1 config file?
ok,

I have 2 folders which have the acl's applied properly, currently i've disabled the thumbnail viewer because the thumbnails are being created.

I want our users to view the thumbs, but need to have 2 configs set (1 for each folder)

folder 1 is the users folder which I want the thumbs to be created as normal, but folder 2 is a shared folder and I do not want thumbs being created because many users access this.

can this be achieved?
Re: can 2 different thumbnail settings be set in 1 config fi
Is there a chance that the folders that you mentioned are resource types?
If yes, then in the configuration file check for $_GET['type'] and apply different thumbnails settings depending on resource type.

The thing that I do not understand is what should happen with the "Shared" resource type? Should files be displayed in the "List" view instead of the Thumbnails" view?

Wiktor Walc
CTO
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+

Re: can 2 different thumbnail settings be set in 1 config fi
Is there a chance that the folders that you mentioned are resource types?


yes, both folders are resource types, if I use $_GET['type'] then should i just perform a check on the type name (shared) as an example and apply a different set of thumbnail settings?

The way I want to configure the thumbs settings for the shared folder is to have it use direct access, because the resource type actually points to the thumbs folder we create automatically. then to load the image we remove "thumbs" from the path so the full sized images get loaded.

i'll have a play and see if i can detect the type and set the direct param.

many thanks for your idea Wiktor. I think get it now.
Re: can 2 different thumbnail settings be set in 1 config fi
hi,

i added a check for $_GET['type'] as below in config.php:

$test=$_GET['type'];
if($test=="Custom Canvases"){
   $config['Thumbnails'] = Array(
         'url' => $baseUrl.$_SESSION['boardid'].'/canvas/thumbs',
         'directory' => $baseDir.$_SESSION['boardid'].'/canvas/thumbs',
         'enabled' => true,
         'directAccess' => false,
         'maxWidth' => 100,
         'maxHeight' => 100,
         'bmpSupported' => false,
         'quality' => 60);
} else {
   $config['Thumbnails'] = Array(
         'url' => $baseUrl.$_SESSION['boardid'].'/canvas/thumbs',
         'directory' => $baseDir.$_SESSION['boardid'].'/canvas/thumbs',
         'enabled' => true,
         'directAccess' => true,
         'maxWidth' => 100,
         'maxHeight' => 100,
         'bmpSupported' => false,
         'quality' => 30);
}


and my resource types are:
$config['ResourceType']['shared'] = Array(
         'name' => $config['pack'].' Canvases',
         'url' => $baseUrl.'canvases/'.$config['pack'].'/thumbs',
         'directory' => $baseDir.'canvases/'.$config['pack'].'/thumbs',
         'allowedExtensions' => 'jpeg,jpg',
);

$config['ResourceType']['markers'] = Array(
         'name' => 'Custom Markers',            // Single quotes not allowed
         'url' => $baseUrl.$config['boardid'].'/backgrounds/icons',
         'directory' => $baseDir.$config['boardid'].'/backgrounds/icons',
         'maxSize' => "100K",
         'allowedExtensions' => 'png',
      );

$config['ResourceType']['canvas'] = Array(
         'name' => 'Custom Canvases',            // Single quotes not allowed
         'url' => $baseUrl.$config['boardid'].'/canvas',
         'directory' => $baseDir.$config['boardid'].'/canvas',
         'maxSize' => "300K",
         'allowedExtensions' => 'jpg, jpeg',
      );


For some reason, thumbs for all folders are being created automatically.

I was under the impression that directaccess means view the thumbnail direct?

any ideas?
Re: can 2 different thumbnail settings be set in 1 config fi
THis is now resolved, basically i recreated the config based on the folder selected.