bbPress

Simple, fast, elegant

bbPress Plugin Browser »

Members Online (0.0.2)

Download

Version: 0.0.2

Last Updated: 2009-8-14

Requires bbPress Version: 0.9 or higher

Compatible up to: 0.9

Author Homepage »

Plugin Homepage »

Donate to this plugin »

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(7)

Your Rating

Author: _ck_

Shows which members are currently online or visited today. Tracks the total time online and last visit for each member in their profile.

This is a lightweight alternative to my overly complex and somewhat buggy Mini-Track (which I don't have the time to maintain right now).

The compromise is it makes no attempt to track guests, at all. Only members are followed. Daily statistics are not (yet) stored.

However the benefit is it's very fast, makes as few queries as possible and should be very easy to install and use.


  1. _ck_

    Moderator

    Let me know if there are any problems or feature requests.
    This is much easier to maintain than Mini-Track.
    It also can replace Simple Onlinelist.

    Posted: 11 months ago #
  2. Installed perfectly and looks to be working fine.

    The only thing I would like to see, and I only mention it to be thorough, is the inclusion of the last log-in time on the user list in the admin section, or alternately a list of users who have not logged in for (n) days.

    Other the that fantastic stuff.

    Posted: 11 months ago #
  3. _ck_

    Moderator

    Oh I will show you at some point soon just how easy it is to extract data based on last logged in time. I will also add some results to my Mini-Stats plugin.

    Unlike the Simple Onlinelist and my Mini-Track plugin, this plugin actually inserts into the real user-meta the last login date which makes it easy to access.

    Any where a user is loaded by bbpress, you now have the variable available $user->last_online (the $user part may vary but the concept is the same)

    It's really almost as simple as this:

    echo "$user->user_login was last online
    <span title='".date('r',$user->last_online)."'>".bb_since($user->last_online,1)."</span> ago";

    (the span and date is just to show an exact date when you mouse over the "xx days ago" part.

    You'll be able to look at who has not been on in the longest time, who has been on recently, who has spent the most time online, and who has spent the least time online.

    Unfortunately the user display list in the admin area is hard coded without filters and cannot be expanded with additional columns but it can be replaced by a new function.

    I'll probably add the support to my "Mass Delete Users" which is useful to find members, even if you don't want to delete them.

    Posted: 11 months ago #
  4. Hi there,

    I shall look into creating a custom view with this information, I quite like the idea that its public actualy, kind of 'name and shame'. Thanks again for the great support.

    On thing, I am gettin the following Warning under the user name, and aboce the 'offline' notice for some users on topic.php.

    Warning: array_flip() [function.array-flip]: The argument should be an array in /homepages/32/d270992632/htdocs/forum/bb-plugins/members-online/members-online.php on line 100

    I would link you but the forum is private, if you need to see it happy to set you up an account.

    Thanks again.

    Posted: 11 months ago #
  5. _ck_

    Moderator

    Ah you found a bug, I know what it is, sometimes absolutely no members are online and I assume that the result will still be an array.

    You can either download the newest copy (no version bump) or just replace line 100 with this
    if (is_array($ids)) {$ids=array_flip($ids);}

    Posted: 11 months ago #
  6. Hi there, updated line 100 everything now working as expected.

    Thanks again.

    Posted: 11 months ago #
  7. Actually, now I say that I was wondering of the 'today' list was working correctly. Dose it list users that were on-line within the last 24hours, or people that were on-line since midnight?

    Ideally it would be within the last 24hours, but either way this don't seem to be working correctly. A member listed there can be clicked on and his profile says he was last on-line 1 day 6 hours ago, yet he was listed in the today section.

    Not a show stopper by any stretch of the imagination but thought it was worth mentioning. Any thoughts

    Posted: 11 months ago #
  8. _ck_

    Moderator

    It shows it since midnight in the timezone you have set.

    I can make it adjustable to show within 24 hours or since midnight.

    Note that the time since midnight will cause a cacheable query, but to do a rolling 24 hours will make a mysql query that is not cached since it changes every moment. On a very busy site you'd want the midnight query.

    Posted: 11 months ago #
  9. Jkenny

    Member

    Is there a way to hide the members online from guests, and to only show it to those who are registered and logged in?

    Posted: 11 months ago #
  10. _ck_

    Moderator

    sure, see where it says this around line 35

    function members_online_footer() {
    	if (!is_front()) {return;}

    add this line right after that part

    if ( !bb_is_user_logged_in()) {return;}
    Posted: 11 months ago #
  11. It seems that "today" shows "now" on my forum o_O .

    Posted: 10 months ago #
  12. Hi _ck_,

    thanks for your great plugins. On my implementation von bbPress I have the same problem as above mentioned. The view 'today' shows all users from the last days. E.g. my second Admin-Account with "1 Day and 13 hours".

    Is there any line in the plugin script that must be changed to fix this problem?

    Posted: 9 months ago #
  13. Upps... It seems I've made an mistake. I mixed-up the "Last time online" and "The last Activity". Sorry.

    Posted: 9 months ago #
  14. Again. I've changed the code a bit on the function members_online_today(). So now - it shows only the members with activitys today.

    Line 83-86

    function members_online_today() {
    $midnight=mktime(0, 0, 0,date('n',time()), date('j',time()), date('Y',time()) ) +bb_get_option("gmt_offset")*3600;
    members_online_now($midnight);}

    The var $time was 0 in the original script - so the script displays all user.

    Posted: 9 months ago #
  15. citizenkeith

    Member

    Here's my current status:

    now : Keith, Pug, Craig
    today : Keith, Pug, Craig, Pug, Pug, candy, Craig, Craig, candy, Craig, Craig, Craig, candy, Craig, candy, candy, candy, candy, Jorge, Danny, doowopman, nelamvr6, wysi, Macca, Matti

    That "today" listing seems a little redundant. I assume that's a bug, and not a feature. :-)

    Posted: 9 months ago #
  16. On my forum "Today" really shows "now online" users. Some bug there (% .

    Posted: 9 months ago #
  17. I've commented part of 85'th line (just don't want to delete) and it looks now like:

    $midnight=mktime(0, 0, 0,date('n',$time), date('j',$time), date('Y',$time) )/*+bb_get_option("gmt_offset")*3600*/;

    So now "Today" works right. And I don't care on GMT (% . What was wrong there? I'm not a programmer (% .

    Posted: 9 months ago #
  18. circuit

    Member

    brilliant plugin. only comment is that the addition of this line has no effect:

    if ( !bb_is_user_logged_in()) {return;}

    Posted: 9 months ago #
  19. circuit

    Member

    regarding the above, i just put all the code into logged-in.php instead, and that solved my issue.

    is there any way to show gravatars (linked to profile) rather than user names?

    Posted: 9 months ago #

RSS feed for this topic

Add a Comment »

You must log in to post.

Code is Poetry.