From 3d9c6f07ef422a9de0aad684f683529923d372db Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 22 Jun 2015 09:55:59 -0700 Subject: [PATCH] Forum: Fixes #1068 Go-to-page button links. --- e107_languages/English/English.php | 1 + e107_plugins/forum/forum_viewforum.php | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/e107_languages/English/English.php b/e107_languages/English/English.php index 06be8f499..51ab3eef3 100644 --- a/e107_languages/English/English.php +++ b/e107_languages/English/English.php @@ -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!"); diff --git a/e107_plugins/forum/forum_viewforum.php b/e107_plugins/forum/forum_viewforum.php index dacffef9b..66a1c76d3 100644 --- a/e107_plugins/forum/forum_viewforum.php +++ b/e107_plugins/forum/forum_viewforum.php @@ -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[] = "{$aa}"; //FIXME LAN_GOPAGE syntax? + $title = $tp->lanVars(LAN_GOTOPAGEX, $aa); + $url = e107::url('forum','topic',$urlparms).'&p='.$aa; + $opts[] = "{$aa}"; } $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[] = "{$aa}"; //FIXME LAN_GOPAGE syntax? + $title = $tp->lanVars(LAN_GOTOPAGEX, $aa); + $url = e107::url('forum','topic',$urlparms).'&p='.$aa; + $opts[] = "{$aa}"; } } 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[] = "{$aa}"; //FIXME LAN_GOPAGE syntax? + $title = $tp->lanVars(LAN_GOTOPAGEX, $aa); + $url = e107::url('forum','topic',$urlparms).'&p='.$aa; + $opts[] = "{$aa}"; } }