Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with pagination #64

Merged
merged 1 commit into from Sep 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/recenttopics.php
Expand Up @@ -247,7 +247,7 @@ public function display_recent_topics($tpl_loopname = 'recent_topics', $spec_for
return;
}

$topics_count = $this->gettopiclist(max(0, min($start,$total_topics_limit)-$topics_per_page) , $topics_per_page, $total_topics_limit, $sort_topics);
$topics_count = $this->gettopiclist(max(0, min($start,$total_topics_limit)) , $topics_per_page, $total_topics_limit, $sort_topics);

// If topics to display
if (sizeof($this->topic_list))
Expand Down Expand Up @@ -568,7 +568,7 @@ public function display_recent_topics($tpl_loopname = 'recent_topics', $spec_for
}

$pagination_url = append_sid($this->root_path . $this->user->page['page_name'], $append_params);
$this->pagination->generate_template_pagination($pagination_url, 'pagination', $tpl_loopname . '_start', $topics_count, $topics_per_page, max(0, min($start,$total_topics_limit)-$topics_per_page));
$this->pagination->generate_template_pagination($pagination_url, 'pagination', $tpl_loopname . '_start', $topics_count, $topics_per_page, max(0, min($start,$total_topics_limit)));

$this->template->assign_vars(
array(
Expand Down