DEDECMS织梦模板实现图集单击图片翻页的教程

打造最全的CMS类教程聚合!

1、为了实现这个功能,我们首先需要获得图片页面的当前页码和总页码 
编辑include/inc_archives_view.php文件 
(1)找到function ParseDMFields,修改为:

 
   
function ParseDMFields($pageNo,$ismake=1) 

{ 

$this->NowPage = $pageNo; 

//获得当前页面编号 


$this->Fields['cpagenum'] = $this->NowPage; 

if($this->SplitPageField!="" && 

isset($this->Fields[$this->SplitPageField])) 

{ 

$this->Fields[$this->SplitPageField] = $this->SplitFields[$pageNo - 1]; 

}
 

注意增加了如下代码用来获得当前的页码:

$this->Fields['cpagenum'] = $this->NowPage;
 


(2)找到function __construct构造函数,修改为:

 

$this->TotalPage = count($this->SplitFields); 

} 

//获得当前页面总数