Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Text formatting editor


richscheese

Recommended Posts

I have a store using 2.3 , page 35 on the documentation shows a text edit box . I want to add different fonts, styles and line breaks on product descriptions. That editor is not on my screen when I edit or create a product. The result is basicly raw text , can anyone help ? I have searched for 2 hours on this site and did not see this issue mentioned.Rich

Link to comment
Share on other sites

Yes in fact I ran into CKEditor osC 2.3.1 which unzipped a categories.php. Forgive me, I know my way around HTML and less so CSS but php is foreign to me , perhaps you can direct me to a reference to help me understand . So I have copied this categories.php into my store folders; I see 3 folders holding this file under the folder catalog ; 1 id backup , 2 is under English and w3 is under admin. I did not copy backup

Attempts to edit the store ran into the following error"

Fatal error: Cannot redeclare do_magic_quotes_gpc() (previously declared in /home/content/m/a/c/macsrods/html/richscheesestore/catalog/admin/includes/functions/compatibility.php:18) in /home/content/m/a/c/macsrods/html/richscheesestore/catalog/admin/includes/functions/compatibility.php on line 30"

I restored files and all is well .

I see STORE OWNER NOT CODER, you are not a coder but I reply , hoping someone will direct me to a reference or solution

Rich

Link to comment
Share on other sites

Hi Rich ,

Just follow the instructions given by

 

JohnAtYM 3rd one down

 

http://addons.oscommerce.com/info/7650

 

There are no new osc files just one to be changed.

 

The package itself can be found

 

http://ckeditor.com/

 

Regards

Joli

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

RS

"The one you have used is not a full package."

Do you mean ckeditor I downloaded was not the full package ?

So I found a download with several files at http://ckeditor.com/

 

"Start from the first one uploaded and add the extra ones as you go. All should then work." What 'one' are you referring to in this statement?

thanks

Link to comment
Share on other sites

Joli,

thanks for your time

 

no instructions at http://addons.oscommerce.com/info/7650

Just a download of categories.php which causes errors, apparently doesn't match the original os commerce store

 

"There are no new osc files just one to be changed." which file needs to be changed ?

 

The package itself can be found http://ckeditor.com/

Ok so I have the files copied them to my web site - nothing new happens when editing a product

 

The actual help screens are at http://ckeditor.com/

where it says ;

 

Loading CKEditor

 

CKEditor is a javascript application. To load it, you need to include a single file reference in your page. If you have installed CKEditor in the ckeditor directory in root of your website, you need to insert the following code fragment into the <head> section of your page:

<head>

...

<script src="/ckeditor/ckeditor.js"></script>

</head>

 

The tern <head> is not in any os commerce file.

 

Any idea what the above instruction means specifically by "your page"? categories.php ?

thanks

Rich

Link to comment
Share on other sites

1. Download the latest CKEditor from http://ckeditor.com/download and unpack to catalog/admin/ext/ckeditor - ckeditor.js should now be in the top level of this folder. CKeditor 3.5 (released December 17th, 2010) is included in this zip but please check for a newer version before install.

 

2. Open /catalog/admin/includes/functions/html_output.php and change the tep_draw_textarea_field (around line 252) to read:

 

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

 

3. Open /catalog/admin/includes/template_top.php and add the following before the </head> tag:

 

<?php

if (!defined('USE_CKEDITOR_ADMIN_TEXTAREA')) {

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, set_function) values ('', 'Use CKEditor', 'USE_CKEDITOR_ADMIN_TEXTAREA','true','Use CKEditor for WYSIWYG editing of textarea fields in admin',1,99,now(),'tep_cfg_select_option(array(\'true\', \'false\'),' )");

define ('USE_CKEDITOR_ADMIN_TEXTAREA','true');

}

if (USE_CKEDITOR_ADMIN_TEXTAREA == "true") {

?>

<script type="text/javascript" src="<?php echo tep_href_link('ext/ckeditor/ckeditor.js'); ?>"></script>

<script type="text/javascript" src="<?php echo tep_href_link('ext/ckeditor/adapters/jquery.js'); ?>"></script>

<script type="text/javascript">

$(function() {

var $editors = $('textarea');

if ($editors.length) {

$editors.each(function() {

var editorID = $(this).attr("id");

var instance = CKEDITOR.instances[editorID];

if (instance) { CKEDITOR.remove(instance); }

CKEDITOR.replace(editorID);

});

}

});

</script>

<?php

}

?>

 

4. All installed - just visit your admin site.

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

J

CKEditor from http://ckeditor.com/download is version 4.11

tep_draw_textarea_field doesn't exist in catalog/admin/includes/functions/html_output.php

closest thing to it on about line 252 is line 247 :

// Output a form textarea field

// The $wrap parameter is no longer used in the core xhtml template

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

global $HTTP_GET_VARS, $HTTP_POST_VARS;

 

 

inserting the above code into catalog/admin/includes/template_top.php above <head> causes the code to literally appear at the top of the admin screen

 

Thanks for you time but neither suggestions got me a text editor

 

 

Link to comment
Share on other sites

Hi Rich,

 

ORIGINAL OSCOMMERCE

 

////

// Output a form textarea field

// The $wrap parameter is no longer used in the core xhtml template

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) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';

 

CHANGED FOR CKEDITOR

 

////

// Output a form textarea field

// The $wrap parameter is no longer used in the core xhtml template

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) . '" id="' . tep_output_string($name) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';

 

 

Regards

 

Joli

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...