histogram: Make histograms crash less
[ninja.git] / application / views / pagination / punbb.php
blob6c50677357026ca1257c6efa03ba5a6522ca9376
1 <?php defined('SYSPATH') OR die('No direct access allowed.');
2 /**
3 * PunBB pagination style
5 * @preview Pages: 1 … 4 5 6 7 8 … 15
6 */
7 ?>
9 <p class="pagination">
11 <?php echo Kohana::lang('pagination.pages') ?> &nbsp;
13 <?php if ($current_page > 3): ?>
14 <a href="<?php echo str_replace('{page}', 1, $url) ?>">1</a>
15 <?php if ($current_page != 4) echo '&hellip; &nbsp;' ?>
16 <?php endif ?>
19 <?php for ($i = $current_page - 2, $stop = $current_page + 3; $i < $stop; ++$i): ?>
21 <?php if ($i < 1 OR $i > $total_pages) continue ?>
23 <?php if ($current_page == $i): ?>
24 <strong><?php echo $i ?></strong>
25 <?php else: ?>
26 <a href="<?php echo str_replace('{page}', $i, $url) ?>"><?php echo $i ?></a>
27 <?php endif ?>
29 <?php endfor ?>
32 <?php if ($current_page <= $total_pages - 3): ?>
33 <?php if ($current_page != $total_pages - 3) echo '&hellip; &nbsp;' ?>
34 <a href="<?php echo str_replace('{page}', $total_pages, $url) ?>"><?php echo $total_pages ?></a>
35 <?php endif ?>
37 </p>