Log in or register to post comments
Last post
Various image dimensions
Hey there,
I'm using CKFinder as a pop up on my site. The thing is, that I'm uploading 2 images - logo and photo - with two different pop ups. I need to set maximum allowed dimensions of these images, which is not that hard, right?

$config['Images'] = Array(
      'maxWidth' => 1600,
      'maxHeight' => 1200,
      'quality' => 80);


Well, the problem is, that I want maximum dimensions of logo and photo to vary. For example, I want to set maxWidth of logo to 500px and maxWidth of photo to 1000px. Is there a way to do it?

Thanks in advance for all your answers :)
Re: Various image dimensions
Are both images uploaded in two different instances of CKFinder?
If yes, you can achieve it by assigning an Id to a CKFinder instance (viewtopic.php?t=20914).
Based on the $_GET['id'] you can later change configuration options dynamically in config.php

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

Re: Various image dimensions
Thank you for your answer, wiktor.
And yes, there are two different instances. Your solution would definitely solve my problem... but...
What I need to do is two different popups just like the popups in _samples directory. There's no problem with that using Javascript. But how can I do these popups with each one having different configuration?

Thanks for your answer
Re: Various image dimensions
Can anyone help me with this?
Re: Various image dimensions
Ok, so le't explain this using the popups sample.

Open popups.html inside of some text editor.

Find:
function BrowseServer( startupPath, functionData )
{
   // You can use the "CKFinder" class to render CKFinder in a page:
   var finder = new CKFinder();

and change it into:

function BrowseServer( startupPath, functionData, id )
{
   // You can use the "CKFinder" class to render CKFinder in a page:
   var finder = new CKFinder();
   
   finder.id = id;


Now find the buttons:
<input type="button" value="Browse Server" onclick="BrowseServer( 'Files:/', 'xFilePath' );" />
<input type="button" value="Browse Server" onclick="BrowseServer( 'Images:/', 'xImagePath' );" />


and add there the "id" parameters to the BrowseServer function:

<input type="button" value="Browse Server" onclick="BrowseServer( 'Files:/', 'xFilePath', 'id1' );" /      <input type="button" value="Browse Server" onclick="BrowseServer( 'Images:/', 'xImagePath', 'id2' );" />


Now you can chek in Firebug in the Ajax console, that CKFinder is now passing the "id" to the connector:
http://localhost/ckfinder/core/connector/php/connector.php?command=Init&id=id1

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

Re: Various image dimensions
well... now i feel like a dummy :D
anyway, thank you very much, you helped a lot, wiktor :)
Re: Various image dimensions
I have been struggling with this same issue for a while now.