bbPress

Simple, fast, elegant

bbPress Plugin Browser »

Simple Onlinelist

Download

Version:

Other Versions

Last Updated: 2007-8-11

Requires bbPress Version: 0.74 or higher

Compatible up to: 0.8.3-alpha

Average Rating

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

Your Rating

Author: thomasklaiber

This plugin displays all users which were online over the past 5 minutes. It can also display when a user was last online on his profile page.


  1. I like this a lot. It works nicely. Would be great if that error didn't come up but I assume it's unavoidable?

    Not liking your date format choice for the profile_last_online() function, I made a minor modification - you can specify the time format. It's not validated or anything, though, so to be used with a little care.

    function profile_last_online( $dateformat = 'Y-m-d H:i:s' ) {
    	global $bbdb, $bb_table_prefix, $user_id;
    
    	$now = get_online_timeout_time();
    
    	echo \"<dl id='userinfo'>\n\";
    	echo \"\t<dt>\" . __('Last Online') . \"</dt>\n\";
    
    	if ($last_online = $bbdb->get_var(\"SELECT activity FROM \".$bb_table_prefix.\"online WHERE user_id=$user_id LIMIT 1\")) :
    		if (strtotime($last_online) > $now) :
    			$last_online_since = $last_online;
    		else :
    			$last_online_since = strtotime($last_online) + 300;
    			$last_online_since = date( $dateformat, $last_online_since );
    		endif;
    		echo \"\t<dd>\" . offset_online_time($last_online_since) . \" (\" . bb_since($last_online_since) . \" ago)</dd>\n\";
    	else :
    		echo \"\t<dd>\" . __('Never') . \"</dd>\n\";
    	endif;
    	echo \"</dl>\n\";
    }
    Posted: 3 years ago #
  2. I'd like to restrict this to be seen only by administrators. What's a good way of doing that?

    Posted: 2 years ago #
  3. Great plugin. Just set it up on bbPress 0.8.1 and it works great. No problems. Thanks for releasing it.

    Posted: 2 years ago #
  4. Hi Thomas,

    I installed your plugin "Simple onlinelist" on my bbpress forum, but I keep getting this message error:

    bbPress database error: [Table 'lalunemal.bb_online' doesn't exist]
    SELECT * FROM bb_online WHERE user_id = 1 LIMIT 1

    bbPress database error: [Table 'lalunemal.bb_online' doesn't exist]
    INSERT INTO bb_online (user_id, activity) VALUES ('1', '2007-05-28 12:47:31')

    Although I set $mysql41 to false;

    Any help would be much appreciated!

    (ps: I tried to send this message through your site's contact form but it didn't work :-/)

    Posted: 2 years ago #
  5. I got the solution from Thomas himself: if you don't place the <?php show_online_users(); ?> code in your template, the MySQL table won't get installed automatically.

    So, to make a long thing short:
    - install the plugin in your "my-plugins" folder
    - put the <?php show_online_users(); ?> in your template (ie front-page.php)
    - load the page twice (the first time, the MySQL error will still happen; the second time, it'll be all gone!)

    Thanks Thomas :)

    Posted: 2 years ago #
  6. So, if I understand correctly, this plugin will always hold an error, unless you refresh?

    Posted: 2 years ago #
  7. Only until the first refresh after you've installed the plugin. Then there shouldn't be any errors anymore ^^

    Posted: 2 years ago #
  8. Just an idea what I did was in your show_online_users() function I didn't like it showing user_login I would rather have it use display_name to keep things looking purdy so I just changed this line:

    echo "<a href=\"".get_user_profile_link($on->user_id)."\" title=\"\">".$user->user_login."</a>$komma";

    to this

    echo "<a href=\"".get_user_profile_link($on->user_id)."\" title=\"\">".$user->display_name."</a>$komma";

    Thanks for this great plugin btw.

    Posted: 2 years ago #
  9. dreamXG

    Inactive

    Awesome plugin!

    I followed jnewing1's method of using a members display_name, but for new users who register using bbpress, it didn't seem to populate the display_name column.

    so instead of:

    echo "<a
    href=\"".get_user_profile_link($on->user_id)."\" title=\"\">".$user->user_login."$komma";

    I used:

    echo "<a
    href=\"".get_user_profile_link($on->user_id)."\" title=\"\">".(empty($user->display_name) ? $user->user_login : $user->display_name)."$komma";

    Just a quick fix, I'm not a pro, so I guess someone will be able to come up with a better method!

    Posted: 2 years ago #
  10. got error

    Posted: 2 years ago #
  11. bbPress database error: [Table 'mamli_forum.bb_online' doesn't exist]
    SELECT * FROM bb_online WHERE user_id = 10 LIMIT 1

    bbPress database error: [Table 'mamli_forum.bb_online' doesn't exist]
    INSERT INTO bb_online (user_id, activity) VALUES ('10', '2007-08-03 11:54:38

    Posted: 2 years ago #
  12. Simply download latest version, no more errors on install.

    Posted: 2 years ago #
  13. I found that there is a function

    function profile_last_online() - is it possible to use it to show when the user have been last online? How?

    Thanks

    Posted: 2 years ago #
  14. @vlp

    Put it into your profile.php template file.

    Posted: 2 years ago #
  15. I ran into the same problem where the table isn't created until you actually use the plugin code in your template. I was just getting a number of plugins installed and hadn't moved to template changes yet, but started getting DB errors.

    Its probably easier for people setting up new installs and installing a bunch of plugins to handle the DB creation on plugin activation. It's a simple change. Remove the call to setup_check() from around Line 86 and then add the following near the bottom (I added it before the add_filter on Line 162:

    bb_register_activation_hook(__FILE__, 'setup_check');

    This also eliminates two DB queries on every page view in the forums when setup_check would run.

    Posted: 2 years ago #
  16. I planned to use this in my next Version. I decided this would be the last release with support for users with older bbpress versions.

    Posted: 2 years ago #
  17. You could always just do a function_exists check and call it the old way if it's an old version - but yeah, maintaining backward compat is a pain :)

    Posted: 2 years ago #
  18. i download latest version and it worked for me
    thx

    Posted: 2 years ago #
  19. Great work, this is a great plug-in.

    Posted: 2 years ago #

RSS feed for this topic

Add a Comment »

You must log in to post.

Code is Poetry.