Results 1 to 10 of 510

Hybrid View

  1. #1
    Join Date
    Aug 2004
    Location
    Belfast, Northern Ireland
    Posts
    2,480
    Plugin Contributions
    14

    Default Re: Back In Stock Notifications

    Hi,

    Just before line 154 of the admin/includes/functions/

    ($email_addresses_result->MoveNext();)

    You could add the following code:

    PHP Code:
    $num_emails_in_batch++

    if (
    $num_emails_in_batch 100) {
      
    $num_emails_in_batch 0;
      
      
    sleep(10);

    You should also add the following before the while loop on line 65:

    PHP Code:
    $num_emails_in_batch 0
    Just good coding practice! :)

    I might make this simple functionality an option in the next version with a configurable number of e-mails in a batch and sleep time.

    All the best...

    Conor
    Ceon

  2. #2
    Join Date
    Dec 2006
    Posts
    199
    Plugin Contributions
    0

    Default Re: Back In Stock Notifications

    Conor,
    You've been very patient with my persistent badgering about this little detail. Once again, thank you very much!

  3. #3
    Join Date
    Dec 2006
    Posts
    199
    Plugin Contributions
    0

    Default Re: Back In Stock Notifications

    Hmm...got trouble:
    Parse error: syntax error, unexpected T_IF in /home/xxxxxx/xxx/xxx/admin/includes/functions/back_in_stock_notifications_functions.php on line 158

    do i need the batch counter or can I just try the sleep?

  4. #4
    Join Date
    Dec 2006
    Posts
    199
    Plugin Contributions
    0

    Default Re: Back In Stock Notifications

    I commented out everything but the sleep(10);

    I have not entered inventory except a little testing bit. There would be 43 emails sent. At 10 seconds it stalls out and goes to a blank page. At 2 seconds, same thing. At 1 second, it takes just over 43 seconds (guesstimate) to return the successful results of a test mailing. In all 3 cases, the sample email was successfully sent out.

  5. #5
    Join Date
    Aug 2004
    Location
    Belfast, Northern Ireland
    Posts
    2,480
    Plugin Contributions
    14

    Default Re: Back In Stock Notifications

    Hi,

    Quote Originally Posted by brushwoodnursery View Post
    Hmm...got trouble:
    Parse error: syntax error, unexpected T_IF in /home/xxxxxx/xxx/xxx/admin/includes/functions/back_in_stock_notifications_functions.php on line 158

    do i need the batch counter or can I just try the sleep?
    Oops, there's a missing semicolon after

    PHP Code:
    $num_emails_in_batch++ 
    It should be:

    PHP Code:
    $num_emails_in_batch++; 
    Sorry! :)

    I have not entered inventory except a little testing bit. There would be 43 emails sent. At 10 seconds it stalls out and goes to a blank page. At 2 seconds, same thing. At 1 second, it takes just over 43 seconds (guesstimate) to return the successful results of a test mailing. In all 3 cases, the sample email was successfully sent out.
    Sounds like PHP is timing out.

    You must have safe mode on, otherwise the script would set the maximum execution time/timeout for PHP to 0 ("Don't time out").

    If you don't have access to your server to change the safe_mode setting or the max_execution setting then I'm afraid the sleep() command will be useless for you!

    All the best..

    Conor

  6. #6
    Join Date
    Dec 2006
    Posts
    199
    Plugin Contributions
    0

    Default Re: Back In Stock Notifications

    Safe Mode is Off.
    The notification panel pulls up just fine now.
    Test run works fine. There's no delay, though, since it's only 43 emails and they batch up as one.
    So, i ran the test with the batch size at 10 and the sleep at 20 seconds. Goes to blank page in just over 1 minute.
    maybe it's my database connection?
    I've decided to try to run it without the delay. I'll just do it after the phplist newsletter goes out and hope for the best. Looking through the list, most of the serious customers are waiting for multiple items. Also, not all of the items will be restocked at this time. It might be fine.

  7. #7
    Join Date
    Aug 2004
    Location
    Belfast, Northern Ireland
    Posts
    2,480
    Plugin Contributions
    14

    Default Re: Back In Stock Notifications

    Hi,

    Quote Originally Posted by brushwoodnursery View Post
    So, i ran the test with the batch size at 10 and the sleep at 20 seconds. Goes to blank page in just over 1 minute.
    maybe it's my database connection?
    Hmm, something's definitely timing out. It could be the DB connection. I'm afraid I don't know enough about this area. If it is the DB connection though then the function would have to be changed to store all of the results and then send the e-mail batches.

    I'll try to look at it in the future when I've some time on my hands!

    Sorry I can't give a better response than that!

    All the best...

    Conor

  8. #8
    Join Date
    Dec 2006
    Posts
    199
    Plugin Contributions
    0

    Default Re: Back In Stock Notifications

    OK, you have until August before I begin pestering you again!

    Thanks for trying!

  9. #9
    Join Date
    Dec 2006
    Posts
    199
    Plugin Contributions
    0

    Default Re: Back In Stock Notifications

    server delay double post -edited out

  10. #10
    Join Date
    Dec 2006
    Posts
    199
    Plugin Contributions
    0

    Default Re: Back In Stock Notifications

    Conor,
    Could your batch script be used to execute only x emails and stop? Would it clean them out properly or would it wipe the entire table clean after the first batch?
    I wouldn't mind hanging out with the admin panel for an hour hitting the button 40 times if it meant saving myself from spam purgatory with the likes of aol and others.

 

 

Similar Threads

  1. Ceon Back In Stock Notifications 3.0.0
    By conor in forum Addon Admin Tools
    Replies: 204
    Last Post: 8 Apr 2025, 05:19 PM
  2. Replies: 146
    Last Post: 13 Dec 2020, 09:52 AM
  3. Replies: 4
    Last Post: 14 Feb 2013, 09:33 PM
  4. v139h Back In Stock Notifications only notify customers ONE time?
    By SRQHoyas in forum General Questions
    Replies: 0
    Last Post: 9 Jun 2012, 01:58 PM
  5. Problems with Back In Stock Notifications addon
    By dhanesh in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 21 Aug 2008, 02:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg