Latest News: (loading..)

gtilflm

Members
  • Content count

    60
  • Joined

  • Last visited

About gtilflm

Profile Information

  • Real Name
    John Bovey
  1. Ok. I've posted the new full package in the addon area. I still may end up using cron at some point, but I'll give this way another shot. I already modified things to use a different database table called "subscriptions", so I have no problem going outside the bounds of OsCommerce. Anyway, thanks for the support.
  2. There were a handful of issues and some were related to how I modified the contrib. to work in the way I wanted it to. So, I don't fully remember all of the issues that were on my end vs. inherent issues with refreshing. A couple that come to mind though are... One time I got some kind of couldn't connect to server error due to too many database connections. One time I got a connection reset error from Firefox. As for the report add-on, it's below. It will place an html file in the admin dir. and email the store owner that the report is there with a link to it. I'll update the contrib. if you think it's solid enough. Note that I've modified things a bit, so some variables might work for me, but still may not fit with the contrib. at large. Both edits are in /catalog/admins/mm_bulkmail.php 1.) BEFORE: echo "<meta http-equiv='refresh' content=$mailrate>"; ADD: //Create/update log file of sent emails. $log_file_id = tep_session_id (); //Using tep_session_id to make the file name unique to this mailing. It's unlikely that someone would send the same newsletter while still logged in with the same session_id. $email_name = $mail['first_name'] . ' ' . $mail['last_name']; $date_time = date("D, d M Y g:i a"); //Does the log file already exist? $log_file_check = tep_db_input($newsletter_id) . '_' . $log_file_id . '.html'; if (!file_exists($log_file_check)) { $log_data = ' <table> <tr> <td colspan="3"><h1>Log File of Sent Emails for Newsletter ID #' . tep_db_input($newsletter_id) . '</h1></td> </tr> <tr> <td colspan="3"><h3>Sending began on ' . $date_time . ' (server time)</h3></td> </tr> <tr> <td><h3>Name</h3></td> <td><h3>Email</h3></td> <td><h3>Date/Time</h3></td> </tr> <tr> <td>' . $email_name . '</td> <td>' . $email . '</td> <td>' . $date_time . '</td> </tr> '; } else { $log_data = ' <tr> <td>' . $email_name . '</td> <td>' . $email . '</td> <td>' . $date_time . '</td> </tr> '; } $log_file_id = tep_session_id (); $log_file = fopen(tep_db_input($newsletter_id) . '_' . $log_file_id . '.html', 'a+'); fwrite($log_file, $log_data); fclose($log_file); 2.) BEFORE: ?> <tr><td><?php echo tep_draw_separator('pixel_trans.gif', '10', '20'); ?></td></tr> <tr><td class="main"><font color="#ff0000"><b> <?php echo TEXT_FINISHED_SENDING_EMAILS; ADD: //Finish updating log file of sent emails. $date_time = date("D, d M Y g:i a"); $log_data = '</table><br><br> END OF LOG DATA FOR THIS BULK EMAIL SEND.<br><i>Ended sending on ' . $date_time . ' (server time)</i>'; $log_file_id = tep_session_id (); $log_file = fopen(tep_db_input($newsletter_id) . '_' . $log_file_id . '.html', 'a+'); fwrite($log_file, $log_data); fclose($log_file); //Email the store admin about the mailing being complete $log_file_location = tep_db_input($newsletter_id) . '_' . $log_file_id . '.html'; $log_email_subject = 'Bulkmail sending of ' . $newsletter['title'] . ' complete'; $log_email_body = 'The bulkmail sending of ' . $newsletter['title'] . ' complete. You can view the log file containing information on who was emailed and more information <a href="' . HTTP_CATALOG_SERVER . DIR_WS_ADMIN . $log_file_location . '">here</a>.'; tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $log_email_subject, $log_email_body, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); That's it!
  3. Two things. 1.) I just finished my first mass sending and there were multiple issues with the 1,700 times of refreshing the page. It was a variety of things and I feel that I may need to alter how this script works to use cron instead. I'll have to think about it. Jase, I can get you my code if I end up doing that. 2.) Jase, I did code in the reporting and it was HUGE in dealing with the issues I encountered. Do you want me to update the package with it? Post it here? Hold off until the cron method is implemented? Let me know. Thanks for the contrib., BTW.
  4. Last question (hopefully). After a sending, is there a record of the number of emails it was sent to? And maybe even a list of email addresses that did receive it? That would be a great way to ensure everything is working properly and that email per hr. server limits weren't reached.
  5. Ok. Thanks for the clarification on how the script works. Just so I understand... in my scenario of sending 1,700 emails, it would refresh the page 1,700 times? If so, maybe it would be better if the emails were sent in chunks of 20, 50, 100? I don't know if this is possible, but I'm just throwing the idea out there.
  6. Oh... right. I was calculating emails per second. Whoops! Still though, if I have about 1,700 emails to send out, wouldn't that have the script executing for a LONG time (over 3 hrs.)? Or is the bulk mail manager set up to send a chunk, then stop, then send a chunk, then stop, etc.? Thanks.
  7. Hey Jase. I'm putting this into production now and I have a question on the "mailing rate in seconds between emails" in the BulkMail Manager. My webhost only allows 500 emails per hr. So, 500 emails per hr. รท 3600 secs. in an hour = 0.1388888... Can a value that is less than 1 be used here? If not, any ideas on a way around this? Thanks!
  8. Ok, great. I'll take a look at those as a I delve deper into it. Thanks!
  9. Hi. I'm just beginning to get into this contrib. I'm wondering if there's a way to say, "Dear _____," in the emails. For example, PayPal always has the user's name in the emails so that you know they are authentic PayPal emails. Does this contrib. allow for that? If not, any brief suggestions on how to build that feature? Thanks!
  10. I run a math tutoring business and I'm developing "side module" where the tutors I hire can login and do various things. I've basically copy/pasted the relevant code from login.php, to the Tutor Login page, but tep_validate_password is continuously returning an error when I correctly enter a password and login. My section of code below contains the error checking lines of... echo $password . '------' . $check_tutor['password']; print_r ($check_tutor); The relevant code then is... <?php require('includes/application_top.php'); // Redirect to a friendly cookie-must-be-enabled page if cookies are disabled (or the session has not started) if ($session_started == false) { tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE)); } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN); $error = false; if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) { $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']); $password = tep_db_prepare_input($HTTP_POST_VARS['password']); // Check if email exists $check_tutor_query = tep_db_query("select * from tutors where tutor_email = '" . tep_db_input($email_address) . "'"); if (!tep_db_num_rows($check_tutor_query)) { $error = true; } else { $check_tutor = tep_db_fetch_array($check_tutor_query); // Check that password is good if (!tep_validate_password($password, $check_tutor['password'])) { $error = true; echo $password . '------' . $check_tutor['password']; print_r ($check_tutor); } else { if (SESSION_RECREATE == 'True') { tep_session_recreate(); } $tutors_id = $check_tutor['tutors_id']; tep_session_register('tutors_id'); //Redirect to the tutor_portal tep_redirect(tep_href_link('tutor_portal.php')); echo $tutors_id; echo $email_address; } } } ?> The crazy thing is that the echo $password . '------' . $check_tutor['password']; line shows that the plain password matches the encrypted one. Please help as this is driving me crazy! Thanks.
  11. Hello all. I have v 2.2 RC2 and the extra email feature is turned on so that I get an email notification of when an order is placed. I've been noticing that if a customer pays via PayPal and they have an unverified address, then I don't get an email. Is this just me, or is this a known issue? If it's a known issue, does it have a fix? Thanks!
  12. Hello. I would like to insert a step before shipping if the customer purchases a certain products_id. On that page, they can choose various options before proceeding to the shipping page. However, only certain parts of this page would be relevant depending on what items they purchase. So, perhaps using some kind of a check against an array of products could determine what info. shows up on the "pre-shipping" page? Does anyone know of anything out there like this already? At least the adding in a page before shipping part? Thanks.
  13. Bump. Anyone with an idea? Please?
  14. Hello all. I'm installing a modification in which I need to insert data into a table based on if the order_status is paid or not. I'm working with checkout_process.php After: // load the after_process function from the payment modules $payment_modules->after_process(); $cart->reset(true); I have: //Begin code for determining if a VBC product has been purchased and handling orders that are paid vs. orders that are to be paid later // 1.) Get order ID for order. //$insert_id This is the orders_id. // 2.) Get customer's data for entering into the bridge. Using information that's already on this page. // 3.) Use order ID to get products assoacited with that order // $order->products[$i]['id'] Contains product information for this order. // 4.) Generate the security token //BOF Security token function function new_token($length) { return substr(_new_token(), 0, $length); } function _new_token() { $rand_bits = ''; // Linux platform $fp = @fopen('/dev/urandom', 'rb'); if ($fp !== FALSE) { $rand_bits .= @fread($fp, 16); @fclose($fp); } // Windows platform if (@class_exists('COM')) { try { $CAPI_Util = new COM('CAPICOM.Utilities.1'); $rand_bits .= $CAPI_Util->GetRandom(16, 0); // 0 - base64 encoding } catch (Exception $ex) { // Fail silently; see OWASP 2007 A6 } } // If both above fail, fall back to a default method if (strlen($rand_bits) < 16) { $rand_bits .= substr(session_id(), 0, 8) . rand() . rand(); } return sha1($rand_bits); } //echo new_token(30); $token = new_token(30); //EOF Security token function // 5.) // a.) Is products_id one of the VBC products? foreach ($order->products as $product) { if (in_array($product['id'], array(85, 86, 89, 90, 91, 92, 93, 94, 95))) { if ($order->info['order_status'] == 3) { //If the status is paid... // Write necessary info. to table. $sql_data_array = array( 'token' => $token, 'orders_id' => $insert_id, 'products_id' => $product['id'], 'customer_firstname' => $order->customer['firstname'], 'customer_lastname' => $order->customer['lastname'], 'customer_email' => $order->customer['email_address'], 'date_added' => 'now()' ); tep_db_perform('VBC_table', $sql_data_array); } else { // The order hasn't been paid for yet... // Write preliminary info. to table. $sql_data_array = array( // Uncomment if the autoincrement isn't being added 'id' => 'null', 'token' => '', 'orders_id' => $insert_id, 'products_id' => $product['id'], 'customer_firstname' => $order->customer['firstname'], 'customer_lastname' => $order->customer['lastname'], 'customer_email' => $order->customer['email_address'], 'date_added' => 'now()' ); tep_db_perform('VBC_table', $sql_data_array); } } } //End code for determining if a VBC product has been purchased and handling orders that are paid vs. orders that are to be paid later (John) Currently, orders that are not yet paid for are having the preliminary data entered into the table and everything is fine. However, when paying by PayPal (with a successful payment), apparently I've done something wrong because I placed an order and an entry was not recorded in the VBC_table. It appears that the check at step 5: if ($order->info['order_status'] == 3) { is failing. Any ideas? Thanks!
  15. Actually, I think I got it working. In the order total module I changed a different function to not display the output. If it helps anyone, my code is below.... function process() { global $order, $cart, $currencies; $extra_charge_tot = $cart->get_extra_charge_total(); // The "if" and "else" statements were added by John to not display the the extra charge if the extra chrage value is 0. if ($extra_charge_tot == 0) { $order->info['total'] += $extra_charge_tot; $this->output = array(); } else { $order->info['total'] += $extra_charge_tot; $this->output[] = array('title' => MODULE_ORDER_TOTAL_EXTRA_CHARGE_TEXT_TITLE . ':', 'text' => $currencies->format($extra_charge_tot, true, $order->info['currency'], $order->info['currency_value']), 'value' => $extra_charge_tot); } } Thanks to all who responded to this.