分页条添加省略号效果
添加方法
打开 /include/arc.listview.class.php 找到
$total_list = $list_len * 2 + 1;
这里有2处,都需要在它的下面加入
//省略号if ($totalpage > $total_list) {$half = floor(($total_list - 4) / 2);$half_start = $this->PageNo - $half + 1;if ($total_list % 2 !== 0) --$half_start;$half_end = $this->PageNo + $half;}if (($totalpage - $this->PageNo) < ($total_list - 3)) {$half_start = $totalpage - $total_list + 3;unset($half_end);}if ($this->PageNo <= ($total_list - 3)) {$half_end = $total_list - 2;unset($half_start);}
继续找到
for($j;$j<=$total_list;$j++)
这里也有2处,都需要改成
for($j=1;$j<=$totalpage;$j++)
最后找到
if($j==$this->PageNo)
这里也有2处,在它上面加入
//省略号if (isset($half_start) && $j < $half_start && $j > 1) {if ($j == 2) $listdd .= "<li style='border:0;'><a href='javascript:void(0)'>...</a></li>";continue;}if (isset($half_end) && $j > $half_end && $j < $totalpage) {if ($j == ($half_end + 1)) $listdd .= "<li style='border:0;'><a href='javascript:void(0)'>...</a></li>";continue;}