This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
rangitaki/res/php/Pagination.php

68 lines
1.7 KiB
PHP
Raw Permalink Normal View History

<?php
/**
2016-02-16 14:15:21 +01:00
* PHP Version 7
*
* PHP script for creating the next / prev page links
*
* @category Pagination
* @package Rbe
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link http://marcel-kapfer.de/rangitaki
*/
require_once "BlogListGenerator.php";
2016-12-29 21:54:37 +01:00
use mmk2410\rbe\BlogListGenerator\BlogListGenerator as BlogListGenerator;
2016-04-23 15:26:35 +02:00
require_once './res/php/Config.php';
2016-04-22 19:46:46 +02:00
2016-04-23 15:26:35 +02:00
$configParser = new mmk2410\rbe\config\Config('./config.yaml', './vendor/autoload.php');
2016-04-22 19:46:46 +02:00
2016-04-23 15:26:35 +02:00
$conf = $configParser->getConfig();
2016-04-22 19:46:46 +02:00
require_once "lang/" . $config["language"] . ".php";
if ($blog["design"]["pagination"]) {
?>
<div class="pag_buttons">
2016-04-22 19:46:46 +02:00
<?php
if ($pag_min > 0) {
if (isset($getblog)) {
2016-04-22 19:46:46 +02:00
?>
<a href="<?php
echo "?blog=" . $getblog . "&page=" . ($pagenumber - 1);
2015-12-21 15:56:18 +01:00
?>" class="pag_prev button"><?php echo $BLOGLANG["Previous Page"]; ?></a>
2016-04-22 19:46:46 +02:00
<?php
} else {
2016-04-22 19:46:46 +02:00
?>
<a href="<?php
echo "?page=" . ($pagenumber - 1);
2015-12-21 15:56:18 +01:00
?>" class="pag_prev button"><?php echo $BLOGLANG['Previous Page']; ?></a>
2016-04-22 19:46:46 +02:00
<?php
}
}
if (isset($getblog)) {
$pag_blog = $getblog;
} else {
$pag_blog = "main";
}
if ($pag_max < BlogListGenerator::getArticleAmount($pag_blog)) {
if (isset($getblog)) {
2016-04-22 19:46:46 +02:00
?>
<a href="<?php
echo "?blog=" . $getblog . "&page=" . ($pagenumber + 1);
2015-12-21 15:56:18 +01:00
?>" class="pag_next button"><?php echo $BLOGLANG["Next Page"]; ?></a>
2016-04-22 19:46:46 +02:00
<?php
} else {
2016-04-22 19:46:46 +02:00
?>
<a href="<?php
echo "?page=" . ($pagenumber + 1);
2015-12-21 15:56:18 +01:00
?>" class="pag_next button"><?php echo $BLOGLANG["Next Page"];?></a>
2016-04-22 19:46:46 +02:00
<?php
}
}
2016-04-22 19:46:46 +02:00
?>
</div>
<?php
}
?>