Welcome Guest, Not a member yet? Register   Sign In
Customize Pagination class
#3

[eluser]CoolGoose[/eluser]
I think I nailed it:

Code:
// Calculate the start and end numbers. These determine
// which number to start and end the digit links with
$start = (($this->cur_page - $this->num_links) > 0) ? $this->cur_page - ($this->num_links - 1) : 1;
$end   = (($this->cur_page + $this->num_links) < $num_pages) ? $this->cur_page + $this->num_links : $num_pages;

if ($this->cur_page >= 10)
{
  $base_number_raw = substr($this->cur_page, 0, -1);
  $base_number = $base_number_raw * 10;
  
  $start = $base_number_raw;
  $end   = $base_number_raw + $this->num_links;
}
else
{
  $start = 1;
  $end   = $this->num_links;
}

Not really tested Tongue.


Messages In This Thread
Customize Pagination class - by El Forum - 11-07-2009, 11:06 AM
Customize Pagination class - by El Forum - 11-08-2009, 04:53 AM
Customize Pagination class - by El Forum - 11-08-2009, 06:28 AM
Customize Pagination class - by El Forum - 11-08-2009, 07:52 AM
Customize Pagination class - by El Forum - 11-08-2009, 07:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB