Write a General page of your own, with the Drop-down selection, you can set the number of page links to display, not to say, look at the code and comments:
1<?php
2//written by Shaoyun 20:17 May 31, 2008
3//email:shaoyun at Yeah.net
4//blog:http://shaoyun.cnblogs.com
5//Paging function: Splitpage (total number of records, number of records per page, display several page links)
6function splitpage ($rscount, $pagesize, $shownum) {
7//Calculate Total Pages
8if ($rscount% $pagesize) {
9 $pagenum = (int) ($rscount/$pagesize) +1;
10}else{
One $pagenum = (int) ($rscount/$pagesize);
12}
13//filter Get the correct page number
14if (!isset ($_get["page")) {
$curpage = 1;
16}elseif (Is_numeric ($_get["page")) {
if ($_get["page"]> $pagenum)
$curpage = $pagenum;
Else
$curpage = (int) $_get["page"];
if ($curpage <1)
$curpage = 1;
23}else{
$curpage = 1;
25}
26//set previous page, next page, previous page, down page
27$first_page=1;
28$last_page= $pagenum;
29$up_page= $curpage-1;
30$down_page= $curpage +1;
31//get the current file name
32$addr_url=$_server["Script_name"];
33$addr_url=strrev ($addr _url);
34$addr_url=substr ($addr _url,0,strpos ($addr _url, "/"));
35$addr_url=strrev ($addr _url);
36$addr_url= $addr _url. "? Page= ";
37
38$page_html= ' altogether '. $rscount. ' Record '. $pagesize. ' article/Page '. $curpage. ' /'. $pagenum. ' Page ';
39
40$page_html.= "<a href= '". $addr _url. $first _page. "' > Home </a> ";
41if ($curpage >1) {
$page _html.= "<a href=". $addr _url. $up _page. "' > Prev </a> ";
43}else{
$page _html.= "Prev ";
45}
46//Compute the paging boundary
47if ($shownum% 2) {
$show _front_num= (int) ($shownum/2);
$show _back_num= (int) ($shownum/2);
50}else{
Wuyi $show _front_num= (int) ($shownum/2)-1;
$show _back_num= (int) ($shownum/2);
53}
54if ($curpage < $show _front_num+1) {
$fbegin = 1;
$fend = $shownum;
57}elseif ($curpage + $show _back_num> $pagenum) {
$fend = $pagenum;
$fbegin = $pagenum-$shownum +1;
60}else{
$fbegin = $curpage-$show _front_num;
$fend = $curpage + $show _back_num;
63}
64//pagination Link
65for ($idx = $fbegin; $idx < $fend +1;++ $idx) {
if ($curpage = = $idx) {
$page _html.= "<b>". $idx. " </b> ";
}else{
$page _html.= "<a href=". $addr _url. $idx. "' > ". $idx." </a> ";
70}
71}
72
73if ($curpage < $pagenum) {
$page _html.= "<a href=". $addr _url. $down _page. "' > next page </a> ";
75}else{
$page _html.= "next page ";
77}
78$page_html.= "<a href= '". $addr _url. $last _page. "' > Last </a> ";
79//Dropdown Navigation Code
80$page_html.= "Jump to ";
81$page_html.= "<select onchange=window.location.href=this.options[this.selectedindex].value>";
82for ($idx =1 $idx < $pagenum +1;++ $idx) {
if ($curpage = = $idx) {
$page _html.= "<option value=". $addr _url. $idx. "' Selected>, $idx." Page </option> ";
}else{
$page _html.= "<option value= '". $addr _url. $idx. "' > ". $idx." Page </option> ";
87}
88}
89$page_html.= "</select>";
90
91echo $page _html;
92}
93?>