Jump to content
Sign in to follow this  
straider

HTMLArea v3.0

Recommended Posts

Download contribution: HTMLArea

Version: 3.0

osCommerce: 2.2-MS1, 2.2-MS2

Kudos: Mihai Bazon - HTMLArea v3.0.

 

Allows users to edit the content of any TextArea field using a fully-featured HTML WYSIWYG editor. For more information, please visit the oficial site at http://dynarch.com/htmlarea/.

 

============================================

Install: The installation process is done in 4 simple steps. The first 3 steps must be executed on each file that has a textarea field to be replaced by the new HTMLArea editor. These are the steps:

 

-------------------------------------------------------------------------------

1. Load Core Files, Plugins and StyleSheet:

------- FIND -------

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

...

</head>

 

--- BETWEEN ADD ----

<!-- DWD Modify -> Add: HTMLArea v3.0 !-->

<!-- Load HTMLArea Core Files. !-->

<script type="text/javascript" src="/htmlarea/htmlarea.js"></script>

<script type="text/javascript" src="/htmlarea/dialog.js"></script>

<script type="text/javascript" src="/htmlarea/lang/en.js"></script>

 

<!-- Load HTMLArea Plugins. !-->

<script type="text/javascript">

HTMLArea.loadPlugin("TableOperations");

HTMLArea.loadPlugin("SpellChecker");

</script>

 

<!-- Load HTMLArea StyleSheet. !-->

<style type="text/css">

@import url(/htmlarea/htmlarea.css);

</style>

<!-- DWD Modify End. !-->

-------------------------------------------------------------------------------

2. Set HTMLArea to replace all TextArea

------- FIND -------

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" ...>

 

--- REPLACE WITH ---

</head>

<!-- DWD Modify -> Replace: HTMLArea v3.0 !-->

<!-- <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" ...> !-->

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" ... onload="HTMLArea.replaceAll()">

<!-- DWD Modify End. !-->

-------------------------------------------------------------------------------

3. Enlarge previous TextArea size

------- FIND -------

<?php echo tep_draw_textarea_field('...', 'soft', '60', '15'); ?>

 

--- REPLACE WITH ---

<!-- DWD Modify -> Replace: HTMLArea v3.0 !-->

<?php echo tep_draw_textarea_field('...', 'soft', '100%', '20'); ?>

<!-- DWD Modify End. !-->

-------------------------------------------------------------------------------

