Answer the question
In order to leave comments, you need to log in
Algorithm for determining the number of unread topics on the forum
I shoveled through many open source forum engines but did not find a solution.
I'll start from the end. It was necessary to determine whether there were new comments in the topic since the last reading of the topic by the user and if true highlight the topic in the list in bold. Quite a simple solution: create a big_brother_viewlog table in the database (fields user_id, topic_id, timelog) when a user opens a topic, write the time in it. When displaying a list of topics, join them or make another query to this table and in the cycle of displaying topics we check if !isset(timelog) OR timelog < last_post (field of the forums_topics table, contains the time of the last comment) then highlight the topic name in bold.
Later I decided to highlight the names of forums in the general list in which there are unread topics. And stalled. Maybe someone picked the source codes of the forums and remembers how this can be done?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question