function fPageCount($TotalResult,$numPerPage,$Page){
$NaviLength='10'; //番号を表示します
$showMorePageGo_Type_=0; // ジャンプ スタイル
$int_showNumberLink_='ten';
$nonLinkColor_=" #999999";
$toF_="9" ;
$toP10_=" 7";
$toP1_=" 3";
$toN1_=" ";
$toN10_=" 8";
$toL_=":";
$page_index = "";
$tpagecount = ceil($TotalResult/$numPerPage);
$nowCoolPage=ceil($Page/$NaviLength);
$toPage_ = $_SERVER['QUERY_STRING'];
if ( $toPage_ == '' ) {
$toPage_ = "?page=";
}else {
$toPage_ = preg_replace("/&?page =d+/ ", '', $toPage_);
$toPage_ = "?".$toPage_."&page=";
}
if($nowCoolPage == 1){
$page_index.="".$toF_." ";
$page_index.="".$toP10_." ";
}else{
$preRow = $Page-$NaviLength;
$page_index.="".$toF_." ";
$page_index.="".$toP10_." ";
}
$upRow = $Page-1;
$downRow = $Page+1;
if ($upRow>0){
$page_index. ="".$toP1_." ";
}else{
$page_index. color=".$nonLinkColor_." title="前のページ">".$toP1_." ";
}
for($i=1;$i $i $page_index.= " else{
1){
$page_index.=" "。 $toN1_." ";
}else{
$page_index.="".$toN1_." $page_index.=" ".$toN10_." ";
$page_index.="< ;font color=".$nonLinkColor_." title="尾页">".$toL_."";
}else{
$nextRow = $Page+$NaviLength;
$theEndRow = $tpagecount ;
$page_index.=" ".$toN10_." ";
$ page_index.="".$toL_."";
}
if ($showMorePageGo_Type_ ==1) {
$Show_Page_i = $Page + 1 ;
if ($Show_Page_i>$tpagecount) $Show_Page_i = 1;
$page_index.=" 跳转 n";
}else{
$page_index.=" 跳转:";
}
$page_index.=$p_.$sp2_ ." 每页".$numPerPage."gt;个记录,现在是:".$sp2_.$Page."/".$tpagecount."页,共gt;".$sp2_.$TotalResult."> ";
$page_index を返します。
}
例: $TotalResult 代表数 $numPerPage 每页显表示数 $page 页码