Page 1 of 1

"Mark all topics Read" -BUG

PostPosted: Tue May 09, 2006 1:27 am
Author: bbalegere
I get this error when I click on Mark all topics Read
Check it out here
http://www.bbalegere.ahbhost.com/forum/
General Error

Could not access topics

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND forum_id = 5 AND topic_moved_id = 0' at line 3

SELECT topic_id FROM integra_topics WHERE topic_id IN () AND forum_id = 5 AND topic_moved_id = 0

Line : 373
File : viewforum.php

PostPosted: Tue May 09, 2006 5:56 am
Author: Eon
Well that is not a bug as no one else has it. Looks like you have an sql error of some sort. Or it is trying to move a topic from forum id #5. Have you checked in phpmyadmin to see what forum has ID # 5?

I see that your site is still new and not live yet. My first suggestion would be to do a new install.

Make sure you clean your sql tables out before hand.

Re: "Mark all topics Read" -BUG

PostPosted: Tue May 09, 2006 7:01 am
Author: Dragonsys
Have you installed any extra MODs recently? it doesn't look like you did, but it never hurts to ask <img>

PostPosted: Tue May 09, 2006 7:07 am
Author: bbalegere
I have not installed any extra mods.
I found the same bug in this site
http://integrmod.com/IntegraMOD_140_demo/ ... um.php?f=1
I think this is a sample site where we can check out all the themes.
In the link I have posted above,just Click on Mark all topics read

You will get an error message which is similar to the error I am getting.

Could not access topics

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near ') AND forum_id = 1 AND topic_moved_id = 0' at line 3

SELECT topic_id FROM phpbb_topics WHERE topic_id IN () AND forum_id = 1 AND topic_moved_id = 0

Line : 373
File : viewforum.php


If you want to see the error directly, click on this link
http://integrmod.com/IntegraMOD_140_demo/ ... ark=topics

PostPosted: Tue May 09, 2006 12:23 pm
Author: Eon
Hmm. Are there any topics to acutally be marked as read??? Cause you know it usually doesn't give you that link unless you are logged in and have a history of what has and has not been seen.

PostPosted: Wed May 10, 2006 5:07 am
Author: bbalegere
Whatever it is,the error is not present only in my site,it is present in the IntegraMOD sample site also.
I hope someone knows how to fix this.

PostPosted: Wed May 10, 2006 6:10 am
Author: Eon
Well like I said that link is not actually available if there are no unread topics to mark. So therefore I would think you would get an error.

If you are using just a link to this mark all topics link, like a favorite then I could see this happening. But when there are topics to actually be marked read does it give you this error?

I signed up at your forum. Make a post so I can see an unread topic and get the error myself.

PostPosted: Wed May 10, 2006 8:31 am
Author: bbalegere
I replied to thetopic.
Check the Mark as read now.

Re: "Mark all topics Read" -BUG

PostPosted: Wed May 10, 2006 9:13 am
Author: Dragonsys
I get the same error on my site, but it does not happen all the time...
and it only happens, when viewing a certain forum.

PostPosted: Wed May 10, 2006 1:50 pm
Author: Eon
I clicked on mark topics read inside the forum, and it worked perfectly.

make another post and I will click on the mark forums read button and check it.

Was it a specific forum that you had a new post in that it was doing that? If so, make a topic there.

PostPosted: Wed May 10, 2006 7:25 pm
Author: BurninFingerTipz
I will add, I also get this error aswell when I "Mark all threads read"

General Error

Could not access topics

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near ') AND forum_id = 3 AND topic_moved_id = 0' at line 3

SELECT topic_id FROM phpbb_topics WHERE topic_id IN () AND forum_id = 3 AND topic_moved_id = 0

Line : 373
File : viewforum.php

PostPosted: Wed May 10, 2006 9:29 pm
Author: bbalegere
OK I got it
The error is shown only if all the topics are already read.
It works perfectly fine if there are topics which are not read.
However I do not want that error to come.
Is there any fix?

PostPosted: Thu May 11, 2006 5:46 am
Author: Eon
Well the link will not be there when there are no unread topics.

So therefore you will not get this error.

Why do you guys save a link to mark all topics read?

That seems pointless. But hey that is just my opinion.

Re: "Mark all topics Read" -BUG

PostPosted: Tue May 16, 2006 11:43 pm
Author: Nogami
I could be wrong because my PHP skills are kind of weak, but isn't this just a formatting problem with the SQL statement?

Code: Select all
   $sql = "SELECT topic_idFROM " . TOPICS_TABLE . "WHERE topic_id IN ($s_topics)AND forum_id = $forum_idAND topic_moved_id = 0";  


Shouldn't it lose the brackets around $s_topics to read]    $sql = "SELECT topic_idFROM " . TOPICS_TABLE . "WHERE topic_id IN $s_topicsAND forum_id = $forum_idAND topic_moved_id = 0";  [/code]

Alternately, add a check so that if the $s_topics variable is empty, just exit with a message "No unread topics?"

Apologies if I'm wrong <img>

PostPosted: Wed May 17, 2006 4:55 am
Author: Dragonsys
"Eon";p="5484" wrote:Well the link will not be there when there are no unread topics.

So therefore you will not get this error.

Why do you guys save a link to mark all topics read?

That seems pointless. But hey that is just my opinion.


Normally that is true. However, when there are unread topics in ANY forum the link shows, even when viewing a forum which does not have any unread topics. If you click on the link while viewint the forum with no unread topics, you will get this error.

It's not that we have a link saved to Mark all topics read.

Re: "Mark all topics Read" -BUG

PostPosted: Thu May 18, 2006 2:09 pm
Author: Nogami
Ok, this fixed it on my system:

in: viewforum.php

Find:

Code: Select all
   // read the relevant topic ids         $sql = "SELECT topic_id                     FROM " . TOPICS_TABLE . "  


Before, Add]             if ( $s_topics == '' )         {             message_die(GENERAL_MESSAGE, 'No unread topics in this forum');         }  [/code]

Of course, you can edit this to be in your language of choice <img>

Dave