Want to modify drupal default pager functionality I am creating a page with teaser of articles using views... In the Full pager, the default functionality is....

1 2 3 4 ... next >

when i click next now the next number gets highlightd like...

&lt; prev ... 1 2 3 4 ... next >

and now when i again click next...

&lt; prev ... 2 3 4 5  ... next >

the number set gets altered...

But what i actually need is...

1 2 3 4 next >

&lt; prev  1 2 3 4  next >

&lt; prev  1 2 3 4  next >

&lt; prev  1 2 3 4  next >

and now when i click next...

&lt; prev 5 6 7 8 next >

There are some modules like PAGERER to change the appearance of the core pager... But is there any to make this functionality or should I do some custom work...
I worked on it and found a result... actually Drupal core pager is user friendly enough but in case you need to alter it's functionality you need to edit variables in theme_pager() in your theme's template file.

To obtain the above functionality I altered some variables which are as follows...

$pager_first = (floor($pager_current / $quantity) * $quantity) + 1;

$pager_last = $pager_first + $quantity - 1;


if( $pager_current % $quantity == 0){
  $pager_first = $pager_current - $quantity +1;
  $pager_last = $pager_first + $quantity - 1;
}


I neglected $page_middle variable since I did not needed it...

Warning: Do this when its absolutely necessary...