Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Spaceman-Spiff on August 14, 2003, 03:06:40 PM

Title: bug in start=new
Post by: Spaceman-Spiff on August 14, 2003, 03:06:40 PM
if the topic is unread, it will be redirected to the last message
didnt seem to happen before
Title: Re:bug in start=new
Post by: Spaceman-Spiff on August 14, 2003, 03:28:18 PM
actually, it happens in every topic now, not only in unread ones
Title: Re:bug in start=new
Post by: morph on August 14, 2003, 03:28:51 PM
Hmmm.. it doesnt seem to be happening to me..
Title: Re:bug in start=new
Post by: Omar Bazavilvazo on August 14, 2003, 04:50:44 PM
it has a bug

somehow, it always redirects to the last post of the thread (1 before #lastPost)

Title: Re:bug in start=new
Post by: [Unknown] on August 14, 2003, 05:26:02 PM
It's always worked perfectly for me.....

-[Unknown]
Title: Re:bug in start=new
Post by: Spaceman-Spiff on August 14, 2003, 05:34:01 PM
weird, its still happenning to me, maybe only to those with custom membergroup?
Title: Re:bug in start=new
Post by: [Unknown] on August 14, 2003, 05:37:53 PM
Quote from: Spaceman-Spiff on August 14, 2003, 05:34:01 PM
weird, its still happenning to me, maybe only to those with custom membergroup?

No, it's happened to me now... here:

      // Find the earliest unread message in the topic.
      $request = db_query("
         SELECT MIN(m.ID_MSG)
         FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m
            LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = $threadid AND lt.ID_MEMBER = $ID_MEMBER)
            LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = $board AND lmr.ID_MEMBER = $ID_MEMBER)
         WHERE t.ID_TOPIC = $threadid
            AND m.ID_TOPIC = $threadid
            AND m.posterTime > GREATEST(lt.logTime, lmr.logTime, 0)", __FILE__, __LINE__);
      list ($linkMessage) = mysql_fetch_row($request);
      mysql_free_result($request);

      // They've read all the messages in the topic - get the last one.
      if (empty($linkMessage))
      {
         $request = db_query("
            SELECT MAX(ID_MSG)
            FROM {$db_prefix}messages
            WHERE ID_TOPIC = $threadid", __FILE__, __LINE__);
         list ($linkMessage) = mysql_fetch_row($request);
         mysql_free_result($request);
      }

      redirectexit('threadid=' . $threadid. ';start=msg' . $linkMessage . (isset($_REQUEST['boardseen']) ? ';boardseen' : '') . '#msg' . $linkMessage);


What's wrong with that?

-[Unknown]
Title: Re:bug in start=new
Post by: Gobalopper on August 14, 2003, 06:29:08 PM
So the bug is that in a topic you haven't read at all yet, when you click the new image you are taken to the last post instead of the first post?
Title: Re:bug in start=new
Post by: Spaceman-Spiff on August 14, 2003, 07:04:03 PM
in every topic, even ones that i have read partly, when i click on the new image, it always goes to the last msg
Title: Re:bug in start=new
Post by: [Unknown] on August 14, 2003, 07:05:37 PM
That means that this:
if (empty($linkMessage))
Is always evaluating to true...

-[Unknown]
Title: Re:bug in start=new
Post by: Jack.R.Abbitâ„¢ on August 14, 2003, 07:29:15 PM
[Unknown], couldn't you check to see if that other (second) query is being run... or has that admin feature been removed?  It could just be the first query returning something unexpected.  Just a thought.
Title: Re:bug in start=new
Post by: [Unknown] on August 14, 2003, 07:36:39 PM
Hmmm.. very odd... maybe it's been fixed...

Here, I have the problem.  On my local server... everything is fine.

-[Unknown]
Title: Re:bug in start=new
Post by: Spaceman-Spiff on August 14, 2003, 07:52:10 PM
maybe there's something wrong with log_mark_read?
i dont think i ever use mark read though...
Title: Re:bug in start=new
Post by: Compuart on August 16, 2003, 05:12:28 AM
I think I found the bug. Should be fixed here.