The problem still persists. There's always
one unread item for me, allthough all are read:
- Front page shows one unread item
- following the link gives the "no unread items message"
I searched through the unb code and the unread threads are queried in the unb_lib/main.inc.php from line 1197:
// Find unread threads
if ($UNB['LoginUserID'])
{
$threads = $UNB['Db']->FastQueryArray(
/*table*/ array(
array('', 'Threads', 't', ''),
array('LEFT', 'ThreadWatch', 'tw', 't.ID = tw.Thread AND tw.User = ' . $UNB['LoginUserID']),
// UserForumFlags, only linked via forum ID
array('LEFT', 'UserForumFlags', 'uff_f', 'uff_f.User = ' . $UNB['LoginUserID'] . ' AND uff_f.Forum = t.Forum AND uff_f.Thread = 0'),
// UserForumFlags, only linked via thread ID
array('LEFT', 'UserForumFlags', 'uff_t', 'uff_t.User = ' . $UNB['LoginUserID'] . ' AND uff_t.Forum = 0 AND uff_t.Thread = t.ID')),
/*fields*/ 't.ID, t.Forum',
/*where*/ '(tw.LastRead < t.LastPostDate OR tw.LastRead IS NULL) AND ' .
'NOT (t.Options & ' . UNB_THREAD_MOVED . ') AND ' .
// Entire forum must not be hidden or ignored
'(uff_f.Flags IS NULL OR NOT (uff_f.Flags & ' . (UNB_UFF_IGNORE | UNB_UFF_HIDE) . ')) AND' .
// Particular thread must not be hidden or ignored
'(uff_t.Flags IS NULL OR NOT (uff_t.Flags & ' . (UNB_UFF_IGNORE | UNB_UFF_HIDE) . '))');
$count = 0;
if ($threads) foreach ($threads as $record)
{
if (UnbCheckRights('viewforum', $record['Forum'], $record['ID'])) $count++;
}
if ($count)
{
$TP['UnreadTopicsLink'] = UnbLink('@search', 'nodef=1&Special=unread&ResultView=1', true);
$TP['UnreadTopicsCount'] = $count;
$new_forums += $count;
}
}
My first guess is: could it be that the "Threads" table maybe contains a ghost thread where "LastPostDate" is empty or sth.?