aboutsummaryrefslogtreecommitdiff
path: root/ratatoeskr/frontend.php
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2011-11-05 22:58:01 +0100
committerKevin Chabowski <kevin@kch42.de>2011-11-05 22:58:01 +0100
commit2d7eb3b97eb802f700965cc88a9b049687e8abf0 (patch)
treea746d79819c9a98f3c3161fd3be196663dbe5165 /ratatoeskr/frontend.php
parent005ba07fb9b46191383adc583e80b0bddbbe05c8 (diff)
downloadratatoeskr-cms-2d7eb3b97eb802f700965cc88a9b049687e8abf0.tar.gz
ratatoeskr-cms-2d7eb3b97eb802f700965cc88a9b049687e8abf0.tar.bz2
ratatoeskr-cms-2d7eb3b97eb802f700965cc88a9b049687e8abf0.zip
2 Small bugfixes.
1. Corrected a SQL-Query in models.php 2. <ste:articles_get> will now set maxpages properly, if there are no articles found.
Diffstat (limited to 'ratatoeskr/frontend.php')
-rw-r--r--ratatoeskr/frontend.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/ratatoeskr/frontend.php b/ratatoeskr/frontend.php
index c1daeb9..1739f8b 100644
--- a/ratatoeskr/frontend.php
+++ b/ratatoeskr/frontend.php
@@ -271,7 +271,10 @@ $ste->register_tag("articles_get", function($ste, $params, $sub)
if(isset($params["perpage"]))
{
if(isset($params["maxpage"]))
- $ste->set_var_by_name($params["maxpage"], ceil(count($result) / $params["perpage"]));
+ {
+ $maxpage = ceil(count($result) / $params["perpage"]);
+ $ste->set_var_by_name($params["maxpage"], $maxpage == 0 ? 1 : $maxpage);
+ }
$page = isset($params["page"]) ? $params["page"] : 1;
$result = array_slice($result, ($page - 1) * $params["perpage"], $params["perpage"]);
}