Prospective Feature: Highlight Posts That Surpass Defined "Likes" Threshold


(Anna) #1

This is a follow-up to “Identify and highlight post with the most likes in a given topic” (which seems a bit dead in the water and I didn’t want to resurrect this far past).


Feature Specifications

I’d love to replicate Blizzard’s approach to highly rated posts (in Blizzard’s case, they implement the upvote/downvote system – not a huge fan of that, but I am a fan of how they “reward” the users that are posting well-received content). In their case, a highly rated post has a “plaque” applied to it that visually distinguishes it from other posts in the thread as one the user should take note of.

Since we already have a “Likes” system in place (and it already shows how many :heart:s were given and by whom) , I’m curious if we can build off that pre-existing data for this “plaque” of honor on a per-post basis. I don’t personally have enough familiarity with programming to create my own plugin, but hopefully the information I’ve provided here is enough of a “spec” for someone with the time, expertise, and passion to make this a reality!

Why Do I Want It?

I personally would love this system (beyond the psychology behind it for the end-user) to assist in AMAs or as a simplified crowd-sourced “voting” method. I do realize that there is already a voting plugin, but that’s a topic-based voting plugin rather than a post-based one, which doesn’t help me very much for our intended purposes. Blizzard (again) has used this feature on their forums to assist in bubbling up the questions that their community wanted the answers to most, as seen here: Blizzard Forums


(Rafael dos Santos Silva) #2

What about highlighting posts that get badges like Great Reply and Good Reply ?


(Anna) #3

Is that badge applied to the post itself so others are able to recognize it as a well-received, “model” post (beyond the seeing the number of likes and making that conclusion for themselves), or is this something only granted to the poster and viewable on their profile? My goal would be to have something that all users can easily recognize on the post itself and take note of.


(Rafael dos Santos Silva) #4

Yes, the badge is mainly for the user. Just thinking in keeping it the way it is AND add a custom style to the post that made the user get the badge.


(Anna) #5

Yeah, that sounds great! They don’t need to be mutually exclusive, and I like keeping the “theme” with the badges. It’s like getting a star sticker for a job well-done, except in this case it’s up on the board that the entire class can see! :slight_smile:

(I think I had misunderstood your previous post, but I get it now!)


(Christopher Heald) #6

We developed a plugin that allows you to conditionally style the post with the most likes in a topic.


(Anna) #7

This is awesome! I’d love something like this, except for any posts that had (defined number) of likes or more would receive the same treatment. When it says you must “specify a user group”, could that group be “everyone”?

Are there any live examples of this at work?


(Jeff Atwood) #8

This is already sort-of possible on topics with 50 or more replies. Press the “summarize this topic” button at the top to filter the topic to the most significant replies. Likes are factored into that.


(Christopher Heald) #9

The query in the plugin targets a single post, and the behavior is modelled around a single result:

    most_liked_post = topic.posts.joins(user: [group_users:[:group]]).where(groups: {name: (params[:group].split("|"))}).where.not(sort_order: 1).order(like_count: :desc).limit(1).first

You could probably replace the .limit(1).first with a .where(like_count:) is greater than your likes threshold. However you would also have to strip out the link to the (single) top post.