Skip to main content
[ADDON] Users Online Today Started by emanuele · · Read 29174 times 0 Members and 1 Guest are viewing this topic. previous topic - next topic

[ADDON] Users Online Today

Users Online Today v0.2.1
Introduction
Quick and dirty, it lacks several features, but it gave me the opportunity to find bugs. :P
Shows in the info center a list of users that logged in in the last 24 hours, week, or since midnight.
Added title effect on the link with the "last seen" date/time.
Added sorting of members by last seen or name, ascending or descending of the members.
Added basic member groups sorting.

Missing features:
  • Permissions
  • Other ideas?

License
o This ElkArte Addon is subject to the terms of the BSD "3-clause" license. You can obtain a copy of the License at http://opensource.org/licenses/BSD-3-Clause

Repository / Download
Last Edit: October 05, 2014, 07:00:57 pm by emanuele
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Users Online Today

Reply #1

Will there be an update in the next time?
I’ve installed it and it works fine, but the addon just shows the members from the last 24 hours or from the last week. I would like to have “today”, too. :)
Also a sorting would be nice, where admins can choose between a sorting by names or by login time (with the options ascending and descending).

Re: [ADDON] Users Online Today

Reply #2

Funnily enough the "from midnight" is already there, but there is no option to select it...
 emanuele wonders what he was drinking when he wrote that code. lol
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Users Online Today

Reply #3

To much Grappa !

Re: [ADDON] Users Online Today

Reply #4

I updated the code with "since midnight" and sorting.
I'll upload a new package soonish. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Users Online Today

Reply #5

Thank you!
I’ve installed it from the master.zip an hour ago and in the forum it works well.
But on the portal (Simple Portal) now the most blocks disappeared and this error message is shown:
Fatal error: Class 'OnlineToday' not found in /www/htdocs/w00f7be5/for-elchtest/sources/subs/PortalBlocks.subs.php on line 301

If I deactivate the "user online block" in the portal, this block is no longer visible, but all other are back again.

In the PortalBlocks.subs.php is this the part for the UsersOnlineToday addon:
Code: [Select]
	// Does the online today addon exist
if ($online_today && !empty($modSettings['onlinetoday']) && file_exists(SUBSDIR . '/OnlineToday.class.php'))
{
require_once(SUBSDIR . '/OnlineToday.class.php');
$context['info_center_callbacks'] = array();
OnlineToday::get();

if (empty($context['num_onlinetoday']))
return;

echo '
<ul class="sp_list">
<li ', sp_embed_class('dot'), '> ', $txt['sp-online_today'], ': ', $context['num_onlinetoday'], '</li>
</ul>
<div class="sp_online_flow">
<ul class="sp_list">';

foreach ($context['onlinetoday'] as $user)
echo '
<li ', sp_embed_class('user', '', 'sp_list_indent'), '>', $user, '</li>';

echo '
</ul>
</div>';
}

Line 301 is that:
OnlineToday::get();

What’s wrong there? Can it be that "user online" and "users online today" impede each other?
 
Last Edit: September 21, 2014, 02:20:59 pm by Lars

Re: [ADDON] Users Online Today

Reply #6

Ooops.
I didn't realize Spuds added it to SP blocks... :P
I changed the name of the class for consistency and so I broke the block. lol

Just change:
Code: [Select]
OnlineToday::get();
to:
Code: [Select]
Online_Today_Integrate::get();

:D
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Users Online Today

Reply #7

Thanks, all is okay now!

Um, in SMF forums, on mouseover over the user names, the times are displayed when the users were at last active in the forum. Can this also be installed here?

Re: [ADDON] Users Online Today

Reply #8

Just a little hint:
The download link leads still to version 0.0.1 and not to the newer 0.1.1 .

Re: [ADDON] Users Online Today

Reply #9

I know, I still have to package the files. lol
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Users Online Today

Reply #10

Updated the package with the new version (0.2.1) that includes:
sorting of members
members since midnight
basic sorting of member groups in the legend
link title with the last seen time
maybe something else I forgot. lol
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Users Online Today

Reply #11

Awesome !!


Re: [ADDON] Users Online Today

Reply #13


Thank you! 

Re: [ADDON] Users Online Today

Reply #14

And if you are lucky it's not even broken! LOL
Bugs creator.
Features destroyer.
Template killer.