Do discourse keep count of who has liked which post ?
I’m working on a method, which changes the color of the like icon, when a user have liked the post.
I have made it so, that if a user likes a post, the “like-icon” changes from gray to red for all users.
I only want it to change to red, if the user have liked that post.
Is there some kind of variable or something I can use from the discourse platform?

What i’m trying to is to only change the color of the heart icon, if the current user have liked that post.
The problem is, that the heart icons, changes color for all the users.
I want to know if, discourse keep tap over who liked what?

In my system the property ‘liked’ that you are referring to is going from null to false upon liking. The id that is passed as ‘likesId’ on the picture below is the id of the topic I am trying to like.
Do you have any explanation for this behaviour, or possibly a solution, so that the property returns true as intended, upon posting a like? It seems to be hindered by something.
Thank you

I have really been trying to understand the database structure and I admit to fail miserably at that. The only thing I can see is that on the live and dev site we have a difference in the response of a “not yet liked” idea. If you’d like to take a look at the responses I have some well documented pictures. It seems that liked property on the running site for “%liked” ideas is false, and on alpha site it is null by default.

That looks like JSON for the latest topic list page. The “liked” is whether or not you liked a post in the topic. (false if you read it but didn’t Like, null if you didn’t read it while logged in). The “like_count” is the number of likes for all the posts in the topic combined.

Depending on what kind of information you want, there may not be what you need in that JSON alone. More intricate criteria may need to run a query against more than one table. Or maybe XHR calls to other pages to get their JSON.

The Data Explorer plugin allows you to make SQL queries against your live database, allowing for up-to-the-minute stats reporting.
Usage
After installing the plugin, head to /admin/plugins. Click on the “Settings” button, and turn on “data explorer enabled”, then return and reload the page.
[image]
There should now be a tab in the stacked nav called “Data Explorer”. Select it, then use the + and Import buttons to create or import queries.
For an example, let’s import one that I wrote. Downl…