angelkelly Posted March 12, 2007 Share Posted March 12, 2007 Hey guys, I've set up a website in oscommerce and am trying to add a fckeditor on the descriptions page. I've downloaded the contribution, loaded it in and fixed a few bugs and error messages along the way, but now I'm really stuck with one particular bit of code - I've tried everything I can think of and now I'm completely at a loss -can anyone help? This is what I'm getting on my screen where the description box should be: Fatal error: Cannot instantiate non-existent class: fckeditor in /home/sites/www.mysitesname.co... on line 259 and this is the bit of code it is referring to: //// // Output a form textarea field w/fckeditor function tep_draw_fckeditor($name, $width, $height, $text) { $oFCKeditor = new fckeditor($name); $oFCKeditor -> Width = $width; $oFCKeditor -> Height = $height; $oFCKeditor -> BasePath = /fckeditor' ; $oFCKeditor -> Value = $text; $field = $oFCKeditor->Create($name); return $field; } anyone got any ideas? Any help much appreciated! I've been at this for the last 6 hours straight and just cant seem to figure it out. Kelly Quote Link to comment https://forums.phpfreaks.com/topic/42403-i-feel-so-silly-for-asking-this-but-i-need-a-little-php-help/ Share on other sites More sharing options...
SammyGunnz Posted March 12, 2007 Share Posted March 12, 2007 Where is the fckeditor class located? It basically isn't finding it in the file where that function is. So if it is in an external file, you'll need to include it to instantiate the class. Quote Link to comment https://forums.phpfreaks.com/topic/42403-i-feel-so-silly-for-asking-this-but-i-need-a-little-php-help/#findComment-205690 Share on other sites More sharing options...
angelkelly Posted March 12, 2007 Author Share Posted March 12, 2007 Thanks for the speedy reply! I located the fckeditor in the root file - but i have no idea what the fckeditor class is - I have a folder called classes and another called command classes. But not a file called fckeditor classes... Quote Link to comment https://forums.phpfreaks.com/topic/42403-i-feel-so-silly-for-asking-this-but-i-need-a-little-php-help/#findComment-205692 Share on other sites More sharing options...
bwochinski Posted March 12, 2007 Share Posted March 12, 2007 You need to be sure the file which defines the class (search on "class fckeditor") is included in this file, before the class instantiation. Quote Link to comment https://forums.phpfreaks.com/topic/42403-i-feel-so-silly-for-asking-this-but-i-need-a-little-php-help/#findComment-205708 Share on other sites More sharing options...
angelkelly Posted March 14, 2007 Author Share Posted March 14, 2007 I have tried everything i can think of, messed around with all the codes I think are the problem, and still no joy! Can anyone out there help? I've spent nearly 30 of the last 48 hrs trying to fix this and I'm literally at the point where I am about to give up and just live with a rubbish website - if I can now undo what I've already put in and get my description field back... I am a newbie and a technophobe to boot so the fact i even got as far as i have is a real achievement for me and I dont want to have to start again just coz some lousy piece of code wasnt put into a contribution correctly. Please, please help, I would be so incredibly grateful! Kelly x Quote Link to comment https://forums.phpfreaks.com/topic/42403-i-feel-so-silly-for-asking-this-but-i-need-a-little-php-help/#findComment-207291 Share on other sites More sharing options...
per1os Posted March 14, 2007 Share Posted March 14, 2007 http://tinymce.moxiecode.com/ I would try that out, a great WYSIWYG editor. --FrosT Quote Link to comment https://forums.phpfreaks.com/topic/42403-i-feel-so-silly-for-asking-this-but-i-need-a-little-php-help/#findComment-207298 Share on other sites More sharing options...
angelkelly Posted March 14, 2007 Author Share Posted March 14, 2007 thanks frost I tried it and 2 others - but the fckeditor is the closest I've got to actually making one work If all else fails I'll re-instate my backup and try it again, thanks for the advice! Much appreciated, Kel x Quote Link to comment https://forums.phpfreaks.com/topic/42403-i-feel-so-silly-for-asking-this-but-i-need-a-little-php-help/#findComment-207313 Share on other sites More sharing options...
per1os Posted March 14, 2007 Share Posted March 14, 2007 Yea, I had the same issues you did too till I found a script that properly used it and hi-jacked it. For that TinyMCE this is the code I used to get it working <script language="javascript" type="text/javascript" src="wysiwyg/jscripts/tiny_mce/tiny_mce.js"></script><script language="javascript" type="text/javascript">tinyMCE.init({ mode : "textareas", theme : "advanced", plugins : "save,emotions,preview,searchreplace", theme_advanced_buttons2_add : "preview,forecolor,backcolor,search,replace,emotions", theme_advanced_toolbar_location : "bottom", theme_advanced_toolbar_align : "center"});</script> Accordingly the code must be where the src points to. EDIT: Looking at the code maybe try this: // Output a form textarea field w/fckeditor function tep_draw_fckeditor($name, $width, $height, $text) { include_once('fckeditor.class.php'); // name of class $oFCKeditor = new fckeditor($name); $oFCKeditor->Width = $width; $oFCKeditor->Height = $height; $oFCKeditor->BasePath = '/fckeditor' ; $oFCKeditor->Value = $text; $field = $oFCKeditor->Create($name); return $field; } I am not sure if that will make a difference, but yea at least this way you know the file is included at least once. --FrosT Quote Link to comment https://forums.phpfreaks.com/topic/42403-i-feel-so-silly-for-asking-this-but-i-need-a-little-php-help/#findComment-207324 Share on other sites More sharing options...
angelkelly Posted March 14, 2007 Author Share Posted March 14, 2007 you must be a genius or something - you modded that yourself? Wow - totally impressed! We'll... if I cant find an answer by the end of the night for my problem then I'll try the tiny MCE again and borrow that lovely bit of code you provided - lol Thanks Frost - your a star! Just saw your edit - I'll try it right now Thank you so so so much! Quote Link to comment https://forums.phpfreaks.com/topic/42403-i-feel-so-silly-for-asking-this-but-i-need-a-little-php-help/#findComment-207329 Share on other sites More sharing options...
angelkelly Posted March 14, 2007 Author Share Posted March 14, 2007 hehe tried it... now I have three error messages instead of one Warning: tep_draw_fckeditor(fckeditor.class.php) [function.tep-draw-fckeditor]: failed to open stream: No such file or directory in /home/sites/www.jewelleryfountain.co.uk/public_html/catalog/admin/includes/functions/html_output.php on line 258 Warning: tep_draw_fckeditor() [function.include]: Failed opening 'fckeditor.class.php' for inclusion (include_path='.:/usr/share/pear') in /home/sites/www.jewelleryfountain.co.uk/public_html/catalog/admin/includes/functions/html_output.php on line 258 Fatal error: Cannot instantiate non-existent class: fckeditor in /home/sites/www.jewelleryfountain.co.uk/public_html/catalog/admin/includes/functions/html_output.php on line 260 thanks for the reply though - I am genuinly grateful! K Quote Link to comment https://forums.phpfreaks.com/topic/42403-i-feel-so-silly-for-asking-this-but-i-need-a-little-php-help/#findComment-207335 Share on other sites More sharing options...
per1os Posted March 14, 2007 Share Posted March 14, 2007 Well what I meant was the what I put for fckeditor.class.php, that needs to point to the actual file you are suppose to be including, I am not sure what that is. Replace that with what it should be and it should work. --FrosT Quote Link to comment https://forums.phpfreaks.com/topic/42403-i-feel-so-silly-for-asking-this-but-i-need-a-little-php-help/#findComment-207338 Share on other sites More sharing options...
angelkelly Posted March 14, 2007 Author Share Posted March 14, 2007 I really wish I knew! I'll try again with loads of different file names and see what it comes up with thank you! Quote Link to comment https://forums.phpfreaks.com/topic/42403-i-feel-so-silly-for-asking-this-but-i-need-a-little-php-help/#findComment-207342 Share on other sites More sharing options...
per1os Posted March 14, 2007 Share Posted March 14, 2007 include("FCKeditor/fckeditor.php") ; The file you need to include is in the FCKeditor dir called fckeditor.php http://wiki.fckeditor.net/Developer%27s_Guide/Integration/PHP --FrosT Quote Link to comment https://forums.phpfreaks.com/topic/42403-i-feel-so-silly-for-asking-this-but-i-need-a-little-php-help/#findComment-207345 Share on other sites More sharing options...
angelkelly Posted March 14, 2007 Author Share Posted March 14, 2007 thank you for the link - I'm up to 6 error messages now - lol I think I'll need it! You are a real star! K Quote Link to comment https://forums.phpfreaks.com/topic/42403-i-feel-so-silly-for-asking-this-but-i-need-a-little-php-help/#findComment-207351 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.