ElkArte Community

Extending Elk => Addons => Topic started by: emanuele on June 06, 2014, 06:52:38 pm

Title: [ADDON] Users Online Today
Post by: emanuele on June 06, 2014, 06:52:38 pm
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:

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
Title: Re: [ADDON] Users Online Today
Post by: Lars on September 17, 2014, 03:24:05 pm
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).
Title: Re: [ADDON] Users Online Today
Post by: emanuele on September 18, 2014, 04:23:51 pm
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
Title: Re: [ADDON] Users Online Today
Post by: Spuds on September 18, 2014, 04:58:54 pm
To much Grappa !
Title: Re: [ADDON] Users Online Today
Post by: emanuele on September 21, 2014, 11:48:39 am
I updated the code with "since midnight" and sorting.
I'll upload a new package soonish. ;)
Title: Re: [ADDON] Users Online Today
Post by: Lars on September 21, 2014, 02:13:14 pm
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?
 
Title: Re: [ADDON] Users Online Today
Post by: emanuele on September 21, 2014, 02:43:43 pm
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
Title: Re: [ADDON] Users Online Today
Post by: Lars on September 21, 2014, 03:22:27 pm
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?
Title: Re: [ADDON] Users Online Today
Post by: Lars on September 26, 2014, 03:00:35 pm
Just a little hint:
The download link leads still to version 0.0.1 and not to the newer 0.1.1 .
Title: Re: [ADDON] Users Online Today
Post by: emanuele on September 27, 2014, 05:39:15 am
I know, I still have to package the files. lol
Title: Re: [ADDON] Users Online Today
Post by: emanuele on October 05, 2014, 07:02:07 pm
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
Title: Re: [ADDON] Users Online Today
Post by: Spuds on October 05, 2014, 07:33:14 pm
Awesome !!
Title: Re: [ADDON] Users Online Today
Post by: meetdilip on October 05, 2014, 09:13:16 pm
Nice work @emanuele
Title: Re: [ADDON] Users Online Today
Post by: Lars on October 06, 2014, 05:08:33 pm

Thank you!  (http://s14.directupload.net/images/141006/2wiykokq.gif)
Title: Re: [ADDON] Users Online Today
Post by: emanuele on October 06, 2014, 06:33:01 pm
And if you are lucky it's not even broken! LOL
Title: Re: [ADDON] Users Online Today
Post by: shaitan on February 06, 2017, 02:44:02 pm
Nice Work, thank you Emanuelle.

French translation in attachment.
Title: Re: [ADDON] Users Online Today
Post by: Trekkie101 on February 06, 2017, 06:23:43 pm
Candidate for 2.0 default :)
Title: Re: [ADDON] Users Online Today
Post by: radu81 on September 16, 2017, 07:07:30 pm
I just tested this addon on 1.1 RC2, it installs in compatibility mode and works fine 
Title: Re: [ADDON] Users Online Today
Post by: Mrs. Chaos on June 26, 2018, 05:30:32 am
After the update to ElkArte 1.1.4 instead of the member names only long lines/URLs are shown in the online list, like

Code: [Select]
Today at 11:15" style="color: #FF0000" href="https://forum.website.de/index.php?action=profile;u=1">membername
How can I change this?
Title: Re: [ADDON] Users Online Today
Post by: Mrs. Chaos on June 26, 2018, 07:52:13 am
The error is fixed. I did this in the  OnlineToday.class.php , line 105:

Find:
Code: [Select]
$title = !empty($user['last_login']) ? 'title="' . standardTime($user['last_login']) . '" ' : '';

Replace with:
Code: [Select]
$title = !empty($user['last_login']) ? 'title="' . strip_tags(standardTime($user['last_login'])) . '" ' : '';
Title: Re: [ADDON] Users Online Today
Post by: Burke Knight on December 08, 2023, 11:15:35 pm
Any chance of this being updated?
Title: Re: [ADDON] Users Online Today
Post by: Spuds on December 09, 2023, 10:46:16 am
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
Title: Re: [ADDON] Users Online Today
Post by: Burke Knight on December 09, 2023, 07:35:49 pm
Quote from: Spuds – I had a 0.2.2 version, so I must have updated for myself at some time.  Try the attached for Elk 1.1

Same issue.
Title: Re: [ADDON] Users Online Today
Post by: Spuds on December 10, 2023, 08:59:11 am
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.
Title: Re: [ADDON] Users Online Today
Post by: Burke Knight on December 10, 2023, 10:01:58 am
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.

Code: [Select]
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

Code: [Select]
Type of error: Undefined
Notice: Undefined index: membergroups
/index.php?action=admin;area=addonsettings;sa=general
File: /sources/subs/OnlineToday.class.php
Line: 293
Title: Re: [ADDON] Users Online Today
Post by: Spuds on December 10, 2023, 06:19:09 pm
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.
Title: Re: [ADDON] Users Online Today
Post by: Burke Knight on December 10, 2023, 09:32:49 pm
Quote from: Spuds – 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. :)
Title: Re: [ADDON] Users Online Today
Post by: Spuds on December 10, 2023, 09:41:35 pm
Awesome  :cheesy: