![]() |
fckeditor with codeigniter - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: fckeditor with codeigniter (/showthread.php?tid=22146) |
fckeditor with codeigniter - El Forum - 08-30-2009 [eluser]crwtrue[/eluser] I used these instruction to include fckeditor with my codeigniter application: http://ellislab.com/forums/viewthread/107642/ I changed the toolbarset to default and changed in the filemanager config: $Config['Enabled'] = true ; $Config['UserFilesPath'] = '/home/example/images' ; To enable user to upload a picture but could these be done in the ci application controller? Second question is that i save the users "webpage" in text-field in mysql table. What i sould do to the user input to make it safe(example.mysql injection) for the database? fckeditor with codeigniter - El Forum - 08-31-2009 [eluser]umefarooq[/eluser] Answer for your second question just enable global_xss_filtering TRUE in config.php file fckeditor with codeigniter - El Forum - 08-31-2009 [eluser]LuckyFella73[/eluser] [quote author="crwtrue" date="1251712459"] ... To enable user to upload a picture but could these be done in the ci application controller? [/quote] You can use the file uploading class provided by codeigniter. Have a look at the http://ellislab.com/codeigniter/user-guide/libraries/file_uploading.html Quote:Second question is that i save the users "webpage" in text-field in mysql table.Additionally to xss filtering use the active record class, then all data saved into the database is escaped automaticly. fckeditor with codeigniter - El Forum - 08-31-2009 [eluser]crwtrue[/eluser] Quote:You can use the file uploading class provided by codeigniter. How can i do this? Sould i change the FileUpload-function call in the fckeditor/editor/filemanager/connectors/php/upload.php to ci's $this->upload->do_upload? but can i even use upload-class in those fckeditor-scripts? fckeditor with codeigniter - El Forum - 08-31-2009 [eluser]LuckyFella73[/eluser] What I meant was you can disable the file upload module from fck editor (or better: just enable the textarea replacement) and send the form as usual to your controler/method where the form validation and fileupload runs. That is at least the way I do it. I never tried the supplied file upload functions comming with this rte tools - it's just that I like to know what happens uploading a file and I'm not familiar with these libraries in detail. fckeditor with codeigniter - El Forum - 08-31-2009 [eluser]crwtrue[/eluser] Quote:just enable the textarea replacement What that means? and how i do it? About the fileupload i can change the form to an multipart() and add input file field but then using the fckeditor aint the same cause the picture is allways in the same place. Could i make fckeditor to use codeigniter upload-class? Also when i used fckeditor upload it allways changed file permissions for the uploaded image. In the fckeditor filemanager config there was properties to change those uploaded file permisions but they only worked with apache not IIS. Also in fckeditor filemanager config there are the options: $Config['UserFilesPath'] = '/userfiles/' ; <- i changed this to upload images folder $Config['UserFilesAbsolutePath'] = '' ; <- sould i change this to somethink? I am asking cause when i click the browse server button in fckeditor add image option fckeditor creates a folder and maybe that is causing those file permissions? fckeditor with codeigniter - El Forum - 09-01-2009 [eluser]LuckyFella73[/eluser] hi crwtrue, like posted before I have no experience with uploading file via fckeditor. In a project I did a while ago I had this js in my header: Code: [removed][removed] The effect is that all form elements type textarea become a rich-text-editor. Thats all I needed that time. "mkb_slim" is a manually defined toolbarset I defined. You could take a standard toolbarset privided with the donwnload package. Additionally I had an input field type "file" and sent the form to my controller using the CI fileupload class. I don't know if you can modify fck editor to use the CI upload class but even if you want to do that there is no reason to modify because you can just use the CI upload class. Or did I misunderstand you? Have a look at the fck docs - here is a link how to set up fck editor 2.x: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Integration/JavaScript |