Jump to content

googly

Members
  • Content count

    14
  • Joined

  • Last visited

1 Follower

Profile Information

  1. googly

    Newsletter & Subscribtion for MS2

    There seem to be a few closing bracket irregularities. Have a go with the code I use below. <?php /* $Id: newsletter.php,v 1.1 2002/03/08 18:38:18 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License */ // ################# Contribution Newsletter v050 ############## /* class newsletter { var $show_choose_audience, $title, $content; function newsletter($title, $content) { $this->show_choose_audience = false; $this->title = $title; $this->content = $content; } */ class newsletter { var $show_choose_audience, $newsletters_id, $module_subscribers, $title, $header, $content, $unsubscribea, $unsubscribeb; function newsletter($newsletters_id, $module_subscribers, $title, $header, $content, $unsubscribea, $unsubscribeb) { $this->show_choose_audience = false; $this->newsletters_id = $newsletters_id; $this->module_subscribers = $module_subscribers; $this->title = $title; $this->header = $header; $this->content = $content; $this->unsubscribea = $unsubscribea; $this->unsubscribeb = $unsubscribeb; } // ################# END - Contribution Newsletter v050 ############## function choose_audience() { return false; } function confirm() { global $HTTP_GET_VARS; $mail_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'"); $mail = tep_db_fetch_array($mail_query); // ################# Contribution Newsletter v050 ############## /* $confirm_string = '<table border="0" cellspacing="0" cellpadding="2">' . "\n" . ' <tr>' . "\n" . ' <td class="main"><font color="#ff0000"><b>' . sprintf(TEXT_COUNT_CUSTOMERS, $mail['count']) . '</b></font></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td class="main"><b>' . $this->title . '</b></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td class="main"><tt>' . nl2br($this->content) . '</tt></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td align="right"><a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=confirm_send') . '">' . tep_image_button('button_send.gif', IMAGE_SEND) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a></td>' . "\n" . ' </tr>' . "\n" . '</table>'; */ $confirm_string = '<table border="0" cellspacing="0" cellpadding="2">' . "\n" . ' <tr>' . "\n" . ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td class="main"><font color="#ff0000"><b>' . tep_draw_separator('pixel_trans.gif', '20', '1') . TEXT_TITRE_INFO . '</b></font></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td class="main">' . sprintf(TEXT_COUNT_CUSTOMERS, $mail['count']) . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td class="main">' . TEXT_BULLETIN_NUMB . "?" . '<font color="#0000ff">' . $this->newsletters_id . '</font></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td class="main">' . TEXT_MODULE . "?" . '<font color="#0000ff">' . $this->module_subscribers . '</font></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td class="main">' . TEXT_TITRE_MAIL . "?" . '<font color="#0000ff">' . $this->title . '</font></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td class="main"><font color="#ff0000"><b>' . tep_draw_separator('pixel_trans.gif', '20', '1') . TEXT_TITRE_VIEW . '</b></font></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td class="main"><tt>' . $this->header . '</tt></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td class="main"><tt>' . $this->content . '</tt></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td class="main"><tt>' . $this->unsubscribea . '</tt></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td class="main"><tt>' . $this->unsubscribeb . '</tt></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td align="right"><a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=confirm_send') . '">' . tep_image_button('button_send.gif', IMAGE_SEND) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a></td>' . "\n" . ' </tr>' . "\n" . '</table>'; // ################# END - Contribution Newsletter v050 ############## return $confirm_string; } // ################# Contribution Newsletter v050 ############## /* function send($newsletter_id) { $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'"); $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer')); $mimemessage->add_text($this->content); $mimemessage->build_message(); while ($mail = tep_db_fetch_array($mail_query)) { */ function send($newsletter_id) { $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'"); while ($mail = tep_db_fetch_array($mail_query)) { $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer')); // Pr?paration de l'envoie du mail en HTML $mimemessage->add_html_newsletter($this->header . "\n\n" . $this->content . "\n\n" . $this->unsubscribea . " " . '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '">' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '</a>' . "\n\n" . $this->unsubscribeb); $mimemessage->build_message(); // ################# END - Contribution Newsletter v050 ############## $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, $this->title); } $newsletter_id = tep_db_prepare_input($newsletter_id); tep_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . tep_db_input($newsletter_id) . "'"); } } ?>
  2. googly

    Newsletter & Subscribtion for MS2

    It looks like you're missing a closing curly brace for the newsletter function. Looks like there should be a } below $this->unsubscribeb = $unsubscribeb; $this->unsubscribeb = $unsubscribeb; } // ################# END - Contribution Newsletter v050 #############
  3. I'm wondering how people here deal with situation that occurs when you change the name of a product. When the product's name is changed, so does the url. This means that there will be 2 versions of the same page out there in Search Engine land for a while. I am trying to put a permanent redirect in my htaccess file, such as Redirect permanent /big-blue-p-118.html http://www.mydomain.co.uk/pink-blue-big-p-118.html This in theory should work (shoudln't it!?) but what returns is http://www.mydomain.co.uk/pink-blue-big-p-118.html?products_id=74 This is what I want except for the ?products_id=74 at the end! Has anyone got an ideas of why it's dealing with it in this way? The htaccess file is below. Hope someone can help! php_value register_globals 1 Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING} RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING} ########Redirecting Old SEO enabled URLs######### Redirect permanent /big-blue-p-118.html http://www.mydomain.co.uk/pink-blue-big-p-118.html
  4. Great - thanks a lot for the advice jefs.42 it's helped me think more about it. I put your suggestion into action and it worked which is always good! I thought that it would be good if it related more to whether there are any shipping methods to choose from though. So instead of if ($order->delivery['country_id'] == '222'){ I added if(sizeof($quotes) > 0 && sizeof($quotes[0]) > 0){ which should only show the continue button if there are shipping methods to choose from (I think!) Thanks again.
  5. I only allow 1 type of shipping for my country, for the rest of the world I do not allow any shipping because we don't ship to these countries. I present a message to make this clear on (checkout_shipping.php). But when you press CONTINUE it goes successfully onto the payment page even if you have no method to select. On the payment page (checkout_payment.php) if you haven't selected or do not have a payment method available it displays a warning message at the top of the page and doesn't allow you to carry on. This is what I need for my checkout_shipping.php page. I see in the code on checkout_payment.php that there seems to be something in place for this but it isn't working. Can anyone help? // if no shipping method has been selected, redirect the customer to the shipping method selection page if (!tep_session_is_registered('shipping')) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); }
  6. I have installed the relevent code in order to display the fields to edit the category meta tags in admin/categories.php but they are not showing for some reason. I've searched for any other posts which experience a similar problem but can't seem to find any. Has anyone come across this before? Why can't I edit the category and sub category meta tags in the caterories/product administration form? The fields just aren't displayed.
  7. Using the Additional Shipping Options for Table Module I now have 3 delivery options at the checkout which is just what I want. For example next day delivery, 2 day, 3day. But I've seen another site that does this, but when the product is over a certain weight (it seems) it defaults to just showing the one delivery option. This delivery option is different from previous 3 which I have described (its cost is more expensive). Does anyone know if the ability to do this is from another mod of if there's any easy way to do it?? Much appreciated if anyone can help.
×