[For 1.8] How to get updated clock & who's online
Ok I have turned it into a sort of plugin and it works but the results are a bit different ...
  • ajax.php (original code always returns the user online, I guess this to be because global.php is writing the session data including the ajax call that my jquery is making.
  • xmlhttp.php does not write any session data so therefore after cutoff time the board returns 0 users online. On reflection this is correct as the board says 'active users' and not connected users.
  • I have never written a plugin before, all code I have done has been in add on php files and to be fair the documentation is a little sparse on the correct methods to use.
example being the returns from the is_installed

function myplugin_is_installed()
	global $mybb;
	$file = 'myplugin.txt';
	if (file_exists ( 'myplugin.txt') === true){
		return true;
else {
	$file =  $mybb->asset_url.'/scripts.js';
	flash_message("file missing ".$file, '');
        return false;  



   does mybb take any action if false is returned ?
Not in this land alone,
But be God's mercies known,
From shore to shore!
Lord make the nations see,
That men should brothers be,
And form one family,
The wide world ov'er


Messages In This Thread
How to get updated clock & who's online - by JimR - 2020-09-11, 08:48 AM
RE: How to get updated clock & who's online - by JimR - 2020-09-13, 11:09 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)