Skip to:
Content
Pages
Categories
Search
Top
Bottom

insert bbpress team Lable/Bage on the top right


  • Benjamin Zekavica
    Participant

    @benjamin-zekavica

    Please, my bad English excuses, am from another country.
    insert bbpress team Lable/Bage on the top right – user colours

    I would improve in appearance with pleasure in bbpress my Admin & presenters of account.
    1. How can I make a Lable like this?

    2. How can I provide colours for Admins & presenters visibilities?

    3. How can I provide in bbpress under the forum some whole view who is on-line?

    I hope you can help me. Please tell me the files that I should open.

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

  • Robkk
    Moderator

    @robkk

    1. it tells you right on the topic you linked to.

    2. this PHP code will help with styling a users reply by role.

    function rk_show_role_classes($classes) {
        $replyid = bbp_get_reply_author_id();
        $bbp_role = bbp_get_user_display_role($replyid);
      
    	$classes[] = $bbp_role;
    	return $classes;
    }
    add_filter( 'bbp_get_topic_class','rk_show_role_classes' );
    add_filter( 'bbp_get_reply_class','rk_show_role_classes' );

    3 this plugin will help

    https://wordpress.org/plugins/wp-useronline/


    Benjamin Zekavica
    Participant

    @benjamin-zekavica

    Where should I insert then the code from: http://www.kriesi.at/support/topic/custom-images-for-moderator-in-bbpress/ of the site?


    Robkk
    Moderator

    @robkk

    first change the PHP function to this, it bugged me that its not lowercase.

    function rk_show_role_classes($classes) {
        $replyid = bbp_get_reply_author_id();
        $bbp_get_role = bbp_get_user_display_role($replyid);
        $bbp_display_role = strtolower($bbp_get_role);
    	  
      
    	$classes[] = $bbp_display_role;
    	return $classes;
    }
    add_filter( 'bbp_get_topic_class','rk_show_role_classes' );
    add_filter( 'bbp_get_reply_class','rk_show_role_classes' );

    Thats CSS in the topic you linked to , put it anywhere you can put custom css

    a child themes style.css file
    a custom css plugin

    this is basically what you would need in your code.

    #bbpress-forums .bbp-body .moderator div.bbp-topic-content, 
    #bbpress-forums .bbp-body .moderator div.bbp-reply-content {
    background: #f8f8f8 url(images/team-badge-head.png) top right no-repeat;
    }

    you will need an image in your child theme in a folder called images though for what they have.

    you can test it out by just changing the background color for the users.

    #bbpress-forums .bbp-body .keymaster div.bbp-topic-content, 
    #bbpress-forums .bbp-body .keymaster div.bbp-reply-content {
    background: blue;
    }

    there should be classes inserted for every role

    .keymaster = Keymaster
    .moderator = Moderator
    .participant = Participant
    .guest = Guest


    Benjamin Zekavica
    Participant

    @benjamin-zekavica

    I have made everything, but it does not work. What do I make wrong?


    Robkk
    Moderator

    @robkk

    link to your site so i can check the source code


    Benjamin Zekavica
    Participant

    @benjamin-zekavica

    I have the side timewise on xampp in the localhost mode. If you can exactly say me which files I must insert this code. Is this in the Theme a folder or in the plug-in itself?


    Robkk
    Moderator

    @robkk

    you insert this into a child themes function.php file or a functionality plugin

    function rk_show_role_classes($classes) {
        $replyid = bbp_get_reply_author_id();
        $bbp_get_role = bbp_get_user_display_role($replyid);
        $bbp_display_role = strtolower($bbp_get_role);
    	  
      
    	$classes[] = $bbp_display_role;
    	return $classes;
    }
    add_filter( 'bbp_get_topic_class','rk_show_role_classes' );
    add_filter( 'bbp_get_reply_class','rk_show_role_classes' );

    this custom css you can put in your child themes style.css file or a custom css plugin.

    
    #bbpress-forums .bbp-body .keymaster div.bbp-topic-content, 
    #bbpress-forums .bbp-body .keymaster div.bbp-reply-content,
    #bbpress-forums .bbp-body .moderator div.bbp-topic-content, 
    #bbpress-forums .bbp-body .moderator div.bbp-reply-content {
    background: #f8f8f8 url(images/team-member.png) top right no-repeat;
    }

    now for this to work exactly like the other site , you can download this image from here, by right clicking save image as, then uploading the image to your child theme in a folder called images. Make sure its named “team-member”


    Benjamin Zekavica
    Participant

    @benjamin-zekavica

    I have made everything. It does not work yet


    Robkk
    Moderator

    @robkk

    explain to me where you put the code and how you did everything so i could see if you did anything wrong or not.

    and also what theme are you using.


    Benjamin Zekavica
    Participant

    @benjamin-zekavica

    I am use Sahifa from Themeforest. I put all the codes in the Theme.


    Robkk
    Moderator

    @robkk

    try this CSS instead.

    #bbpress-forums .keymaster div.bbp-topic-content, 
    #bbpress-forums .keymaster div.bbp-reply-content,
    #bbpress-forums .moderator div.bbp-topic-content, 
    #bbpress-forums .moderator div.bbp-reply-content {
    background: #f8f8f8 url(images/team-member.png) top right no-repeat;
    }
Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.
Skip to toolbar