Menu callbacks that display paged query results should call theme('pager') to
retrieve a pager control so that users can view other results.
Format a list of nearby pages with additional query results.

Parameters

$tags:
An array of labels for the controls in the pager.

$limit:
The number of query results to display per page.

$element:
An optional integer to distinguish between multiple pagers on one page.

$parameters:
An associative array of query string parameters to append to the pager links.

// Calculate various markers within this pager piece: // Middle is used to "center" pages around the current page. $pager_middle = ceil($quantity / 2); // current is the page we are currently paged to $pager_current = $pager_page_array[$element] + 1; // first is the first page listed by this pager piece (re quantity) $pager_first = $pager_current - $pager_middle + 1; // last is the last page listed by this pager piece (re quantity) $pager_last = $pager_current + $quantity - $pager_middle; // max is the maximum page number $pager_max = $pager_total[$element]; // End of marker calculations.

Hi,
while i am adding this code in my basic theme template.I am getting following error.
Cannot unset string offsets in D:\Install\xampp\htdocs\myproject\sites\all\modules\devel_themer\devel_themer.module
how can i fix this error ?

// Calculate various markers within this pager piece: // Middle is used to "center" pages around the current page. $pager_middle = ceil($quantity / 2); // current is the page we are currently paged to $pager_current = $pager_page_array[$element] + 1; // first is the first page listed by this pager piece (re quantity) $pager_first = $pager_current - $pager_middle + 1; // last is the last page listed by this pager piece (re quantity) $pager_last = $pager_current + $quantity - $pager_middle; // max is the maximum page number $pager_max = $pager_total[$element]; // End of marker calculations.

Edit: You may also need the code below if you are using ApacheSolr on your site. I corrected the text in the pager. The core Search module had set a variable that we no longer use, and the variable value was 10 when we currently are using 20. The variable is now dynamic, so if we choose to show more search results per page then the pager text will reflect that. I have the ApacheSolr running on my site.

// Calculate various markers within this pager piece: // Middle is used to "center" pages around the current page.$pager_middle = ceil($quantity / 2);// current is the page we are currently paged to$pager_current = $pager_page_array[$element] + 1;// first is the first page listed by this pager piece (re quantity)$pager_first = $pager_current - $pager_middle + 1;// last is the last page listed by this pager piece (re quantity)$pager_last = $pager_current + $quantity - $pager_middle;// max is the maximum page number$pager_max = $pager_total[$element];// End of marker calculations.

// Calculate various markers within this pager piece: // Middle is used to "center" pages around the current page.$pager_middle = ceil($quantity / 2);// current is the page we are currently paged to$pager_current = $pager_page_array[$element] + 1;// first is the first page listed by this pager piece (re quantity)$pager_first = $pager_current - $pager_middle + 1;// last is the last page listed by this pager piece (re quantity)$pager_last = $pager_current + $quantity - $pager_middle;// max is the maximum page number$pager_max = $pager_total[$element];// End of marker calculations.

I'm new to Drupal and trying to figure this out.
I have the pagination working, but I was wondering if there is a way to append the URL so that you can use the browser's back/forward buttons. Any Ideas?

// Calculate various markers within this pager piece: // Middle is used to "center" pages around the current page. $pager_middle = ceil($quantity / 2); // current is the page we are currently paged to $pager_current = $pager_page_array[$element] + 1; // first is the first page listed by this pager piece (re quantity) $pager_first = $pager_current - $pager_middle + 1; // last is the last page listed by this pager piece (re quantity) $pager_last = $pager_current + $quantity - $pager_middle; // max is the maximum page number $pager_max = $pager_total[$element]; // End of marker calculations.