Commit 6a146598 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Respect max posts setting in forum posts blocktype (bug #634669)


Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 750a630c
......@@ -76,6 +76,7 @@ class PluginBlocktypeRecentForumPosts extends SystemBlocktype {
if ($role || $group->public) {
$limit = 5;
$configdata = $instance->get('configdata');
if (!empty($configdata['limit'])) {
$limit = intval($configdata['limit']);
}
......@@ -94,8 +95,9 @@ class PluginBlocktypeRecentForumPosts extends SystemBlocktype {
AND t.deleted = 0
AND p.deleted = 0
ORDER BY
p.ctime DESC
LIMIT ?', array($group->id, $limit));
p.ctime DESC',
array($group->id), 0, $limit
);
$smarty = smarty_core();
$smarty->assign('group', $group);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment