需求:我的圖片集有幾百張,幻燈顯示會把所有的都列出來,影響美觀,如圖:
效果:
修改后達到這個效果,只列前后6張,共13個鏈接,如圖:
方法:
修改 include\inc_archives_view.php 文件:
1、查找“function GetPagebreakDM($totalPage,$nowPage,$aid)”(動態頁面分頁函數,大概在510行左右 )
A、往下幾行找到“for($i=1;$i<=$totalPage;$i++)”,在上面插入
Copy to ClipboardLiehuo.Net Codes引用的內容:[www.dede58.com]
$total_list=13; //顯示13個,6*2+1=13
if($nowPage >= $total_list) {
$i = $nowPage-6; //前后6個,(13-1)/ 2=6
$total_list = $nowPage+6; //前后6個,(13-1)/ 2=6
if($total_list >= $totalPage) $total_list = $totalPage;
}else{
$i=1;
if($total_list >= $totalPage) $total_list = $totalPage;
}
B、把“for($i=1;$i<=$totalPage;$i++)”,改成“for($i;$i<=$totalPage;$i++)”
2、查找“function GetPagebreak($totalPage,$nowPage,$aid)”(靜態頁面分頁函數函數,大概在550行左右)
A、同上
B、同上
附件下載:091110114422.rar
相關文章:DedeCMS分頁太多 頁碼智能顯示的方法