Jump to content

Where are the reaction types given stored in the database?


theblackelk

Recommended Posts

I am trying to generate some analytics about which reactions are used and which I can prune. There doesn't seem to be a way to do this in the admin panel, so I was going to see where it was stored in the database and count the usage that way.

Basically I am trying to see how many total times each individual reaction was used. So, where in the database does it store the reputation given and its type when someone reacts to a post?

Link to comment
Share on other sites

@Square Wheels this is the best I got now, I think it's correct but test it see what you get. (I don't know how to get to the reaction name itself so it lists the reaction icon name, hopefully your files have meaningful names that allow you to identify the reaction easily)

SELECT b.reaction_id, b.reaction_icon,
COUNT(a.reaction) AS times_used
FROM core_reputation_index AS a
JOIN core_reactions AS b 
ON a.reaction = b.reaction_id
GROUP BY b.reaction_id, b.reaction_icon, a.reaction
ORDER BY COUNT(a.reaction) DESC

 

Link to comment
Share on other sites

15 hours ago, -FP said:

@Square Wheels this is the best I got now, I think it's correct but test it see what you get. (I don't know how to get to the reaction name itself so it lists the reaction icon name, hopefully your files have meaningful names that allow you to identify the reaction easily)


SELECT b.reaction_id, b.reaction_icon,
COUNT(a.reaction) AS times_used
FROM core_reputation_index AS a
JOIN core_reactions AS b 
ON a.reaction = b.reaction_id
GROUP BY b.reaction_id, b.reaction_icon, a.reaction
ORDER BY COUNT(a.reaction) DESC

 

I'm not a query guy, but I have something similar somewhere else, and the phrases are located in core_sys_lang_words.

INNER JOIN
core_sys_lang_words
ON
CONCAT('word_key_', core_reactions.reaction_id) = core_sys_lang_words.word_key

I use this as part of the query, maybe it could be a starting point if you were interested in trying to add the titles.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...