1
natxocc
Unread topics in newbb2. I think doesn't work well
  • 2005/3/13 14:23

  • natxocc

  • Just popping in

  • Posts: 19

  • Since: 2005/1/23


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 topic

and

Last read topic (from cookie) < last post topic = unread topic


Now 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

Login

Who's Online

165 user(s) are online (79 user(s) are browsing Support Forums)


Members: 0


Guests: 165


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits