1
Example:
I connect from my PC, I go to forums ( I have 3 topics no readed). I read the first one. I disconnect.
Now, from work I want to continue reading topics but... All was readed!!! Now I don't know what topics are not readed.
The conditions are:
Last visit to forums < last post topic = unread topicand
Last read topic (from cookie) < last post topic = unread topicNow the question is if I have no cookies (other PC or remove them), why I have my topics readed?
Look at forum.php (inside class directory from newbb) line 514 aprox.
Quote:
// ------------------------------------------------------
/* Necessary and sufficient conditions for an unread topic:
1. the last_post_time must be later than the last_vist;
2. the last_post_time must be later than the topic_lastread;
*/
$is_unread = false;
$lastread = empty($topic_lastread[$myrow['topic_id']])? 0 : $topic_lastread[$myrow['topic_id']];
if(max($GLOBALS['last_visit'], $lastread) < $myrow['last_post_time']) $is_unread = true;
// ------------------------------------------------------
I think is was correct if I use the minium value from 'last_visit' or '$lastread' and not max value. Probably correct was:
Quote:
// ------------------------------------------------------
/* Necessary and sufficient conditions for an unread topic:
1. the last_post_time must be later than the last_vist;
2. the last_post_time must be later than the topic_lastread;
*/
$is_unread = false;
$lastread = empty($topic_lastread[$myrow['topic_id']])? 0 : $topic_lastread[$myrow['topic_id']];
if(min($GLOBALS['last_visit'], $lastread) < $myrow['last_post_time']) $is_unread = true;
// ------------------------------------------------------
It's a suggestion