mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
Merge branch 'develop' into feature/avatars
* develop: (201 commits) [feature/new-tz-handling] Don't use global user but make it a parameter [feature/new-tz-handling] Fix size of suggestion button in chrome [feature/new-tz-handling] Fall back to UTC, if the timezone is invalid [feature/new-tz-handling] Add previous selected value to validation if valid [feature/new-tz-handling] Display suggestion when a different value is selected [ticket/10998] Add border-radius to forum rules block - prosilver [feature/new-tz-handling] Remove additional marking of selected items [feature/new-tz-handling] Move update helper function to new class [feature/new-tz-handling] Fix unit test [feature/new-tz-handling] Delete old variable which is not used anymore [feature/new-tz-handling] Rename $user->tz back to $user->timezone [feature/pagination-as-list] New parameter for name of start var [feature/pagination-as-list] Updates for nils comments [feature/pagination-as-list] Rename and deprecate functions [feature/pagination-as-list] Various fixes and improvements [ticket/10968] Render pagination within the template [feature/new-tz-handling] Remove "timezone might be numeric" [feature/new-tz-handling] Add function to update the timezone [feature/new-tz-handling] Correctly update user and board timezones on update [ticket/10996] Use correct DBMS name in Travis config for PostgreSQL ...
This commit is contained in:
@@ -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 ? '' : '&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
|
||||
*/
|
||||
@@ -1221,7 +1179,9 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
if ($can_watch)
|
||||
{
|
||||
$s_watching['link'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start&hash=" . generate_link_hash("{$mode}_$match_id"));
|
||||
$s_watching['link_toggle'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&" . ((!$is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start&hash=" . generate_link_hash("{$mode}_$match_id"));
|
||||
$s_watching['title'] = $user->lang[(($is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)];
|
||||
$s_watching['title_toggle'] = $user->lang[((!$is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)];
|
||||
$s_watching['is_watching'] = $is_watching;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user