Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

rhysgerrard

Pioneers
  • Posts

    2
  • Joined

  • Last visited

Everything posted by rhysgerrard

  1. Is it working with the new os commerece yet and do you know when it may become available to work with it?
  2. Hi Guys, I've installed and used this but for some reason on the Customer Testimonial Write page it breaks the templates up. http://www.naturadirect.com/shop/customer_testimonials_write.php Here is my code for the customer_tesitmonials_write file, im also using STS. <?php /* $Id: customer_testimonials.php 10/20/2008 Exp $ Released under the GNU General Public License Modified by Bill Kellum 'bkellum' for Image Upload Modified by Richard Cranium for ReCaptcha and additional admin functions */ require('includes/application_top.php'); /*** Begin Scrolling Customer Testimonials v1.0 ***/ // Redirect user to login page if any of the following are true: // 1) Admin has disabled Customer Testimonials mod; or // 2) only registered users permitted to write testimonials and user is not logged in if ((TESTIMONIAL_ACTIVE != 'Yes') || (TESTIMONIAL_REGISTERED_WRITE == "Disabled") || ((TESTIMONIAL_REGISTERED_WRITE == "Registered Users Only") && (!tep_session_is_registered('customer_id')))) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } /*** End Scrolling Customer Testimonials v1.0 ***/ require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CUSTOMER_TESTIMONIALS); /*** Begin Scrolling Customer Testimonials v1.1 ***/ include_once(DIR_WS_LANGUAGES . TESTIMONIAL_ADMIN_EMAIL . '/' . FILENAME_CUSTOMER_TESTIMONIALS_ADMIN_EMAIL); /*** End Scrolling Customer Testimonials v1.1 ***/ /*** Begin Scrolling Customer Testimonials v1.0 ***/ if (TESTIMONIAL_CAPTCHA == 'Yes') { // start modification for reCaptcha require_once('includes/classes/recaptchalib.php'); // end modification for reCaptcha } /*** End Scrolling Customer Testimonials v1.0 ***/ $testimonials_error = false; if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == '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']); // make sure testimonials directory exists if(!is_dir(DIR_WS_IMAGES . 'testimonials'))mkdir(DIR_WS_IMAGES . 'testimonials', '777'); $testimonial_image = new upload('testimonial_image'); $testimonial_image->set_destination(DIR_WS_IMAGES . 'testimonials/'); $imagefiletypes = array('jpg','jpeg','gif','png','bmp'); $testimonial_image->set_extensions($imagefiletypes); if ($testimonial_image->parse() && $testimonial_image->save()) { $testimonial_image_name = $testimonial_image->filename; } if (empty($testimonials_title)) { $testimonials_error = true; $messageStack->add('testimonials', ERROR_TESTIMONIALS_TITLE_REQUIRED); } if (empty($testimonials_name)) { $testimonials_error = true; $messageStack->add('testimonials', ERROR_TESTIMONIALS_NAME_REQUIRED); } if (empty($testimonials_email)) { $testimonials_error = true; $messageStack->add('testimonials', ERROR_TESTIMONIALS_EMAIL_REQUIRED); } if (!tep_validate_email($testimonials_email)) { $testimonials_error = true; $messageStack->add('testimonials', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } if (empty($html_text)) { $testimonials_error = true; $messageStack->add('testimonials', ERROR_TESTIMONIALS_DESCRIPTION_REQUIRED); } /*** Begin Scrolling Customer Testimonials v1.0 ***/ if (TESTIMONIAL_CAPTCHA == 'Yes') { // start modification for reCaptcha // the response from reCAPTCHA $resp = null; // was there a reCAPTCHA response? $resp = recaptcha_check_answer (RECAPTCHA_PRIVATE_KEY, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { $testimonials_error = true; $messageStack->add('testimonials', ENTRY_SECURITY_CHECK_ERROR . " (reCAPTCHA output: " . $resp->error . ")"); } // end modification for reCaptcha } /*** End Scrolling Customer Testimonials v1.0 ***/ /*** Begin Scrolling Customer Testimonials v1.1 ***/ $languages_query = tep_db_query("select languages_id from " . TABLE_LANGUAGES . " where directory = '" . $language . "'"); $language_id = tep_db_fetch_array($languages_query); 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, 'testimonial_image' => $testimonial_image_name, 'language_id' => $language_id['languages_id']); /*** End Scrolling Customer Testimonials v1.1 ***/ 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 . TESTIMONIAL_CONJ . $testimonials_location . '.' . "\n\n" . TESTIMONIAL_NOTIFICATION_TITLE . $testimonials_title . "\n\n" . TESTIMONIAL_NOTIFICATION_HTML_TEXT . $html_text . "\n\n" . TESTIMONIAL_NOTIFICATION_APPROVE; tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, TESTIMONIAL_NOTIFICATION_SUBJECT, $email_text, $testimonials_name, $testimonials_email); } $testimonials_id = ''; $testimonials_title = ''; $testimonials_location = ''; $testimonials_name = ''; $testimonials_email = ''; $html_text = ''; tep_redirect(tep_href_link(FILENAME_CUSTOMER_TESTIMONIALS_WRITE, 'action=success')); } else { $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']); } } $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"> <form name="customer_testimonial" method="post" action="<?php echo tep_href_link(FILENAME_CUSTOMER_TESTIMONIALS_WRITE, 'action=insert', 'NONSSL'); ?>" enctype="multipart/form-data"> <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 HEADING_TITLE2; ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php if ($messageStack->size('testimonials') > 0) { ?> <tr> <td><?php echo $messageStack->output('testimonials'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) { ?> <tr> <td class="main" align="center"><?php echo TEXT_TESTIMONIALS_SUCCESSFUL; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '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 align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { 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> <td> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td><?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><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td><table align="center" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo TEXT_TESTIMONIALS_WRITE; ?></b></td> <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td> </tr> </table></td> </tr> <tr> <td class="infoBox"><table width="100%" border="0" cellspacing="0" cellpadding="7" class="infoBoxContents"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="main"><?php echo TEXT_TESTIMONIALS_TITLE; ?><br> <?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; ?><br> <?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; ?><br> <?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; ?><br> <?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; ?> <span class="inputRequirement">*</span><br> <?php echo tep_draw_textarea_field('html_text', 'soft', '130', '10', $html_text); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <?php /*** Begin Scrolling Customer Testimonials v1.0 ***/ if (TESTIMONIAL_IMAGE_ALLOW == 'Yes') { ?> <tr> <td valign="top" class="main"><?php echo 'Upload an image'; ?><br> <?php echo tep_draw_file_field('testimonial_image'); ?></td> </tr> <?php } /*** End Scrolling Customer Testimonials v1.0 ***/ ?> </table></td> </tr> </table></td> </tr></table> <?php /*** Begin Scrolling Customer Testimonials v1.0 ***/ if (TESTIMONIAL_CAPTCHA == 'Yes') { ?> <!-- start modification for reCaptcha --> <tr> <td class="main"><?php echo ENTRY_SECURITY_CHECK; ?></td> </tr> <tr> <?php $languages_query = tep_db_query("select code from " . TABLE_LANGUAGES . " where directory = '" . $language . "'"); $language_id = tep_db_fetch_array($languages_query); ?> <script> var RecaptchaOptions = { theme : 'white', tabindex : 3, lang : '<?php if (in_array($language_id['code'] ,array('en', 'fr', 'de', 'pt', 'es'))) {echo $language_id['code']; } else {echo 'en'; } ?>', }; </script> <td><?php echo recaptcha_get_html(RECAPTCHA_PUBLIC_KEY, null, ($request_type == 'SSL')); ?></td> </tr> <!-- end modification for reCaptcha --> <?php } /*** End Scrolling Customer Testimonials v1.0 ***/ ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> </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_SUBMIT); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> </table></form></td> </tr> <?php } ?> </td></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 //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
×
×
  • Create New...