Users Online Today v0.2.1IntroductionQuick 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:
Licenseo 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
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).
Funnily enough the "from midnight" is already there, but there is no option to select it...
/me wonders what he was drinking when he wrote that code. lol
To much Grappa !
I updated the code with "since midnight" and sorting.
I'll upload a new package soonish. ;)
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
301If 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:
// 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?
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:
OnlineToday::get();
to:
Online_Today_Integrate::get();
:D
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?
Just a little hint:
The download link leads still to version 0.0.1 and not to the newer 0.1.1 .
I know, I still have to package the files. lol
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
Awesome !!
Thank you! (http://s14.directupload.net/images/141006/2wiykokq.gif)
And if you are lucky it's not even broken! LOL
Nice Work, thank you Emanuelle.
French translation in attachment.
Candidate for 2.0 default :)
I just tested this addon on 1.1 RC2, it installs in compatibility mode and works fine
After the update to ElkArte 1.1.4 instead of the member names only long lines/URLs are shown in the online list, like
Today at 11:15" style="color: #FF0000" href="https://forum.website.de/index.php?action=profile;u=1">membername
How can I change this?
The error is fixed. I did this in the
OnlineToday.class.php , line 105:
Find:
$title = !empty($user['last_login']) ? 'title="' . standardTime($user['last_login']) . '" ' : '';
Replace with:
$title = !empty($user['last_login']) ? 'title="' . strip_tags(standardTime($user['last_login'])) . '" ' : '';
Any chance of this being updated?
I had a 0.2.2 version, so I must have updated for myself at some time. Try the attached for Elk 1.1
ETA: Update is below
What is the issue, what
@Mrs. Chaos reported? I do have this running on several sites w/o problems so trying to understand if its a theme/config item or other.
I had gotten a "Invalid argument supplied for foreach()" error that broke the site after activating.
Had to phpmyadmin into the settings to disable the addon.
Type of error: General
Warning: Invalid argument supplied for foreach()
/index.php?action=admin;area=addonsettings;sa=general
File: /sources/subs/OnlineToday.class.php
Line: 222
Type of error: Undefined
Notice: Undefined index: membergroups
/index.php?action=admin;area=addonsettings;sa=general
File: /sources/subs/OnlineToday.class.php
Line: 293
Strange .... but then its not my Addon. I think this will prevent the error when there are no membergroups found, I'm just not sure how it gets to that point.
That did the trick. Thank you, my friend. :)
Awesome :cheesy: