Merge pull request #62 from galex-713/patch-12
Amélioration de la liste des liens de pagination.
This commit is contained in:
commit
fed9c28a62
1 changed files with 11 additions and 14 deletions
|
@ -870,23 +870,20 @@ else
|
||||||
}
|
}
|
||||||
|
|
||||||
$max = $vvb->countArticles();
|
$max = $vvb->countArticles();
|
||||||
if ($max > $config->articles_per_page)
|
if ($max > $config->articles_per_page) {
|
||||||
{
|
echo "\n".' <nav>'."\n";
|
||||||
echo "\n".' <nav>'."\n";
|
if ($page > 1)
|
||||||
|
echo ' <a rel="prev" href="'.$vvb->getLocalURL($page - 1).'">← '.__('Newer').'</a>'."\n";
|
||||||
|
|
||||||
if ($page > 1)
|
$last = ceil($max / $config->articles_per_page);
|
||||||
echo ' <a href="'.$vvb->getLocalURL($page - 1).'">← '.__('Newer').'</a>'."\n";
|
for ($i = 1; $i <= $last; $i++) {
|
||||||
|
echo ' '.($i == $page ? '<strong>'.$i.'</strong>' : '<a href="'.$vvb->getLocalURL($i).'">'.$i.'</a>')."\n";
|
||||||
|
}
|
||||||
|
|
||||||
$last = ceil($max / $config->articles_per_page);
|
if ($page < $last)
|
||||||
for ($i = 1; $i <= $last; $i++)
|
echo ' <a rel="next" href="'.$vvb->getLocalURL($page + 1).'">'.__('Older').' →</a>'."\n";
|
||||||
{
|
|
||||||
echo ' <a href="'.$vvb->getLocalURL($i).'">'.($i == $page ? '<strong>'.$i.'</strong>' : $i).'</a>'."\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($page < $last)
|
echo ' </nav>';
|
||||||
echo ' <a href="'.$vvb->getLocalURL($page + 1).'">'.__('Older').' →</a>'."\n";
|
|
||||||
|
|
||||||
echo ' </nav>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue