Index: db_tag_processor.php =================================================================== --- db_tag_processor.php (revision 12899) +++ db_tag_processor.php (working copy) @@ -618,12 +618,25 @@ function MoreLink($params) { $per_page = $this->SelectParam($params, 'per_page,max_items'); - if ($per_page !== false) $params['per_page'] = $per_page; + + if ($per_page !== false) { + $params['per_page'] = $per_page; + } + $list =& $this->GetList($params); - if ($list->PerPage < $list->RecordsCount) { - $block_params = $this->prepareTagParams($params); - $block_params['name'] = $this->SelectParam($params, 'render_as,block'); + if ($list->Counted) { + $has_next_page = $list->Page < $list->GetTotalPages(); + } + else { + $has_next_page = $list->PerPage < $list->RecordsCount; + } + + if ($has_next_page) { + $block_params = Array ( + 'name' => $this->SelectParam($params, 'render_as,block'), + ); + return $this->Application->ParseBlock($block_params); } }