Jump to content

olsonsp4c

Members
  • Content count

    545
  • Joined

  • Last visited

Everything posted by olsonsp4c

  1. olsonsp4c

    Customer Testimonials v1.0

    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@address.com', 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
  2. olsonsp4c

    USPS Shipping Insurance

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

    USPS Shipping Insurance

    I have confirmed the problem; however, I am leaving out of town for a week or so and won't be able to work on it. Can someone else look into this as this could be frustrating to customers? Scott
  4. olsonsp4c

    USPS Shipping Insurance

    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
  5. 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
  6. It should work with Google Checkout, but I have not tested it personally. It works independent of most payment solutions, with the exception of Paypal - the changes made to checkout_process.php must be integrated into the paypal ipn in order for the order email to send properly. If a payment solution overrides the default oscommerce order email (like paypal does), then you'd have to modify that payment solution's file(s) as well. I personally use the old osCommerce Official Paypal IPN addon version 1.4 because I like things simple that just work. However, I too wanted both Paypal and Google Checkout and couldn't figure out a way to integrate both into the checkout process at that time. This may be possible now, but I haven't checked. I wanted them both as options on the checkout_payment.php page without having buttons throughout the whole store and such... Scott
  7. olsonsp4c

    USPS Shipping Insurance

    Tested and slightly adjusted the code above. It works! Thanks so much! I've updated the addon to 1.4 and made a few other minor changes. http://addons.oscommerce.com/info/5782 Changes since v1.3 ------------------ * Fixed the issue: the order history doesn't show that insurance was ordered (thanks VITW) * Fixed the issue: going from "Confirmation" back to "Payment" doesn't retain the fact that insurance was requested (thanks VITW) * Updated insurance rates to current prices (taken from usps.com) * I have confirmed that 1.4 does work with the osC rc2a PayPal Website Payments Standard, properly carrying over the insurance value * Updated the Upgrade section Still could use help with the 2 other known issues in the "What I could use help with" section... Scott
  8. olsonsp4c

    Automatic Stock Notification

    Everybody, I've updated the addon to version 2.3 and integrated the above fix. * Missed a multi-lingual reference in the email subject, changed catalog/admin/includes/languages/xxxxxxxxxx/categories.php accordingly. * Updated the addon to work properly when stock is from "out of stock" to "in stock" and not to include stock increases when stock is already greater than 0 (THANKS to ggbig) * Updated the instructions to include the option to delete or not delete customer email notifications from the database after the email is sent (added step 2b and 3a/b/c/d) http://addons.oscommerce.com/info/3152
  9. Most likely, your last "}" needs to be moved because it is conflicting with other addons you have installed. I don't know where you need to move it to, you'll have to play around with placement and test your store. Scott
  10. olsonsp4c

    USPS Shipping Insurance

    Yes, that really helps. thanks Rich - I'll test the code on my store too at some point soon - and integrate it into the code. Scott
  11. olsonsp4c

    USPS Shipping Insurance

    it's going to be a while until I am able to take a look at Paypal integration - could someone else chime in who's successfully done it? thanks! also, you might want to put specifically which Paypal addon or module you are using - the stock osC rc2a Paypal? Paypal Pro? the old "official" Paypal addon? Scott
  12. olsonsp4c

    [Contribution] - USPS Methods

    go to configuration -> shipping options and enter your zipcode.
  13. olsonsp4c

    USPS Shipping Insurance

    it depends on which Paypal addon you are using, that's part of the problem... could be either: paypal_ipn.php OR paypal.php OR ipn.php Scott
  14. olsonsp4c

    Automatic Stock Notification

    Yes - it could be integrated into other addons possibly though. Scott
  15. olsonsp4c

    Automatic Stock Notification

    Version 2.2 is out. Bug 2 from above is fixed. Since v2.1 ---------- * Bugfix: Now sends the correct name in the greeting to each customer when email notifications are sent * Added support forum in instructions * Added "What I could use help with" section http://addons.oscommerce.com/info/3152 Scott
  16. olsonsp4c

    Automatic Stock Notification

    OK, I need some help here. Here are the bugs I've found so far and I'm unsure how to fix them. 1. It is supposed to only send emails when stock goes from 0 to MORE than 0 in stock; however, it will send emails whenever the stock is increased. There needs to be a way to query the current (old) stock quantity and store it in a variable (like $prior_products_quantity) and then write an if statement so that the code would look something like this: // BEGIN Automatic Stock Notification if ($prior_products_quantity == 0) { if ($HTTP_POST_VARS['products_quantity'] > 0){ $audience = array(); $products_query = tep_db_query("select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where c.customers_id = pn.customers_id and pn.products_id in ( '" . (int)$products_id . "')"); 2. If there is more than 1 customer subscribed to product, it sends the name of the 1st customer to ALL customers!!! That's all I've found so far. I need help making this work like it was designed to work. Scott
  17. olsonsp4c

    USPS Priority Mail Flat Rate Shipping

    Everyone, note that usps priority mail prices have changed... so update your addon! Scott
  18. olsonsp4c

    USPS Shipping Insurance

    thanks Rich, I appreciate the feedback... Issue 1 - this would be a good feature to consider adding in the future, but I'm not sure how to do it at this point Issue 2 - with Paypal you will probably have to add the section you added to checkout_confirmation.php to your paypal file - paypal has lots of issues like this Issue 3 - i've known about this; however, I don't know how to fix it honestly, maybe someone else has an idea - the best idea probably is to use 1.2 which has the selection on checkout_payment.php page, then when they go back, they'll have to reselect insurance. Not optimal, but it's a quicker fix. Scott
  19. olsonsp4c

    Dynamic SiteMap

    Dynamic Sitemap 3.5 Here are changes that I made on my installation to make this work that aren't in the install and some bugs: 1. You can remove this line from admin/includes/filenames.php as it is no longer necessary: define('FILENAME_CREATE_XML_SITEMAPS', 'create_xml_sitemaps.php'); 2. change the file permissions in catalog/dynamic_sitemap.php and in catalog/create_xml_sitemaps.php to 775 or 777 3. in catalog/create_xml_sitemaps has the admin directory hardcoded in about LINE 82, so if you've changed the admin directory, you need to change this too 4. in catalog/dynamic_sitemap.php find this: echo '<li>'.$boxHeading[$b]['heading'][$b]; $nb_elements = count($boxHeading[$b]['filename']); if($nb_elements > 0) { if (tep_not_null($boxHeading[$b]['filename'][0])) { echo '<ul>'; for ($f = 0; $f < $nb_elements; ++$f) if (tep_not_null($boxHeading[$b]['filename'][$f])) echo '<li><a title="'. $boxHeading[$b]['boxtext'][$f] .'" href="' . tep_href_link($boxHeading[$b]['filename'][$f]) . '">' . $boxHeading[$b]['boxtext'][$f] . '</a></li>'; echo '</ul>'; } } echo '</li>'; } change to this: echo $boxHeading[$b]['heading'][$b]; $nb_elements = count($boxHeading[$b]['filename']); if($nb_elements > 0) { if (tep_not_null($boxHeading[$b]['filename'][0])) { echo '<ul>'; for ($f = 0; $f < $nb_elements; ++$f) if (tep_not_null($boxHeading[$b]['filename'][$f])) echo '<li><a title="'. $boxHeading[$b]['boxtext'][$f] .'" href="' . tep_href_link($boxHeading[$b]['filename'][$f]) . '">' . $boxHeading[$b]['boxtext'][$f] . '</a></li>'; echo '</ul>'; } } } A few other notes: 1. If you re-uploaded your files, make sure you remember to hardcode your webaddress in catalog/sitemaps.xml 2. If you re-uploaded your files, make sure your file permissions in the catalog directory for all .xml files are set to 666 3. If you re-uploaded your files, make sure your file permissions in the catalog directory for catalog/dynamic_sitemap.php and catalog/create_xml_sitemaps.php are set to 775 or 777 Bugs: 1. In the admin, there is not a cool integrated popup for the xml sitemap creation with rad icons to submit the sitemap to each of 3 different search engines - ONLY the one popup will work at a time presently in my Firefox browser. Once you've clicked one popup, you can't click the others. 2. The Yahoo submission link always popsup saying This XML file does not appear to have any style information associated with it. The document tree is shown below. − <Success> <Message>Update notification has successfully submitted.</Message> </Success> − <!-- ws05.search.scd.yahoo.com compressed/chunked Tue Jun 17 17:43:03 PDT 2008 --> thanks for all your work. Scott
  20. olsonsp4c

    Who's Online Enhancement 1.4

    I just wanted to say thank you to those who have developed this, especially Steve Dallas for 3.5 because it is the first time the who's online enhancement has been fully functional in my admin. Appreciate the effort. Scott
  21. The only idea I have is to download fresh of both checkout_process.php and the english file and merge them with your existing files and then upload. see if that works. Scott
  22. Most likely it is because your customers used Paypal to pay for the order - you must merge all changes to checkout_process.php into your paypal file in the appropriate place OR you are using another payment module that requires you to merge changes to checkout_process.php into your payment file. Scott
  23. olsonsp4c

    [Contribution] - USPS Methods

    Thanks Greg! Scott
  24. I apologize - I don't think I'll be able to help with this one as I'm just not familiar with the updated ajax stuff... anyone else out there who can help? Scott
  25. olsonsp4c

    USPS Shipping Insurance

    looks like the edits to includes/languages/english.php are missing also note that the stylesheet.css file is in the root directory NOT includes/ Scott
×