// Values that can be used in other PHP code on the page
$paginate_num_pages = 42;
$paginate_num_sections = 167;
$paginate_page_selector = 'page';
$paginate_current_page = $_GET['page'];
// Pin page selector to a valid number (or 'all')
if($paginate_current_page=='')
$paginate_current_page = '1';
if($paginate_current_page != 'all') {
if($paginate_current_page == 'first')
$paginate_current_page = 1;
elseif($paginate_current_page == 'last')
$paginate_current_page = 42;
elseif($paginate_current_page < 1)
$paginate_current_page = 1;
elseif($paginate_current_page > 42)
$paginate_current_page = 42;
$paginate_sections = array( 0
, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 167);
$paginate_top_section = $paginate_sections[$paginate_current_page-1]+1;
$paginate_bottom_section = $paginate_sections[$paginate_current_page];
} else {
$paginate_top_section = 1;
$paginate_bottom_section = 167;
}
$paginate_self = '&' . $_SERVER['QUERY_STRING'] . '&';
$paginate_self = preg_replace("/&page=[^&]*&/", "&", $paginate_self);
$paginate_self = substr($paginate_self, 0, strlen($paginate_self) - 1);
if($paginate_self == '&')
$paginate_self = '';
$paginate_self = basename($_SERVER['PHP_SELF']) . "?${paginate_self}page";
?>