MyBB Community Forums

Full Version: Paging error (non-existing page numbers on the paging links)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

We have been facing a problem for some time already, that visitors of the site (not logged) can see more pages (the paging on the top of the topic) than there really exist.

In this case below the post has 68 pages, but unlogged visitors can see 71 pages on the paging links. If you try to click on the non-existing pages you get an error.

http://forum.antinovaordemmundial.com/To...es?page=70

This doesn't happens when you are logged in...

I'm using the latest version of mybb 1.6.8
Is this a known issue?
One possible cause is wrong thread counters. Try Recount&Rebuild in Admin CP -> Tools.

Did you convert your forum to MyBB from another systems, and is it only converted threads affected? Then those threads might have a wrong firstpost set in the database.
Yes, I did convert, but it has been almost 2 years ago, and this is a newer thread...

Well, now it seems it corrected itself Smile
Also affected. Converted from phpBB3 to MyBB.
Example:
[attachment=27347]
[attachment=27348]

I've just rebuilt thread counters...

This thread is an old thread. Don't know if this happens also with new threads (we will see).

It seems it only happens with threads that have 30 answers, 20 answers, 10 answers... Seems mybb says "ok, 30 answers + first post = 31 posts. 31 posts = 4 pages." and it is wrong, it is 30 posts in total, not 30+1.

Am I wrong?
You have to set the firstpost for those threads.

Something like UPDATE mybb_threads t SET t.firstpost=(SELECT MIN(pid) FROM mybb_posts p WHERE p.tid=t.tid) WHERE t.firstpost=0 (not tested)

recount&rebuild doesn't fix firstpost unfortunately. visiting the thread might, so a forum that's around long enough (google crawled all threads) the recount&rebuild might suffice