1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 14:46:56 +02:00

Merge pull request #4742 from Jimmi08/correct-url-after-editing-post-in-paginated-topic

Fixes #4245 stay on correct page after editing paginated topic
This commit is contained in:
Cameron
2022-04-02 12:43:05 -07:00
committed by GitHub
2 changed files with 17 additions and 4 deletions

View File

@@ -1585,7 +1585,16 @@ class forum_post_handler
// $url = e107::getUrl()->create('forum/thread/post', "id={$this->data['post_id']}", 'encode=0&full=1'); // XXX what data is available, find thread name
$url = e107::url('forum','topic',$this->data); // ."&f=post";
$page= (varset($_GET['p']) ? (int)$_GET['p'] : 1);
if($page > 1)
{
$url = e107::url('forum','topic',$this->data)."?p=".$page;
}
else {
$url = e107::url('forum','topic',$this->data);
}
//$url = e107::url('forum','topic',$this->data); // ."&f=post";
$this->redirect($url);

View File

@@ -672,7 +672,8 @@ class plugin_forum_view_shortcodes extends e_shortcode
if(USER && !empty($this->postInfo['post_user']) && $this->postInfo['post_user'] == USERID && $this->var['thread_active'])
{
$qry = array('f' => 'edit', 'id' => $this->postInfo['post_thread'], 'post' => $this->postInfo['post_id']);
$page= (varset($_GET['p']) ? (int)$_GET['p'] : 1);
$qry = array('f' => 'edit', 'id' => $this->postInfo['post_thread'], 'post' => $this->postInfo['post_id'], 'p' => $page);
$editURL = e107::url('forum', 'post', null, array('query' => $qry));
return "<a class='e-tip' href='" . $editURL . "' title=\"" . LAN_EDIT . "\">" . IMAGE_edit . '</a> ';
@@ -912,6 +913,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
$tp = e107::getParser();
$threadID = !empty($this->postInfo['post_thread']) ? $this->postInfo['post_thread'] : 0;
$postID = !empty($this->postInfo['post_id']) ? $this->postInfo['post_id'] : 0;
$page= (varset($_GET['p']) ? (int)$_GET['p'] : 1);
// {EMAILITEM} {PRINTITEM} {REPORTIMG}{EDITIMG}{QUOTEIMG}
$text = '<div class="btn-group pull-right float-right float-end">
@@ -944,7 +946,8 @@ class plugin_forum_view_shortcodes extends e_shortcode
{
$url = e107::url('forum', 'post') . "?f=edit&amp;id=" . $threadID . "&amp;post=" . $postID;
//$url = e107::url('forum', 'post') . "?f=edit&amp;id=" . $threadID . "&amp;post=" . $postID;
$url = e107::url('forum', 'post') . "?f=edit&amp;id=" . $threadID . "&amp;post=" . $postID . "&amp;p=".$page;
//$url = e107::getUrl()->create('forum/thread/edit', array('id' => $threadID, 'post'=>$postID));
$text .= "<li class='text-right text-end float-right'><a class='dropdown-item' href='" . $url . "'>" . LAN_EDIT . " " . $tp->toGlyph('fa-edit') . "</a></li>";
@@ -981,7 +984,8 @@ class plugin_forum_view_shortcodes extends e_shortcode
if((USER && isset($this->postInfo['post_user']) && $this->postInfo['post_user'] != USERID && $this->var['thread_active']))
{
$url = e107::url('forum', 'post') . "?f=edit&amp;id=" . $threadID . "&amp;post=" . $postID;
//$url = e107::url('forum', 'post') . "?f=edit&amp;id=" . $threadID . "&amp;post=" . $postID;
$url = e107::url('forum', 'post') . "?f=edit&amp;id=" . $threadID . "&amp;post=" . $postID . "&amp;p=".$page;
// $url = e107::getUrl()->create('forum/thread/edit', array('id' => $threadID, 'post'=>$postID));
$text .= "<li class='text-right text-end float-right'><a class='dropdown-item' href='" . $url . "'>" . LAN_EDIT . " " . $tp->toGlyph('fa-edit') . "</a></li>";