Hi all,
I remember someone creating a hack for this use in an old version of the fckeditor, and still have the code (fck_filarkiv.js), but I'm looking for a tidy way to implement a seperate file upload for my cms using the fckeditor's default file/image browser.
Can someone help me please?
To clarify, I want a text field, and a 'browse' button that when clicks opens the file/image browser popup. When one has been chosen, the popup closes and the text field populates with the (relative) path of the file/image.
The popup browser must work on the default FCKConfig values.
Cheers in advance.
P.s. I have a good grounding in DOM Scripting but need some direction rather than sifting through all the source files.
I remember someone creating a hack for this use in an old version of the fckeditor, and still have the code (fck_filarkiv.js), but I'm looking for a tidy way to implement a seperate file upload for my cms using the fckeditor's default file/image browser.
Can someone help me please?
To clarify, I want a text field, and a 'browse' button that when clicks opens the file/image browser popup. When one has been chosen, the popup closes and the text field populates with the (relative) path of the file/image.
The popup browser must work on the default FCKConfig values.
Cheers in advance.
P.s. I have a good grounding in DOM Scripting but need some direction rather than sifting through all the source files.

RE: 2.1.1 Standalone File/Image Browser
A plain file upload/insert command.
No files managing. (Something that can be done in the admin side, evenctually).
Have a nice day.
ContiW
RE: 2.1.1 Standalone File/Image Browser
RE: 2.1.1 Standalone File/Image Browser
var fieldname = "menupic";
function SetUrl( url )
{
document.getElementById('' + fieldname).value = url.replace("/" , "../") ;
}
</script>
<input type="text" name="menupic" size="45"> <img src="images/gif.gif" alt="Add picture" onclick="fieldname='menupic';window.open('fckeditor/editor/filemanager/browser/mcpuk/browser.html?Type=Image&Connector=connectors/php/connector.php', '_fileupload', 'HEIGHT=700,resizable=yes,scrollbars=yes,WIDTH=800,screenX=5,top=20,screenY=20,left=5');return false;">
That worked for me.
With fieldname="X" you can define the input field which you are currently using (one ore more).
Fckeditor must be loaded and initialized of course.
Cheers, Oliver
RE: 2.1.1 Standalone File/Image Browser
Cheers for the feedback, unfortunately it's not quite what I'm after.
I want to use the default FCKConfig settings.
I also want to be able to use this feature independently of the wysiwyg, that is to say that I don't want to have to draw out a wysiwyg field, I don't mind initialising one if that's possible (without drawing it)
How could I initialise it if this is the case? If it's possible, it will solve my problem with using the default config file.
Cheers
RE: 2.1.1 Standalone File/Image Browser
<html> <head> <title>FCK Standalone File Upload</title> <script type="text/javascript" src="FCKeditor/editor/js/fck_startup.js"></script> <script type="text/javascript" src="FCKeditor/fckconfig.js"></script> <script type="text/javascript"> function browserURL(s){ var directories = s.split('/'); var newPath = ''; // Rebuild the basepath for(var dir=0;dir<directories.length;dir++){ newPath += directories[dir]+'/'; if(dir==1){ newPath += 'FCKeditor/editor/'; } } // Take the last slash off if(newPath.lastIndexOf('/')==((newPath.length)-1)){ newPath = newPath.substring(0,((newPath.length)-1)); } // Reset the browser url return newPath; } FCKConfig.ImageBrowserURL = browserURL(FCKConfig.ImageBrowserURL); FCKConfig.LinkBrowserURL = browserURL(FCKConfig.LinkBrowserURL); // Set the target field var target = 'file'; // Return the file path function SetUrl(fileUrl){ var field = document.getElementById(target); field.value = fileUrl; } // Browse the server files function browse(image,field){ // Update the target field target = field; // Image browser if(image){ window.open(FCKConfig.ImageBrowserURL,'serverBrowse','width='+FCKConfig.ImageBrowserWindowWidth+',height='+FCKConfig.ImageBrowserWindowHeight+',location=0,menubar=0,directories=0,toolbar=0,status=0,resizable=0,scrollbars=0,modal=1'); } // File browser else{ window.open(FCKConfig.LinkBrowserURL,'serverBrowse','width='+FCKConfig.LinkBrowserWindowWidth+',height='+FCKConfig.LinkBrowserWindowHeight+',location=0,menubar=0,directories=0,toolbar=0,status=0,resizable=0,scrollbars=0,modal=1'); } } </script> </head> <body> <form method="post" action="/javascript - dom/fck-upload.php"> <div> File:<br/> <input type="text" id="file" name="file" size="40" readonly="readonly" /><input type="button" value="Browse" onclick="browse(0,'file');" /><br /> Image:<br /> <input type="text" id="image" name="file" size="40" readonly="readonly" /><input type="button" value="Browse" onclick="browse(1,'image');" /> </div> </form> </body> </html>RE: 2.1.1 Standalone File/Image Browser
good to know...
I use the input fields on the same page as the editor, but i need it on another page i knownow how to.
Oliver