options['topics_per_page'];
$topic_offset = $this->current_page * $number_of_topics;
$topics = $this->content->get_topics($this->current_forum, $topic_offset, $number_of_topics);
$topics_sticky = $this->content->get_sticky_topics($this->current_forum);
// Set counter.
$counter_normal = count($topics);
$counter_total = count($topics_sticky) + $counter_normal;
// Load editor.
$this->editor->showEditor('addtopic', true);
// Show pagination and menu.
echo '
';
$paginationRendering = ($counter_normal > 0) ? $this->pagination->renderPagination($this->tables->topics, $this->current_forum) : '';
echo $paginationRendering;
echo $this->showForumMenu();
echo '
';
echo '
';
// Render subforums.
if ($this->options['subforums_location'] == 'above' || $this->options['subforums_location'] == 'both') {
$this->render_subforums($this->current_category, $this->current_forum);
}
if ($counter_total > 0) {
echo '';
// Show sticky topics.
if ($topics_sticky && !$this->current_page) {
foreach ($topics_sticky as $topic) {
$this->render_topic_element($topic, 'topic-sticky');
}
}
foreach ($topics as $topic) {
$this->render_topic_element($topic);
}
echo '
';
echo '';
echo $paginationRendering;
echo $this->showForumMenu();
echo '
';
echo '
';
} else {
echo '';
$this->render_notice(__('There are no topics yet!', 'asgaros-forum'));
echo '
';
}
// Render subforums.
if ($this->options['subforums_location'] == 'below' || $this->options['subforums_location'] == 'both') {
$this->render_subforums($this->current_category, $this->current_forum);
}