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); }
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; }
新闻热点
疑难解答