4. Copy htmlarea/* to /catalog/htmlarea/*

============================================

CAUTION:

  • In step 2. pay close attention to the end of <body> tag. Usually last statement is to define the background color. But in some case, the onload statement is the last one and in these cases the onload replacement must be onload="SetFocus(); HTMLArea.replaceAll()"
  • In step 3. pay close attention to the width and height of the textarea. Usually height shouldn't be any smaller than 20 pixels, and width should be set to 100%. Bare in mind that the '...' is a placeholder for the actual textarea field name, which can be for instance 'message'.
  • Step 4. is to be one only once. The location of the folder has direct impact in step 1., where each /htmlarea/ must be replaced with the final location used in step 4. If you don't put htmlarea/ folder beneath /catalog/ folder, then you must edit entries in step 1. that match /htmlarea/. For instance if you put the folder on the location /catalog/includes/modules/htmlarea/ then you must edit all entries in step 1. with /includes/modules/htmlarea/. Bare in mind that /catalog/ is the web document root in these instructions. If that's not your case, edit it accordingly.

============================================

 

Uninstall:

Simply undo the editions made to each file where you have replaced the TextArea with HTMLArea.

 

Notes:

This contribution replaces any TextArea field with a WYSIWYG HTML Editor, with table support.

If you want to see a demonstration, check this demo online shop . Bare in mind that the text is in Portuguese.

 

To-Do:

  • Fix HTMLArea Bugs:
    • Back action in Mozilla.
    • Color Dialog dimensions in Mozilla.
    • Insert image tags in Mozilla.
    • Loading/Registering Plugins.

Edited by straider

Contributions:

. Browse by Categories

-----------------------------------------------------------

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

I am really excited about this add-on. but I am confused on what files I should put the

--- BETWEEN ADD ----

<!-- DWD Modify -> Add: HTMLArea v3.0 !-->

<!-- Load HTMLArea Core Files. !-->

<script type="text/javascript" src="/htmlarea/htmlarea.js"></script>

<script type="text/javascript" src="/htmlarea/dialog.js"></script>

<script type="text/javascript" src="/htmlarea/lang/en.js"></script>

 

<!-- Load HTMLArea Plugins. !-->

<script type="text/javascript">

HTMLArea.loadPlugin("TableOperations");

HTMLArea.loadPlugin("SpellChecker");

</script>

 

<!-- Load HTMLArea StyleSheet. !-->

<style type="text/css">

@import url(/htmlarea/htmlarea.css);

</style>

<!-- DWD Modify End. !-->

 

what files do I add this to and where are they???

thank you inadvanced.

naomi


Peace is possible.. Please don't give up.

 

"War is --the old betraying the young"

Share this post


Link to post
Share on other sites

beardeddone,

 

Do you have MIME messages enabled in e-mail Settings, under Configuration options for e-mail? Maybe that's the problem, and although everything works fine for me, there may exist some bugs regarding MIME enabled/disabled settings.

 

Hope it helps.


Contributions:

. Browse by Categories

-----------------------------------------------------------

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

noppie,

 

As an example, these are the files that I have edited in order to replace the default TextArea fields with the new HTMLArea editor:

  • /catalog/admin/categories.php
  • /catalog/admin/mail.php
  • /catalog/admin/manufacturers.php
  • /catalog/admin/newsletters.php
  • /catalog/contact_us.php
  • /catalog/tell_a_friend.php

Bare in mind that I'm still using osCommerce 2.2 MileStone 2, there may be some files that differ from this list in newer milestones.

 

Hope it helps.


Contributions:

. Browse by Categories

-----------------------------------------------------------

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

straider

thank you so much.. it would save me so much time when adding items--

and I am using the same one as you.

 

thank you again

noppie


Peace is possible.. Please don't give up.

 

"War is --the old betraying the young"

Share this post


Link to post
Share on other sites
beardeddone,

 

Do you have MIME messages enabled in e-mail Settings, under Configuration options for e-mail? Maybe that's the problem, and although everything works fine for me, there may exist some bugs regarding MIME enabled/disabled settings.

 

Hope it helps.

Here's what I have

 

E-Mail Transport Method sendmail

E-Mail Linefeeds LF

Use MIME HTML When Sending Emails false

Verify E-Mail Addresses Through DNS false

Send E-Mails true

 

I've played with this many times and ended up going back to the origional contact_us, contact_us sends a blank message, but the to and subject are in tact.


Best Regards

Share this post


Link to post
Share on other sites

noppie,

 

If all you want is to add new products with a WYSIWYG HTML Editor, then just edit the file /catalog/admin/categories.php, according to the instructions on the first post.

 

I also have added Categories Description and I need to have Manufacturers descriptions as well, and for these reasons I've also edited my "hacked" /catalog/admin/categories.php and /catalog/admin/manufacturers.php.

 

If you have send MIME messages enabled, you could also edit /catalog/admin/mail.php and /catalog/admin/newsletters.php. This would allow you to send rich-content e-mail messages to your customers.

 

If you wish to provide those same content-rich e-mail messages to your customers, through the catalog pages, then you could edit /catalog/contact_us.php or /catalog/tell_a_friend.php.

 

It's up to you. If you also have other contributions, such as Define MainPage or Information Pages Unlimited, you could also edit the files that have a textarea field. Bare in mind though that Information pages Unlimited is not as trivial as the others, since you must edit two files instead of just one.

 

Hope this helps you.


Contributions:

. Browse by Categories

-----------------------------------------------------------

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites
Here's what I have

 

E-Mail Transport Method sendmail 

E-Mail Linefeeds LF 

Use MIME HTML When Sending Emails false 

Verify E-Mail Addresses Through DNS false 

Send E-Mails true

 

I've played with this many times and ended up going back to the origional contact_us, contact_us sends a blank message, but the to and subject are in tact.

beardeddone,

 

I'm not sure, but the problems you may have with Contact Us page should be fixed if you enable Send MIME Messages.

 

If you are actually sending blank e-mails that means your e-mails are getting out OK, since some mail servers may require Linefeeds to be CR+LF. And because the message body is blank, that may very well be because HTMLArea outputs a HTML formatted message, which is not being sent through the osCommerce mailer. I had some problems with the mailer class, which were solved after I tweaked with nl2br function. Try passing the contents of message through nl2br, before sending a MIME e-mail message.

 

Bare in mind that this causes all e-mail messages to be sent formatted as HTML, which may cause disruption in other areas of osCommerce.

 

Hope this helps you out.


Contributions:

. Browse by Categories

-----------------------------------------------------------

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

Before I uninstalled this the last time I did try using the MIME HTML When Sending Emails true option and some of the body did go through, but it wasn't good, it was codded with all the coding in place, looked terrible, this is funny as all the other WYSIWYG stuff works great, but it's in the admin area I use it, not for any e-mail.


Best Regards

Share this post


Link to post
Share on other sites

beardeddone,

 

Sorry if I can't help you more. I don't see any reasons why it shouldn't work OK. Maybe other users that have installed the contribution can figure it out. If I see any reasons that may be causing the problem you described, I'll post them and the solutions in this topic.

 

Thanks.


Contributions:

. Browse by Categories

-----------------------------------------------------------

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

straider

thank you so much...

this is going to be so helpfull

 

thank you

naomi


Peace is possible.. Please don't give up.

 

"War is --the old betraying the young"

Share this post


Link to post
Share on other sites
beardeddone,

 

Sorry if I can't help you more. I don't see any reasons why it shouldn't work OK. Maybe other users that have installed the contribution can figure it out. If I see any reasons that may be causing the problem you described, I'll post them and the solutions in this topic.

 

Thanks.

That's ok, also just wanted to let you know I just installed wysiwyg in the email.php for the admin and it works like it is supposed to, to bad that one can't be used for contact_up too.


Best Regards

Share this post


Link to post
Share on other sites

Viva Jos? Carlos:

 

Desculpe usar este t?pico, mas gostava de saber se conhece um bom processador de pagamento por cart?o de cr?dito que trabalhe com portugal.

O Paypal obriga a ter uma conta no estrangeiro, portanto n?o me serve.

O tocheckout apenas trabalha com dolares, e obriga a um pagamento de $50 de activa??o.

N?o me importo de pagar activa??o, mas queria um metodo fiavel e que depositasse as transa??es no meu banco de portugal.

 

Um abra?o.

Share this post


Link to post
Share on other sites

Nelson,

 

This is way off-topic. If you wish, follow this link to a good Yahoo Group, created by HumanEasy, that is in portuguese and for portuguese (Brasil and Portugal). HumanEasy is currently working on a MBnet add-on. I'll answer your questions there, or here if you start another topic. This is just for HTMLArea v3.0 (beta). The group is located at osCommerce-PT

 

Thanks.


Contributions:

. Browse by Categories

-----------------------------------------------------------

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites
That's ok, also just wanted to let you know I just installed wysiwyg in the email.php for the admin and it works like it is supposed to, to bad that one can't be used for contact_up too.

beardeddone,

 

Maybe you have installed /htmlarea/ inside the /catalog/admin folder or you are using different paths for /catalog/ and /admin/. It's as simple as replacing the textarea field in /catalog/admin/mail.php as it is in /catalog/contact_us.php. Same procedure, same steps.

 

Is this helpful?


Contributions:

. Browse by Categories

-----------------------------------------------------------

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

delafe,

 

HTMLArea 3.0 works not only with Internet Explorer but also with gecko-based browsers, such as Mozilla. As you can see from the official site, HTMLArea is "compatible" with IE 5.5+ and Mozilla 1.3+. One thing I like in HTMLArea is that it is OS-independant (at least for Mozilla) and supports two of the major Internet Browsers available.

 

AFAIK, only Windows is supported for Internet Explorer, but you can learn more from visiting and reading the posts on the official forum.

 

Does this answer your question?

Edited by straider

Contributions:

. Browse by Categories

-----------------------------------------------------------

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

Hi together!

 

I've got a problem. I've installed the textmaker contirbution! there is an old htmlarea integrated which isn't that good. I would like to upgrade to htmlarea3

 

No I tried to modifiy my admin/shipping,privacy etc... but I couldn't figure out were and what exactely I have to change. I uploaded the whole htmlarea files like

: admin\htmlarea_3

 

please can someone take a look on that little bit of code?

 

<?php

  /*

  $Id: conditions.php,v 1.3 2001/12/20 14:14:14 dgw_ Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright © 2003 osCommerce

 

  Released under the GNU General Public License

*/

