aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_display.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-01-17 18:41:49 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-01-17 18:41:49 +0000
commita841fe70a8234bf158165105339e32aa5ceb75a2 (patch)
treea3e85eb75ec6bb59b331bd830667532d4511a868 /phpBB/includes/functions_display.php
parent708113b790368fffbf57eb5b96c8132eda00ba9c (diff)
downloadforums-a841fe70a8234bf158165105339e32aa5ceb75a2.tar
forums-a841fe70a8234bf158165105339e32aa5ceb75a2.tar.gz
forums-a841fe70a8234bf158165105339e32aa5ceb75a2.tar.bz2
forums-a841fe70a8234bf158165105339e32aa5ceb75a2.tar.xz
forums-a841fe70a8234bf158165105339e32aa5ceb75a2.zip
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
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r--phpBB/includes/functions_display.php11
1 files changed, 7 insertions, 4 deletions
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 .= '<a href="' . $url . '&amp;start=' . $j . '">' . $times . '</a>';
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)
{