Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

olsonsp4c

Pioneers
  • Posts

    545
  • Joined

  • Last visited

Posts posted by olsonsp4c

  1. Another line that needs to be changed:

     

    catalog/admin/categories.php

     

    find:

    	  if ($HTTP_GET_VARS['cID']) {
    	echo tep_image_submit('button_update.gif', IMAGE_UPDATE);
      } else {
    	echo tep_image_submit('button_insert.gif', IMAGE_INSERT);
      }

     

    make sure the next line reads:

    	  echo '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['cID']) ? '&cID=' . $HTTP_GET_VARS['cID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';

     

    Scott

  2. WOW! Nice work Scott. I panicked after loading the upgrade to a live and very, very busy site. Knew of the harversters from years ago, had a bad seed working for us and it was quickly apparent what he was doing - we found some software from Atom Harvester I think it was - very nasty! Hope I didn't offend.

     

    Regards and thanks again for the option!

     

    C

     

    I'm not offended. thanks for the heads up - it was because i read your post that i rewrote the code :rolleyes:

     

    Scott

  3. Ugh... It's really hard to try and troubleshoot when my OSCommerce installation doesn't have those errors. I am using the same module everyone else is using and it works perfectly (for me). So If you're having problems and need it to work "yesterday", please use the previous version untill I can work out the kinks in this Beta with the "Beta Testers".

     

    I appreciate everyone's involvement but please be patient with me as college has just started and I'm taking online courses, school courses, working one job, and trying to run a business all at the same time.

     

    I just wanted to say thanks to Greg for all his hard work re-coding this addon...

     

    Scott

  4. ok so I eventually had issues with paypal.

     

    Subject line of orders with paypal read "EMAIL_TEXT_SUBJECT"

     

     

    So i just went into catalog/includes/languages/english/checkout_process.php

     

    and changed //define('EMAIL_TEXT_SUBJECT', 'Order Process');

    to define('EMAIL_TEXT_SUBJECT', 'Order Process');

     

    (took out comments) not sure if there is any bad side effect of this but dont see any yet and my subject line is back for paypal orders and still showing up for credit card orders.

     

     

    Great! Thanks for posting!

     

    Scott

  5. I get this error in :Fatal error: Cannot redeclare tep_draw_textbox_field() (previously declared in /catalog/admin/includes/functions/html_output.php:272) in catalog/admin/includes/functions/html_output.php on line 372

     

     

    right when you add this code in:

     

    * STEP 8 *
    **********
    
    OPEN catalog/admin/includes/functions/html_output.php
    
    FIND this:
    
    ////
    // Output a form textarea field
     function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
       global $HTTP_GET_VARS, $HTTP_POST_VARS;
    
       $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 ( ($reinsert_value == true) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {
         if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {
           $field .= tep_output_string_protected(stripslashes($HTTP_GET_VARS[$name]));
         } elseif (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) {
           $field .= tep_output_string_protected(stripslashes($HTTP_POST_VARS[$name]));
         }
       } elseif (tep_not_null($text)) {
         $field .= tep_output_string_protected($text);
       }
    
       $field .= '</textarea>';
    
       return $field;
     }
    
    ADD this AFTER:
    
    //Package Tracking Plus BEGIN
    ////
    // Output a form textbox field
     function tep_draw_textbox_field($name, $size, $numchar, $value = '', $params = '', $reinsert_value = true) {
       $field = '<input type="text" name="' . $name . '" size="' . $size . '" maxlength="' . $numchar . '" value="';
       if ($params) $field .= '' . $params;
       $field .= '';
       if ( ($GLOBALS[$name]) && ($reinsert_value) ) {
         $field .= $GLOBALS[$name];
     } elseif ($value != '') {
         $field .= trim($value);
       } else {
         $field .= trim($GLOBALS[$name]);
       }
       $field .= '">';
    
       return $field;
     }
    //Package Tracking Plus END

     

     

     

    and here is how I put it in:

    ///
    // Output a form textarea field
     function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
       global $HTTP_GET_VARS, $HTTP_POST_VARS;
    
       $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 ( ($reinsert_value == true) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {
         if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {
           $field .= tep_output_string_protected(stripslashes($HTTP_GET_VARS[$name]));
         } elseif (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) {
           $field .= tep_output_string_protected(stripslashes($HTTP_POST_VARS[$name]));
         }
       } elseif (tep_not_null($text)) {
         $field .= tep_output_string_protected($text);
       }
    
       $field .= '</textarea>';
    
       return $field;
     }
      //Package Tracking Plus BEGIN
    ////
    // Output a form textbox field
     function tep_draw_textbox_field($name, $size, $numchar, $value = '', $params = '', $reinsert_value = true) {
       $field = '<input type="text" name="' . $name . '" size="' . $size . '" maxlength="' . $numchar . '" value="';
       if ($params) $field .= '' . $params;
       $field .= '';
       if ( ($GLOBALS[$name]) && ($reinsert_value) ) {
         $field .= $GLOBALS[$name];
     } elseif ($value != '') {
         $field .= trim($value);
       } else {
         $field .= trim($GLOBALS[$name]);
       }
       $field .= '">';
    
       return $field;
     }
    //Package Tracking Plus END
    
    ////
    // Output a form hidden field
     function tep_draw_hidden_field($name, $value = '', $parameters = '') {
       global $HTTP_GET_VARS, $HTTP_POST_VARS;
    
       $field = '<input type="hidden" name="' . tep_output_string($name) . '"';
    
       if (tep_not_null($value)) {
         $field .= ' value="' . tep_output_string($value) . '"';
       } elseif ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) {
         if ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) ) {
           $field .= ' value="' . tep_output_string(stripslashes($HTTP_GET_VARS[$name])) . '"';
         } elseif ( (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) {
           $field .= ' value="' . tep_output_string(stripslashes($HTTP_POST_VARS[$name])) . '"';
         }
       }
    
       if (tep_not_null($parameters)) $field .= ' ' . $parameters;
    
       $field .= '>';
    
       return $field;
     }
    
    ////
    // Hide form elements
     function tep_hide_session_id() {
       $string = '';
    
       if (defined('SID') && tep_not_null(SID)) {
         $string = tep_draw_hidden_field(tep_session_name(), tep_session_id());
       }
    
       return $string;
     }
    
    ////
    // Output a form pull down menu
     function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
       global $HTTP_GET_VARS, $HTTP_POST_VARS;
    
       $field = '<select name="' . tep_output_string($name) . '"';
    
       if (tep_not_null($parameters)) $field .= ' ' . $parameters;
    
       $field .= '>';
    
       if (empty($default) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {
         if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {
           $default = stripslashes($HTTP_GET_VARS[$name]);
         } elseif (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) {
           $default = stripslashes($HTTP_POST_VARS[$name]);
         }
       }
    
       for ($i=0, $n=sizeof($values); $i<$n; $i++) {
         $field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';
         if ($default == $values[$i]['id']) {
           $field .= ' SELECTED';
         }
    
         $field .= '>' . tep_output_string($values[$i]['text'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</option>';
       }
       $field .= '</select>';
    
       if ($required == true) $field .= TEXT_FIELD_REQUIRED;
    
       return $field;
     }
     function tep_draw_textbox_field($name, $size, $numchar, $value = '', $params = '', $reinsert_value = true) {
       $field = '<input type="text" name="' . $name . '" size="' . $size . '" maxlength="' . $numchar . '" value="';
       if ($params) $field .= '' . $params;
       $field .= '';
       if ( ($HTTP_POST_VARS[$name]) && ($reinsert_value) ) {
         $field .= $HTTP_POST_VARS[$name];
     } elseif ($value != '') {
         $field .= trim($value);
       } else {
         $field .= trim($HTTP_POST_VARS[$name]);
       }
       $field .= '">';
    
       return $field;
     }
    ?>

     

     

    so how do I fix this scott?

     

    I'm sorry everybody, I'm not getting emails when people post here... feel free to message me if I don't respond quickly.

     

    Look at the bottom of the second code block:

     

    function tep_draw_textbox_field($name, $size, $numchar, $value = '', $params = '', $reinsert_value = true) {
    $field = '<input type="text" name="' . $name . '" size="' . $size . '" maxlength="' . $numchar . '" value="';
    if ($params) $field .= '' . $params;
    $field .= '';
    if ( ($HTTP_POST_VARS[$name]) && ($reinsert_value) ) {
      $field .= $HTTP_POST_VARS[$name];
     } elseif ($value != '') {
      $field .= trim($value);
    } else {
      $field .= trim($HTTP_POST_VARS[$name]);
    }
    $field .= '">';
    
    return $field;
     }

     

    Apparently another addon had you install a function with the same name. You can fix it by renaming the function for Package Tracking Plus (maybe to tep_draw_textbox_field_ptp - so you can differentiate the two functions) and going back through the code you inserted to edit every instance that Package Tracking Plus calls the function to the new name (your rename).

     

    Scott

  6. Thanks for the complements. For those of you who want the "Click to email the author" link to exist, I've updated my osC reCaptcha addon to include instructions to implement reCaptcha mailhide to conceal and protect your customer's email addresses from potential harvesters: http://addons.oscommerce.com/info/6306

     

    I have not heard of such a mod (uploading pics); however, there might be a way to steal code from another uploading addon to integrate this. If you solve this issue, please post the code so everyone can benefit.

     

    Scott

  7. Nice wrapping up of this and recaptch with it, but how does one remove the email the author link in the customer testimonials. There are too many easy harvester software out there to have the customers emails so openly available on the customer testimonial page.

     

    I HIGHLY ADVISE AGAINST ANYONE LEAVING THIS INTACT - YOU WILL LOSE FACE QUICKLY WITH CUSTOMERS WHO HAVE GIVEN TESTIMONIALS!!!

     

    This has been addressed in version 3.61: http://addons.oscommerce.com/info/5477

     

    Scott

  8. I am running MySQL client version: 4.1.20

    with osCommerce V2.2 RC2

     

    Thanks

     

    Though I can not be certain of this, absolutely, it might be because you are on mySQL version less than 5.0... is it possible for you to upgrade? Also, try re-uploading all the files and double checking your edits...

     

    Scott

  9. Customer Testimonials v3.6 is out: http://addons.oscommerce.com/info/5477

     

    Upgrade path included in installation.txt - Full package

     

    Since v3.5(1)

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

    * Added further multi-lingual support in all areas

    * Added email validation to the catalog and the admin

    * Added date added field in the catalog

    * Added language defines in catalog/includes/languages/english.php

    * Added admin link in testimony submission email

    * Removed unnecessary case in catalog

    * Removed erroneous language defines

    * HTML fixes in both the catalog and the admin

    * Adjusted the admin language defines for consistency

    * Rewrote code in catalog/customer_testimonials_write.php to make this addon compatible with my osC reCaptcha addon: http://addons.oscommerce.com/info/6306

    * Rewrote code in catalog/includes/modules/customer_testimonials.php significantly

    * Added screenshots to save bandwidth

    * Added a new button in the catalog

     

    Scott

  10. if you have a problem cancelling a new category insert and pulling up the whole screen properly, here is the fix:

     

    in admin/categories.php

     

    Find:

    		  <tr>
    		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    	  </tr>
    	  <tr>
    	  <tr>
    		<td class="main"><?php echo TEXT_EDIT_CATEGORIES_IMAGE; ?></td>
    		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_file_field('categories_image') . '<br>' . tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $cInfo->categories_image . tep_draw_hidden_field('categories_previous_image', $cInfo->categories_image); ?></td>
    	  </tr>
    	  <tr>
    		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    	  </tr>
    	  <tr>
    		<td class="main"><?php echo TEXT_EDIT_SORT_ORDER; ?></td>
    		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sort_order', $cInfo->sort_order, 'size="2"'); ?></td>
    	  </tr>
    	  <tr>
    		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    	  </tr>
    	</table></td>
      </tr>
      <tr>
    	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>

     

    afterwards make sure the next lines are:

     

    	  <tr>
    	<td class="main" align="left"><?php echo tep_draw_hidden_field('categories_date_added', (($cInfo->date_added) ? $cInfo->date_added : date('Y-m-d'))) . tep_draw_hidden_field('parent_id', $cInfo->parent_id) . tep_image_submit('button_save.gif', IMAGE_SAVE) . '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['cID']) ? '&cID=' . $HTTP_GET_VARS['cID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
      </form></tr>

     

    Scott

  11. I tried installing this, however it does not work for me.

    The following errors were received.

     

    Note: I have checked all the tables and they do exist in phpMyAdmin after the SQL file was ran.

     

    I Used the column_left.php ,If I remove the Colum_left php the error goes away.

     

     

    1146 - Table 'xxx_xxxx.customer_testimonials' doesn't exist
    
    select * FROM customer_testimonials WHERE status = 1 ORDER BY rand() LIMIT 1
    
    [TEP STOP]

     

     

     

    My Column_left.php is below.

     

    Thanks for your help.

     

    // {{ buySAFE Module
      if (MODULE_BUYSAFE_BUYSAFE_STATUS == 'True' && tep_not_null(MODULE_BUYSAFE_BUYSAFE_SEAL_AUTHENTICATION_DATA) && MODULE_BUYSAFE_BUYSAFE_SEAL_AUTHENTICATION_DATA != '-- none --' && $buysafe_result['IsBuySafeEnabled'] != 'false' && !$buysafe_result['faultstring']) echo "<!-- buySAFE //-->\n<tr><td align=\"center\"><script src=\"" . MODULE_BUYSAFE_BUYSAFE_ROLLOVER_URL . "\"></script><span id=\"BuySafeSealSpan\"><script type=\"text/javascript\">WriteBuySafeSeal('BuySafeSealSpan', '" . MODULE_BUYSAFE_BUYSAFE_SEAL_TYPE . "', 'HASH=" . urlencode(MODULE_BUYSAFE_BUYSAFE_SEAL_AUTHENTICATION_DATA) . "');</script> </span></td></tr>\n<!-- buySAFE_eof //-->\n";
    // }}
    
      if ((USE_CACHE == 'true') && empty($SID)) {
     echo tep_cache_categories_box();
      } else {
     include(DIR_WS_BOXES . 'categories.php');
      }
    
      if ((USE_CACHE == 'true') && empty($SID)) {
     echo tep_cache_manufacturers_box();
      } else {
     include(DIR_WS_BOXES . 'manufacturers.php');
      }
      require(DIR_WS_BOXES . 'whats_new.php');
      require(DIR_WS_BOXES . 'search.php');
      if ($request_type == NONSSL) {   /* only show adsense in NON SSL else it causes warning */
     include(DIR_WS_BOXES . 'google_adsense_search.php');
      }
      require(DIR_WS_BOXES . 'information.php');
       include(DIR_WS_BOXES . 'customer_testimonials.php');
    ?>

     

    what version of mysql are you running?

    Scott

  12. disregard, got it working.

     

    Had to change tld.txt and add gmail, etc.

     

    I apologize, but could you elaborate a little bit on this and explain a little more on this so that others could understand what you did, in case they have the same problem? Thanks!

     

    Scott

  13. Everybody, I rewrote this addon and fixed all known issues that I could find including the admin update issue mentioned above...

     

    Download it here: http://addons.oscommerce.com/info/5477

     

    Here's the skinny:

     

    Since v3.2

    ----------

    * Modified the sql to do away with url and instead use email address

    * Modified the catalog infobox formatting a little bit

    * Modified the layout of the catalog files and functionality

    * Added a new button to the catalog and updated all other buttons added by this addon

    * Altogether rewrote error message logic to be consistent with osC standards in the catalog

    * Fixed the success page bug so that it redirects to the success page properly

    * Fixed the module email address bug, now "mailto:" is automatically added to email addresses

    * Fixed the update issue in the Admin where it changed from Update to Insert

    * Fixed the update issue in the Admin where it would not append updated info to the database properly

    * Added a bunch of language defines that weren't there

    * Integrated the email message mod into the base code

    * Removed ALOT of superflous code that had crept into the addon

    * Many, many, many other small things and some larger ones :)

     

    It is quite ready for multilingual support; however, you all will need to do the translation work for me :)

     

    Scott

  14. I was hope someone could help me with an error or bug that I am having.

     

    I have read all six pages of this support forum and only noticed this bug mentioned once, with no reply or answer.

    I find it had to believe they we are the only 2 experiencing this.

     

    I've tried for many hours now to correct this but have had no luck. I decided to see if I could find some help.

     

    Here is the problem as clearly described as I can:

     

    In admin, if I select a testimonial and then click the Edit button, I am brought to an Edit page with an Update button at the bottom.

    If I make no changes here, pressing Update returns me to the default page listing all testimonials.

    If I make changes that don't trigger any error messages, pressing Update returns me to the default page listing all testimonials.

    *Now here's the messed up part*

    If I make a change that I know will trigger an error message, pressing Update refreshes the page, no messagestack is displayed, and the Update button is replaced with an Insert button.

    If I correct the input that triggered the error messages, pressing Insert causes a new testimonial to be added to the database and returns me to the default page where I see the newly, yet unnecessarily, added testimonial at the top of the list.

     

    Has anyone else encountered this bug?

     

    Does anyone have a solution to this bug?

     

    I find it had to believe that its made it this many versions and no one besides the other person and myself have had this bug. Like I mentioned before I have tried for hours to hunt down the cause of this bug with out any success.

     

    Please Help!

     

    I looked at it, the issue is that it is losing the tID for some reason and switching from the 'update' case to the 'insert' case... I'm not sure how to fix it at this point....

     

    Scott

  15. Anyone find a solution to the customer testimonials pushing out left and right. Its fairly easy to adjust most pages to fit the 770 width but I am having trouble with this one (5 hours later, lol).

     

    Anyone know of where I can start to fix this?

     

    Carry

    :blush:

     

    I remember having an issue with this at some point - towards the bottom there is probably a missing </tr> or an extra one perhaps... look at the code I posted and compare it to your file...

     

    Scott

  16. I've added an addon to add reCaptcha support for osC forms and could use help on integration into the Customer Testimonials Addon.

     

    You can download it here: http://addons.oscommerce.com/info/6306

     

    I've included a section on a non-working version for this addon that you could help me troubleshoot that is essentially the same as I've posted above but tells you how to add it to your store... please backup before you install it as it is currently NON-functional for the customer_testimonials_write.php page...

     

    thanks!

     

    Scott

  17. Hello! I'm trying to integrate reCaptcha with testimonials on the customer_testimonials_write.php page (I've already done it on contact us and create account and other pages...). This is the code I'm using; however, I can't get reCaptcha to validate that I put in the correct words (and I am typing the correct words) - it always gives "incorrect code entered" - below is the code I'm using on this page to make this work thusfar... any thoughts? My initial thoughts are that the "insert" "case" is messing it up somehow... my code is commented...

     

     <?php
     /*
      $Id: customer_testimonials_write.php,v 2 10/17/2007 Exp $
      Released under the GNU General Public License
      Contributed by http://www.nxlcart.com
    */
    
    
      require('includes/application_top.php');
    
      require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CUSTOMER_TESTIMONIALS);
    
    // start modification for reCaptcha
      require_once('includes/classes/recaptchalib.php');
      require_once('includes/recaptchakeys.php');
    // end modification for reCaptcha
    
      $location = ' » <a href="' . tep_href_link(FILENAME_CUSTOMER_TESTIMONIALS_WRITE, '', 'NONSSL') . '" class="headerNavigation">' . NAVBAR_TITLE . '</a>';
      $breadcrumb->add(NAVBAR_TITLE2, tep_href_link(FILENAME_CUSTOMER_TESTIMONIALS_WRITE));
    ?>
    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html <?php echo HTML_PARAMS; ?>>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
    <title><?php echo TITLE; ?></title>
    <base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
    <link rel="stylesheet" type="text/css" href="stylesheet.css">
    </head>
    <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
    <!-- header //-->
    <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
    <!-- header_eof //-->
    <!-- body //-->
    <table border="0" width="100%" cellspacing="3" cellpadding="3">
      <tr>
     <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
    <!-- left_navigation //-->
    <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
    <!-- left_navigation_eof //-->
     </table></td>
    <!-- body_text //-->
     <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
       <tr>
    	 <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
    	   <tr>
    		 <td class="pageHeading" colspan="2"><?php echo TEXT_TESTIMONIALS_WRITE; ?></td>
    	   </tr>
    	 </table></td>
       </tr>
       <tr>
    	 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
       </tr>
    <?php
    
    if ($HTTP_GET_VARS['action']) {
     switch ($HTTP_GET_VARS['action']) {
       case 'insert':
    	 $testimonials_id = tep_db_prepare_input($HTTP_POST_VARS['testimonials_id']);
    	 $testimonials_title = tep_db_prepare_input($HTTP_POST_VARS['testimonials_title']);
    	 $testimonials_name = tep_db_prepare_input($HTTP_POST_VARS['testimonials_name']);
    	 $testimonials_email = tep_db_prepare_input($HTTP_POST_VARS['testimonials_email']);
    	 $testimonials_location = tep_db_prepare_input($HTTP_POST_VARS['testimonials_location']);
    	 $html_text = tep_db_prepare_input($HTTP_POST_VARS['html_text']);
    
    	 $testimonials_error = false;
    	 $messageStack = ERROR_HEADER;
    	 if (empty($testimonials_title)) {
    	   $messageStack .= '['.ERROR_TESTIMONIALS_TITLE_REQUIRED.']';
    	   $testimonials_error = true;
    	 }
    	 if (empty($testimonials_name)) {
    	   $messageStack .= '['.ERROR_TESTIMONIALS_NAME_REQUIRED.']';
    	   $testimonials_error = true;
    	 }
    	  if (empty($testimonials_email)) {
    	   $messageStack .= '['.ERROR_TESTIMONIALS_EMAIL_REQUIRED.']';
    	   $testimonials_error = true;
    	 }
    	 if (empty($html_text)) {
    	   $messageStack.= '['.ERROR_TESTIMONIALS_DESCRIPTION_REQUIRED.']';
    	   $testimonials_error = true;
    	 }
    // start modification for reCaptcha
    	 if ($HTTP_GET_VARS['action'] == 'insert') {
    	   // the response from reCAPTCHA
    	   $resp = null;
    
    	   // was there a reCAPTCHA response?
    	   $resp = recaptcha_check_answer ($privatekey,
    									   $_SERVER["REMOTE_ADDR"],
    									   $_POST["recaptcha_challenge_field"],
    									   $_POST["recaptcha_response_field"]);
    	   if (!$resp->is_valid) {
    		 $messageStack.='['.ENTRY_SECURITY_CHECK_ERROR.$resp->error.']';
    		 $testimonials_error = true;
    	   }
    	 }
    // end modification for reCaptcha
    
    	 if (!$testimonials_error) {
    	   $sql_data_array = array('testimonials_title' => $testimonials_title,						 
    							   'testimonials_location' => $testimonials_location,
    							   'testimonials_name' => $testimonials_name,
    							   'testimonials_email' => $testimonials_email,
    							   'testimonials_html_text' => $html_text);
    	  // if ($HTTP_GET_VARS['action'] == 'insert') {
    		// $insert_sql_data = array('date_added' => 'now()',
    								  // 'status' => '0');
    		 // $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
    		 // tep_db_perform(TABLE_CUSTOMER_TESTIMONIALS, $sql_data_array);
    		 // $testimonials_id = tep_db_insert_id();
    	   // }
    	  if ($HTTP_GET_VARS['action'] == 'insert') {
    		$insert_sql_data = array('date_added' => 'now()',
    								  'status' => '0');
    		 $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
    		 tep_db_perform(TABLE_CUSTOMER_TESTIMONIALS, $sql_data_array);
    		 $testimonials_id = tep_db_insert_id();
    		 // email notification added by maestro
    		 $email_text = TESTIMONIAL_NOTIFICATION_TEXT . $testimonials_name . "\n" .
    					   TESTIMONIAL_NOTIFICATION_TEXT_2 . "\n\n" .
    					   TESTIMONIAL_NOTIFICATION_TITLE . $testimonials_title . "\n\n" .
    					   TESTIMONIAL_NOTIFICATION_HTML_TEXT . "\n" .
    					   $html_text . "\n\n" .
    					   $testimonials_url . "\n\n" .
    					   TESTIMONIAL_NOTIFICATION_APPROVE;
    		 tep_mail('', '[email protected]', TESTIMONIAL_NOTIFICATION_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
    	   }
    	   echo '<tr><td colspan="2">' . tep_draw_separator('pixel_trans.gif', '1', '10') .' </td></tr>';
    	   echo '<tr><td class="main">'. TEXT_TESTIMONIALS_SUCCESSFUL .'</td><td class="main"><a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a></td></tr>';
    	   $testimonials_id = '';
    		$testimonials_title = '';
    		$testimonials_location = '';
    		$testimonials_name = '';
    		$testimonials_email = '';
    		$html_text = '';
    	 } else {
    		echo '<tr><td colspan="2">' . tep_draw_separator('pixel_trans.gif', '1', '10') .' </td></tr>';
    		echo '<tr><td class="main">'. $messageStack .'</td><td class="main"></td></tr>';
    
    		$testimonials_id = tep_db_prepare_input($HTTP_POST_VARS['testimonials_id']);
    		$testimonials_title = tep_db_prepare_input($HTTP_POST_VARS['testimonials_title']);		  
    		$testimonials_location = tep_db_prepare_input($HTTP_POST_VARS['testimonials_location']);
    		$testimonials_name = tep_db_prepare_input($HTTP_POST_VARS['testimonials_name']);
    		$testimonials_email = tep_db_prepare_input($HTTP_POST_VARS['testimonials_email']);
    		$html_text = tep_db_prepare_input($HTTP_POST_VARS['html_text']);
    	 }
    	 break;
     }
      }
    
    ?>
    
    <?php
    if (tep_session_is_registered('customer_id')) {
     $account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
     $account = tep_db_fetch_array($account_query);
    
     $testimonials_name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
     $testimonials_email = $account['customers_email_address'];
      }
    ?>
    
    <tr><form name="customer_testimonial" method="post" action="<?php echo tep_href_link(FILENAME_CUSTOMER_TESTIMONIALS_WRITE, 'action=insert', 'NONSSL'); ?>">
    	 <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
    	   <tr>
    		 <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    	   </tr>
    	   <tr>
    		 <td class="main"><?php echo TEXT_TESTIMONIALS_INTRO; ?></td>
    	   </tr>
    	   <tr>
    		 <td><table align="center" width="100%" border="0" cellspacing="0" cellpadding="0">
    		   <tr>
    			 <td class="infoBox"><table width="100%" border="0" cellspacing="0" cellpadding="2" class="infoBoxContents">
    		   <tr>
    			 <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
    		   <tr>
    			 <td class="main"><?php echo TEXT_TESTIMONIALS_TITLE; ?>
    
    							  <?php echo tep_draw_input_field('testimonials_title',  $testimonials_title, '', true); ?><span class="inputRequirement">*</span></td>
    		   </tr>
    		   <tr>
    			 <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    		   </tr>
    		   <tr>
    			 <td class="main"><?php echo TEXT_TESTIMONIALS_NAME; ?>
    
    							  <?php echo tep_draw_input_field('testimonials_name', $testimonials_name, '', true); ?><span class="inputRequirement">*</span></td>
    		   <tr>
    			 <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    		   </tr>
    		   <tr>
    			 <td class="main"><?php echo TEXT_TESTIMONIALS_EMAIL; ?>
    
    							  <?php echo tep_draw_input_field('testimonials_email'); ?> <span class="inputRequirement">*</span></td> 
    		   </tr>
    		   <tr>
    			 <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    		   </tr>
    		   <tr>
    			 <td class="main"><?php echo TEXT_TESTIMONIALS_LOCATION; ?>
    
    							  <?php echo tep_draw_input_field('testimonials_location', $testimonials_location); ?></td>
    			  </tr>
    		   <tr>
    			 <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    		   </tr>
    		   <tr>
    			 <td valign="top" class="main"><?php echo TEXT_BANNERS_HTML_TEXT; ?>
    
    										   <?php echo tep_draw_textarea_field('html_text', 'soft', '130', '10', $html_text); ?></td>
    		   </tr>
    		 </table></td>
    	   </tr>
    		 </table></td>
    	   </tr>
    		   <tr>
    			 <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    		   </tr>
    <!-- start modification for reCaptcha -->
    		   <tr>
    			 <td class="main"><?php echo ENTRY_SECURITY_CHECK; ?></td>
    		   </tr>
    		   <tr>
    			 <script>
    			 var RecaptchaOptions = {
    				theme : 'white',
    				tabindex : 3
    			 };
    			 </script>				  
    			 <td class="main"><?php echo recaptcha_get_html($publickey); ?></td>
    		   </tr>
    <!-- end modification for reCaptcha -->
    		   <tr>
    			 <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    		   </tr>
    		   <tr>
    			 <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
    			   <tr class="infoBoxContents">
    				 <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
    				   <tr>
    					 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
    					 <td class="main" align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_CUSTOMER_TESTIMONIALS) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
    					 <td class="main" align="right" valign="middle"><?php echo tep_image_submit('button_submit.gif', IMAGE_BUTTON_INSERT). '<a href="' . tep_href_link(FILENAME_CUSTOMER_TESTIMONIALS_WRITE, '', 'NONSSL'); ?></td>
    					 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
    				   </tr>
    				 </table></td>
    			   </tr>
    			 </table></td>
    		   </tr>
    	 </table></td>
       </form></tr>
      </tr>
    </table>
    </td>
      </tr>
    </table>
    <!-- body_text_eof //-->
     <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
    <!-- right_navigation //-->
    <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
    <!-- right_navigation_eof //-->
     </table></td>
      </tr>
    </table>
    <!-- body_eof //-->
    
    <!-- footer //-->
    <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
    <!-- footer_eof //-->
    
    
    </body>
    </html>
    <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

     

    Scott

  18. Thanks! I like the addition and will integrate it. I am back and will make some time this week to work on the back/forth checked/unchecked value continuing to be retained issue mentioned above, though I'm not an expert at those kind of issues and could use help.

  19. So far it's been working as planned, although does anyone know if I can make insurance required, and not allow a customer to uncheck the box at the checkout stage?

     

     

    You should just install USPS Methods and use the "with insurance" option and choose that you want insurance included in the admin - that way, all price quotes from usps include shipping insurance automatically.

     

    Scott

  20. Hello everyone. I followed the instructions EXACTLY to install this contrib. Now when I log into my Admin panel and go to "Orders", I am receiving the following error:

     

    Parse error: syntax error, unexpected T_CASE in /home/kitchens/public_html/admin/orders.php on line 286

     

    I'm sure you figured this out, but the below code is the issue. You copied the tep_db_query into the code, which was only there so you'd know where to insert it. So you double the queries. And you get the extra "}" which caused the "unexpected T_CASE".

     

    //Package Tracking Plus END
    
    	   tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "')");
    
    	   $order_updated = true;
    	 }
    
    
    	   tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "')");
    
    	   $order_updated = true;
    	 }

     

     

    should be:

     

     

     //Package Tracking Plus END
    
    	   tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "')");
    
    		$order_updated = true;
    	  }

     

     

    Scott

×
×
  • Create New...