Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    663
    Plugin Contributions
    0

    Default [Done v2.0] HTMLarea not showing -> fix included

    Hi folks,

    I recently came across this issue myself, when installing the cart in sub directory. This error only appears there... for example you have installed your cart in www.yourdomainname.com/store/, then you have most likely experience this bug, if you were using htmlarea!

    The problem is, the htmleditor should be loaded from a non exisitng location. Zen assumes incorrectly, that all editor files are in www.yourdomainname.com/editors/htmlarea, however they are in www.yourdomainname.com/store/editors/htmlarea!

    How to fix it?

    Just simply add a base to the javascript inclusion file. Simply replace all occurances of DIR_WS_CATALOG with HTTP_CATALOG_SERVER.DIR_WS_CATALOG in admin/includes/htmlarea.php.

    Your file should have looked like this:
    Code:
    <?php
    /**
     * @package htmleditors
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: htmlarea.php 4245 2006-08-24 14:07:50Z drbyte $
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die('Illegal Access');
    }
    
    define('BR',"\n");
    
    // INSERTS <SCRIPT> TAGS IN <HEAD> FOR HTMLAREA TO BE CALLED
    if ($_SESSION['html_editor_preference_status']=="HTMLAREA") {
    
    //define URL and LANG parameters
      echo '<script type="text/javascript">' .BR;
      echo '   _editor_url = "'.DIR_WS_CATALOG . 'editors/htmlarea/";' .BR;
      echo '	_editor_lang = "'.strtolower($_SESSION['languages_code']).'";' .BR;
      echo '</script>' .BR;
    
    //<!-- load the main HTMLArea files -->
      echo '<script type="text/javascript" src="' . DIR_WS_CATALOG . 'editors/htmlarea/htmlarea.js"></script>' .BR;
    //  echo '<script type="text/javascript" src="' . DIR_WS_CATALOG . 'editors/htmlarea/lang/'.strtolower(DEFAULT_LANGUAGE).'.js"></script>' .BR;
    //  echo '<script type="text/javascript" src="' . DIR_WS_CATALOG . 'editors/htmlarea/dialog.js"></script>' .BR;
    //  echo '<script type="text/javascript" src="' . DIR_WS_CATALOG . 'editors/htmlarea/popupdiv.js"></script>' .BR;
    //  echo '<script type="text/javascript" src="' . DIR_WS_CATALOG . 'editors/htmlarea/popupwin.js"></script>' .BR;
    
    //<!-- load the plugins -->
      echo '<script type="text/javascript">' .BR;
          // WARNING: using this interface to load plugin
          // will _NOT_ work if plugins do not have the language
          // loaded by HTMLArea.
    
          // In other words, this function generates SCRIPT tags
          // that load the plugin and the language file, based on the
          // global variable HTMLArea.I18N.lang (defined in the lang file,
          // in our case "lang/en.js" loaded above).
    
          // If this lang file is not found the plugin will fail to
          // load correctly and nothing will work.
    
      echo '      HTMLArea.loadPlugin("TableOperations");' .BR;
      echo '      HTMLArea.loadPlugin("SpellChecker");' .BR;
      //  echo ' }' .BR;
      echo '</script>' .BR;
    } 
    ?>
    and should be changed to:
    Code:
    <?php
    /**
     * @package htmleditors
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: htmlarea.php 4245 2006-08-24 14:07:50Z drbyte $
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die('Illegal Access');
    }
    
    define('BR',"\n");
    
    // INSERTS <SCRIPT> TAGS IN <HEAD> FOR HTMLAREA TO BE CALLED
    if ($_SESSION['html_editor_preference_status']=="HTMLAREA") {
    
    //define URL and LANG parameters
      echo '<script type="text/javascript">' .BR;
      echo '   _editor_url = "'.HTTP_CATALOG_SERVER.DIR_WS_CATALOG . 'editors/htmlarea/";' .BR;
      echo '	_editor_lang = "'.strtolower($_SESSION['languages_code']).'";' .BR;
      echo '</script>' .BR;
    
    //<!-- load the main HTMLArea files -->
      echo '<script type="text/javascript" src="' . HTTP_CATALOG_SERVER.DIR_WS_CATALOG . 'editors/htmlarea/htmlarea.js"></script>' .BR;
    //  echo '<script type="text/javascript" src="' . HTTP_CATALOG_SERVER.DIR_WS_CATALOG . 'editors/htmlarea/lang/'.strtolower(DEFAULT_LANGUAGE).'.js"></script>' .BR;
    //  echo '<script type="text/javascript" src="' . HTTP_CATALOG_SERVER.DIR_WS_CATALOG . 'editors/htmlarea/dialog.js"></script>' .BR;
    //  echo '<script type="text/javascript" src="' . HTTP_CATALOG_SERVER.DIR_WS_CATALOG . 'editors/htmlarea/popupdiv.js"></script>' .BR;
    //  echo '<script type="text/javascript" src="' . HTTP_CATALOG_SERVER.DIR_WS_CATALOG . 'editors/htmlarea/popupwin.js"></script>' .BR;
    
    //<!-- load the plugins -->
      echo '<script type="text/javascript">' .BR;
          // WARNING: using this interface to load plugin
          // will _NOT_ work if plugins do not have the language
          // loaded by HTMLArea.
    
          // In other words, this function generates SCRIPT tags
          // that load the plugin and the language file, based on the
          // global variable HTMLArea.I18N.lang (defined in the lang file,
          // in our case "lang/en.js" loaded above).
    
          // If this lang file is not found the plugin will fail to
          // load correctly and nothing will work.
    
      echo '      HTMLArea.loadPlugin("TableOperations");' .BR;
      echo '      HTMLArea.loadPlugin("SpellChecker");' .BR;
      //  echo ' }' .BR;
      echo '</script>' .BR;
    } 
    ?>
    Have a nice day!

  2. #2
    Join Date
    Aug 2006
    Location
    Melbourne, Australia
    Posts
    30
    Plugin Contributions
    0

    Default Re: HTMLarea not showing -> fix included

    My site is installed in a sub-directory and I have not experienced this problem with HTMLarea.

  3. #3
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    663
    Plugin Contributions
    0

    Default Re: HTMLarea not showing -> fix included

    I just experienced it on three carts (on different servers) so I thought this might be a general problem... But if you ever have the problem, you know how to fix it :)

  4. #4
    Join Date
    Apr 2005
    Posts
    76
    Plugin Contributions
    0

    Default Re: HTMLarea not showing -> fix included

    I have the same problem and it didn't work for me.

  5. #5
    Join Date
    Jan 2007
    Location
    Boston, MA, USA
    Posts
    40
    Plugin Contributions
    0

    Default Re: HTMLarea not showing -> fix included

    Thank you!!! HTMLarea was not working for me since I upgraded, but this fixed it!

  6. #6
    Join Date
    Apr 2006
    Location
    Göteborg
    Posts
    126
    Plugin Contributions
    0

    Default Re: HTMLarea not showing -> fix included

    See also http://zen-cart.com/forum/showthread...455#post347455 with two suggested very easy fixes to get HTMLAREA to show in 1.3.7.

  7. #7
    Join Date
    Oct 2007
    Posts
    12
    Plugin Contributions
    0

    Default Re: HTMLarea not showing -> fix included

    Thank you masterblaster !

    This solved the "HTMLArea not working" problem on my local server using an alias for the Zen-Cart URL (the folder where the store is isn't a subfolder of the server's document root… even if the URL says http://document.root/store/).


  8. #8
    Join Date
    Oct 2007
    Posts
    12
    Plugin Contributions
    0

    Default Re: HTMLarea not showing -> fix included

    And this is not specific to HTMLArea…
    I get the same issue with TinyMCE, had to change

    Code:
    <script language="javascript" type="text/javascript" src="<?php echo DIR_WS_CATALOG; ?>editors/tiny_mce/tiny_mce_gzip.php"></script>
    at the beginning of editors/tinymce.php to

    Code:
    <script language="javascript" type="text/javascript" src="<?php echo HTTP_SERVER . DIR_WS_CATALOG; ?>editors/tiny_mce/tiny_mce_gzip.php"></script>
    the same way…

  9. #9

    Default Re: HTMLarea not showing -> fix included

    Thank you Thank you Thank you masterblaster!

    I struggled with this for quite some time before I found your very helpful post! The html editor worked just fine on my previous server (with the same sub-directory structure) without this fix but I couldn't get it to work on the new server no matter what I did. I'm not sure why it is inconsistent across servers but it works now and I am extremely grateful (and so is my shop owner) for your help.

    Catherine

  10. #10
    Join Date
    Nov 2007
    Location
    Dallas, Texas USA
    Posts
    183
    Plugin Contributions
    0

    Default Re: HTMLarea not showing -> fix included

    I'm still having problems with this after using masterBlaster's fix. I did find a work-around by switching to plain text before saving my changes. However, I'd like to get it right if possible. Using 1.3.8a

    Here's my htmlarea.php:

    Code:
    <?php
    /**
     * @package htmleditors
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: htmlarea.php 4245 2006-08-24 14:07:50Z drbyte $
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die('Illegal Access');
    }
    
    define('BR',"\n");
    
    // INSERTS <SCRIPT> TAGS IN <HEAD> FOR HTMLAREA TO BE CALLED
    if ($_SESSION['html_editor_preference_status']=="HTMLAREA") {
    
    //define URL and LANG parameters
      echo '<script type="text/javascript">' .BR;
      echo '   _editor_url = "'.HTTP_CATALOG_SERVER.DIR_WS_CATALOG . 'editors/htmlarea/";' .BR;
      echo '	_editor_lang = "'.strtolower($_SESSION['languages_code']).'";' .BR;
      echo '</script>' .BR;
    
    //<!-- load the main HTMLArea files -->
      echo '<script type="text/javascript" src="' . HTTP_CATALOG_SERVER.DIR_WS_CATALOG . 'editors/htmlarea/htmlarea.js"></script>' .BR;
    //  echo '<script type="text/javascript" src="' . HTTP_CATALOG_SERVER.DIR_WS_CATALOG . 'editors/htmlarea/lang/'.strtolower(DEFAULT_LANGUAGE).'.js"></script>' .BR;
    //  echo '<script type="text/javascript" src="' . HTTP_CATALOG_SERVER.DIR_WS_CATALOG . 'editors/htmlarea/dialog.js"></script>' .BR;
    //  echo '<script type="text/javascript" src="' . HTTP_CATALOG_SERVER.DIR_WS_CATALOG . 'editors/htmlarea/popupdiv.js"></script>' .BR;
    //  echo '<script type="text/javascript" src="' . HTTP_CATALOG_SERVER.DIR_WS_CATALOG . 'editors/htmlarea/popupwin.js"></script>' .BR;
    
    //<!-- load the plugins -->
      echo '<script type="text/javascript">' .BR;
          // WARNING: using this interface to load plugin
          // will _NOT_ work if plugins do not have the language
          // loaded by HTMLArea.
    
          // In other words, this function generates SCRIPT tags
          // that load the plugin and the language file, based on the
          // global variable HTMLArea.I18N.lang (defined in the lang file,
          // in our case "lang/en.js" loaded above).
    
          // If this lang file is not found the plugin will fail to
          // load correctly and nothing will work.
    
      echo '      HTMLArea.loadPlugin("TableOperations");' .BR;
      echo '      HTMLArea.loadPlugin("SpellChecker");' .BR;
      //  echo ' }' .BR;
      echo '</script>' .BR;
    } 
    ?>

 

 

Similar Threads

  1. HTMLarea editor not showing paragrahps
    By barendfaber in forum General Questions
    Replies: 5
    Last Post: 24 Aug 2010, 08:15 AM
  2. HTMLarea toolbar not showing on new host
    By mikegw in forum General Questions
    Replies: 0
    Last Post: 11 Aug 2009, 12:39 AM
  3. HTMLArea - formatting buttons not showing up in Admin
    By woodlandsprite in forum General Questions
    Replies: 26
    Last Post: 3 Dec 2007, 08:54 PM
  4. images not showing in htmlarea image manager
    By birdoasis in forum General Questions
    Replies: 2
    Last Post: 5 Mar 2007, 08:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg