Show a user's reputation/user level next to their name

First of all, I’ve been using discourse for about a couple of years now (since the pre 1.0 days). Great product and our community loves it.

My only gripe with it is that it doesn’t show any kind of statistics/reputation next to the person’s name. Right now it appears that everyone is at the same level; there’s no way to tell apart between the guy who’s been consistently posting for two years and a guy who just signed up yesterday.

I know that @codinghorror doesn’t want to go the typical forum route where they list “meaningless” stats such as number of posts created. While I understand that argument, I do want to show something next to the username so that others know who they’re dealing with. Perhaps display a user level, some kind of badge, etc.

I saw previous discussions relating to this, but they all seemed to have died down in 2013/2014.

Is something like this in the pipeline?

5 Likes

Something like this when you click on the avatar or name?

2 Likes

Two problems with this approach:

  1. It’s not easily visible. I want to look at a thread and quickly see who’s who without clicking on the user’s name.

It also took me sometime to realize that you can actually click on the username. I bet most users don’t bother clicking unless they need to contact the user for something.

  1. User levels (i.e., Member) as a metric are too coarse. I have users that are in Level 0, 1 and 2. Most of the active users are at Level 2. It doesn’t tell me anything when most of the active threads are being discussed by Level 2 people.

I think displaying something right next to the user’s avatar is the ideal solution. When I browse other forums, the user’s reputation/# of posts/custom label is the first thing that catches my eye when I try to figure out who the user is.

4 Likes

I take it your forum has been online for somewhere between 20 and 45 days, then?

IMHO that’s probably the best reason for having the User Card vs. “always there”
If one is not interested in that information it is nothing but distracting visual noise and clutter.
If someone is interested, a simple click is all it takes.

That said, the post.hbs template has a plugin-outlet
{{plugin-outlet "poster-avatar-bottom"}}
which is located beneath the avatar of each post

So using a plugin to display stuff there should be easy enough if you really wanted it.

You could do something with badges and auto assigned titles. But probably this is plugin territory.

Can you mock up what you have in mind visually?

No, this new forum is live for about 7-8 months. I’m the only guy who’s at Level 3.

I do have some people that consistently start topics and add lots of value to the forum. So, perhaps I need to play with the settings to make sure they’re being rewarded/promoted properly.

2 Likes

Sort of related: I’d still love to see a reputation system (trust levels mainly convey how long someone’s been around and not whether they’re a positive contributor):

https://meta.discourse.org/t/ability-to-block-or-mute-another-user/6001/26?u=adamcapriola

I’ve been meaning to come up with a full mockup/schematic … will try to draw something up in June. :pencil2:

2 Likes

Isn’t there already a user CP option to change one’s title from ‘won’ badges?

3 Likes

It’s been some time since I opened this thread, so I wanted to check if theres a way to attach certain statistics next to the username? As in how many threads they started, when they joined, etc.

Something like this would be ideal.

Is this something that can be done via a plugin? Or does it require a special hack?

I want everyone to know who’s new on the forum and who’s been heavily participating, etc.

1 Like

I’m interested in getting the same thing for our forum under everyone’s avatar, many folks have asked for it.

Is there a working plugin?
Can someone please share?

@Rainbowresidue

1 Like

Thanks so much, but I’m not looking for a plugin for a badge.

I’m looking for a plugin for something like this (to go under the avatar.), more like user stats.

I will be tackling that as it is a feature I want as well, but don’t have a timeline as of now.

2 Likes

Great, if you figure it out, I’d love to try it out for you.
:smiley:

1 Like

Hello, I just wanted to share my findings. Its not plugin ready, just quick hack to core files (sorry). But as inspiration for someone it may be handy…

Add User Post Count in post template and user-card

Use as example. It can be adjusted to display various user stats (post count, user_last_seen_at, etc.) in user-card and in post stream.

app/assets/javascripts/discourse/templates/user-card.hbs

{{user-reputation post_count=user.post_count}}

/assets/javascripts/discourse/components/user-reputation.js.es6

    export default Ember.Component.extend({
      tagName: 'div',
      classNames: ['user-reputation-user-card'],

      render: function(buffer) {
        
        const post_count = this.get('post_count');
        const contents = '<b>' + post_count + '</b>'; 
        
        buffer.push(contents);
      }
    });

/assets/javascripts/discourse/initializers/user-reputation-init.js.es6

    import { withPluginApi } from 'discourse/lib/plugin-api';
    import { includeAttributes } from 'discourse/lib/transform-post';
    import { h } from 'virtual-dom';

    export default {
      
      name: 'user-reputation-init',
      
      initialize(){
        
        withPluginApi('0.1', api => {
          api.includePostAttributes('user_last_seen_at');  // (automatically added to transform-post.js.es6)
          
          api.decorateWidget('poster-name:after', function(helper) {
            const attrs = helper.attrs;
            const user_custom_fields = attrs.user_title;
            const post_count = attrs.post_count;
            return [h('span', 'post_count ' + post_count)];
              
          });
        })
      }
      
    }

app/serializers/user_serializer.rb

                  :user_fields,
                  :topic_post_count,
                  :pending_count,
    +              :post_count,
                  :profile_view_count

app/serializers/post_serializer.rb

                  :via_email,
                  :is_auto_generated,
                  :action_code,
                  :action_code_who
    +              :post_count,

    +   def post_count 
    +     object.try(:user).try(:post_count)
    +     #object.try(:user).try(:user_stat).try(:post_count)
    +  end
4 Likes