1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-04 20:27:40 +02:00

Blog Plugin as a part of Monstra CMS

This commit is contained in:
Awilum
2014-01-03 19:07:05 +02:00
parent 79f4abe6bd
commit 83264e41f3
12 changed files with 487 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?php
if (Request::get('tag')) $tag = '&tag='.Request::get('tag'); else $tag = '';
$neighbours = 6;
$left_neighbour = $page - $neighbours;
if ($left_neighbour < 1) $left_neighbour = 1;
$right_neighbour = $page + $neighbours;
if ($right_neighbour > $pages) $right_neighbour = $pages;
if ($page > 1) {
echo ' <a href="?page=1'.$tag.'">'.__('begin', 'blog').'</a> ... <a href="?page=' . ($page-1) . $tag.'">'.__('prev', 'blog').'</a> ';
}
for ($i=$left_neighbour; $i<=$right_neighbour; $i++) {
if ($i != $page) {
echo ' <a href="?page=' . $i . $tag.'">' . $i . '</a> ';
} else {
echo ' <b>' . $i . '</b> ';
}
}
if ($page < $pages) {
echo ' <a href="?page=' . ($page+1) . $tag.'">'.__('next', 'blog').'</a> ... <a href="?page=' . $pages . $tag.'">'.__('end', 'blog').'</a> ';
}
?>