FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Make the » in the Pager jump to the very end ?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Make the » in the Pager jump to the very end ? [message #187524] Thu, 12 July 2018 16:44 Go to next message
_alex is currently offline  _alex
Messages: 5
Registered: July 2018
Karma: 0
Junior Member
I'm currently in the process of applying a lot of changes / wishes of our community, one thing i was asked if the » in the pager is somehow 'broken'.

Users expect it to jumo to the very end of a list in forum's or thread view, but it seems to be made to jump 15 pages (or 'entries per page') forward/backward.

How would i change this / is it even possible ?

Thanks,
Alex
Re: Make the » in the Pager jump to the very end ? [message #187527 is a reply to message #187524] Sun, 15 July 2018 08:59 Go to previous messageGo to next message
naudefj is currently offline  naudefj   United States
Messages: 3772
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
I'm sure it's possible to fix. Unfortunately, I don't have a form with such a long thread. I mean, if you show 40 messages/page and you have more than 15 pages, your thread must have more than 600 replies! The longest thread I can detect on any of my forums has 577 replies.

[Updated on: Sun, 15 July 2018 09:05]

Report message to a moderator

Aw: Make the » in the Pager jump to the very end ? [message #187528 is a reply to message #187524] Mon, 16 July 2018 07:43 Go to previous messageGo to next message
_alex is currently offline  _alex   Germany
Messages: 5
Registered: July 2018
Karma: 0
Junior Member
Hi, yes, Users i.e. created a sticky thread about their daily weather back in 2010.
This has now 215 pages, 15 threads / page, currently 3213 replies Shocked

Guess there are some other long-running threads where the double-arrow in the pager just doesn't work well.
Re: Aw: Make the » in the Pager jump to the very end ? [message #187592 is a reply to message #187528] Wed, 19 September 2018 14:37 Go to previous messageGo to next message
_alex is currently offline  _alex
Messages: 5
Registered: July 2018
Karma: 0
Junior Member
Just in case this is of interest, here is how it gives the right number for the last double-arrow:

src/draw_pager.inc.t, ca. Line 107 ...


if ($append) {
$page_next_url = $arg . $upfx . $page_start . $suf;
// $page_last_url = $arg . $upfx . $page_start_2 . $suf;
$page_last_url = $arg . $upfx . floor($total/$count)*$count . $suf;
} else {
$page_next_url = $page_last_url = $arg;
pager_replace($page_next_url, $upfx . $page_start, $count);
pager_replace($page_last_url, $upfx . $page_start_2, $count);
}
Re: Aw: Make the » in the Pager jump to the very end ? [message #187593 is a reply to message #187592] Thu, 20 September 2018 18:24 Go to previous messageGo to next message
naudefj is currently offline  naudefj   United States
Messages: 3772
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Thank you so much!
Patch committed @ http://sourceforge.net/p/fudforum/code/6203
Aw: Re: Aw: Make the » in the Pager jump to the very end ? [message #187594 is a reply to message #187593] Thu, 20 September 2018 18:29 Go to previous messageGo to next message
_alex is currently offline  _alex   Germany
Messages: 5
Registered: July 2018
Karma: 0
Junior Member
This had a little bug - if the number of total is exactly a multiple of numbers per page it jumps one increment too far.. .

decreasing the total by one should work, so better use smth like this:

$page_last_url = $arg . $upfx . floor($total-1/$count)*$count . $suf;
Re: Aw: Re: Aw: Make the » in the Pager jump to the very end ? [message #187595 is a reply to message #187594] Sat, 22 September 2018 07:56 Go to previous messageGo to next message
naudefj is currently offline  naudefj   United States
Messages: 3772
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Fix committed - thanks gain!
Re: Aw: Re: Aw: Make the » in the Pager jump to the very end ? [message #187606 is a reply to message #187595] Mon, 15 October 2018 19:56 Go to previous message
naudefj is currently offline  naudefj   United States
Messages: 3772
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
I've applied this patch to one of my forums, and it mostly jumps to an empty page. Can it be fixed or should we rather roll it back?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Karma/user reputation patch
Next Topic: BUG & Fix: Cleaning up GLOBALS.php $INCLUDE remnants
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Dec 12 15:54:49 GMT 2024

Total time taken to generate the page: 0.02038 seconds