Found some bugs in this plugin.
1.
Code: (OnlineToday.php) [Select]
I think that should be "earliest_time".
2. The plugin uses systemtime (time(), strtotime()) therefore there's no need to substract the timezone settings. This error might not appear for some, but they just have those settings set to 0.
Untested solution:
Code: (OnlineToday.php) [Select] Dont want to fork wedge/plugins, otherwise i would open up a pull request. Im not sure if last_login uses forum time or system time. But however, something is wrong with this plugin.
EDIT:
'last_login' => time()
Changed my solution.
1.
case '7d':
$earliest_type = time() - 604800;
break;
I think that should be "earliest_time".
2. The plugin uses systemtime (time(), strtotime()) therefore there's no need to substract the timezone settings. This error might not appear for some, but they just have those settings set to 0.
Untested solution:
switch ($settings['uot_type'])
{
default:
$settings['uot_type'] = 'today'; // This is deliberate, falling through to 'today' because that's what to use in the event of an invalid type being used.
case 'today':
$earliest_time = strtotime('today');
break;
case '24h':
$earliest_time = time() - 86400;
break;
case '7d':
$earliest_time = time() - 604800;
break;
}
EDIT:
'last_login' => time()
Changed my solution.