(1)找到function ParseDMFields,修改為:
注意增加了如下代碼用來(lái)獲得當(dāng)前的頁(yè)碼:
function ParseDMFields($pageNo,$ismake=1) { $this->NowPage = $pageNo; //獲得當(dāng)前頁(yè)面編號(hào) $this->Fields['cpagenum'] = $this->NowPage; if($this->SplitPageField!="" && isset($this->Fields[$this->SplitPageField])) { $this->Fields[$this->SplitPageField] = $this->SplitFields[$pageNo - 1]; }
(2)找到function __construct構(gòu)造函數(shù),修改為:$this->Fields['cpagenum'] = $this->NowPage;
注意增加了如下代碼用來(lái)獲得總頁(yè)碼:
$this->TotalPage = count($this->SplitFields); } //獲得當(dāng)前頁(yè)面總數(shù) $this->Fields['totalpage'] = $this->TotalPage; $this->LoadTemplet(); $this->ParseTempletsFirst(); }
2、接下來(lái)在模板中用js實(shí)現(xiàn)分析靜態(tài)頁(yè)面和動(dòng)態(tài)頁(yè)面以及向下翻頁(yè)$this->Fields['totalpage'] = $this->TotalPage;
在這個(gè)js腳本中,我們定義一個(gè)方法goNextPic用來(lái)切換到下一個(gè)圖片。
<script language="javascript"> var npage = {dede:field/}; var totalpage = {dede:field/}; var filename=""; var curl=location.href; function goNextPic(){ str1 = /.html/ig; str2 = /_/ig; r = curl.search(str1); r1 = curl.search(str2); if(r>0){ if(npage==1) filename = curl.substr(0,r); else filename = curl.substr(0,r1); if(npage==totalpage){ location.href = filename+".html"; } else{ location.href = filename+"_"+(npage+1)+".html"; } }else{ if(npage==totalpage){ location.href = "view.php?aid={dede:field/}"; } else{ location.href = "view.php?aid={dede:field/}&pageno="+(npage+1); } } } </script>
為:$revalue = "<center><a href='$src' target='_blank'><img src='$src' alt='$alt' $iw/></a><br/>$alt<br/></center>rn";
$revalue = "<center><a href='javascript:goNextPic();'><img src='$src' alt='$alt' $iw/></a><br/>$alt<br/></center> ";
版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: 織夢(mèng)dede源碼模板下載實(shí)現(xiàn)圖集單擊圖片翻頁(yè)的功能的代碼