Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Guest

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

Link to comment
Share on other sites

  • Replies 557
  • Created
  • Last Reply

Top Posters In This Topic

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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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:

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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.

Link to comment
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.

Link to comment
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.

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