1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-18 05:09:05 +01:00

Issue #1026 - Added redirection debug info. Redirection after 'Update reply' corrected.

This commit is contained in:
Cameron 2015-05-26 12:25:12 -07:00
parent 240d509fd0
commit 8d5e106fd6
2 changed files with 29 additions and 16 deletions

View File

@ -1842,11 +1842,11 @@ class e107forum
$FORUM_CRUMB['sitename']['value'] = str_replace($search, $replace, $FORUM_CRUMB['sitename']['value']);
$search = array('{FORUMS_TITLE}', '{FORUMS_HREF}');
$replace = array(LAN_PLUGIN_FORUM_NAME, e107::getUrl()->create('forum/forum/main'));
$replace = array(LAN_PLUGIN_FORUM_NAME, e107::url('forum','index'));
$FORUM_CRUMB['forums']['value'] = str_replace($search, $replace, $FORUM_CRUMB['forums']['value']);
$search = array('{PARENT_TITLE}', '{PARENT_HREF}');
$replace = array($tp->toHTML($forumInfo['parent_name']), e107::getUrl()->create('forum/forum/main')."#".$frm->name2id($forumInfo['parent_name']));
$replace = array($tp->toHTML($forumInfo['parent_name']), e107::url('forum','index')."#".$frm->name2id($forumInfo['parent_name']));
$FORUM_CRUMB['parent']['value'] = str_replace($search, $replace, $FORUM_CRUMB['parent']['value']);
if($forumInfo['forum_sub'])

View File

@ -93,7 +93,7 @@ class forum_post_handler
{
if(isset($_POST['fjsubmit']))
{
header('Location:'.e107::getUrl()->create('forum/forum/view', array('id'=>(int) $_POST['forumjump']), '', 'full=1&encode=0'));
$this->redirect(e107::getUrl()->create('forum/forum/view', array('id'=>(int) $_POST['forumjump']), '', 'full=1&encode=0'));
exit;
}
@ -208,6 +208,16 @@ class forum_post_handler
*/
private function redirect($url)
{
if(E107_DEBUG_LEVEL > 0)
{
require_once(HEADERF);
e107::getRender()->tablerender('Debug', "Redirecting to: <a href='".$url."'>".$url."</a>");
require_once(FOOTERF);
exit;
}
e107::getRedirect()->go($url);
}
@ -865,6 +875,7 @@ class forum_post_handler
if ($this->forumObj->prefs->get('redirect'))
{
$this->redirect($threadLink);
// header('location:'.e107::getUrl()->create('forum/thread/last', $postInfo, array('encode' => false, 'full' => true)));
exit;
@ -1030,11 +1041,12 @@ class forum_post_handler
e107::getCache()->clear('newforumposts');
$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::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,true)."&f=post"; //FIXME
$url = e107::url('forum','topic',$this->data,true); // ."&f=post";
$this->redirect($url);
header('location:'.$url);
exit;
}
@ -1190,7 +1202,7 @@ exit;
/*
require_once(e_PLUGIN.'forum/forum_class.php');
$forum = new e107forum();
@ -1304,7 +1316,7 @@ if (isset($_POST['submitpoll']))
echo $FORUMPOLLPOSTED;
require_once(FOOTERF);
exit;
}
}*/
/*if (isset($_POST['fpreview']))
{
@ -1371,7 +1383,7 @@ if (isset($_POST['submitpoll']))
$eaction = false;
}
}*/
/*
if (isset($_POST['newthread']) || isset($_POST['reply']))
{
$postInfo = array();
@ -1432,7 +1444,7 @@ if (isset($_POST['newthread']) || isset($_POST['reply']))
}
// $postInfo['_FIELD_TYPES']['post_attachments'] = 'array';
$postInfo['post_attachments'] = e107::serialize($newValues); //FIXME XXX - broken encoding when saved to DB.
$postInfo['post_attachments'] = e107::serialize($newValues);
}
// var_dump($uploadResult);
@ -1555,7 +1567,7 @@ if (isset($_POST['update_thread']))
// exit;
if (!$_POST['subject'] || !$_POST['post'])
{
$error = "<div style='text-align:center'>".LAN_FORUM_3007."</div>"; // TODO $mes
$error = "<div style='text-align:center'>".LAN_FORUM_3007."</div>";
}
else
{
@ -1600,7 +1612,7 @@ if (isset($_POST['update_reply']))
{
if (!$_POST['post'])
{
$error = "<div style='text-align:center'>".LAN_FORUM_3007.'</div>'; // TODO $mes
$error = "<div style='text-align:center'>".LAN_FORUM_3007.'</div>';
}
else
{
@ -1659,9 +1671,10 @@ if ($action == 'edit' || $action == 'quote')
{
//remote [hide] bbcode, or else it doesn't hide stuff too well :)
/* $post = preg_replace('#\[hide].*?\[/hide]#s', '', $post);
$quoteName = ($postInfo['user_name'] ? $postInfo['user_name'] : $postInfo['post_user_anon']);
$post = "[quote={$quoteName}]\n".$post."\n[/quote]\n";*/
// $post = preg_replace('#\[hide].*?\[/hide]#s', '', $post);
// $quoteName = ($postInfo['user_name'] ? $postInfo['user_name'] : $postInfo['post_user_anon']);
// $post = "[quote={$quoteName}]\n".$post."\n[/quote]\n";
// $eaction = true;
// $action = 'reply';
@ -1762,6 +1775,6 @@ function image_getsize($fname)
}
require_once(FOOTERF);
require_once(FOOTERF);*/
?>