修改默認搜索模版的分頁是在e/class/connect.php下,搜索下function page1就是我們要修改的分頁了,下面是我修改後的分頁
function
page1(
$num
,
$line
,
$page_line
,
$start
,
$page
,
$search
){
global
$fun_r
;
if
(
$num
<=
$line
)
{
return
''
;
}
$search
=RepPostStr(
$search
,1);
$url
=eReturnSelfPage(0).
'?page'
;
$snum
=2;
$totalpage
=
ceil
(
$num
/
$line
);
$firststr
=
'<a title="'
.
$fun_r
[
'trecord'
].
'" class="disabled">'
.
$num
.
'</a>'
;
if
(
$page
<>0)
{
$toppage
=
'<a href="'
.
$url
.
'=0'
.
$search
.
'" class="disabled">'
.
$fun_r
[
'startpage'
].
'</a>'
;
$pagepr
=
$page
-1;
$prepage
=
'<a href="'
.
$url
.
'='
.
$pagepr
.
$search
.
'" class="disabled">'
.
$fun_r
[
'pripage'
].
'</a>'
;
}
if
(
$page
!=
$totalpage
-1)
{
$pagenex
=
$page
+1;
$nextpage
=
'<a href="'
.
$url
.
'='
.
$pagenex
.
$search
.
'" class="disabled">'
.
$fun_r
[
'nextpage'
].
'</a>'
;
$lastpage
=
'<a href="'
.
$url
.
'='
.(
$totalpage
-1).
$search
.
'" class="disabled">'
.
$fun_r
[
'lastpage'
].
'</a>'
;
}
$starti
=
$page
-
$snum
<0?0:
$page
-
$snum
;
$no
=0;
for
(
$i
=
$starti
;
$i
<
$totalpage
&&
$no
<
$page_line
;
$i
++)
{
$no
++;
if
(
$page
==
$i
)
{
$is_1
=
"<a class='cur'>"
;
$is_2
=
"</a>"
;
}
else
{
$is_1
=
'<a href="'
.
$url
.
'='
.
$i
.
$search
.
'">'
;
$is_2
=
"</a>"
;
}
$pagenum
=
$i
+1;
$returnstr
.=
$is_1
.
$pagenum
.
$is_2
;
}
$returnstr
=
$firststr
.
$toppage
.
$prepage
.
$returnstr
.
$nextpage
.
$lastpage
;
return
$returnstr
;
}
最後一點要說明下,就是分頁個數是在【系統設置】-【系統參數設置】-【搜索設置】-【頁面設置】中根據自己的需要設置把
*