Fixed error in return to post link when editing a message

git-svn-id: file:///svn/phpbb/trunk@502 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2001-06-16 14:29:49 +00:00
parent 57bd34df47
commit dc2cd415d3

View file

@ -6,7 +6,11 @@
* copyright : (C) 2001 The phpBB Group * copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com * email : support@phpbb.com
* *
<<<<<<< posting.php
* $Id$ * $Id$
=======
* $Id$
>>>>>>> 1.35
* *
* *
***************************************************************************/ ***************************************************************************/
@ -663,8 +667,10 @@ switch($mode)
break; break;
case 'editpost': case 'editpost':
$page_title = " $l_editpost"; $page_title = " $l_editpost";
$section_title = $l_editpostin; $section_title = $l_editpostin;
if(isset($HTTP_POST_VARS['submit']) && !$error && !$preview) if(isset($HTTP_POST_VARS['submit']) && !$error && !$preview)
{ {
if(isset($HTTP_POST_VARS['delete_post'])) if(isset($HTTP_POST_VARS['delete_post']))
@ -690,13 +696,13 @@ switch($mode)
} }
} }
$sql = "UPDATE ".POSTS_TEXT_TABLE." SET post_text = '$message', post_subject = '$subject' WHERE post_id = ".$HTTP_POST_VARS[POST_POST_URL]; $sql = "UPDATE ".POSTS_TEXT_TABLE." SET post_text = '$message', post_subject = '$subject' WHERE post_id = $post_id";
if($db->sql_query($sql)) if($db->sql_query($sql))
{ {
if($is_first_post) if($is_first_post)
{ {
// Update topics table here, set notification level and such // Update topics table here, set notification level and such
$sql = "UPDATE ".TOPICS_TABLE." SET topic_title = '$subject', topic_notify = '$notify', topic_type = '".$topic_type."' WHERE topic_id = ".$HTTP_POST_VARS[POST_TOPIC_URL]; $sql = "UPDATE ".TOPICS_TABLE." SET topic_title = '$subject', topic_notify = '$notify', topic_type = '".$topic_type."' WHERE topic_id = $new_topic_id";
if(!$db->sql_query($sql)) if(!$db->sql_query($sql))
{ {
if(SQL_LAYER != "mysql") if(SQL_LAYER != "mysql")
@ -746,7 +752,7 @@ switch($mode)
// //
include('includes/page_header.'.$phpEx); include('includes/page_header.'.$phpEx);
$msg = $lang['Stored'] . "<br /><br />" . $lang['Click'] . " <a href=\"" . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$new_post_id#$new_post_id") . "\">" . $lang['Here'] . "</a> " . $lang['to_view_message'] . "<br /><br />" . $lang['Click'] . " <a href=\"" . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\">" . $lang['Here'] . "</a> ". $lang['to_return_forum']; $msg = $lang['Stored'] . "<br /><br />" . $lang['Click'] . " <a href=\"" . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id") . "\">" . $lang['Here'] . "</a> " . $lang['to_view_message'] . "<br /><br />" . $lang['Click'] . " <a href=\"" . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\">" . $lang['Here'] . "</a> ". $lang['to_return_forum'];
$template->set_filenames(array( $template->set_filenames(array(
"reg_header" => "error_body.tpl" "reg_header" => "error_body.tpl"
@ -783,7 +789,7 @@ switch($mode)
// //
include('includes/page_header.'.$phpEx); include('includes/page_header.'.$phpEx);
$msg = $lang['Stored'] . "<br /><br />" . $lang['Click'] . " <a href=\"" . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$new_post_id#$new_post_id") . "\">" . $lang['Here'] . "</a> " . $lang['to_view_message'] . "<br /><br />" . $lang['Click'] . " <a href=\"" . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\">" . $lang['Here'] . "</a> ". $lang['to_return_forum']; $msg = $lang['Stored'] . "<br /><br />" . $lang['Click'] . " <a href=\"" . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id") . "\">" . $lang['Here'] . "</a> " . $lang['to_view_message'] . "<br /><br />" . $lang['Click'] . " <a href=\"" . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\">" . $lang['Here'] . "</a> ". $lang['to_return_forum'];
$template->set_filenames(array( $template->set_filenames(array(
"reg_header" => "error_body.tpl" "reg_header" => "error_body.tpl"
@ -813,6 +819,7 @@ switch($mode)
else if(!$preview) else if(!$preview)
{ {
$post_id = ($HTTP_GET_VARS[POST_POST_URL]) ? $HTTP_GET_VARS[POST_POST_URL] : $HTTP_POST_VARS[POST_POST_URL]; $post_id = ($HTTP_GET_VARS[POST_POST_URL]) ? $HTTP_GET_VARS[POST_POST_URL] : $HTTP_POST_VARS[POST_POST_URL];
if(!empty($post_id)) if(!empty($post_id))
{ {
@ -851,13 +858,14 @@ switch($mode)
$attach_sig = TRUE; $attach_sig = TRUE;
} }
$message = eregi_replace("\[addsig]$", "", $message); $message = eregi_replace("\[addsig]$", "", $message);
$message = str_replace("<br />", "\n", $message);
// These have not been implemented yet! // Removes UID from BBEncoded entries
/* $message = preg_replace("/\:[0-9a-z\:]*?\]/si", "]", $message);
$message = bbdecode($message);
$message = desmile($message); // This has not been implemented yet!
*/ //$message = desmile($message);
$message = str_replace("<br />", "\n", $message);
$message = undo_htmlspecialchars($message); $message = undo_htmlspecialchars($message);
@ -881,10 +889,7 @@ switch($mode)
$is_stuck = TRUE; $is_stuck = TRUE;
break; break;
} }
} }
} }
else else
{ {