Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

FCK WYSIWYG HTML editor


spooks

Recommended Posts

hello at all,

 

sorry for my bad English, I'm from Swiss.

 

I've installed the editor and more Pics (latest version) yesterday.

After few problems it is running mor than less.

 

Now I don't know, it is correct or not:

Admin picture

 

Fact is, everytime I make a modify, the link is brocken.

Can everyone help me?

 

thanks for help.

 

Michael

 

Your product description field looks ok but the fck editor is also shown on the product image field. I suspect this is because you are using htmlarea or similar to upload the main image (because this uses a textarea field).

 

I also suspect that you have replaced the main textarea function in /includes/function/htmlarea.php to use the fck editor.

 

Solution: keep the previous taxtarea function in place. Simply create a new one for the fckeditor (see my post above) and only replace the textarea function in categories.php for the product_description field. I hope that helps.

 

Simon

Link to comment
Share on other sites

Your product description field looks ok but the fck editor is also shown on the product image field. I suspect this is because you are using htmlarea or similar to upload the main image (because this uses a textarea field).

 

I also suspect that you have replaced the main textarea function in /includes/function/htmlarea.php to use the fck editor.

 

Solution: keep the previous taxtarea function in place. Simply create a new one for the fckeditor (see my post above) and only replace the textarea function in categories.php for the product_description field. I hope that helps.

 

Simon

 

Thank you for your reply.

I don't made a change in htmlarea.php, this file does not exist in my folder. :blink:

 

I made a change in categories.php on line 752 after I had the same error as "Khanh" (in the first page on this thread). (tep_draw_file_field_image_fckeditor change to tep_draw_fckeditor )

Link to comment
Share on other sites

You appear to have made a mess of your mods, without your code its not possible to tell what you've done wrong.

 

When combining contribs you need to be extra careful. Perhaps yopu should restore & do it again.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Thank you for your reply.

I don't made a change in htmlarea.php, this file does not exist in my folder. :blink:

 

I made a change in categories.php on line 752 after I had the same error as "Khanh" (in the first page on this thread). (tep_draw_file_field_image_fckeditor change to tep_draw_fckeditor )

 

Sorry I meant html_output.php for the location of the function - typing too fast is always a mistake in my case!

 

Simon

Link to comment
Share on other sites

The stylesheet on the admin side is not the same as on your client side, to correct this I create a edit-stylesheet.css in my catalog directory that contains the main styles used, then in admin/categories.php add the link, ie

 

Find:

 

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

 

Add After:

 

<link rel="stylesheet" type="text/css" href="../edit-stylesheet.css">

 

You can also get fck to 'see' your css

 

open fckeditor/fckconfig.js

 

find and set:

 

FCKConfig.EditorAreaStyles = 'http://www.mysite.co.uk/catalog/stylesheet.css' ;

FCKConfig.ToolbarComboPreviewCSS = 'http://www.mysite.co.uk/catalog/stylesheet.css' ;

 

Hope that helps.

 

;)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

What i mean is when i make say the header of my description red for example in the product editor using fck editor, it shows up as red and it is also red when previewing in the admin. After i have updated and then gone to the actual listing on the shop it is just plain black still.

Link to comment
Share on other sites

Its not a problem I've seen, how are you making your header red? do you have a url?

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Hi, I am new to posting in this forum, but over the years, it has been a great source of information on thing what to do and what not to do!

 

so now i have my first question, in regards to FCK WYISYG with mail.php. I have installed fckeditor 2.6.2 in categories.php and newsletter.php and have it working now, however with mail.php it is sending code not html Does some one know what i should check, I am at my wits end. below is the code i have used for the page.

 

<td valign="top" class="main"><?php echo TEXT_MESSAGE; ?></td>

<td><?php echo tep_draw_fckeditor('message','600','400'); ?></td>

 

any help would be much appreciated.

Link to comment
Share on other sites

