I see a number of columns in the topics table in the Data Explorer called “Featured_user…” and it’s rarely mentioned anywhere on Discourse with description of what it is and how it functions (or that I wasn’t able to find the source)?
Would be grateful for an explanation or a reference, please! Thank you! (:
I believe those are the users/avatars that show up next to the topic author in the topic lists (along with the
Thanks @JammyDodger! Testing this on Data Explorer plugin sometimes the UI shows for example four featured users but the query for
SELECT id, title, featured_user1_id, featured_user2_id, featured_user3_id,
featured_user4_id FROM topics
might display NULL for the fourth, third, second, or even all!
has about three users displayed in the Top list whereas when running the query only one user appears to be a featured user:
– same id, same topic…
The first avatar would be the topic owner
(topic.user_id), and the second would likely be the
featured_user1, and the third
You could try this and see if it marries up with what your topic list shows:
-- integer :topic_id
SELECT t.id as topic_id,
t.user_id as topic_owner_user_id,
t.featured_user1_id as F1_user_id,
t.featured_user2_id as F2_user_id,
t.featured_user3_id as F3_user_id,
t.featured_user4_id as F4_user_id,
FROM topics t
WHERE t.id = :topic_id
Okay thanks a lot, and sorry if I wasn’t able to explain this properly from the start, but in my example above, it shows three users (yes the first user is the owner) but in the query result only one user appears to be a featured_user so my question is how come in the query it chose to display one user and not the other whom is visible in the UI? (without including the topic owner - that’s understood)
I expect it to display two featured users + the owner, like we have it in the UI (:
The users move across from
last_post_user_id as you go:
Yes thanks so much! That’s exactly what I wanted to understand!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.