Hi
I want to be able to set the directory that the images get saved dynamically from the query string.
In the file fckconfig.js you can set the Save path
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php&ServerPath=/some/directory/" ;
these variables communicate with the javascript in the files FCKeditor/editor/filemanager/browser/default/frmupload.html however I don't know what scripts actually check the fckconfig.js file.
So what I want to do is when the fckeditor is loaded a variable in the query string will be used to set the folder for the images to be saved in any ideas even little ones are appreciated?
Thanks
Many thanks for any help.
Correy
I want to be able to set the directory that the images get saved dynamically from the query string.
In the file fckconfig.js you can set the Save path
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php&ServerPath=/some/directory/" ;
these variables communicate with the javascript in the files FCKeditor/editor/filemanager/browser/default/frmupload.html however I don't know what scripts actually check the fckconfig.js file.
So what I want to do is when the fckeditor is loaded a variable in the query string will be used to set the folder for the images to be saved in any ideas even little ones are appreciated?
Thanks
Many thanks for any help.
Correy
RE: Setting the image folder dynamically
I don't know how to convert this initialise command on asp:
oFCKeditor->Config['ImageBrowserURL'] = $oFCKeditor->BasePath . 'editor/' . "filemanager/browser/default/browser.html?Connector!connectors/php/connector.php_Type!Image_ServerPath!/images/id/{$_GET['id']}/" ;
RE: Setting the image folder dynamically
try
urlencode() on PHP
$oFCKeditor->Config['LinkBrowserURL'] = urlencode(YOU_URL);
and on javascript - unescape
fck_link.js
function BrowseServer()
{
...
var oWindow = window.open( unescape(oEditor.FCKConfig.LinkBrowserURL), "FCKBrowseWindow", sOptions );
}
Then it all worked fine
RE: Setting the image folder dynamically
Step 1: After this line
$oFCKeditor = new FCKeditor('FCKeditor1') ;
I added this line
$oFCKeditor->Config['ImageBrowserURL'] = $oFCKeditor->BasePath . 'editor/' . "filemanager/browser/default/browser.html?Connector!connectors/php/connector.php_Type!Image_ServerPath!/images/id/{$_GET['id']}/" ;
Notice the use of $_GET['id'] therefore every user gets their own directory. You may be wondering where the "=" sign is and the "&" signs are in the query string. Well the answer is whenever I used these characters they caused the script not to include them as well as every proceeding character. If anyone knows why please tell?
So then I had to fix up the dhtml in the file FCKeditor/editor/filemanager/browser/default/browser.html
and I modified the GetUrlParam function to look like this.
function GetUrlParam( paramName )
{
var oRegex = new RegExp( '[\?_]' + paramName + '!([^_]+)', 'i' ) ;
var oMatch = oRegex.exec( window.top.location.search ) ;
if ( oMatch && oMatch.length > 1 )
return oMatch[1] ;
else
return '' ;
}
Then it all worked fine and dandy.
RE: Setting the image folder dynamically
Can anyone give me a good example how to set the image path, cause I'm lost here.... the workaround for the & character isn't something I want to do.
I would like two things with the php connector:
1. point the filebrowser to a custom location, with the possibility to add custom vars to the end
2. Keep fck from adding the Image directory ('what's the use of that?)
Can anyone help me out?
Thanx in advance
Can anyone help me out?
RE: Setting the image folder dynamically
Dear hooky,
Assumed you use PHP, you have to do things:
In the root of the fck-editor system open fckconfig.js and comment these lines 99 and 116 (asp...) and uncomment lines 102 and 118 (php...)
In the root of your website make directory "UserFiles" and change mod to 777,
inside this dir you make subdirectory "Images" and change mod to 777 (all rights).
Note:
/editor/filemanager/browser/default/connectors/php/connector.php , on line 37 you can change the path
Kind Regards,
Jeroen Haan
http://www.haan.net
RE: Setting the image folder dynamically
RE: Setting the image folder dynamically
Set oFCKeditor = New FCKeditor
with oFCKeditor
.Config("LinkBrowserURL") = sBasePath & "filemanager/browser/default/browser.html?Connector=connectors/asp/connector.asp&ServerPath=/CustomFiles/"
If anyone has a functional ASP example I'd like to see it.
RE: Setting the image folder dynamically
I edited fckconfig.js as:
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/asp/connector.asp&ServerPath=/userfiles/image/1/' ;
And the filemanager still starts in the default directory.
Sure would be nice to simply have a server side property like:
FCKEditor.imagepath=""
Guess that'll be next version.
My plan was to use my server side code to set up a client side var before fckEditor loads.
e.g. <script>var userImagePath = '<%=user%>'</script>
And then modify fckconfig.js as:
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/asp/connector.asp&ServerPath=/userfiles/image/'+ userImagePath +'/' ;
That seemed reasonable to me but it didn't work. So then I hard coded the value in the first example and it still wouldn't start in a different directory. So far the only way it has worked for me was when I hardcoded a different value in "browser.html" way down in the sub-dirs.
If anyone has a working ASP example of dynamically changing the image path I would very much like to see it.
Thanks
I'm an idiot
What was I doing with the "LinkBrowserURL" ??
How about:
oFCKeditor.Config("ImageBrowserURL") = sBasePath & "editor/filemanager/browser/default/browser.html?Connector=connectors/asp/connector.asp&ServerPath=/userfiles/image/" & vUserFolder & "/"
Yup, that works fine. I should point out that in the fckconfig.js the imageBrowserURL starts at "filemanager/" whereas setting it server side from the page hosting the editor it needed to start at "editor/" Of course it would depend on the location of your ASP with the control.
This works well for me, maybe it will help the other asp users.
how to enable the image browser
hi ,
i want to enable image browser in ck editor and aslo wanto set a path for image stoing can anyone help me?