View Full Version : [Fixed] Show thread problems if pagenumber exceeds number of actual pages.
Paul
Sun 6th Apr '03, 12:34am
Hi,
The following issue occurs when a value is specified for pagenumber higher than the number of actual pages in a thread. This issue was brought to our attention by a user on our forums who was browsing a long thread that was split.
I've provided a link below to a thread on vbulletin.org that demonstrates the problem. I think if the number of pages exceeds the number of actual available pages, vBulletin should display the last available page.
http://www.vbulletin.org/forum/showthread.php?s=&threadid=34527&perpage=15&display=&pagenumber=30
Best wishes,
Paul
Angelos
Sun 6th Apr '03, 12:58am
Very good suggestion!
I back it up!
I had some "problems" with this issue !
Paul
Sun 6th Apr '03, 7:24pm
It turns out this is a problem for most parts of vBulletin 2.x where multiple page navigation is used, although not with the same affect as showthreads.php. We've developed a fix for showthreads.php and are currently working on other affected files. We will post our progress here.
Best wishes,
Paul
Paul
Sun 6th Apr '03, 8:59pm
The following files are affected:
forumdisplay.php showthread.php member.php member2.php memberlist.php printthread.php search.php (2 places)The following file may be affected, although I don't see what the affected code does just yet. It may be from an older version:
usercp.phpThe general fix for each file involves the following bit of code:
$totalpages = ceil($codespecificvariable/$perpage);
if ($pagenumber>$totalpages) {
$pagenumber = $totalpages;
}
Where $codespecificvariable is the count of results being made in each of these files. For example, in forumdisplay.php $codespecificvariable would be $totalthreads.
In some of these files, the following code (or something similar) would need to be moved under the fix above:
$limitlower=($pagenumber-1)*$perpage+1;
$limitupper=($pagenumber)*$perpage;
The fixed code should be in the following order:
Result count Fix above $limitlower/$limitupper definitionI do not recommend anyone try to make this many changes unless they really know what they're doing for what amounts to be a minor problem that will only arise under very specific conditions:
A user follows an old bookmark to a multipage listing where items have been removed, thus lowering the page count. A user attempts to manually increment the pagenumber value in the URL. A user is viewing a multipage listing while pruning or spliting is occuring on the forums, thus lowering the page count.The suggested fix above will display the last page of results for any $pagenumber that is larger than the total number of pages, as defined by the number of results divided by the number of results to display per page.
Best wishes,
Paul
Paul
Mon 14th Apr '03, 10:23am
*bump*
Steve Machol
Mon 14th Apr '03, 12:45pm
Moved to the Bugs forum so a Dev can look at this.
Scott MacVicar
Mon 9th Jun '03, 4:47am
fixed now, a new function was introduced to sanatize perpage and pagenumber results.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.