?>

<?php require('includes/application_top.php');?>

 

 

 

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<!--

Copyright 2003

 

f?r die Deutsche Version:

Michael Klaucke

 

info@osc-shop.de

 

Dieser zusatz darf nicht gel?scht werden.

 

//-->

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

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

<script language="javascript" src="includes/menu.js"></script>

<script language="Javascript1.2"><!-- // load htmlarea

_editor_url = "<?php echo HTTP_SERVER . DIR_WS_ADMIN . 'htmlarea_old/' ?>";                    // URL to htmlarea files

var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);

if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }

if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }

if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }

if (win_ie_ver >= 5.5) {

document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');

document.write(' language="Javascript1.2"></scr' + 'ipt>');

} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

// --></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

 

<table border="0" width="100%" cellspacing="2" cellpadding="2">

  <tr>

    <td width="<?php echo BOX_WIDTH; ?>" valign="top" height="27">

    <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

    <?php require(DIR_WS_INCLUDES . 'column_left.php');?>

    </table></td>

    <td class="pageHeading" valign="top"><?php

      echo "Site Updates";

?> <?php

 

 

  if ($REQUEST_METHOD=="POST")

  {

    mysql_query('REPLACE INTO info_shipping (Id, Text) VALUES (1, "'.mysql_escape_string($aboutus).'")')

          or die(mysql_error());

  }

 

  $sql=mysql_query('SELECT * FROM info_shipping')

    or die(mysql_error());

  $row=mysql_fetch_array($sql);

 

