1 <?php
defined('SYSPATH') OR die('No direct access allowed.');
3 * Digg pagination style
5 * @preview « Previous 1 2 … 5 6 7 8 9 10 11 12 13 14 … 25 26 Next »
11 <?php
if ($previous_page): ?
>
12 <a href
="<?php echo str_replace('{page}', $previous_page, $url) ?>">«
; 
;<?php
echo Kohana
::lang('pagination.previous') ?
></a
>
14 «
; 
;<?php
echo Kohana
::lang('pagination.previous') ?
>
18 <?php
if ($total_pages < 13): /* « Previous 1 2 3 4 5 6 7 8 9 10 11 12 Next » */ ?
>
20 <?php
for ($i = 1; $i <= $total_pages; $i++
): ?
>
21 <?php
if ($i == $current_page): ?
>
22 <strong
><?php
echo $i ?
></strong
>
24 <a href
="<?php echo str_replace('{page}', $i, $url) ?>"><?php
echo $i ?
></a
>
28 <?php
elseif ($current_page < 9): /* « Previous 1 2 3 4 5 6 7 8 9 10 … 25 26 Next » */ ?
>
30 <?php
for ($i = 1; $i <= 10; $i++
): ?
>
31 <?php
if ($i == $current_page): ?
>
32 <strong
><?php
echo $i ?
></strong
>
34 <a href
="<?php echo str_replace('{page}', $i, $url) ?>"><?php
echo $i ?
></a
>
39 <a href
="<?php echo str_replace('{page}', $total_pages - 1, $url) ?>"><?php
echo $total_pages - 1 ?
></a
>
40 <a href
="<?php echo str_replace('{page}', $total_pages, $url) ?>"><?php
echo $total_pages ?
></a
>
42 <?php
elseif ($current_page > $total_pages - 8): /* « Previous 1 2 … 17 18 19 20 21 22 23 24 25 26 Next » */ ?
>
44 <a href
="<?php echo str_replace('{page}', 1, $url) ?>">1</a
>
45 <a href
="<?php echo str_replace('{page}', 2, $url) ?>">2</a
>
48 <?php
for ($i = $total_pages - 9; $i <= $total_pages; $i++
): ?
>
49 <?php
if ($i == $current_page): ?
>
50 <strong
><?php
echo $i ?
></strong
>
52 <a href
="<?php echo str_replace('{page}', $i, $url) ?>"><?php
echo $i ?
></a
>
56 <?php
else: /* « Previous 1 2 … 5 6 7 8 9 10 11 12 13 14 … 25 26 Next » */ ?
>
58 <a href
="<?php echo str_replace('{page}', 1, $url) ?>">1</a
>
59 <a href
="<?php echo str_replace('{page}', 2, $url) ?>">2</a
>
62 <?php
for ($i = $current_page - 5; $i <= $current_page +
5; $i++
): ?
>
63 <?php
if ($i == $current_page): ?
>
64 <strong
><?php
echo $i ?
></strong
>
66 <a href
="<?php echo str_replace('{page}', $i, $url) ?>"><?php
echo $i ?
></a
>
71 <a href
="<?php echo str_replace('{page}', $total_pages - 1, $url) ?>"><?php
echo $total_pages - 1 ?
></a
>
72 <a href
="<?php echo str_replace('{page}', $total_pages, $url) ?>"><?php
echo $total_pages ?
></a
>
77 <?php
if ($next_page): ?
>
78 <a href
="<?php echo str_replace('{page}', $next_page, $url) ?>"><?php
echo Kohana
::lang('pagination.next') ?
> 
;»
;</a
>
80 <?php
echo Kohana
::lang('pagination.next') ?
> 
;»
;