Jump to content
Sign in to follow this  
MaxiDVD

[Contribution] HTML WYSIWYG Editor for Product Desc, MS1 2.2

Recommended Posts

Lee,

Thanks for the quick reply. The issue seems to be on the product page itself, It does not show the desciptions. I can use full screen type in my description then hit the exit button (in full screen) and it past the HTML code into the HTML are box. I then click preview and it look fine, click update then I can go to my cart and it looks fine, but if I go back into the products and click edit all is gone and I haev to start over from scratch. When I installed it the code you say to look for in section 1a is not there. Below is a snipit of my catagories.php

 

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

<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>

<script language="javascript">

 var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE);

</script>

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

//MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.6 <head>

     _editor_url = "<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN; ?>htmlarea/";  // 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; }

      <?php if (HTML_AREA_WYSIWYG_BASIC_PD == 'Basic'){ ?>  if (win_ie_ver >= 5.5) {

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

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

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

      <?php } else{ ?> if (win_ie_ver >= 5.5) {

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

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

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

      <?php }?>

// --></script>

 

Thanks

Mike Snow

Share this post


Link to post
Share on other sites

Follow up. If I disable HTML area the HTML code shows up in the standard description box. Its like HTML area is not pulling the info from the DB.

 

Thanks again

Share this post


Link to post
Share on other sites

Hi Mike,

 

Yeah I know what your saying now, the HTMLarea is capable of pulling the info from the DB, It has too - or editing products in WYSIWYG enviroment would be impossible....

 

Your code is in the wrong place it needs to be higher in the page, I use Winsyntax for editing my work its a free download from download.com, have a look a few post back theres a link where you can get it..

 

Winsyntax has a built in feature that allows you to search the page code, open categories.php and search for: </head>

 

once you find </head> paste the code directly above that.

then try editing products again. if you get it right the HTML Area, will pull the description from the database into the wysiwyg enviroment..

 

Cheers Lee

Share this post


Link to post
Share on other sites

Thanks Lee that was part of my problem. The other was my PopUpCop it seemd like it was either keeping a cache or for some reason was not letting the HTML area retrieve the info from the DB. Not sure how or why...But it working great.

 

Thanks you

MIke Snow

Share this post


Link to post
Share on other sites

Hi there,

 

I have a small problem with Link to File.

I do not have the catalog folder anymore.

Everything else though works fine because

the configuration is setup correctly.

Is there some place where this can be fixed

on the files that I have added for this contribution.

 

I checked the file files.php under files but didn't find anything that I could modify. Did the same with configure.php under /admin/includes/

 

 

config.gif

 

thanks

Share this post


Link to post
Share on other sites

Well Lord give me patience but make it quick.

 

I got it fixed, was right there. For anybody else, if you come this problem accross, go to /admin/htmlarea/popups/file/config.inc.php/

 

//this is where the files will be stored relative to the $BASE_DIR (and $BASE_URL)

//this directory MUST be readable AND writable by the web server.

 

$BASE_ROOT = 'catalog/download';

 

change to

 

$BASE_ROOT = 'download'; or whatever your directory structure is.

 

Later

Share this post


Link to post
Share on other sites

Hi Guys

 

I have installed the contribution and the html area works fine in newsletters and email . in thge product description i can use it and add images chnages fonts ...etc but when click preview or update i get the following error ,

 

Fatal error: Cannot instantiate non-existent class: upload in /home/compusel/public_html/admin/categories.php on line 527

Share this post


Link to post
Share on other sites

IO,

 

Your problem has nothing to do with HTML WYSIWYG Editor,

Fatal error: Cannot instantiate non-existent class: upload

 

what this means is the php function upload class does not exist,

 

Your Admin/includes/classes/upload.php file is non-existent or...

You're missing a line in application_top.php that should say something like

 

REQUIRE (DIR_WS_CLASSES . 'upload.php');

 

If all this still fails, try searching for an answer:

Tick --> Search for all terms

Cannot instantiate non-existent class: upload in the forums there is a heap of topics about this to read through..

 

Cheers Lee :lol:

Share this post


Link to post
Share on other sites

oliverm

 

I found the solution to your problem, and its not related to WYSIWYG HTML Area, just so you know.. :-)

 

I cant belive how long categories.php is, it has to be one of the biggest files in osCommerce, and twice as long if your looking for errors in the code.

 

I went up and down your page 3 times with a magnifying glass, but I think I found it...

 

Line 601

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

$products_description = $HTTP_POST_VARS['description'];

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

description does not exist, its submitting your products descriptions into space rather then your database... hence no preview or edit.

 

FIX

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

$products_description = $HTTP_POST_VARS['products_description'];

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

 

try it, Let me know how it goes..

 

Cheers Lee

Share this post


Link to post
Share on other sites

juliankrye

 

I got it fixed, was right there. For anybody else, if you come this problem accross, go to /admin/htmlarea/popups/file/config.inc.php/  

 

//this is where the files will be stored relative to the $BASE_DIR (and $BASE_URL)  

//this directory MUST be readable AND writable by the web server.  

 

$BASE_ROOT = 'catalog/download';  

 

change to  

 

$BASE_ROOT = 'download'; or whatever your directory structure is.

You where too quick for me that time, I belive in Majority Rules, so I decided to set it up with osCommerce default folder structure as most oscommerce store owners stick with that setting.

 

But thats a good tip, for others who do change the store structure..

 

:wink: Lee

Share this post


Link to post
Share on other sites

maxidvd

 

thanks for your help , it is working now what a nice contribution :D

i have one more questions though , where from you can modify ,or add more of those predefinied texts ,

 

thanks

i.O

Share this post


Link to post
Share on other sites

Hi storeman

v1.6 /admin/html/editor_basic.js --> line 387 --> // Custom3

and

v1.6 /admin/html/editor_advanced.js --> line 541 --> // Custom3

 

you can make custom buttons pretty easy just duplicated //Custom 3 create a new under it call it //Custom 4 or alter 1,2,3 then in the top of them files you need to uncomment these or create the new ones

 

this part is the placement on the WYSIWYG toolbars

// ['custom1', 'custom3', custom3','separator'],

 

also this part

 

// Add custom buttons here:

"custom1": ['custom1', ' Purpose of button 1 ', 'editor_action(this.id)', 'ed_custom.gif'],

"custom2": ['custom2', ' Purpose of button 2 ', 'editor_action(this.id)', 'ed_custom.gif'],

"custom3": ['custom3', ' Custom info ', 'editor_action(this.id)', 'ed_custom.gif'],

this part defines the name of the button the mouse-over name and the image to be used for the button

 

Cheers Lee

Share this post


Link to post
Share on other sites

Hey great contrib, got it to work fairly easy. Did have to make a major adjustment.

 

I actualy dont use MultiLanguage support so I deleted those directories in OSC and turned them off in admin.

 

I had to change the loop to not fire that looked at the number of languages. Other than that 1.64 went through fine...

 

BUT!!!!

1.65 is out..whats the upgrade procedure for 1.64>1.65

Share this post


Link to post
Share on other sites

Oh yea...either I am on crack, or default.php has been renamed/removed in the latest CVS

Share this post


Link to post
Share on other sites

Yes. it is now INDEX.PHP - you should look at the MS2 and CVS commit notes. There has been more than 50 files with new changes in the CVS - some of it is changing refernces from DEFAULT.PHP to INDEX.PHP

Share this post


Link to post
Share on other sites

chain

 

have you followed the instructions to a "T" and installed the SQL script. if so send me your categories.php via email attachment so I can have a look at it.

 

Ket

 

 

1.65 is out..whats the upgrade procedure for 1.64>1.65

simply overwrite the old HTMLAREA Folder, Make a back-up first...

 

in addition to that I included the Full Define Main Page contribution from Mattice, what its it? Define Main Page it lets you put HTML content on your default.php or index.php in a WYSIWYG enviroment, If you put content on your homepage its a fantastic addition.. follow the steps in ms1_easy_install_instructions.txt file to get it working.

 

Oh yea...either I am on crack, or default.php has been renamed/removed in the latest CVS

Thats always a possibilty with CVS :-) might be named index.php

 

Did have to make a major adjustment.  

 

I actualy dont use MultiLanguage support so I deleted those directories in OSC and turned them off in admin.  

 

I had to change the loop to not fire that looked at the number of languages.

It supports multilingual but will still work on one language.

 

oliverm

Im outta idea's on this one, have you tried a clean categories.php, I know you have contributions installed on your categories.php but It looks like one or the other as the contributions clash..

 

Cheers Lee

Share this post


Link to post
Share on other sites

Has anyone had any problems with the define mainpage portion of html area?

 

It shows up in the backend fine, and is editable, but on the front end I cant seem to shake this error...

 

Warning: Failed opening 'includes/languages/english/FILENAME_MAINPAGE' for inclusion (include_path='.:/usr/local/lib/php')

 

I've gone over and over to see if I messed an define statement or something, but everything looks ok.

Share this post


Link to post
Share on other sites

I think there is a step missing from the install instructions

 

open application_top and insert this line

 

define('FILENAME_MAINPAGE', 'mainpage.php');

Share this post


Link to post
Share on other sites

OK, the step wasnt missed in the directions, there were a few syntax errors in steps 1.5 & 1.6.

 

Step 1.5 Was...

 

<tr>

<td class="main"><?php include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_MAINPAGE); ?></td>

</tr>

 

Should be...

 

<tr>

<td class="main"><?php include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE); ?></td>

</tr>

 

Step 1.6 Was...

 

define('FILENAME_DEFINE_MAINPAGE', 'define_mainpage.php');

 

Should be...

 

define('FILENAME_DEFINE_MAINPAGE', 'mainpage.php');

 

I hope this helps others with one of the best osc contributions provided.

Share this post


Link to post
Share on other sites

My Bad :oops:

 

Sorry about the instructions, what Islander2u mentioned is right, i also ment to included Mattices Instructions and material in the zip file, it was getting late - I was having a :roll: hard time reading and double checking before I uploaded the file ..LOL,

 

this will be done in the next upload/fix.

 

CSS via admin, I think you could manage that with the /Tools--> File Manager.. stylesheets.css but thats not in a WYSIWG eviroment, ''That would be nice'' - but how often would you change the style of your site..?

 

be well.

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  

×