Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display this plugin before the username on replies


  • AleksDerFar
    Participant

    @aleksderfar

    Hi.
    I’ve bbp user online status plugin working ok and displaying an green/red icon on bbp_theme_after_reply_author_details. Is there any way to display it on the left side (before) of the username on replies? and in the profile page in the same place?

Viewing 14 replies - 1 through 14 (of 14 total)

  • Robkk
    Moderator

    @robkk

    contact the plugin author


    AleksDerFar
    Participant

    @aleksderfar

    I did but unfortunately it seems that he does not offer support.

    I’m trying to find where bbp-author-name is created and perhaps I can do something.


    Robkk
    Moderator

    @robkk

    @aleksderfar

    the plugin is still fresh it was uploaded to the WordPress repository 5 days ago.

    making the online status location configurable seems to be on the developers to-do list.

    i did see that the plugin author did reply back though.

    and you did figure how to show the green/red icon , so if you could tell him how you did it to help with future development of the plugin.


    Stagger Lee
    Participant

    @stagger-lee

    Nice plugin. I did it manually in bbPress profile screen and BuddyPress screen, with SVG Wifi colored icons. Not easy to explain how, different files involved.
    But for topic user info could not manage it. Different queries.


    Robkk
    Moderator

    @robkk

    @stagger-lee

    if you could im sure that will help other users even the developer.


    Stagger Lee
    Participant

    @stagger-lee

    Cannot post it. Fix this stupid filter. What is this ?


    Stagger Lee
    Participant

    @stagger-lee

    Cannot post same comment on some other topic either. Duplicate content warning.


    Robkk
    Moderator

    @robkk

    remove the http:// when you go past 2 links.


    Stagger Lee
    Participant

    @stagger-lee

    functions.php:

    /**
    * webdeveloperswall.com/buddypress/check-if-a-user-is-online
    **/
    function is_user_online($user_id, $time=5){
    	global $wp, $wpdb;
    	
    	$user_login = $wpdb->get_var( $wpdb->prepare( "
    SELECT u.user_login FROM $wpdb->users u JOIN $wpdb->usermeta um ON um.user_id = u.ID
    WHERE u.ID = $user_id
    AND um.meta_key = 'last_activity'
    AND DATE_ADD( um.meta_value, INTERVAL $time MINUTE ) >= UTC_TIMESTAMP()
    " ,APP_POST_TYPE
    ));
    	if(isset($user_login) && $user_login !=""){
    		return true;
    	}
    	else {return false;}
    }

    pastebin.com/hEfRfKGe
    members-loop-php (BuddyPress)

    pastebin.com/9AyQJHBe
    member-header.php (BuddyPress)

    Probably the same process for bbPress alone. Cannot ruin now all to test it.
    Font Awesome needs to be activated for frontend. Or more easy, activate Dashicons for frontend and use some other SVG icon.

    s14.postimg.org/i6oixhaj5/2015_03_27_220006.jpg

    s21.postimg.org/xde02ec6v/2015_03_27_221745.jpg

    Some CSS:

    .bp-user #buddypress .online .fa-wifi {
    	color:green; 
    	font-size:22px;
    }
    .bp-user #buddypress .offline .fa-wifi {
    	color:#cf4d35; 
    	font-size:22px;
    }
    .bp-user #buddypress .online, 
    .bp-user #buddypress .offline {display:inline-block; text-align:right;float:right;}
    .members #buddypress .online-list .fa-wifi {color:green; font-size:15px;}
    .members #buddypress .offline-list .fa-wifi {color:#cf4d35; font-size:15px;}
    
    #buddypress .online-list,
    #buddypress .offline-list,
    #buddypress .offline,
    #buddypress .online {font-size:12px;}

    Stagger Lee
    Participant

    @stagger-lee

    Move all this to another topic, to not ruin this.

    members-loop-php (BuddyPress)

    member-header.php (BuddyPress)

    Cannot make links clickable. Great advertising for bbPress forum script.


    Robkk
    Moderator

    @robkk

    @stagger-lee

    the way you did it requires BuddyPress especially the activities part of it.

    still neat though, i like how you used the wifi signal for the online status icon.


    Stagger Lee
    Participant

    @stagger-lee

    You can use same function for bbPress part, I believe. It is up to you where do you want to adapt it.

    Or maybe “is_user_logged_in()”:

    http://wordpress.stackexchange.com/questions/34429/how-to-check-if-a-user-not-current-user-is-logged-in


    Stagger Lee
    Participant

    @stagger-lee

    Forgot about this and that I did it without buddyPress. Took code from this plugin and adapted it to my needs. But I see you already found it and adapted it self. Added some additional thing, Non logged User doesnt see online/offline icons, logged in User see them. Good to force curious people to log in.

    https://wordpress.org/support/topic/show-a-red-green-circle?replies=16
    https://wordpress.org/plugins/bbp-user-online-status/screenshots/


    Stagger Lee
    Participant

    @stagger-lee

Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.
Skip to toolbar