芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/kwesioben.com/store/system/library/pagination.php
total; if ($this->page < 1) { $page = 1; } else { $page = $this->page; } if (!(int)$this->limit) { $limit = 10; } else { $limit = $this->limit; } $num_links = $this->num_links; $num_pages = ceil($total / $limit); $this->url = str_replace('%7Bpage%7D', '{page}', $this->url); $output = '
'; if ($page > 1) { $output .= '
' . $this->text_first . '
'; if ($page - 1 === 1) { $output .= '
' . $this->text_prev . '
'; } else { $output .= '
' . $this->text_prev . '
'; } } if ($num_pages > 1) { if ($num_pages <= $num_links) { $start = 1; $end = $num_pages; } else { $start = $page - floor($num_links / 2); $end = $page + floor($num_links / 2); if ($start < 1) { $end += abs($start) + 1; $start = 1; } if ($end > $num_pages) { $start -= ($end - $num_pages); $end = $num_pages; } } for ($i = $start; $i <= $end; $i++) { if ($page == $i) { $output .= '
' . $i . '
'; } else { if ($i === 1) { $output .= '
' . $i . '
'; } else { $output .= '
' . $i . '
'; } } } } if ($page < $num_pages) { $output .= '
' . $this->text_next . '
'; $output .= '
' . $this->text_last . '
'; } $output .= '
'; if ($num_pages > 1) { return $output; } else { return ''; } } }