diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php
index b430bd74e1..994ad3ab74 100755
--- a/phpBB/language/lang_english.php
+++ b/phpBB/language/lang_english.php
@@ -106,7 +106,7 @@ $lang['moderate_forum'] = "moderate this forum";
$lang['View_latest_post'] = "View latest post";
$lang['ICQ'] = "ICQ Number";
-$lang['AIM'] = "AIM address";
+$lang['AIM'] = "AIM Address";
$lang['MSNM'] = "MSN Messenger";
$lang['YIM'] = "Yahoo Messenger";
@@ -218,6 +218,7 @@ $lang['Post_Annoucement'] = "Announcement";
$lang['Post_Sticky'] = "Sticky";
$lang['Options'] = "Options";
+$lang['Confirm_delete'] = "Are you sure you want to delete this post?";
$lang['Submit_post'] = "Submit Post";
$lang['Preview'] = "Preview";
$lang['Cancel_post'] = "Cancel post";
@@ -227,6 +228,11 @@ $lang['Sorry_edit_own_posts'] = "Sorry but you can only edit your own posts";
$lang['Empty_subject'] = "You must specifiy a subject when posting a new topic";
$lang['Empty_message'] = "You must enter a message when posting";
$lang['Annouce_and_sticky'] = "You cannot post a topic that is both an annoucement and a sticky topic";
+$lang['Topic_locked'] = "This topic is locked you cannot edit posts or make replies";
+$lang['No_post_id'] = "You must select a post to edit";
+$lang['No_topic_id'] = "You must select a topic to reply to";
+$lang['No_valid_mode'] = "You can only post, reply edit or quote messages, please return and try again";
+$lang['No_such_post'] = "There is no such post, please return and try again";
$lang['Attach_signature'] = "Attach signature (signatures can be changed in profile)";
$lang['Disable'] = "Disable "; // This is followed by a type, eg. HTML, Smilies, etc. and then 'on this post'
@@ -235,14 +241,17 @@ $lang['BBCode'] = "BBCode";
$lang['Smilies'] = "Smilies";
$lang['in_this_post'] = " in this post";
$lang['Notify'] = "Notify";
+$lang['Delete_post'] = "Delete this post";
$lang['is_ON'] = " is ON"; // this goes after either BBCode or HTML
$lang['is_OFF'] = " is OFF"; // see above
$lang['Stored'] = "Your message has been entered successfully";
+$lang['Deleted'] = "Your message has been deleted successfully";
$lang['Click'] = "Click"; // Followed by here and then either return to topic or view message
$lang['Here'] = "Here";
$lang['to_return_forum'] = "to return to the forum";
$lang['to_view_message'] = "to view your message";
+$lang['to_return_topic'] = "to return to the topic";
//
// Private Messaging
@@ -320,7 +329,8 @@ $lang['Pick_local_Avatar'] = "Select Avatar from the gallery";
$lang['Link_remote_Avatar'] = "Link to off-site Avatar";
$lang['Link_remote_Avatar_explain'] = "Enter the URL of the location containing the Avatar image you wish to link to.";
$lang['Avatar_URL'] = "URL of Avatar Image";
-$lang['Avatar_gallery'] = "Show gallery of Avatar images";
+$lang['Select_from_gallery'] = "Select Avatar from gallery";
+$lang['Avatar_gallery'] = "Show gallery";
$lang['Delete_Image'] = "Delete Image";
$lang['Current_Image'] = "Current Image";
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 33daaf61cc..35789eabe2 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -37,30 +37,42 @@ init_userprefs($userdata);
//
// Set initial conditions
//
-if(!isset($HTTP_GET_VARS['forum']) && !isset($HTTP_POST_VARS['forum'])) // For backward compatibility
+if( isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL]) )
{
- $forum_id = ($HTTP_GET_VARS[POST_FORUM_URL]) ? $HTTP_GET_VARS[POST_FORUM_URL] : $HTTP_POST_VARS[POST_FORUM_URL];
+ $forum_id = (isset($HTTP_GET_VARS[POST_FORUM_URL])) ? $HTTP_GET_VARS[POST_FORUM_URL] : $HTTP_POST_VARS[POST_FORUM_URL];
}
else
{
- $forum_id = ($HTTP_GET_VARS['forum']) ? $HTTP_GET_VARS['forum'] : $HTTP_POST_VARS['forum'];
+ $forum_id = "";
+}
+if( isset($HTTP_GET_VARS[POST_POST_URL]) || isset($HTTP_POST_VARS[POST_POST_URL]) )
+{
+ $post_id = (isset($HTTP_GET_VARS[POST_POST_URL])) ? $HTTP_GET_VARS[POST_POST_URL] : $HTTP_POST_VARS[POST_POST_URL];
+}
+else
+{
+ $post_id = "";
+}
+if( isset($HTTP_GET_VARS[POST_TOPIC_URL]) || isset($HTTP_POST_VARS[POST_TOPIC_URL]) )
+{
+ $topic_id = (isset($HTTP_GET_VARS[POST_TOPIC_URL])) ? $HTTP_GET_VARS[POST_TOPIC_URL] : $HTTP_POST_VARS[POST_TOPIC_URL];
+}
+else
+{
+ $topic_id = "";
}
$mode = (isset($HTTP_GET_VARS['mode'])) ? $HTTP_GET_VARS['mode'] : ( (isset($HTTP_POST_VARS['mode'])) ? $HTTP_POST_VARS['mode'] : "");
-$is_first_post = (($HTTP_GET_VARS['is_first_post'] == 1) || ($HTTP_POST_VARS['is_first_post'] == 1)) ? TRUE : FALSE;
-
$disable_html = (isset($HTTP_POST_VARS['disable_html'])) ? $HTTP_POST_VARS['disable_html'] : !$userdata['user_allowhtml'];
$disable_bbcode = (isset($HTTP_POST_VARS['disable_bbcode'])) ? $HTTP_POST_VARS['disable_bbcode'] : !$userdata['user_allowbbcode'];
$disable_smilies = (isset($HTTP_POST_VARS['disable_smile'])) ? $HTTP_POST_VARS['disable_smile'] : !$userdata['user_allowsmile'];
-
$attach_sig = (isset($HTTP_POST_VARS['attach_sig'])) ? $HTTP_POST_VARS['attach_sig'] : $userdata['user_attachsig'];
$notify = (isset($HTTP_POST_VARS['notify'])) ? $HTTP_POST_VARS['notify'] : $userdata["always_notify"];
-
$preview = (isset($HTTP_POST_VARS['preview'])) ? TRUE : FALSE;
-if(isset($HTTP_POST_VARS['topictype']))
+if( isset($HTTP_POST_VARS['topictype']) )
{
if($HTTP_POST_VARS['topictype'] == "announce")
{
@@ -75,9 +87,108 @@ if(isset($HTTP_POST_VARS['topictype']))
$topic_type = POST_NORMAL;
}
}
+else
+{
+ $topic_type = POST_NORMAL;
+}
+//
+// Here we do various lookups to find topic_id, forum_id, post_id
+// etc. Doing it here prevents spoofing (eg. faking forum_id,
+// topic_id or post_id).
+//
+if( $mode != "newtopic" )
+{
+ if($mode == "reply" || $mode == "quote")
+ {
+ if($mode == "reply" && !empty($topic_id) )
+ {
+ $sql = "SELECT forum_id, topic_status
+ FROM " . TOPICS_TABLE . " t
+ WHERE topic_id = $topic_id";
+
+ $msg = $lang['No_topic_id'];
+ }
+ else if( !empty($post_id) )
+ {
+ $sql = "SELECT t.topic_id, t.forum_id, t.topic_status
+ FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
+ WHERE p.post_id = $post_id
+ AND t.topic_id = p.topic_id";
+
+ $msg = $lang['No_post_id'];
+ }
+ else
+ {
+ message_die(GENERAL_MESSAGE, $msg);
+ }
+ }
+ else if($mode == "editpost")
+ {
+ if( isset($post_id) )
+ {
+ $sql = "SELECT p.post_id, t.forum_id, t.topic_status, t.topic_last_post_id, f.forum_last_post_id
+ FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
+ WHERE t.topic_id = $topic_id
+ AND p.topic_id = t.topic_id
+ AND f.forum_id = t.forum_id
+ ORDER BY p.post_time ASC
+ LIMIT 1";
+ }
+ else
+ {
+ message_die(GENERAL_MESSAGE, $lang['No_post_id']);
+ }
+ }
+ else
+ {
+ message_die(GENERAL_MESSAGE, $lang['No_valid_mode']);
+ }
+
+ if($result = $db->sql_query($sql))
+ {
+ $check_row = $db->sql_fetchrow($result);
+
+ $forum_id = $check_row['forum_id'];
+ $topic_status = $check_row['topic_status'];
+
+ if( $mode == "editpost" )
+ {
+ $is_first_post = ($check_row['post_id'] == $post_id) ? TRUE : FALSE;
+ $is_last_post = ($check_row['topic_last_post_id'] == $post_id) ? TRUE : FALSE;
+ $is_last_post_forum = ($check_row['forum_last_post_id'] == $post_id) ? TRUE : FALSE;
+ }
+ else
+ {
+ if($mode == "quote")
+ {
+ $topic_id = $check_row['topic_id'];
+ }
+ $is_first_post = FALSE;
+ $is_last_post = FALSE;
+ }
+ }
+ else
+ {
+ message_die(GENERAL_ERROR, $lang['No_such_post'], "", __LINE__, __FILE__, $sql);
+ }
+}
+else
+{
+ $is_first_post = TRUE;
+ $is_last_post = FALSE;
+ $topic_status = TOPIC_UNLOCKED;
+}
//
-// Auth code
+// Is topic locked?
+//
+if($topic_status == TOPIC_LOCKED)
+{
+ message_die(GENERAL_MESSAGE, $lang['Topic_locked']);
+}
+
+//
+// Auth checks
//
switch($mode)
{
@@ -143,13 +254,18 @@ if(!$is_auth[$is_auth_type])
// End Auth
//
+//
+// Clear error check
+//
$error = FALSE;
+$error_msg = "";
//
// Prepare our message and subject on a 'submit'
//
-if(isset($HTTP_POST_VARS['submit']) || $preview)
+if( ( isset($HTTP_POST_VARS['submit']) || $preview ) && $topic_status == TOPIC_UNLOCKED )
{
+
//
// Flood control
//
@@ -173,7 +289,7 @@ if(isset($HTTP_POST_VARS['submit']) || $preview)
}
}
//
- // End: Flood control
+ // End Flood control
//
//
@@ -185,7 +301,7 @@ if(isset($HTTP_POST_VARS['submit']) || $preview)
if(!validate_username($username))
{
$error = TRUE;
- if(isset($error_msg))
+ if(!empty($error_msg))
{
$error_msg .= "
";
}
@@ -201,7 +317,7 @@ if(isset($HTTP_POST_VARS['submit']) || $preview)
if($mode == 'newtopic' && empty($subject))
{
$error = TRUE;
- if(isset($error_msg))
+ if(!empty($error_msg))
{
$error_msg .= "
";
}
@@ -214,7 +330,7 @@ if(isset($HTTP_POST_VARS['submit']) || $preview)
if($annouce && $sticky)
{
$error = TRUE;
- if(isset($error_msg))
+ if(!empty($error_msg))
{
$error_msg .= "
";
}
@@ -254,11 +370,11 @@ if(isset($HTTP_POST_VARS['submit']) || $preview)
else
{
$error = TRUE;
- if(isset($error_msg))
+ if(!empty($error_msg))
{
$error_msg .= "
";
}
- $error_msg .= $lang['Empty_msg'];
+ $error_msg .= $lang['Empty_message'];
}
}
@@ -266,7 +382,7 @@ if(isset($HTTP_POST_VARS['submit']) || $preview)
// If submitted then update tables
// according to the mode
//
-if($mode == "newtopic" || $mode == "reply")
+if( ($mode == "newtopic" || $mode == "reply") && $topic_status == TOPIC_UNLOCKED)
{
$page_title = ($mode == "newtopic") ? " " . $lang['Post_new_topic'] : " " . $lang['Post_reply'];
$section_title = ($mode == "newtopic") ? $lang['Post_new_topic_in'] : " " . $Lang['Post_reply_to'];
@@ -277,7 +393,7 @@ if($mode == "newtopic" || $mode == "reply")
if($mode == "reply")
{
- $new_topic_id = $HTTP_POST_VARS[POST_TOPIC_URL];
+ $new_topic_id = $topic_id;
}
else if($mode == "newtopic")
{
@@ -382,15 +498,13 @@ if($mode == "newtopic" || $mode == "reply")
}
}
}
-else if($mode == "quote" && !$preview)
+else if($mode == "quote" && !$preview && $topic_status == TOPIC_UNLOCKED)
{
$page_title = " " . $lang['Post_reply'];
$section_title = " " . $Lang['Post_reply_to'];
- if( isset($HTTP_GET_VARS[POST_POST_URL]) )
+ if( isset($post_id) )
{
- $post_id = $HTTP_GET_VARS[POST_POST_URL];
-
$sql = "SELECT p.*, pt.post_text, pt.post_subject, u.username, u.user_id, u.user_sig, t.topic_title, t.topic_notify, t.topic_type
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . TOPICS_TABLE . " t, " . POSTS_TEXT_TABLE . " pt
WHERE p.post_id = $post_id
@@ -435,28 +549,208 @@ else if($mode == "quote" && !$preview)
}
else
{
- message_die(GENERAL_MESSAGE, "Sorry but there is no such post");
+ message_die(GENERAL_MESSAGE, $lang['No_such_post']);
}
}
-else if($mode == "editpost")
+else if( $mode == "editpost" && $topic_status == TOPIC_UNLOCKED )
{
$page_title = " " . $lang['Edit_post'];
$section_title = $lang['Edit_post_in'];
- if(isset($HTTP_POST_VARS['submit']) && !$error && !$preview)
+ if( ( isset($HTTP_POST_VARS['submit']) || isset($HTTP_GET_VARS['confirm']) || isset($HTTP_POST_VARS['confirm']) )
+ && !$error && !$preview )
{
- if(isset($HTTP_POST_VARS['delete_post']))
- {
- //
- // To be completed!
- //
+
+ $sql = "SELECT poster_id
+ FROM " . POSTS_TABLE . "
+ WHERE post_id = $post_id";
+ if($result = $db->sql_query($sql))
+ {
+ list($check_user_id) = $db->sql_fetchrow($result);
+
+ if($userdata['user_id'] != $check_user_id && !$is_auth['auth_mod'])
+ {
+ $msg = ( isset($HTTP_POST_VARS['delete']) || isset($HTTP_GET_VARS['delete']) ) ? $lang['Sorry_delete_own_posts'] : $lang['Sorry_edit_own_posts'];
+
+ message_die(GENERAL_MESSAGE, $msg);
+ }
+ }
+
+ if( ( isset($HTTP_POST_VARS['delete']) || isset($HTTP_GET_VARS['delete']) ) && ( $is_last_post || $is_auth['auth_mod'] ) )
+ {
+ //
+ // Output a confirmation message, unless we've
+ // over-ridden it on the posting_body form (
+ // override_confirm set ), this is so people
+ // can implement JavaScript checkers if they wish
+ //
+ if( isset($HTTP_POST_VARS['delete']) && !isset($HTTP_POST_VARS['override_confirm']) )
+ {
+
+ $msg = '
' . $lang['Confirm_delete'] . '
' . $lang['Yes'] . ' ' . $lang['No'] . '
';
+
+ message_die(GENERAL_MESSAGE, $msg);
+
+ }
+ else if( isset($HTTP_GET_VARS['confirm']) || isset($HTTP_POST_VARS['confirm']) ||
+ isset($HTTP_POST_VARS['override_confirm']) )
+ {
+
+ $sql = "DELETE FROM " . POSTS_TEXT_TABLE . "
+ WHERE post_id = $post_id";
+
+ if($db->sql_query($sql, BEGIN_TRANSACTION))
+ {
+ $sql = "DELETE FROM " . POSTS_TABLE . "
+ WHERE post_id = $post_id";
+
+ if($is_last_post && $is_first_post)
+ {
+ //
+ // Delete the topic completely, updating the forum_last_post_id
+ // if necessary
+ //
+ if($db->sql_query($sql))
+ {
+ $sql = "DELETE FROM " . TOPICS_TABLE . "
+ WHERE topic_id = $topic_id";
+
+ $sql_forum_upd = "forum_posts = forum_posts - 1, forum_topics = forum_topics - 1";
+
+ $if_die_msg = "Couldn't delete from topics table";
+ }
+ else
+ {
+ // Rollback ?
+ message_die(GENERAL_ERROR, "Error deleting from post table", "", __LINE__, __FILE__, $sql);
+ }
+ }
+ else if($is_last_post)
+ {
+ //
+ // Delete the post and update the _last_post_id's of both
+ // the topic and forum if necessary
+ //
+ if($db->sql_query($sql))
+ {
+ $sql = "SELECT MAX(post_id) AS new_last_post_id
+ FROM " . POSTS_TABLE . "
+ WHERE topic_id = $topic_id";
+
+ if($result = $db->sql_query($sql))
+ {
+ list($new_last_post_id) = $db->sql_fetchrow($result);
+
+ $sql = "UPDATE " . TOPICS_TABLE . "
+ SET topic_replies = topic_replies - 1, topic_last_post_id = $new_last_post_id
+ WHERE topic_id = $topic_id";
+
+ $sql_forum_upd = "forum_posts = forum_posts - 1";
+
+ $if_die_msg = "Error updating topics table";
+ }
+ else
+ {
+ // Rollback ?
+ message_die(GENERAL_ERROR, "Error obtaining new last topic id", "", __LINE__, __FILE__, $sql);
+ }
+ }
+ else
+ {
+ // Rollback ?
+ message_die(GENERAL_ERROR, "Error deleting from post table", "", __LINE__, __FILE__, $sql);
+ }
+ }
+ else if($is_auth['auth_mod'])
+ {
+ //
+ // It's not last and it's not both first and last
+ // so it's somewhere in the middle(!) Only moderators
+ // can delete these posts, all we need do is update
+ // the forums table data as necessary
+ //
+ $sql_forum_upd = "forum_posts = forum_posts - 1";
+
+ $if_die_msg = "Couldn't delete from posts table";
+ }
+
+ //
+ // Updating the forum is common to all three possibilities,
+ // _remember_ we're still in a transaction here!
+ //
+ if($db->sql_query($sql))
+ {
+ if($is_last_post_forum)
+ {
+ $sql = "SELECT MAX(post_id) AS new_last_post_id
+ FROM " . POSTS_TABLE . "
+ WHERE forum_id = $forum_id";
+
+ if($result = $db->sql_query($sql))
+ {
+ list($new_last_post_id) = $db->sql_fetchrow($result);
+ }
+ else
+ {
+ message_die(GENERAL_ERROR, "Couldn't obtain new last post id for the forum", "", __LINE__, __FILE__, $sql);
+ }
+
+ $new_last_sql = ", forum_last_post_id = $new_last_post_id";
+ }
+ else
+ {
+ $new_last_sql = "";
+ }
+
+ $sql = "UPDATE " . FORUMS_TABLE . "
+ SET " . $sql_forum_upd . $new_last_sql . "
+ WHERE forum_id = $forum_id";
+
+ if($db->sql_query($sql, END_TRANSACTION))
+ {
+ //
+ // If we get here the post has been deleted successfully.
+ //
+ $msg = $lang['Deleted'];
+
+ if(!$is_last_post || !$is_first_post)
+ {
+ $msg .= "
" . $lang['Click'] . " " . $lang['Here'] . " " . $lang['to_return_topic'];
+ }
+ $msg .= "
" . $lang['Click'] . " " . $lang['Here'] . " ". $lang['to_return_forum'];
+
+ message_die(GENERAL_MESSAGE, $msg);
+ }
+ else
+ {
+ // Rollback ?
+ message_die(GENERAL_ERROR, "Error updating forums table", "", __LINE__, __FILE__, $sql);
+ }
+ }
+ else
+ {
+ //
+ // This error is produced by the last SQL query carried out
+ // before we jumped into this common block
+ //
+ // Rollback ?
+ message_die(GENERAL_ERROR, $if_die_msg, "", __LINE__, __FILE__, $sql);
+ }
+ }
+ else
+ {
+ // Rollback ?
+ message_die(GENERAL_ERROR, "Error deleting from posts text table", "", __LINE__, __FILE__, $sql);
+ }
+ }
+ else
+ {
+ header("Location: viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
+ }
}
else
{
- $post_id = $HTTP_POST_VARS[POST_POST_URL];
- $new_topic_id = $HTTP_POST_VARS[POST_TOPIC_URL];
-
$sql = "UPDATE " . POSTS_TABLE . "
SET bbcode_uid = '$bbcode_uid'
WHERE post_id = $post_id";
@@ -476,7 +770,7 @@ else if($mode == "editpost")
//
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_title = '$subject', topic_notify = '$notify', topic_type = '".$topic_type."'
- WHERE topic_id = $new_topic_id";
+ WHERE topic_id = $topic_id";
if($db->sql_query($sql, END_TRANSACTION))
{
@@ -501,7 +795,8 @@ else if($mode == "editpost")
// If we get here the post has been inserted successfully.
//
$msg = $lang['Stored'] . "
" . $lang['Click'] . " " . $lang['Here'] . " " . $lang['to_view_message'] . "
" . $lang['Click'] . " " . $lang['Here'] . " ". $lang['to_return_forum'];
- message_die(GENERAL_MESSAGE, $msg);
+
+ message_die(GENERAL_MESSAGE, $msg);
}
else
{
@@ -517,9 +812,7 @@ else if($mode == "editpost")
}
else if(!$preview)
{
- $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) )
{
$sql = "SELECT p.*, pt.post_text, pt.post_subject, u.username, u.user_id, u.user_sig, t.topic_title, t.topic_notify, t.topic_type
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . TOPICS_TABLE . " t, " . POSTS_TEXT_TABLE . " pt
@@ -581,10 +874,10 @@ else if($mode == "editpost")
}
else
{
- message_die(GENERAL_MESSAGE, "Sorry but there is no such post");
+ message_die(GENERAL_MESSAGE, $lang['No_such_post']);
}
}
-} // end if ... mode
+}// end if ... mode
//
// Output page
@@ -655,10 +948,9 @@ if($preview && !$error)
//
// Show the same form for each mode.
//
-
-if(!isset($HTTP_GET_VARS[POST_FORUM_URL]) && !isset($HTTP_POST_VARS[POST_FORUM_URL]))
+if( empty($forum_id) )
{
- message_die(GENERAL_ERROR, "Sorry but there is no such forum");
+ message_die(GENERAL_ERROR, $lang['Forum_not_exist']);
}
$sql = "SELECT forum_name
@@ -795,21 +1087,36 @@ if($mode == "newtopic" || ($mode == "editpost" && $notify_show))
$notify_toggle .= "> " . $lang['Notify'];
}
-if($mode == "reply" || $mode == "editpost" || $mode == "quote")
+//
+// Display delete toggle?
+//
+if($mode == 'editpost' && ( $is_last_post || $is_auth['auth_mod'] ) )
{
- $topic_id = ($HTTP_GET_VARS[POST_TOPIC_URL]) ? $HTTP_GET_VARS[POST_TOPIC_URL] : $HTTP_POST_VARS[POST_TOPIC_URL];
- $post_id = ($HTTP_GET_VARS[POST_POST_URL]) ? $HTTP_GET_VARS[POST_POST_URL] : $HTTP_POST_VARS[POST_POST_URL];
+ $delete_toggle = ' ' . $lang['Delete_post'];
+}
+//
+// Define hidden fields
+//
+$hidden_form_fields = "";
+if($mode == "newtopic")
+{
+ $hidden_form_fields .= "";
+}
+else if($mode == "reply" || $mode == "quote")
+{
//
// Reset mode to reply if quote is in effect
// to allow proper handling by submit/preview
//
- if($mode == "quote")
- {
- $mode = "reply";
- }
+ $mode = "reply";
+ $hidden_form_fields .= "";
}
-$hidden_form_fields = "";
+else if($mode == "editpost")
+{
+ $hidden_form_fields .= "";
+}
+$hidden_form_fields .= "";
if($mode == "newtopic")
{
@@ -834,6 +1141,7 @@ $template->assign_vars(array(
"SMILE_TOGGLE" => $smile_toggle,
"SIG_TOGGLE" => $sig_toggle,
"NOTIFY_TOGGLE" => $notify_toggle,
+ "DELETE_TOGGLE" => $delete_toggle,
"TYPE_TOGGLE" => $topic_type_toggle,
"BBCODE_TOGGLE" => $bbcode_toggle,
"BBCODE_STATUS" => $bbcode_status,
@@ -843,7 +1151,8 @@ $template->assign_vars(array(
"L_OPTIONS" => $lang['Options'],
"L_PREVIEW" => $lang['Preview'],
"L_SUBMIT" => $lang['Submit_post'],
- "L_CANCEL" => $lang['Cancel_post'],
+ "L_CANCEL" => $lang['Cancel_post'],
+ "L_CONFIRM_DELETE" => $lang['Confirm_delete'],
"L_POST_A" => $post_a,
"S_POST_ACTION" => append_sid("posting.$phpEx"),
diff --git a/phpBB/templates/Default/posting_body.tpl b/phpBB/templates/Default/posting_body.tpl
index 5589f7de76..3efd022bf7 100644
--- a/phpBB/templates/Default/posting_body.tpl
+++ b/phpBB/templates/Default/posting_body.tpl
@@ -73,7 +73,7 @@ function addBBcode(bbCode)