Here you go. I haven't had the cron running since the last time I posted in this thread on the 4th. So the Last Upload time is about when I disabled the cronscript.
There were several pages of results, so I just grabbed a random assortment of a few of them and truncated the email addresses for user privacy.
If you need more than that, I can upload an attachment of the full list.
From what I can see, the time stamps are correct.
I only know the basics in PHP. I'm not seeing any script warnings or errors when I run sendnotice.php but is there any chance this problem could be related to the version of PHP I'm running (PHP Version 5.3.3-7+squeeze1).
However, I do get this warning on occasion from the advanced search:
Warning: trim() expects parameter 1 to be string, array given in /www/sites/mysite/files/html/classifieds/pp-inc.php on line 41
I only mention the warning because pp-inc.php is also included in sendnotice.php
Here are the results of the print statement you asked for:
Code:
Content visible to verified customers only.
Then I ran the script a few minutes later and i get this:
Code:
Content visible to verified customers only.
So the "if" statement is evaluating correctly and only allowing it to proceeded sending the notices once every 24 hours, so the problem has to be later in the script, or more likely the problem is in cron.php and how that evaluates to see if it's been 24 hours since the last updates were sent out.
This is what I have in my sendnotice.php
This is where my beginner PHP skills get fuzzy. I can see select statement is only selecting ads that will expire in less than 3 days. But I don't understand what part of the code that follows is forcing the script to only email them once per day, instead of every time the script runs.
Code:
Content visible to verified customers only.
The cron.php cronscript appears to be running roughly every 30 minutes (give or take depending on when someone loads a page to trigger it.
What I don't understand is where in the script does it tell it NOT to send an email to someone that it just sent the email to 30 minutes ago.
Here is what I have for cron.php:
Code:
Content visible to verified customers only.
However, in admin settings, $Globals['crontime'] is set to 1440, which should be 24 hours in minutes per the instructions
"Number of minutes to run cron task?"
Could that be the entire cause of the problem right there? By any chance is it a typo where it says to set "number of minutes" and in reality that should be set to 86400 in second to limit that section of cron.php to run only once per 24 hours?
I didn't want to change the setting, as I'm sure that same setting is used elsewhere for auctions and other things that require running more often than once per day.
Maybe just the IF portion of the part of the cron.php script that sends the 3 day notices needs to be modified to convert the minutes to seconds with something like:
Original if statement with crontime in minutes
Code:
Content visible to verified customers only.
Modified to convert the crontime value to seconds
Code:
Content visible to verified customers only.
Thereby forcing the cron to only send the 3 day emails once per day?
Am I on the right track?
Thanks for the help debugging this. I'm sure it will turn out to be something quite silly once we find it.