Topic being viewed by online users?

I have a member who’s online:
image

Has been online every day for the past 6 days, but only 1 topic viewed. Is there any way to see what topic this user is viewing? Could this be a bot?

Edit:

7 hours later, still online and only view 1 topic:

You should be able to find this out using the data explorer. Maybe something like this:

-- [params]
-- user_id :user

SELECT *
FROM topic_views
WHERE user_id = :user
ORDER BY viewed_at DESC

The topic_views table only records the first time someone views a topic, so you can’t tell how often they visited it over the last x amount of time, but maybe this is enough?

Alternatively, you could impersonate that user and then view their /activity/read page in their profile.

1 Like

I have used this query to find out which topic the test user I created used for testing something. It returns the topic, category, and the number of the post that was read, ordered by most recent view. Usually the most recently viewed topic is the one I was looking for :slight_smile:

-- [params]
-- user_id
SELECT 
    tu.topic_id, 
    category_id, 
    tu.last_read_post_number, 
    tu.last_visited_at 
FROM 
    topics 
LEFT OUTER JOIN 
    topic_users AS tu 
    ON topics.id = tu.topic_id 
WHERE 
    tu.user_id = :user_id 
    AND tu.last_visited_at IS NOT NULL 
ORDER BY 
    tu.last_visited_at DESC

2 Likes