mark read and unread posts

Discussion forum for Extension Writers regarding Extension Development.
User avatar
sebo
Registered User
Posts: 53
Joined: Mon Jan 22, 2024 10:28 pm

mark read and unread posts

Post by sebo »

Hi there, i'm devolping something and trying to list the last 50 posts grouped by topics (in a list page like the "recent posts").
i've a problem understanding how posts are marked like read or unread for the reader.

we have the forum_track (i think we don't need it)
we have the topic_track table (it give the marktime for topic_id and user_id)
we have the last_post_time column in phpbb_topics

so i guess, :idea: i need the marktime to check with the lastpost_time... :idea: so while i visit the topic and the last post, in the db will appears (in topic_track) a new record with:
  • my id
  • the topic_id i've visited
  • the marktime, the time i've visited it
isn't it?
nope.
If i visit some posts, it doesn't appear the new record in topic_track table, so how it works? :?: :?: :? :shock:
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53514
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: mark read and unread posts

Post by Brf »

On your Load Settings, do you have "Enable server-side topic marking" set to Yes?
User avatar
sebo
Registered User
Posts: 53
Joined: Mon Jan 22, 2024 10:28 pm

Re: mark read and unread posts

Post by sebo »

yes, it's enabled,but it doesn't work for all topics.

for some topic it works and i can find the marktime.
in other cases it doesn't work, so i don't know how can i make a marktime on a topic...?

is it the correct way to check the marktime?
i've searched the marktime in the phpbb_users table, but i guess it is for the subscription and it doesn't need for read/unread.
thanks

i've tried now and i make an example:
i've visited a topic: 14447 with 216 views and 0 replies.
in topic_mark table, if i make a search with topic id 14447 i obtain only 4 records. and my user_id i've just visited is not in the list. :?:
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53514
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: mark read and unread posts

Post by Brf »

Has a new post been made to that topic since the last time you used "Mark all read" on its forum, or the board in general?
User avatar
sebo
Registered User
Posts: 53
Joined: Mon Jan 22, 2024 10:28 pm

Re: mark read and unread posts

Post by sebo »

No, It has 0 replies, and i've never used "Mark all read" function... But i didn't change options/settings in my forum since 1 year and this topic Is from a few days ago...
In the meantime some topics works and i can them Mark read/unread with the topic_track table !
rxu
Extensions Development Team
Posts: 3848
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: mark read and unread posts

Post by rxu »

It's not that easy actually, you could start from looking into the big SQL query in the function get_unread_topics() in includes/functions.php.
Last edited by rxu on Fri Aug 09, 2024 3:06 pm, edited 1 time in total.
User avatar
sebo
Registered User
Posts: 53
Joined: Mon Jan 22, 2024 10:28 pm

Re: mark read and unread posts

Post by sebo »

thanks! i'll check it!!

Return to “Extension Writers Discussion”