MyBB Community Forums

Full Version: mybb timer class
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone I'm currently in the proces of trying to use the class.timers in my application but how can I get the time from 1 hook in a different hook.

So for example:

login hook


global $time;
....
require_once MYBB_ROOT."/inc/class_timers.php";

$time = new timer();

Showthread hook:


global $time;
.....

require_once MYBB_ROOT."/inc/class_timers.php";
if(isset($time) && $time != null) {
   $now = $time->getTime();
   $time->stop();
}

This currently gives a white screen any idea of how I could use it?