mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-07-10 07:47:34 +00:00
Fixed pager with simple_urls disabled
This commit is contained in:
parent
e7598dee7e
commit
3a959a8d15
19
inc/page.php
19
inc/page.php
@ -82,7 +82,7 @@ class Page {
|
|||||||
$page = $_GET['page']; // user input
|
$page = $_GET['page']; // user input
|
||||||
} else {
|
} else {
|
||||||
if ($argc > 1) {
|
if ($argc > 1) {
|
||||||
$page = $this->args[$argc-2];
|
$page = $this->args[$argc - 2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (filter_var($page, FILTER_VALIDATE_INT)) {
|
if (filter_var($page, FILTER_VALIDATE_INT)) {
|
||||||
@ -552,7 +552,7 @@ class Page {
|
|||||||
';
|
';
|
||||||
}
|
}
|
||||||
|
|
||||||
function print_pager($total = -1, $args = "", $prevargs = "", $page = null, $simple=true) {
|
function print_pager($total = -1, $args = "", $prevargs = "", $page = null, $simple = true) {
|
||||||
if (!$this->settings->show_pager) return;
|
if (!$this->settings->show_pager) return;
|
||||||
$table = $this->table;
|
$table = $this->table;
|
||||||
if ($page === null) {
|
if ($page === null) {
|
||||||
@ -585,11 +585,11 @@ class Page {
|
|||||||
$pager_next = "<div class=\"litebans-pager litebans-pager-right $next_class\">»</div>";
|
$pager_next = "<div class=\"litebans-pager litebans-pager-right $next_class\">»</div>";
|
||||||
|
|
||||||
if ($simple) {
|
if ($simple) {
|
||||||
$pager_prev_href = $this->link("$page{$prevargs}&page={$prev}");
|
$pager_prev_href = $this->append_param($this->link("$page{$prevargs}"), "page={$prev}");
|
||||||
$pager_next_href = $this->link("$page{$args}&page={$next}");
|
$pager_next_href = $this->append_param($this->link("$page{$args}"), "page={$next}");
|
||||||
} else {
|
} else {
|
||||||
$pager_prev_href = $this->link("$page") . "{$prevargs}&page={$prev}";
|
$pager_prev_href = $this->append_param(($this->link("$page") . "{$prevargs}"), "page={$prev}");
|
||||||
$pager_next_href = $this->link("$page") . "{$args}&page={$next}";
|
$pager_next_href = $this->append_param(($this->link("$page") . "{$args}"), "page={$next}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($prev_active) {
|
if ($prev_active) {
|
||||||
@ -612,6 +612,13 @@ class Page {
|
|||||||
include_once './inc/footer.php';
|
include_once './inc/footer.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function append_param($url, $param) {
|
||||||
|
if (preg_match("/\?[a-z]+=/", $url)) {
|
||||||
|
return "${url}&${param}";
|
||||||
|
}
|
||||||
|
return "${url}?${param}";
|
||||||
|
}
|
||||||
|
|
||||||
function link($url) {
|
function link($url) {
|
||||||
if ($this->settings->simple_urls && $this->is_index) {
|
if ($this->settings->simple_urls && $this->is_index) {
|
||||||
$url = preg_replace("/\.php/", "", $url, 1);
|
$url = preg_replace("/\.php/", "", $url, 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user