1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 11:20:25 +02:00

Forum: Fixes #1068 Go-to-page button links.

This commit is contained in:
Cameron
2015-06-22 09:55:59 -07:00
parent fab4d18485
commit 3d9c6f07ef
2 changed files with 14 additions and 7 deletions

View File

@@ -51,6 +51,7 @@ define("LAN_DELETE","Delete");
define("LAN_MORE", "More..");
define("LAN_READ_MORE", "Read more..");
define("LAN_GOPAGE", "Go to page");
define("LAN_GOTOPAGEX", "Go to page [x]");
define("LAN_GO", "Go");
define("LAN_NONE", "None");
define("LAN_WARNING", "Warning!");

View File

@@ -793,11 +793,13 @@ function fadminoptions($thread_info)
function fpages($thread_info, $replies)
{
global $forum;
global $forum;
$tp = e107::getParser();
$pages = ceil(($replies)/$forum->prefs->get('postspage'));
$thread_info['thread_sef'] = eHelper::title2sef($thread_info['thread_name'],'dashl');
$urlparms = $thread_info;
$text = '';
if ($pages > 1)
{
@@ -810,8 +812,9 @@ function fpages($thread_info, $replies)
// $urlparms['page'] = $aa;
// $url = e107::getUrl()->create('forum/thread/view', $urlparms);
$url = e107::url('forum','topic',$urlparms).'?p='.$aa;
$opts[] = "<a data-toggle='tooltip' title=\"Go to Page $aa\" href='{$url}'>{$aa}</a>"; //FIXME LAN_GOPAGE syntax?
$title = $tp->lanVars(LAN_GOTOPAGEX, $aa);
$url = e107::url('forum','topic',$urlparms).'&amp;p='.$aa;
$opts[] = "<a data-toggle='tooltip' title=\"".$title."\" href='{$url}'>{$aa}</a>";
}
$text .= ' ... ';
for($a = $pages-3; $a <= $pages-1; $a++)
@@ -820,20 +823,23 @@ function fpages($thread_info, $replies)
$text .= $text ? ' ' : '';
// $urlparms['page'] = $aa;
// $url = e107::getUrl()->create('forum/thread/view', $urlparms);
$url = e107::url('forum','topic',$urlparms).'?p='.$aa;
$opts[] = "<a data-toggle='tooltip' title=\"Go to Page $aa\" href='{$url}'>{$aa}</a>"; //FIXME LAN_GOPAGE syntax?
$title = $tp->lanVars(LAN_GOTOPAGEX, $aa);
$url = e107::url('forum','topic',$urlparms).'&amp;p='.$aa;
$opts[] = "<a data-toggle='tooltip' title=\"".$title."\" href='{$url}'>{$aa}</a>";
}
}
else
{
for($a = 0; $a <= ($pages-1); $a++)
{
$aa = $a + 1;
$text .= $text ? ' ' : '';
// $urlparms['page'] = $aa;
// $url = e107::getUrl()->create('forum/thread/view', $urlparms);
$url = e107::url('forum','topic',$urlparms).'?p='.$aa;
$opts[] = "<a data-toggle='tooltip' title=\"Go to Page $aa\" href='{$url}'>{$aa}</a>"; //FIXME LAN_GOPAGE syntax?
$title = $tp->lanVars(LAN_GOTOPAGEX, $aa);
$url = e107::url('forum','topic',$urlparms).'&amp;p='.$aa;
$opts[] = "<a data-toggle='tooltip' title=\"".$title."\" href='{$url}'>{$aa}</a>";
}
}