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
(9)

Your Rating

Author: _ck_


  1. citizenkeith

    Member

    I decided to put the members online list in the footer, specifically in the footer div so that it matches the "powered by bbpress" text. I followed the instructions in the readme for custom placement.

    In the plugin:
    $members_online['footer'] = false;

    And in the footer.php:
    <?php do_action('members_online_now',''); ?>

    Now, when a user posts to any topic, they get this error:

    Warning: Cannot modify header information - headers already sent by (output started at /nfs/c04/h04/mnt/68418/domains/mydomain.com/html/forums/my-plugins/members-online/members-online.php:1) in /nfs/c04/h04/mnt/68418/domains/mydomain.com/html/forums/bb-includes/functions.bb-pluggable.php on line 218

    Any ideas?

    Posted: 2 years ago #
  2. Make sure you didn't add any white space before or after the <?php ?> in the templates and the plugin.

    The error you are seeing is not the primary error, it's caused by another error happening before it.

    When the error happens, do a "view source" in your browser and see if you can find an earlier error message ahead of the "headers already sent"

    Posted: 2 years ago #
  3. citizenkeith

    Member

    Indeed, there was white space at the beginning of the plugin file. I must have hit Tab accidentally when editing. Thanks, ck!

    Posted: 2 years ago #
  4. Nice plug-in. I updated the members_online_today function as it wasn't working properly for me. I really didn't see the purpose of the $time or time(). Now when a user logs in they're added to the today list. It's still working off of the midnight mark. I may update it so that's it within 24 hours rather than basing it off of midnight. This is how I am using it.

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

    Posted: 2 years ago #
  5. The links produced by <?php do_action('members_online_now',''); ?> don't seem to work for me. The links are /profile.php?id=34 instead of the permalink structure I've got selected. clicking any user link gives me a user not found page. I assume I just need a bit of something in my .htaccess but I'm not sure what. Ideas?

    Posted: 2 years ago #
  6. Discovered a fix. In members-online.php, line 79, I just changed

    $member->ID

    to

    $member->user_login

    oh and on line 78 I updated the part after the URI to just profile/

    Posted: 2 years ago #
  7. n8kindt

    Member

    i took clarklab's fix a little further

    78: $profile=bb_get_option('uri')."profile/"; $output="";
    79: foreach ($members as $member) {$output.="<a rel='nofollow' href='".get_user_profile_link( $member->ID )."'>".get_user_display_name( $member->ID )."</a>, ";}
    Posted: 2 years ago #
  8. The reason why I don't use get_user_profile_link is it causes the bbpress api to do an extra query for every user in the list. If you have 100 users online, that will be 100 queries.

    The profile.php?id= shortcut I use should work no matter if permalinks are on or not, but that might be broken in 1.0, so I can eventually just detect which format is being used and switch between ID vs user_login as necessary. Alternately I could just do bb_cache_users so that all the api functions will work without extra queries, but the idea here was maximum performance.

    Posted: 2 years ago #
  9. Hello there! Great plugin, I am using it. Though i have a request, is it possible to add the member's avatars(Gravatars) to the function instead of the links? I'd like to have small avatars in my sidebar that when clicked on take you to their profile.

    Would it work to do something with the bb_get_avatar() function?

    Posted: 2 years ago #
  10. I also have post count plus where it says when you joined, your post count etc. Under it, it shows the member online post...but there is a space between post count plus and the member online post. I am trying to figure out how to remove the space so online is right under the post count.

    http://www.ghostdroppings.com/bbpress/topic.php?id=6732

    I also didn't create this layout, I have just been added plugins and modifying. They messed up the spacing in between actual posts. Can anyone help me out as far as how to fix the spacing in between posts so the avatars/post are more spread out and not on top of eachother.

    Posted: 2 years ago #
  11. citizenkeith

    Member

    I'm unable to keep members hidden from non-users. I'm running 0.9.0.6. I inserted the code _ck_ recommended above:

    if ( !bb_is_user_logged_in()) {return;}

    No go.

    Posted: 2 years ago #
  12. Version 0.0.2 now generates proper profile links based on selected permalink style.

    citizenkeith I have no idea why that's not working for you, it's perfectly valid code
    make sure it looks like this

    function members_online_footer() {
    	if (!is_front()) {return;}
    	if (!bb_is_user_logged_in()) {return;}
    	global $members_online;
    Posted: 2 years ago #
  13. citizenkeith

    Member

    _ck_,

    That's exactly how I have the plugin modified. I tried it with 0.0.2 and it still doesn't work.

    Posted: 2 years ago #
  14. I think you are calling the list directly instead of letting the plugin do it, so that's the wrong place.

    I've now added many more options and fixed an important bug with how midnight is calculated, so please re-download 0.0.2

    Instead of editing it with that line, change the option at the top
    $members_online['show_anyone'] = false;
    and then only members should see the list.

    Remember it only updates here once per hour, so you may need to download it directly here:
    http://plugins-svn.bbpress.org/members-online/trunk/members-online.php

    Posted: 2 years ago #
  15. citizenkeith

    Member

    That did the trick. Thanks, _ck_!

    Posted: 2 years ago #
  16. Nice plugin, I love it.

    Posted: 2 years ago #
  17. One question though, how can I show the members who are online in a list, like:

    Now online:
    Jim
    Jack
    John
    Etc.

    Instead of:
    Jim Jack John Etc.

    Posted: 2 years ago #
  18. I have encountered a problemn.

    The profile links in "member online" are not working.

    if my domain is http://www.example.com

    and the link to the user's profile is http://www.example.com/profile.php?id=235

    I'm getting in the now online list:
    http://www.example.com/http://www.example.com/profile.php?id=235

    Posted: 2 years ago #
  19. Tomcraft1980

    Member

    permalinks now work great, but without permalinks the links builded as follows:

    http://www.xtc-modified.org/forum/http://www.xtc-modified.org/forum/profile.php?id=xxxx

    Any suggestions?

    kind regards

    Tom

    Posted: 2 years ago #
  20. fixed now

    Posted: 2 years ago #

RSS feed for this topic

Add a Comment »

You must log in to post.