bug in start=new

Started by Spaceman-Spiff, August 14, 2003, 03:06:40 PM

Previous topic - Next topic

Spaceman-Spiff

if the topic is unread, it will be redirected to the last message
didnt seem to happen before

Spaceman-Spiff

actually, it happens in every topic now, not only in unread ones

morph

Hmmm.. it doesnt seem to be happening to me..

Coming soon!

Omar Bazavilvazo

it has a bug

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





Personal Signature:
HablaJapones
http://hablajapones.org
http://hablajapones.org/tutoriales.php


NO me manden PM para soporte o dudas
...Leo los foros como todos...

[Unknown]

It's always worked perfectly for me.....

-[Unknown]

Spaceman-Spiff

weird, its still happenning to me, maybe only to those with custom membergroup?

[Unknown]

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]

Gobalopper

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?

Spaceman-Spiff

in every topic, even ones that i have read partly, when i click on the new image, it always goes to the last msg

[Unknown]

That means that this:
if (empty($linkMessage))
Is always evaluating to true...

-[Unknown]

Jack.R.Abbit™

[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.

[Unknown]

Hmmm.. very odd... maybe it's been fixed...

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

-[Unknown]

Spaceman-Spiff

maybe there's something wrong with log_mark_read?
i dont think i ever use mark read though...

Compuart

I think I found the bug. Should be fixed here.
Hendrik Jan Visser
Former Lead Developer & Co-founder www.simplemachines.org
Personal Signature:
Realitynet.nl -> ExpeditieRobinson.net / PekingExpress.org / WieIsDeMol.Com

Advertisement: