1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/10968] Render pagination within the template

Since phpBB 2 pagination has been rendered mostly within the source. This
limits just what designers can do with pagination. The current form is also
questionable in terms of "best practice". The aim is to move rendering
completely to the template via the use of a block element. Enabling S_
template vars also allows for control over specific aspects of the
pagination output such as next, previous, active and ellipsis.

Related to this - merging the capabilities of the topic_generate_pagination
with generate_pagination removes an element of duplication.

PHPBB3-10968
This commit is contained in:
Drae
2012-07-04 23:19:59 +01:00
parent b176b86f11
commit 922147f05a
63 changed files with 1039 additions and 268 deletions

View File

@@ -1222,10 +1222,11 @@ class acp_attachments
}
$db->sql_freeresult($result);
generate_pagination($this->u_action . "&$u_sort_param", $num_files, $attachments_per_page, $start);
$template->assign_vars(array(
'TOTAL_FILES' => $num_files,
'TOTAL_SIZE' => get_formatted_filesize($total_size),
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param", $num_files, $attachments_per_page, $start, true),
'S_ON_PAGE' => on_page($num_files, $attachments_per_page, $start),
'S_LIMIT_DAYS' => $s_limit_days,

View File

@@ -682,13 +682,14 @@ class acp_groups
$s_action_options .= '<option value="' . $option . '">' . $user->lang['GROUP_' . $lang] . '</option>';
}
generate_pagination($this->u_action . "&amp;action=$action&amp;g=$group_id", $total_members, $config['topics_per_page'], $start);
$template->assign_vars(array(
'S_LIST' => true,
'S_GROUP_SPECIAL' => ($group_row['group_type'] == GROUP_SPECIAL) ? true : false,
'S_ACTION_OPTIONS' => $s_action_options,
'S_ON_PAGE' => on_page($total_members, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;action=$action&amp;g=$group_id", $total_members, $config['topics_per_page'], $start, true),
'GROUP_NAME' => ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'],
'U_ACTION' => $this->u_action . "&amp;g=$group_id",

View File

@@ -927,10 +927,8 @@ class acp_icons
}
}
$db->sql_freeresult($result);
$template->assign_var('PAGINATION',
generate_pagination($this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true)
);
generate_pagination($this->u_action, $item_count, $config['smilies_per_page'], $pagination_start);
}
/**

View File

@@ -288,6 +288,8 @@ class acp_inactive
$option_ary += array('remind' => 'REMIND');
}
generate_pagination($this->u_action . "&amp;$u_sort_param&amp;users_per_page=$per_page", $inactive_count, $per_page, $start);
$template->assign_vars(array(
'S_INACTIVE_USERS' => true,
'S_INACTIVE_OPTIONS' => build_select($option_ary),
@@ -296,7 +298,7 @@ class acp_inactive
'S_SORT_KEY' => $s_sort_key,
'S_SORT_DIR' => $s_sort_dir,
'S_ON_PAGE' => on_page($inactive_count, $per_page, $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param&amp;users_per_page=$per_page", $inactive_count, $per_page, $start, true),
'USERS_PER_PAGE' => $per_page,
'U_ACTION' => $this->u_action . "&amp;$u_sort_param&amp;users_per_page=$per_page&amp;start=$start",

View File

@@ -129,13 +129,14 @@ class acp_logs
$log_count = 0;
$start = view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort, $keywords);
generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start);
$template->assign_vars(array(
'L_TITLE' => $l_title,
'L_EXPLAIN' => $l_title_explain,
'U_ACTION' => $this->u_action . "&amp;$u_sort_param$keywords_param&amp;start=$start",
'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start, true),
'S_LIMIT_DAYS' => $s_limit_days,
'S_SORT_KEY' => $s_sort_key,

View File

@@ -1120,10 +1120,11 @@ class acp_users
$log_count = 0;
$start = view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
generate_pagination($this->u_action . "&amp;u=$user_id&amp;$u_sort_param", $log_count, $config['topics_per_page'], $start);
$template->assign_vars(array(
'S_FEEDBACK' => true,
'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;u=$user_id&amp;$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
'S_LIMIT_DAYS' => $s_limit_days,
'S_SORT_KEY' => $s_sort_key,
@@ -2035,14 +2036,14 @@ class acp_users
}
$db->sql_freeresult($result);
generate_pagination($this->u_action . "&amp;u=$user_id&amp;sk=$sort_key&amp;sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start);
$template->assign_vars(array(
'S_ATTACHMENTS' => true,
'S_ON_PAGE' => on_page($num_attachments, $config['topics_per_page'], $start),
'S_SORT_KEY' => $s_sort_key,
'S_SORT_DIR' => $s_sort_dir,
'PAGINATION' => generate_pagination($this->u_action . "&amp;u=$user_id&amp;sk=$sort_key&amp;sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start, true))
);
));
break;

View File

@@ -1884,85 +1884,99 @@ function tracking_unserialize($string, $max_depth = 3)
* Pagination routine, generates page number sequence
* tpl_prefix is for using different pagination blocks at one page
*/
function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = false, $tpl_prefix = '')
function generate_pagination($base_url, $num_items, $per_page, $start_item = 1, $tpl_prefix = '', $reverse_count = false, $ignore_on_page = false, $block_var_name = '')
{
global $template, $user;
// Make sure $per_page is a valid value
$per_page = ($per_page <= 0) ? 1 : $per_page;
$separator = '<span class="page-sep">' . $user->lang['COMMA_SEPARATOR'] . '</span>';
$total_pages = ceil($num_items / $per_page);
if ($total_pages == 1 || !$num_items)
{
return false;
return;
}
$on_page = floor($start_item / $per_page) + 1;
$url_delim = (strpos($base_url, '?') === false) ? '?' : ((strpos($base_url, '?') === strlen($base_url) - 1) ? '' : '&amp;');
$page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href="' . $base_url . '">1</a>';
if ($total_pages > 5)
$block_var_name = ($block_var_name) ? $block_var_name . '.pagination' : 'pagination';
if ($reverse_count)
{
$start_cnt = min(max(1, $on_page - 4), $total_pages - 5);
$end_cnt = max(min($total_pages, $on_page + 4), 6);
$page_string .= ($start_cnt > 1) ? '<span class="page-dots"> ... </span>' : $separator;
for ($i = $start_cnt + 1; $i < $end_cnt; $i++)
{
$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "{$url_delim}start=" . (($i - 1) * $per_page) . '">' . $i . '</a>';
if ($i < $end_cnt - 1)
{
$page_string .= $separator;
}
}
$page_string .= ($end_cnt < $total_pages) ? '<span class="page-dots"> ... </span>' : $separator;
$start_cnt = ($total_pages > 5) ? $total_pages - 3 : 1;
$end_cnt = $total_pages;
}
else
{
$page_string .= $separator;
for ($i = 2; $i < $total_pages; $i++)
{
$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "{$url_delim}start=" . (($i - 1) * $per_page) . '">' . $i . '</a>';
if ($i < $total_pages)
{
$page_string .= $separator;
}
}
$start_cnt = ($total_pages > 5) ? min(max(1, $on_page - 4), $total_pages - 5) : 1;
$end_cnt = ($total_pages > 5) ? max(min($total_pages, $on_page + 4), 6) : $total_pages;
}
$page_string .= ($on_page == $total_pages) ? '<strong>' . $total_pages . '</strong>' : '<a href="' . $base_url . "{$url_delim}start=" . (($total_pages - 1) * $per_page) . '">' . $total_pages . '</a>';
if ($add_prevnext_text)
if ($on_page != $total_pages)
{
if ($on_page != 1)
$template->assign_block_vars($block_var_name, array(
'PAGE_NUMBER' => '',
'PAGE_URL' => $base_url . "{$url_delim}start=" . ($on_page * $per_page),
'S_IS_CURRENT' => false,
'S_IS_PREV' => false,
'S_IS_NEXT' => true,
'S_IS_ELLIPSIS' => false,
));
}
$i = 1;
do
{
$page_url = $base_url . (($i == 1) ? '' : $url_delim . 'start=' . (($i - 1) * $per_page));
$template->assign_block_vars($block_var_name, array(
'PAGE_NUMBER' => $i,
'PAGE_URL' => $page_url,
'S_IS_CURRENT' => (!$ignore_on_page && $i == $on_page) ? true : false,
'S_IS_NEXT' => false,
'S_IS_PREV' => false,
'S_IS_ELLIPSIS' => ($i == 2 && $start_cnt > 1) || ($i == $total_pages - 1 && $end_cnt < $total_pages) ? true : false,
));
if ($i > 1 && $i < $start_cnt - 1)
{
$page_string = '<a href="' . $base_url . "{$url_delim}start=" . (($on_page - 2) * $per_page) . '">' . $user->lang['PREVIOUS'] . '</a>&nbsp;&nbsp;' . $page_string;
$i = $start_cnt;
}
if ($on_page != $total_pages)
elseif ($i == $end_cnt && $end_cnt < $total_pages - 1)
{
$page_string .= '&nbsp;&nbsp;<a href="' . $base_url . "{$url_delim}start=" . ($on_page * $per_page) . '">' . $user->lang['NEXT'] . '</a>';
$i = $total_pages - 1;
}
else
{
$i++;
}
}
while ($i <= $total_pages);
if ($on_page != 1)
{
$template->assign_block_vars($block_var_name, array(
'PAGE_NUMBER' => '',
'PAGE_URL' => $base_url . "{$url_delim}start=" . (($on_page - 2) * $per_page),
'S_IS_CURRENT' => false,
'S_IS_PREV' => true,
'S_IS_NEXT' => false,
'S_IS_ELLIPSIS' => false,
));
}
$template->assign_vars(array(
$tpl_prefix . 'BASE_URL' => $base_url,
'A_' . $tpl_prefix . 'BASE_URL' => addslashes($base_url),
$tpl_prefix . 'PER_PAGE' => $per_page,
$tpl_prefix . 'PREVIOUS_PAGE' => ($on_page == 1) ? '' : $base_url . "{$url_delim}start=" . (($on_page - 2) * $per_page),
$tpl_prefix . 'NEXT_PAGE' => ($on_page == $total_pages) ? '' : $base_url . "{$url_delim}start=" . ($on_page * $per_page),
$tpl_prefix . 'TOTAL_PAGES' => $total_pages,
$tpl_prefix . 'CURRENT_PAGE' => $on_page,
));
return $page_string;
return;
}
/**

View File

@@ -639,48 +639,6 @@ function get_forum_parents(&$forum_data)
return $forum_parents;
}
/**
* Generate topic pagination
*/
function topic_generate_pagination($replies, $url)
{
global $config, $user;
// Make sure $per_page is a valid value
$per_page = ($config['posts_per_page'] <= 0) ? 1 : $config['posts_per_page'];
if (($replies + 1) > $per_page)
{
$total_pages = ceil(($replies + 1) / $per_page);
$pagination = '';
$times = 1;
for ($j = 0; $j < $replies + 1; $j += $per_page)
{
$pagination .= '<a href="' . $url . ($j == 0 ? '' : '&amp;start=' . $j) . '">' . $times . '</a>';
if ($times == 1 && $total_pages > 5)
{
$pagination .= '<span class="page-dots"> ... </span>';
// Display the last three pages
$times = $total_pages - 3;
$j += ($total_pages - 4) * $per_page;
}
else if ($times < $total_pages)
{
$pagination .= '<span class="page-sep">' . $user->lang['COMMA_SEPARATOR'] . '</span>';
}
$times++;
}
}
else
{
$pagination = '';
}
return $pagination;
}
/**
* Obtain list of moderators of each forum
*/

View File

@@ -61,10 +61,7 @@ function generate_smilies($mode, $forum_id)
'body' => 'posting_smilies.html')
);
$template->assign_var('PAGINATION',
generate_pagination(append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;f=' . $forum_id),
$smiley_count, $config['smilies_per_page'], $start, true)
);
generate_pagination(append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;f=' . $forum_id), $smiley_count, $config['smilies_per_page'], $start);
}
$display_link = false;

View File

@@ -101,6 +101,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total;
$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
generate_pagination($url . "&amp;i=$id&amp;action=$action&amp;mode=$mode&amp;sd=$sort_dir&amp;sk=$sort_key&amp;st=$sort_days" . (($merge_select) ? $selected_ids : ''), $forum_topics, $topics_per_page, $start);
$template->assign_vars(array(
'ACTION' => $action,
'FORUM_NAME' => $forum_info['forum_name'],
@@ -129,7 +131,6 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'S_MCP_ACTION' => $url . "&amp;i=$id&amp;forum_action=$action&amp;mode=$mode&amp;start=$start" . (($merge_select) ? $selected_ids : ''),
'PAGINATION' => generate_pagination($url . "&amp;i=$id&amp;action=$action&amp;mode=$mode&amp;sd=$sort_dir&amp;sk=$sort_key&amp;st=$sort_days" . (($merge_select) ? $selected_ids : ''), $forum_topics, $topics_per_page, $start),
'PAGE_NUMBER' => on_page($forum_topics, $topics_per_page, $start),
'TOTAL_TOPICS' => $user->lang('VIEW_FORUM_TOPICS', (int) $forum_topics),
));

View File

@@ -171,10 +171,11 @@ class mcp_logs
$log_count = 0;
$start = view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort, $keywords);
generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start);
$template->assign_vars(array(
'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start),
'TOTAL' => $user->lang('TOTAL_LOGS', (int) $log_count),
'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start),
'L_TITLE' => $user->lang['MCP_LOGS'],

View File

@@ -215,6 +215,8 @@ class mcp_notes
}
}
generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start);
$template->assign_vars(array(
'U_POST_ACTION' => $this->u_action,
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
@@ -226,7 +228,6 @@ class mcp_notes
'L_TITLE' => $user->lang['MCP_NOTES_USER'],
'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start),
'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $log_count),
'RANK_TITLE' => $rank_title,

View File

@@ -298,6 +298,8 @@ class mcp_pm_reports
}
}
generate_pagination($this->u_action . "&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $config['topics_per_page'], $start);
// Now display the page
$template->assign_vars(array(
'L_EXPLAIN' => ($mode == 'pm_reports') ? $user->lang['MCP_PM_REPORTS_OPEN_EXPLAIN'] : $user->lang['MCP_PM_REPORTS_CLOSED_EXPLAIN'],
@@ -307,7 +309,6 @@ class mcp_pm_reports
'S_MCP_ACTION' => $this->u_action,
'S_CLOSED' => ($mode == 'pm_reports_closed') ? true : false,
'PAGINATION' => generate_pagination($this->u_action . "&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'TOTAL' => $total,
'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $total),

View File

@@ -419,6 +419,8 @@ class mcp_queue
}
unset($rowset, $forum_names);
generate_pagination($this->u_action . "&amp;f=$forum_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $config['topics_per_page'], $start);
// Now display the page
$template->assign_vars(array(
'L_DISPLAY_ITEMS' => ($mode == 'unapproved_posts') ? $user->lang['DISPLAY_POSTS'] : $user->lang['DISPLAY_TOPICS'],
@@ -430,7 +432,6 @@ class mcp_queue
'S_MCP_ACTION' => build_url(array('t', 'f', 'sd', 'st', 'sk')),
'S_TOPICS' => ($mode == 'unapproved_posts') ? false : true,
'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => $user->lang((($mode == 'unapproved_posts') ? 'VIEW_TOPIC_POSTS' : 'VIEW_FORUM_TOPICS'), (int) $total),

View File

@@ -411,6 +411,8 @@ class mcp_reports
unset($report_ids, $row);
}
generate_pagination($this->u_action . "&amp;f=$forum_id&amp;t=$topic_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $config['topics_per_page'], $start);
// Now display the page
$template->assign_vars(array(
'L_EXPLAIN' => ($mode == 'reports') ? $user->lang['MCP_REPORTS_OPEN_EXPLAIN'] : $user->lang['MCP_REPORTS_CLOSED_EXPLAIN'],
@@ -421,7 +423,6 @@ class mcp_reports
'S_FORUM_OPTIONS' => $forum_options,
'S_CLOSED' => ($mode == 'reports_closed') ? true : false,
'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id&amp;t=$topic_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => $total,

View File

@@ -306,6 +306,11 @@ function mcp_topic_view($id, $mode, $action)
'post_ids' => $post_id_list,
));
if ($posts_per_page)
{
generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;t={$topic_info['topic_id']}&amp;mode=$mode&amp;action=$action&amp;to_topic_id=$to_topic_id&amp;posts_per_page=$posts_per_page&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir"), $total, $posts_per_page, $start);
}
$template->assign_vars(array(
'TOPIC_TITLE' => $topic_info['topic_title'],
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_info['forum_id'] . '&amp;t=' . $topic_info['topic_id']),
@@ -345,7 +350,6 @@ function mcp_topic_view($id, $mode, $action)
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$topic_info['forum_id']}&amp;start=$start") . '">', '</a>'),
'PAGE_NUMBER' => on_page($total, $posts_per_page, $start),
'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;t={$topic_info['topic_id']}&amp;mode=$mode&amp;action=$action&amp;to_topic_id=$to_topic_id&amp;posts_per_page=$posts_per_page&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir"), $total, $posts_per_page, $start),
'TOTAL_POSTS' => $user->lang('VIEW_TOPIC_POSTS', (int) $total),
));
}

View File

@@ -175,6 +175,8 @@ class mcp_warn
));
}
generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=warn&amp;mode=list&amp;st=$st&amp;sk=$sk&amp;sd=$sd"), $user_count, $config['topics_per_page'], $start);
$template->assign_vars(array(
'U_POST_ACTION' => $this->u_action,
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
@@ -183,7 +185,6 @@ class mcp_warn
'S_SELECT_SORT_DAYS' => $s_limit_days,
'PAGE_NUMBER' => on_page($user_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=warn&amp;mode=list&amp;st=$st&amp;sk=$sk&amp;sd=$sd"), $user_count, $config['topics_per_page'], $start),
'TOTAL_USERS' => $user->lang('LIST_USERS', (int) $user_count),
));
}

View File

@@ -170,9 +170,10 @@ class ucp_attachments
}
$db->sql_freeresult($result);
generate_pagination($this->u_action . "&amp;sk=$sort_key&amp;sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start);
$template->assign_vars(array(
'PAGE_NUMBER' => on_page($num_attachments, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;sk=$sort_key&amp;sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start),
'TOTAL_ATTACHMENTS' => $num_attachments,
'L_TITLE' => $user->lang['UCP_ATTACHMENTS'],

View File

@@ -844,11 +844,12 @@ class ucp_groups
$s_action_options .= '<option value="' . $option . '">' . $user->lang['GROUP_' . $lang] . '</option>';
}
generate_pagination($this->u_action . "&amp;action=$action&amp;g=$group_id", $total_members, $config['topics_per_page'], $start);
$template->assign_vars(array(
'S_LIST' => true,
'S_ACTION_OPTIONS' => $s_action_options,
'S_ON_PAGE' => on_page($total_members, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;action=$action&amp;g=$group_id", $total_members, $config['topics_per_page'], $start),
'U_ACTION' => $this->u_action . "&amp;g=$group_id",
'S_UCP_ACTION' => $this->u_action . "&amp;g=$group_id",

View File

@@ -670,8 +670,9 @@ class ucp_main
if ($topics_count)
{
generate_pagination($this->u_action, $topics_count, $config['topics_per_page'], $start);
$template->assign_vars(array(
'PAGINATION' => generate_pagination($this->u_action, $topics_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start),
'TOTAL_TOPICS' => $user->lang('VIEW_FORUM_TOPICS', (int) $topics_count),
));
@@ -813,7 +814,6 @@ class ucp_main
'S_DELETED_TOPIC' => (!$row['topic_id']) ? true : false,
'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . "&amp;t=$topic_id")),
'REPLIES' => $replies,
'VIEWS' => $row['topic_views'],
'TOPIC_TITLE' => censor_text($row['topic_title']),
@@ -837,6 +837,8 @@ class ucp_main
'U_VIEW_TOPIC' => $view_topic_url,
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
));
generate_pagination(append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . "&amp;t=$topic_id"), $replies + 1, $config['posts_per_page'], 1, '', true, true, 'topicrow');
}
}
}

View File

@@ -451,8 +451,9 @@ function get_pm_from($folder_id, $folder, $user_id)
$sql_limit_time = '';
}
generate_pagination(append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=view&amp;action=view_folder&amp;f=$folder_id&amp;$u_sort_param"), $pm_count, $config['topics_per_page'], $start);
$template->assign_vars(array(
'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=view&amp;action=view_folder&amp;f=$folder_id&amp;$u_sort_param"), $pm_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($pm_count, $config['topics_per_page'], $start),
'TOTAL_MESSAGES' => $user->lang('VIEW_PM_MESSAGES', (int) $pm_count),