在e/data/language/bg/pub/fun.php这个文件里。打开这个文件,我理解了startpage这代表首页函数,lastpage代表尾页函数,trecord代表总数。所以回到e/class/t_functions.php文件里,尝试做了如下修改,实现了去除列表分页总数、首页、尾页。
贴出e/class/t_functions.php的前两百行,修改部分做了标记,跟大家分享,请老鸟给看看有没有不妥,另外自己怕忘,谁知道以后还改不改。
<?php
if(!defined('InEmpireCMS'))
{
exit();
}
define('InEmpireCMSTfun',TRUE);
require_once(ECMS_PATH."e/class/userfun.php");
//列表模板分页函数
function sys_ShowListPage($num,$pagenum,$dolink,$dotype,$page,$lencord,$ok,$search="",$add){
global $fun_r;
//文件名
if(empty($add['dofile']))
{
$add['dofile']='index';
}
//静态页数
$repagenum=$add['repagenum'];
//首页
if($pagenum<>1)
{
$pagetop="<a href='".$dolink.$add['dofile'].$dotype."'>".$fun_r['startpage']."</a> ";
}
else
{
$pagetop=$fun_r['startpage']." ";
}
//上一页
if($pagenum<>1)
{
$pagepr=$pagenum-1;
if($pagepr==1)
{
$prido=$add['dofile'].$dotype;
}
else
{
$prido=$add['dofile'].'_'.$pagepr.$dotype;
}
$pagepri="<a href='".$dolink.$prido."'>".$fun_r['pripage']."</a> ";
}
else
{
$pagepri=$fun_r['pripage']." ";
}
//下一页
if($pagenum<>$page)
{
$pagenex=$pagenum+1;
$nextpagelink=$repagenum&&$repagenum<$pagenex?eReturnRewritePageLink2($add,$pagenex):$dolink.$add['dofile'].'_'.$pagenex.$dotype;
$pagenext="<a href='".$nextpagelink."'>".$fun_r['nextpage']."</a> ";
}
else
{
$pagenext=$fun_r['nextpage']." ";
}
//尾页 //……………………………………………………………………………………………………………整个尾页部分删掉。
if($pagenum==$page)
{
$pageeof=$fun_r['lastpage'];
}
else
{
$lastpagelink=$repagenum&&$repagenum<$page?eReturnRewritePageLink2($add,$page):$dolink.$add['dofile'].'_'.$page.$dotype;
$pageeof="<a href='".$lastpagelink."'>".$fun_r['lastpage']."</a>";
}
$options="";
//取得下拉页码
if(empty($search))
{
for($go=1;$go<=$page;$go++)
{
if($go==1)
{$file=$add['dofile'].$dotype;}
else
{$file=$add['dofile'].'_'.$go.$dotype;}
$thispagelink=$repagenum&&$repagenum<$go?eReturnRewritePageLink2($add,$go):$dolink.$file;
if($ok==$go)
{$select=" selected";}
else
{$select="";}
$myoptions.="<option value='".$thispagelink."'>".$fun_r['gotos'].$go.$fun_r['gotol']."</option>";
$options.="<option value='".$thispagelink."'".$select.">".$fun_r['gotos'].$go.$fun_r['gotol']."</option>";
}
}
else
{
$myoptions=$search;
$options=str_replace("value='".$dolink.$add['dofile'].'_'.$ok.$dotype."'>","value='".$dolink.$add['dofile']."_".$ok.$dotype."' selected>",$search);
}
$options="<select name=select onchange="self.location.href=this.options[this.selectedIndex].value">".$options."</select>";
//分页
$pagelink=$pagetop.$pagepri.$pagenext.$pageeof;
//替换模板变量
$pager['showpage']=ReturnListpageStr($pagenum,$page,$lencord,$num,$pagelink,$options);
$pager['option']=$myoptions;
return $pager;
}
//列表模板之列表式分页
function sys_ShowListMorePage($num,$page,$dolink,$type,$totalpage,$line,$ok,$search="",$add){
global $fun_r,$public_r;
if($num<=$line)
{
$pager['showpage']='';
return $pager;
}
//文件名
if(empty($add['dofile']))
{
$add['dofile']='index';
}
//静态页数
$repagenum=$add['repagenum'];
$page_line=$public_r['listpagelistnum'];
$snum=2;
//$totalpage=ceil($num/$line);//取得总页数
$firststr='<a title="Total record"> <b>'.$num.'</b> </a> ';//…………………………………………删掉本行去除总页数
//上一页
if($page<>1)
{
$toppage='<a href="'.$dolink.$add['dofile'].$type.'">'.$fun_r['startpage'].'</a> '; //…………………………删掉本行去除首页
$pagepr=$page-1;
if($pagepr==1)
{
$prido=$add['dofile'].$type;
}
else
{
$prido=$add['dofile'].'_'.$pagepr.$type;
}
$prepage='<a href="'.$dolink.$prido.'">'.$fun_r['pripage'].'</a>';
}
//下一页
if($page!=$totalpage)
{
$pagenex=$page+1;
$nextpagelink=$repagenum&&$repagenum<$pagenex?eReturnRewritePageLink2($add,$pagenex):$dolink.$add['dofile'].'_'.$pagenex.$type;
$lastpagelink=$repagenum&&$repagenum<$totalpage?eReturnRewritePageLink2($add,$totalpage):$dolink.$add['dofile'].'_'.$totalpage.$type;
$nextpage=' <a href="'.$nextpagelink.'">'.$fun_r['nextpage'].'</a>';
$lastpage=' <a href="'.$lastpagelink.'">'.$fun_r['lastpage'].'</a>'; //…………………………………………………删掉本行去除尾页
}
$starti=$page-$snum<1?1:$page-$snum;
$no=0;
for($i=$starti;$i<=$totalpage&&$no<$page_line;$i++)
{
$no++;
if($page==$i)
{
$is_1="<b>";
$is_2="</b>";
}
elseif($i==1)
{
$is_1='<a href="'.$dolink.$add['dofile'].$type.'">';
$is_2="</a>";
}
else
{
$thispagelink=$repagenum&&$repagenum<$i?eReturnRewritePageLink2($add,$i):$dolink.$add['dofile'].'_'.$i.$type;
$is_1='<a href="'.$thispagelink.'">';
$is_2="</a>";
}
$returnstr.=' '.$is_1.$i.$is_2;
}
$returnstr=$firststr.$toppage.$prepage.$returnstr.$nextpage.$lastpage;
$pager['showpage']=$returnstr;
return $pager;
注:本文来源于互联网