Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Contribution problem


Guest

Recommended Posts

Hi,

 

I have found a contribution that I am struggling to install as i'm not very good with this sort of thing :blush: . It is called WYSIWYG SPAW EDITOR (http://www.oscommerce.com/community/contributions,2963/). I've followed the instructions the best I can but when I get to the last bit where I have to edit the includes/catalog/admin/includes/functions/html_output.php file, it says i need to replace a bit of the code. But this is where i'm completely stuck.

 

I replaced this code to find it was already below the code that was said needs replacing! so i left it as it was but i get "Parse error: parse error, unexpected '*' in /****/****/public_html/admin/includes/functions/html_output.php on line 245". I've tried deleting the code below in the file but i get more errors, i haven't got a clue what I need to do.

 

I would greatly appreciate your help!

Thanks in advance

Link to comment
Share on other sites

Best advice - restore from an original copy of that file, and then make the modification again. Hope you're not using the osCommerce File Manager to edit files!

 

Vger

Link to comment
Share on other sites

Best advice - restore from an original copy of that file, and then make the modification again.  Hope you're not using the osCommerce File Manager to edit files!

 

Vger

 

Hi,

 

No i'm using Note Tab Light :thumbsup: . I've restored the original html_output.php file and my admin is back working with no errors. So my problem is in this code which doesn't seem to make sense to me, i've included it below so hopefully someone can point me in the right direction. This is the php file that is included in the contribution:

 

////
// Output a form textarea field
/*
 function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
   $field = '<textarea name="' . tep_output_string($name) . '" wrap="' . tep_output_string($wrap) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';

   if (tep_not_null($parameters)) $field .= ' ' . $parameters;

   $field .= '>';

   if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) {
     $field .= stripslashes($GLOBALS[$name]);
   } elseif (tep_not_null($text)) {
     $field .= $text;
   }

   $field .= '</textarea>';

   return $field;
 }
 */
////
// Output a form textarea field
 function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
    if (tep_not_null($parameters)) $field .= ' ' . $parameters;

       $sw = new SPAW_Wysiwyg(tep_output_string($name), stripslashes($text), '', '', '', '', '');
       $sw->show();
   return $field;
 }

Now the instructions say :

 

OPEN with TEXT editor

file: includes/catalog/admin/includes/functions/html_output.php

after <?php

ADD:

include('../../catalog/includes/edit-wysiwyg.php'); ...This is already done in the file on line 12 of the contribution

 

AROUND LINE 236 FIND:

 

////
// Output a form textarea field

 function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
   $field = '<textarea name="' . tep_output_string($name) . '" wrap="' . tep_output_string($wrap) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';

   if (tep_not_null($parameters)) $field .= ' ' . $parameters;

   $field .= '>';

   if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) {
     $field .= stripslashes($GLOBALS[$name]);
   } elseif (tep_not_null($text)) {
     $field .= $text;
   }

   $field .= '</textarea>';

   return $field;
 }

 

 

REPLACE WITH:

 

////
// Output a form textarea field
 function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
    if (tep_not_null($parameters)) $field .= ' ' . $parameters;

       $sw = new SPAW_Wysiwyg(tep_output_string($name), stripslashes($text), '', '', '', '', '');
       $sw->show();
   return $field;
 }

 

But it's already there and so is the code that it says to replace! :'(

 

I've tried deleting one set of the codes, leaving both of the different 'textarea field' codes in, but i always get errors.

 

Any more help would be great

Thanks again

Link to comment
Share on other sites

The html_output.php file from the contribution has commented out the original code, leaving only the modified code to be run by the server. If you've not made any other modifications to this file outside this contribution, just use the file with no change at all, and it should be fine.

 

The error "Parse error: parse error, unexpected '*' in /****/****/public_html/admin/includes/functions/html_output.php on line 245" seems to indicate that one of the comment tag pairs (/* ...code you don't want to run here */) was edited by mistake.

Link to comment
Share on other sites

Sorry to be a pain, i've just tried using the contribution html_output.php file without changing it at all. The admin now works but at the top of my screen is the message:

 

Warning: main(../../catalog/includes/edit-wysiwyg.php): failed to open stream: No such file or directory in /****/****/public_html/admin/includes/functions/html_output.php on line 12

 

Warning: main(../../catalog/includes/edit-wysiwyg.php): failed to open stream: No such file or directory in /****/****/public_html/admin/includes/functions/html_output.php on line 12

 

Warning: main(): Failed opening '../../catalog/includes/edit-wysiwyg.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /****/****/public_html/admin/includes/functions/html_output.php on line 12

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /****/****/public_html/admin/includes/functions/html_output.php:12) in /****/****/public_html/admin/includes/functions/sessions.php on line 67

 

The admin seems to work ok apart from where the contribution is supposed to be, it just says:

 

Fatal error: Cannot instantiate non-existent class: spaw_wysiwyg in /****/****/public_html/admin/includes/functions/html_output.php on line 262

 

I hoping I only need to change a little bit more, but i'm not sure what else could be going wrong.

 

Any more help would be great

Thanks again

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...