Jump to content

I feel so silly for asking this but I need a little PHP help


angelkelly

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.