Let get this simple, I plan to build a web app that will let the users (there's a dozen of them) upload images to the system. Every upload would be registered to the DB, including the image path and the user id.
What I want, is when I click the little image icon on the editor to add an image to my text (assuming that the user already uploaded his file), instead of having ( Browse the server ) has button have a drop-down list with the images belonging to the current logged user OR keep the Browse the server button and only show the user files, is that possible?
In the same time, is it possible to modify the upload tab to register the new image upload with his path and the sender id? I mean, does CKFinder really list the directories or retrieve his informations from a DB?
At least, if all of this doesn't work, is there an alternative to add images to the editor like I want?
What I want, is when I click the little image icon on the editor to add an image to my text (assuming that the user already uploaded his file), instead of having ( Browse the server ) has button have a drop-down list with the images belonging to the current logged user OR keep the Browse the server button and only show the user files, is that possible?
In the same time, is it possible to modify the upload tab to register the new image upload with his path and the sender id? I mean, does CKFinder really list the directories or retrieve his informations from a DB?
At least, if all of this doesn't work, is there an alternative to add images to the editor like I want?
Re: Can I modify CKFinder to show only images uploaded by the us
At this moment, the only way to customize the Link/Image dialog box in FCKeditor is to change html files used by FCKeditor:
- editor/dialog/fck_image.html
- editor/dialog/fck_link.html.
To link each file with the user using some kind fo a database, you would have to alter the code of server connector in CKFinder. For example if you're working on PHP5, take a look into the following directory: core/connector/php/php5
In CommandHandler/FileUpload.php you can inject your code that will be executed when file is uploaded (use sesion variables to get the user id).
Much more simple approach would be to tell CKFinder to use different directories for each user (by setting baseUrl/baseDir variables dynamically depending on a session variable for example). This way all you would have to do is to adjust the dialog files used by FCKeditor.
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: Can I modify CKFinder to show only images uploaded by the us
ex.
user1 = /public_html/users/user1/
user2 = /public_html/users/user2/
user3 = /public_html/users/user3/
etc.
???
Can CKFinder compute the remaining space availaible too?
ex.: limit for all of them = 10 mo
user1 = 10 Mo remaining in /public_html/users/user1/
user2 = 7.2 Mo remaining in /public_html/users/user2/
user1 = 0.5 Mo remaining in /public_html/users/user3/
I mean, each user would have the same quota (10 Mo) and when they reaches that limit, upload fails with ERROR MSG printing out on the page. That size computing would compute all what the user folder contains (pdf, exe, doc, zip, images, flash, etc.), after reaching the limit, no more uploads.
And if it works, what happens? if a user only has 1 Mo remaining and tries to upload a 2 Mo file, what happens?
Do I have to change a lot of files to make CKFinder works like this? That would be really ... really great !!!
Thanks for the replies if any.
Re: Can I modify CKFinder to show only images uploaded by the us
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: Can I modify CKFinder to show only images uploaded by the us
I don't know what you mean ... CKFinder will create folders automatically based on what? baseurl/basedir variables?? Where I specifiy those, in a config file? If yes, how can this be dynamic? When, let's say, I create a user via an admin section (exp.: homer), I want a folder to be created in /public_html/users/homer/ where user 'homer' will dump his files. He won't have access to anywhere else, just /homer.
What if the folder already exists?
For the limit quota, I'm in PHP, is it possible too?
If found this code that seems to work (I tried it), but could this be easily implemented in CKFinder?
Thanks
Re: Can I modify CKFinder to show only images uploaded by the us
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+