UBB.Dev
Mod Name / Version - Subscriptions without a Cron Task 0.9 beta release
Description - Ever wanted to run subscriptions, but could never figure out how to run a cron task? Or does your server not allow them? This script will run the ubbt subscriptions.php file in the /cron/php directory of your ubbt install once per day (as long as you have at least one visitor per day) so that subscribers can receive emails.
Working Under - UBB.Threads 6.2, but will work with any version to my knowledge.
Pre-requisites - Make sure you have your cron/php/ directory still!
Files Altered - ubbt.inc.php
New File - sub.inc.php
Author - Dalar (Rob Porter)

Enjoy!

Attached File
- thanks Dalar
I am having a weird bug occur in this, and had a question for anyone in the know about the date() function.

Does it record the server time or the user's system's time or the adjusted server time? It seems to be sending at strange hours, multiple times in a day, and I've tracked it down to occuring when users from very distant timezones visit the site.

Would there be any ideas about a workaround to this?
#######################################################################
// get_date
// #######################################################################
function get_date() {

global $config;
$currtime = time();
$currtime = $currtime+($config['adjusttime']*3600);
return $currtime;
}


It is converted from the server time. Threads grabs the server time called time() then it adds the adjust time in the config file shown for your time zone. If your time zone is one hour away from the server your config file has a 1 which in this case if 1 x 3600 seconds or ONE HOUR. The date is stored as a UNIX TIMESTAMP. Thus the need for all seconds.

Have you tried?

$now = $this -> get_date();

Neat idea Thanks.
Cool, thanks.
Wait.. if threads is calling the server time, this problem wouldn't be happening (as is diagnosed). Making the change as proposed would only work for those that have changed their profiles(or even have profiles, as guests wouldn't).

So, could there be a different problem with this script that I'm not seeing?
Installed this hack. How do I know it is working? Sorry not too keen on cron task...
© UBB.Developers