fix dblayer error
This commit is contained in:
parent
8a3745b116
commit
b1f8cda044
10
_public.php
10
_public.php
@ -94,14 +94,20 @@ class pubSaba
|
|||||||
$params['limit'] = [(($_page_number - 1) * $params['limit']), $params['limit']];
|
$params['limit'] = [(($_page_number - 1) * $params['limit']), $params['limit']];
|
||||||
|
|
||||||
# get posts
|
# get posts
|
||||||
|
$posts = dcCore::app()->blog->getPosts($params);
|
||||||
|
if ($posts->isEmpty()) { // hack: don't breack context
|
||||||
|
$params = ['limit' => $params['limit']];
|
||||||
|
$posts = dcCore::app()->blog->getPosts($params);
|
||||||
|
}
|
||||||
dcCore::app()->ctx->post_params = $params;
|
dcCore::app()->ctx->post_params = $params;
|
||||||
dcCore::app()->ctx->posts = dcCore::app()->blog->getPosts($params);
|
dcCore::app()->ctx->posts = $posts;
|
||||||
|
|
||||||
unset($params);
|
unset($params);
|
||||||
}
|
}
|
||||||
dcCore::app()->ctx->saba_options = $options;
|
dcCore::app()->ctx->saba_options = $options;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getPostsParams($params)
|
public static function getPostsParams(&$params)
|
||||||
{
|
{
|
||||||
if (!isset($params['sql'])) {
|
if (!isset($params['sql'])) {
|
||||||
$params['sql'] = '';
|
$params['sql'] = '';
|
||||||
|
Loading…
Reference in New Issue
Block a user