Skip to:
Content
Pages
Categories
Search
Top
Bottom

Displaying who’s online within members-loop.php

  • So I’m trying to display who is online within the main members loop where the small avatars and member names are displayed.
    I defined the following function at the top of my php file.
    `
    <?php function user_online($memberName){
    if ( bp_has_members( ‘type=online&search_terms=’.$memberName)) return true;
    else return false;
    ?>
    }
    `
    Within the members-loop.php where it displays “last active TIME_LAST_ACTIVE”, I would like to be able to display whether or not the user is online. If so print “online now”, else print “last active TIME_LAST_ACTIVE”
    Here’s where I call my function defined above
    `

    <?php $thisMemberName=bp_member_name();
    if(user_online($thisMemberName))
    echo “NOW ONLINE”;
    else bp_member_latest_update();
    ?>

    `
    Thanks in advance for your help. I really appreciate it.
    Alex

  • The topic ‘Displaying who’s online within members-loop.php’ is closed to new replies.
Skip to toolbar