From 84485c50daf204e850c232706bce36abe2846633 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 26 Jun 2015 10:26:47 -0700 Subject: [PATCH] Forum: Fixes #1079 - broken 'move' url. --- e107_plugins/forum/e_url.php | 4 ++++ e107_plugins/forum/forum_post.php | 11 +++++++++-- e107_plugins/forum/forum_viewforum.php | 12 ++++++++---- e107_plugins/forum/forum_viewtopic.php | 3 ++- .../forum/shortcodes/batch/view_shortcodes.php | 3 +-- index.php | 7 +++++++ 6 files changed, 31 insertions(+), 9 deletions(-) diff --git a/e107_plugins/forum/e_url.php b/e107_plugins/forum/e_url.php index 43280bbaf..1d135e9bd 100644 --- a/e107_plugins/forum/e_url.php +++ b/e107_plugins/forum/e_url.php @@ -43,6 +43,10 @@ class forum_url // plugin-folder + '_url' 'redirect' => '{e_PLUGIN}forum/forum_post.php', ); + $config['move'] = array( + 'sef' => 'forum/post/?f=move&id={thread_id}', + ); + $config['topic'] = array( 'regex' => '^forum/(.*)/(\d*)-([\w-]*)/?\??(.*)', 'sef' => 'forum/{forum_sef}/{thread_id}-{thread_sef}/', diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index 93febe574..5ffd109df 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -132,10 +132,8 @@ class forum_post_handler break; case 'edit': - case 'move': case "quote": case "report": - $postInfo = $this->forumObj->postGet($this->post, 'post'); $forumInfo = $this->forumObj->forumGet($postInfo['post_forum']); $data = array_merge($postInfo ,$forumInfo); @@ -144,6 +142,15 @@ class forum_post_handler return $data; break; + case 'move': + $thread = $this->forumObj->threadGet($this->id, true); + $extra = $this->forumObj->postGet($this->id,0,1); // get first post. + $data = array_merge($thread,$extra[0]); + $data['action'] = $this->action; + $this->setPageTitle($data); + return $data; + break; + default: $url = e107::url('forum','index',null,'full'); $this->redirect($url); diff --git a/e107_plugins/forum/forum_viewforum.php b/e107_plugins/forum/forum_viewforum.php index 12e822adc..269b14d1b 100644 --- a/e107_plugins/forum/forum_viewforum.php +++ b/e107_plugins/forum/forum_viewforum.php @@ -591,12 +591,15 @@ function parse_thread($thread_info) // FIXME _URL_ thread name // e107::getUrl()->create('forum/forum/view', "id={$thread_info['thread_forum_id']}") // USED self instead + + $moveUrl = e107::url('forum','move', $thread_info); + $tVars->ADMIN_ICONS = "
".($thread_info['thread_sticky'] == 1 ? " " : " ")." ".($thread_info['thread_active'] ? " " : " "). " - ".IMAGE_admin_move.' + ".IMAGE_admin_move.'
'; @@ -744,15 +747,16 @@ function fadminoptions($thread_info) $tp = e107::getParser(); // $text = "
"; - $text .= '