Not logged in. · Lost password · Register
Forum: Offtopic Forum Help RSS
Forum title shows unread, but isn't
Avatar
Smorkster #1
Member since Nov 2009 · 16 posts
Group memberships: Members
Show profile · Link to this post
Subject: Forum title shows unread, but isn't
Lately the title for section "Installation and Configuration" have been shown in bold telling me that there are unread posts, but when I go there, all are read and fine.
Have tried to walk around the other sections, pushing the link to (the named) section, relogging. But nothing works.
Avatar
andi (Administrator) #2
Member since May 2006 · 2446 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hmm. Maybe try to use "mark all topics read" in the forum?
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
chi #3
Member since Jun 2006 · 1851 posts · Location: Munich Germany
Group memberships: Members, Super Mods, Wiki Managers
Show profile · Link to this post
I can confirm this. I sometimes get a "One Unread Topic" link when after I've visited the forum. When I follow the link I get the page which tells me that there are _no_ unread items (used mark all read at least twice since the mysql hickups you microblogged about). I will now remove my old cookie, maybe there's something going on with this.

**EDIT:** Nope, that didn't help either.

**EDIT2:** It gets weirder. I just used "mark all topics" read but the link stating that one unread topic remains still displays.
Please add [SOLVED] to the initial thread subject if you feel your question has been answered.
If my answer doesn't make sense maybe your question didn't either - just visit http://facepalm.org.
Avatar
andi (Administrator) #4
Member since May 2006 · 2446 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Probably something that went out of sync on the latest MySQL troubles. But I cannot even figure out how the forum stores read or unread status from the database structure. I'd need to dig through the code to get an idea. Maybe someone of you is faster and can tell me what I should look at?
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
chi #5
Member since Jun 2006 · 1851 posts · Location: Munich Germany
Group memberships: Members, Super Mods, Wiki Managers
Show profile · Link to this post
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:

  1.                         // Find unread threads
  2.                         if ($UNB['LoginUserID'])
  3.                         {
  4.                                 $threads = $UNB['Db']->FastQueryArray(
  5.                                         /*table*/ array(
  6.                                                 array('', 'Threads', 't', ''),
  7.                                                 array('LEFT', 'ThreadWatch', 'tw', 't.ID = tw.Thread AND tw.User = ' . $UNB['LoginUserID']),
  8.                                                 // UserForumFlags, only linked via forum ID
  9.                                                 array('LEFT', 'UserForumFlags', 'uff_f', 'uff_f.User = ' . $UNB['LoginUserID'] . ' AND uff_f.Forum = t.Forum AND uff_f.Thread = 0'),
  10.                                                 // UserForumFlags, only linked via thread ID
  11.                                                 array('LEFT', 'UserForumFlags', 'uff_t', 'uff_t.User = ' . $UNB['LoginUserID'] . ' AND uff_t.Forum = 0 AND uff_t.Thread = t.ID')),
  12.                                         /*fields*/ 't.ID, t.Forum',
  13.                                         /*where*/ '(tw.LastRead < t.LastPostDate OR tw.LastRead IS NULL) AND ' .
  14.                                                 'NOT (t.Options & ' . UNB_THREAD_MOVED . ') AND ' .
  15.                                                 // Entire forum must not be hidden or ignored
  16.                                                 '(uff_f.Flags IS NULL OR NOT (uff_f.Flags & ' . (UNB_UFF_IGNORE | UNB_UFF_HIDE) . ')) AND' .
  17.                                                 // Particular thread must not be hidden or ignored
  18.                                                 '(uff_t.Flags IS NULL OR NOT (uff_t.Flags & ' . (UNB_UFF_IGNORE | UNB_UFF_HIDE) . '))');
  19.  
  20.                                 $count = 0;
  21.                                 if ($threads) foreach ($threads as $record)
  22.                                 {
  23.                                         if (UnbCheckRights('viewforum', $record['Forum'], $record['ID'])) $count++;
  24.                                 }
  25.                                 if ($count)
  26.                                 {
  27.                                         $TP['UnreadTopicsLink'] = UnbLink('@search', 'nodef=1&Special=unread&ResultView=1', true);
  28.                                         $TP['UnreadTopicsCount'] = $count;
  29.                                         $new_forums += $count;
  30.                                 }
  31.                         }

My first guess is: could it be that the "Threads" table maybe contains a ghost thread where "LastPostDate" is empty or sth.?
Please add [SOLVED] to the initial thread subject if you feel your question has been answered.
If my answer doesn't make sense maybe your question didn't either - just visit http://facepalm.org.
chi #6
Member since Jun 2006 · 1851 posts · Location: Munich Germany
Group memberships: Members, Super Mods, Wiki Managers
Show profile · Link to this post
To narrow it further down, it seems to be sth. in the subforum "Installation And Configuration" (at least for me) - it always shows an unread item.
Please add [SOLVED] to the initial thread subject if you feel your question has been answered.
If my answer doesn't make sense maybe your question didn't either - just visit http://facepalm.org.
This post was edited on 2010-03-17, 12:13 by chi.
Avatar
andi (Administrator) #7
Member since May 2006 · 2446 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
You were right. There was a thread with no posts and a LastPostDate of NULL. I deleted it. Can you check if this solved your problems?
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
chi #8
Member since Jun 2006 · 1851 posts · Location: Munich Germany
Group memberships: Members, Super Mods, Wiki Managers
Show profile · Link to this post
Quote by andi:
You were right. There was a thread with no posts and a LastPostDate of NULL. I deleted it. Can you check if this solved your problems?

Perfect that solved it :-)!
Please add [SOLVED] to the initial thread subject if you feel your question has been answered.
If my answer doesn't make sense maybe your question didn't either - just visit http://facepalm.org.
Avatar
Smorkster #9
Member since Nov 2009 · 16 posts
Group memberships: Members
Show profile · Link to this post
Solved for me to :)
Thanks for the help
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20120620-dev, © 2003-2011 by Yves Goergen
Current time: 2014-04-21, 11:37:51 (UTC +02:00)