mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/17004] Repair pagination func for global announce in ucp front
PHPBB3-17004
This commit is contained in:
parent
0f1c62bc7b
commit
3f6abe056a
1 changed files with 23 additions and 1 deletions
|
@ -36,7 +36,13 @@ class ucp_main
|
|||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $phpbb_dispatcher, $cache;
|
||||
global $request;
|
||||
global $request, $phpbb_container, $language;
|
||||
|
||||
/* @var $pagination \phpbb\pagination */
|
||||
$pagination = $phpbb_container->get('pagination');
|
||||
|
||||
/* @var $phpbb_content_visibility \phpbb\content_visibility */
|
||||
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
|
@ -105,6 +111,7 @@ class ucp_main
|
|||
$topic_list[] = $row['topic_id'];
|
||||
$rowset[$row['topic_id']] = $row;
|
||||
}
|
||||
$topics_count = (int) $db->sql_fetchfield('topics_count');
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
|
@ -152,6 +159,19 @@ class ucp_main
|
|||
$folder_img = ($unread_topic) ? $folder_new : $folder;
|
||||
$folder_alt = ($unread_topic) ? 'UNREAD_POSTS' : (($row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_UNREAD_POSTS');
|
||||
|
||||
// Replies
|
||||
$replies = $phpbb_content_visibility->get_count('topic_posts', $row, $forum_id) - 1;
|
||||
|
||||
if ($topics_count)
|
||||
{
|
||||
$start = $pagination->validate_start($start, $config['topics_per_page'], $topics_count);
|
||||
$pagination->generate_template_pagination($this->u_action, 'pagination', 'start', $topics_count, $config['topics_per_page'], $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'TOTAL_TOPICS' => $language->lang('VIEW_FORUM_TOPICS', (int) $topics_count),
|
||||
));
|
||||
}
|
||||
|
||||
if ($row['topic_status'] == ITEM_LOCKED)
|
||||
{
|
||||
$folder_img .= '_locked';
|
||||
|
@ -218,6 +238,8 @@ class ucp_main
|
|||
extract($phpbb_dispatcher->trigger_event('core.ucp_main_front_modify_template_vars', compact($vars)));
|
||||
|
||||
$template->assign_block_vars('topicrow', $topicrow);
|
||||
|
||||
$pagination->generate_template_pagination(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=$topic_id"), 'topicrow.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true);
|
||||
}
|
||||
|
||||
if ($config['load_user_activity'])
|
||||
|
|
Loading…
Add table
Reference in a new issue