1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

forum pages now counting from 1 (insted from 0)

This commit is contained in:
secretr
2011-04-25 16:52:20 +00:00
parent cbf3082c49
commit a441e3675b
2 changed files with 10 additions and 10 deletions

View File

@@ -129,7 +129,7 @@ if ($pages)
{
if(strpos($FORUM_VIEW_START, 'THREADPAGES') !== false || strpos($FORUM_VIEW_END, 'THREADPAGES') !== false)
{
if(!$page) $page = 1;
//if(!$page) $page = 1;
$url = rawurlencode(e107::getUrl()->getUrl('forum', 'forum', array('func' => 'view', 'id' => $forumId, 'page' => '[FROM]')));
$parms = "total={$pages}&type=page&current={$page}&url=".$url."&caption=off";
$fVars->THREADPAGES = $e107->tp->parseTemplate("{NEXTPREV={$parms}}");
@@ -404,7 +404,7 @@ function parse_thread($thread_info)
}
$tVars->THREADNAME = "<a {$title} href='".$e107->url->getUrl('forum', 'thread', "func=view&id={$threadId}")."'>{$thread_name}</a>";
$pages = ceil(($tVars->REPLIES+1)/$forum->prefs->get('postspage'));
$pages = ceil(($tVars->REPLIES)/$forum->prefs->get('postspage'));
if ($pages > 1)
{
if($pages > 6)

View File

@@ -497,7 +497,7 @@ class e107ForumThread
header('Location:' . $e107->url->getUrl('forum', 'forum', array('func' => 'main')));
exit;
}
$this->pages = ceil(($this->threadInfo['thread_total_replies'] + 1) / $this->perPage);
$this->pages = ceil(($this->threadInfo['thread_total_replies']) / $this->perPage);
$this->noInc = false;
}
@@ -541,33 +541,33 @@ class e107ForumThread
$postId = varset($_GET['id']);
$postInfo = $forum->postGet($postId,'post');
$postNum = $forum->postGetPostNum($postInfo['post_thread'], $postId);
$postPage = ceil($postNum / $forum->prefs->get('postspage'))-1;
$url = $e107->url->getUrl('forum', 'thread', "func=view&id={$postInfo['post_thread']}&page=$postPage");
$postPage = ceil($postNum / $forum->prefs->get('postspage'));
$url = $e107->url->getUrl('forum', 'thread', "func=view&id={$postInfo['post_thread']}&page=$postPage&raw");
header('location: '.$url);
exit;
break;
case 'last':
$pages = ceil(($thread->threadInfo['thread_total_replies'] + 1) / $thread->perPage);
$thread->page = ($pages);
$thread->page = ($pages - 1);
break;
case 'next':
case 'next': // FIXME - nextprev thread detection not working
$next = $forum->threadGetNextPrev('next', $this->threadId, $this->threadInfo['forum_id'], $this->threadInfo['thread_lastpost']);
if ($next)
{
$url = $e107->url->getUrl('forum', 'thread', array('func' => 'view', 'id' => $next));
$url = $e107->url->getUrl('forum', 'thread', array('func' => 'view', 'id' => $next, 'raw' => true));
header("location: {$url}");
exit;
}
$this->message = LAN_405;
break;
case 'prev':
case 'prev': // FIXME - nextprev thread detection not working
$prev = $forum->threadGetNextPrev('prev', $this->threadId, $this->threadInfo['forum_id'], $this->threadInfo['thread_lastpost']);
if ($prev)
{
$url = $e107->url->getUrl('forum', 'thread', array('func' => 'view', 'id' => $prev));
$url = $e107->url->getUrl('forum', 'thread', array('func' => 'view', 'id' => $prev, 'raw' => true));
header("location: {$url}");
exit;
}