From a841fe70a8234bf158165105339e32aa5ceb75a2 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 17 Jan 2007 18:41:49 +0000 Subject: ok, handled some bugs... the most important being validate_username (the variable passed to validate_data([...]array('username', [...])) and updating group listings while doing relevant group actions. Oh, and PM icons are working now. :o git-svn-id: file:///svn/phpbb/trunk@6894 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index e1e6496c36..601eaa544c 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -504,20 +504,23 @@ function topic_generate_pagination($replies, $url) { global $config, $user; - if (($replies + 1) > $config['posts_per_page']) + // 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) / $config['posts_per_page']); + $total_pages = ceil(($replies + 1) / $per_page); $pagination = ''; $times = 1; - for ($j = 0; $j < $replies + 1; $j += $config['posts_per_page']) + for ($j = 0; $j < $replies + 1; $j += $per_page) { $pagination .= '' . $times . ''; if ($times == 1 && $total_pages > 4) { $pagination .= ' ... '; $times = $total_pages - 3; - $j += ($total_pages - 4) * $config['posts_per_page']; + $j += ($total_pages - 4) * $per_page; } else if ($times < $total_pages) { -- cgit v1.2.1