PDA

View Full Version : [fixed] Perpage missing in forumdisplay.


Stadler
Mon 21st Oct '02, 6:47am
The perpage-value is missing in the forumdisplay-templates.

To correct this, edit the template forumdisplay_multipagenav_pagenumber by replacing the content with
<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]&perpage=$maxposts&pagenumber=$acurpage">$acurpage</a> Be sure not to forget the space before <a href="...

(Changes marked red)

Just adding some usability, when users with different "Posts per page"-values are posting links to pages of threads. Thats all. :)

Scott MacVicar
Mon 21st Oct '02, 12:21pm
the perpage is calculated within showthread.php about line 191

Stadler
Mon 21st Oct '02, 12:24pm
Yes, but sometimes users are posting links to pages, using the link from forumdisplay and not from showthread, which can cause some confusion between users, who have different perpage-settings.

It's a small bug, but it's still a bug. :rolleyes:

Scott MacVicar
Mon 21st Oct '02, 12:27pm
yes but doing what you propose would overide any custom set posts per page with the maximuim number that they can set it to.

I'll copy the code from showthread.php into forumdisplay.php and use the custom value.

Scott MacVicar
Mon 21st Oct '02, 12:33pm
make the template

<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]&perpage=$pperpage&pagenumber=$acurpage">$acurpage</a>

and open up forumdisplay.php

look for

// check to see if there are any threads to display. If there are, do so, otherwise, show message

below it add

$umaxposts = explode(',', $usermaxposts . ",$maxposts");
$newmaxposts = max($umaxposts);
if ($bbuserinfo['maxposts']!=-1 and $bbuserinfo['maxposts']!=0 and $bbuserinfo['maxposts'] <= $newmaxposts) {
$pperpage = $bbuserinfo['maxposts'];
} else {
$pperpage = $maxposts;
}

Stadler
Mon 21st Oct '02, 12:50pm
Works. Thanks for your time :)