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 :: Unread Messages :: Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
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 12:44 Go to next message
_alex is currently offline  _alex
Messages: 5
Registered: July 2018
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 04:59 Go to previous messageGo to next message
naudefj is currently offline  naudefj   United States
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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 05: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 03:43 Go to previous messageGo to next message
_alex is currently offline  _alex   Germany
Messages: 5
Registered: July 2018
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 10:37 Go to previous messageGo to next message
_alex is currently offline  _alex
Messages: 5
Registered: July 2018
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 14:24 Go to previous messageGo to next message
naudefj is currently offline  naudefj   United States
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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 14:29 Go to previous messageGo to next message
_alex is currently offline  _alex   Germany
Messages: 5
Registered: July 2018
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 03:56 Go to previous messageGo to next message
naudefj is currently offline  naudefj   United States
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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 15:56 Go to previous message
naudefj is currently offline  naudefj   United States
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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?
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
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 Oct 10 19:40:04 EDT 2024

Total time taken to generate the page: 0.06881 seconds