?>

 

thanks!!

 

andreas

Share this post


Link to post
Share on other sites

Hi :D

 

Installation worked fine ... i just want it in the categories.php ...

 

BUT ... the images/icons are not displayed!??? there link goes to the /admin/images folder and not to the /catalog/htmlarea/ folder where they are located ...

 

where to I change this setting???

 

THX ;)

 

kind regards

 

zweilicht

Share this post


Link to post
Share on other sites

Hello Everyone,

I am having massive issues with this install, I think it has to do with paths but not fully sure. Can someone talk alook at my code?

 

<html <?php echo HTML_PARAMS; ?>>
<head>
   <!-- DWD Modify -> Add: HTMLArea v3.0 !-->
   <!-- Load HTMLArea Core Files. !-->
   <script type="text/javascript" src="htmlarea/htmlarea.js"></script>
   <script type="text/javascript" src="htmlarea/dialog.js"></script>
   <script type="text/javascript" src="htmlarea/lang/en.js"></script>

   <!-- Load HTMLArea Plugins. !-->
   <script type="text/javascript">
     HTMLArea.loadPlugin("TableOperations");
     HTMLArea.loadPlugin("SpellChecker");
   </script>

   <!-- Load HTMLArea StyleSheet. !-->
   <style type="text/css">
     @import url(/htmlarea/htmlarea.css);
   </style>
   <!-- DWD Modify End. !-->

 

Also....

 

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus(); onload="HTMLArea.replaceAll()">

 

and...

 

<?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', .....

 

I have the htmlarea located in my admin directory, and even /store/htmlarea.

I keep getting java errors stating that something wasn't defined.

So thats why I think its purley path issures.

 

Thanks

David

Share this post


Link to post
Share on other sites

danthony2,

 

The path for the htmlarea folder must be the same you use to access, for instance, the example.html of the HTMLArea editor. What's the full URL you have to type to reach /htmlarea/example.html ?

For instance, if you setup osCommerce under www.yourdomain.com/catalog and you put the htmlarea folder inside the public_html/catalog you just need to type /catalog/htmlarea/ in the script src. But if you have your catalog under www.yourdomain.com/catalog/catalog and you put the htmlarea folder inside the public_html/catalog/catalog then you must replace /htmlarea/ with /catalog/catalog/htmlarea/. In all script src and pay close attention to the import url statement.

 

Your onload example must be: onload="SetFocus(); HTMLArea.replaceAll()", as I wrote in the CAUTION section of the readme file.

 

The textarea statement seems OK, at first sight. You shouldn't have any problems with it.

 

This reply may not be clear enough, if so please send me a PM with your URL and paths and I'll try to help you more.

 

Thanks.


Contributions:

. Browse by Categories

-----------------------------------------------------------

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

zweilicht,

 

At first, I had that problem too. It end up being a problem with the paths definition. I've edited to match my configuration, and everything works fine, except loading the plugins for the tables and spell. I'm still trying to figure this out, but I don't have much spare time at the moment.

 

If the images for the buttons don't show up, I bet it has to do with paths. For me it was. I had to actually fix a line of code inside HTMLArea, to make it properly work.

 

Hope this helps.


Contributions:

. Browse by Categories

-----------------------------------------------------------

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

Bug Tracking: no button images are displayed.

Cause: the original version of HTMLArea has an empty value for the editor URL.

Solution: edit line 49 of htmlarea.js from

this.editorURL = "";

to

this.editorURL = "/htmlarea/";

Kudos: danthony2

 

Don't forget to replace /htmlarea/ with the proper path you use when loading the javascripts.

Edited by straider

Contributions:

. Browse by Categories

-----------------------------------------------------------

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×