I`ve done a contrib to fix Send Admin HTML e-mails http://addons.oscommerce.com/info/5806

 

:)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Dude! Spooks, this is AWESOME!!!

 

This pretty much takes away the need to mess with all those extra picture contributions. Although, those are great too, because of the automation, but this takes so much pressure off me in terms of deadlines.

 

AWESOME AWESOME AWESOME!!

Link to comment
Share on other sites

  • 2 weeks later...

This is excellent thanks :)

 

I have a small problem tho.

I also added the Send Admin HTML e-mails

 

It seems to be working fine on the test email I sent but in where you do the emails up I have 2 of the boxes :blink: Here is a pic of what is seen.

emailform.gif

 

I added the HTML editor first worked great on the product info stuff. Then added the HTML e-mails.

 

I must not have looked to closely at the codes changes :blush:

Link to comment
Share on other sites

:blush:

Fixed my error. I left some of the old code (that was meant to be replaced) in the mail.php file.

 

Going to have a go at doing it for the newletter file now.

Link to comment
Share on other sites

I am unable to get this to work for the newsletter :blush:

The editor shows I am able to write all that but once saved cames up blank nothing there.

 

Any idea what have done wrong? :blush:

Link to comment
Share on other sites

newsletters mod

 

I am unable to get this to work for the newsletter :blush:

The editor shows I am able to write all that but once saved cames up blank nothing there.

 

Any idea what have done wrong? :blush:

 

 

Its a simple mod:

 

In newsletters.php

 

find: (192)

 

 <td class="main"><?php echo tep_draw_textarea_field('content', 'soft', '100%', '20', $nInfo->content); ?></td>

 

replace with:

 

<td class="main" colspan="2"><?php echo tep_draw_fckeditor('content', '700', '500', $nInfo->content); ?></td>

thats it!!

 

;)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Hello - my FCKeditor 2.6.3 installation is a partial success.

 

I can change all the products descriptions but when it comes to sedning emails and newsletter the recipient see the content aswell as the HTML markup.

 

How can I fix this issue?

 

Also I noticed in the instructions it said:

 

Find near 235-253

 

 

////

// Output a form textarea field

function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {

$field = '<textarea name="' . tep_output_string($name) . '" wrap="' . tep_output_string($wrap) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';

 

if (tep_not_null($parameters)) $field .= ' ' . $parameters;

 

$field .= '>';

 

if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) {

$field .= tep_output_string_protected(stripslashes($GLOBALS[$name]));

} elseif (tep_not_null($text)) {

$field .= tep_output_string_protected($text);

}

 

$field .= '</textarea>';

 

return $field;

}

 

 

Add After:

 

 

////

////

// 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;

}

 

 

 

However my code is slightly different:

 

////

// Output a form textarea field

function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {

global $HTTP_GET_VARS, $HTTP_POST_VARS;

 

$field = '<textarea name="' . tep_output_string($name) . '" wrap="' . tep_output_string($wrap) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';

 

if (tep_not_null($parameters)) $field .= ' ' . $parameters;

 

$field .= '>';

 

if ( ($reinsert_value == true) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {

if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {

$field .= tep_output_string_protected(stripslashes($HTTP_GET_VARS[$name]));

} elseif (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) {

$field .= tep_output_string_protected(stripslashes($HTTP_POST_VARS[$name]));

}

} elseif (tep_not_null($text)) {

$field .= tep_output_string_protected($text);

}

 

$field .= '</textarea>';

 

return $field;

}

 

 

 

 

 

 

 

Please advise.

 

 

Many Thanks

 

TMM

Whats the point of a signature?

Link to comment
Share on other sites

Send Admin HTML e-mails http://addons.oscommerce.com/info/5806

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

What I think your wanting is DEFINE MAINPAGE, it exists as part of http://addons.oscommerce.com/info/5679 you should be able to do the part you need only.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Hi Spooks just have a conflict now with another module seo header tags 3.0.4 1 2.

 

I have installed fckedotor and the following code needs to be replace with the SEO header code, how can I work around this?

 

Around line 519, find this section of code in admin/categories.php

 

NOTE: There can be several instances of the code:

for ($i=0, $n=sizeof($languages); $i<$n; $i++)

so you need to be sure you have the correct one. The best way is to do a

search for TEXT_PRODUCTS_DESCRIPTION, which is part of the code to be replaced.

 

<?php

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

?>

<tr>

<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>

<td><table border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

<td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>

</tr>

</table></td>

</tr>

<?php

}

?>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

 

Replace with the following

 

<Replacement code>

 

 

 

 

But the code I have at this point is:

 

<?php

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

?>

<tr>

<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>

<td><table border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

 

<!-- Following old code replaced for FCK editor Bal 12/08/08 -->

<!--<td class="main"></*?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? $products_description[$languages[$i]['id']] : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?*/></td> -->

<!-- New code: -->

<td class="main"><?php echo tep_draw_fckeditor('products_description[' . $languages[$i]['id'] . ']','600','300',(isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>

</tr>

 

 

 

So if I replace the code then I will be removing the FCK editor functionality.

 

Please advise on the issue.

 

Just like to say many thanks for your time.

 

Thank

 

TMM

Whats the point of a signature?

Link to comment
Share on other sites

I would'nt say this is a conflict, just a integration issue.

 

As you have'nt posted the replacement code I can't say, but just follow the standard technique.

Edited by spooks

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...