Vergleich editpost.php - 1.8.18 - 1.8.24

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 16Zeile 16
$templatelist .= ",postbit_avatar,postbit_find,postbit_pm,postbit_rep_button,postbit_www,postbit_email,postbit_reputation,postbit_warn,postbit_warninglevel,postbit_author_user,posticons";
$templatelist .= ",postbit_signature,postbit_classic,postbit,postbit_attachments_thumbnails_thumbnail,postbit_attachments_images_image,postbit_attachments_attachment,postbit_attachments_attachment_unapproved";
$templatelist .= ",posticons_icon,post_prefixselect_prefix,post_prefixselect_single,newthread_postpoll,editpost_disablesmilies,post_attachments_attachment_mod_approve,post_attachments_attachment_unapproved";

$templatelist .= ",postbit_avatar,postbit_find,postbit_pm,postbit_rep_button,postbit_www,postbit_email,postbit_reputation,postbit_warn,postbit_warninglevel,postbit_author_user,posticons";
$templatelist .= ",postbit_signature,postbit_classic,postbit,postbit_attachments_thumbnails_thumbnail,postbit_attachments_images_image,postbit_attachments_attachment,postbit_attachments_attachment_unapproved";
$templatelist .= ",posticons_icon,post_prefixselect_prefix,post_prefixselect_single,newthread_postpoll,editpost_disablesmilies,post_attachments_attachment_mod_approve,post_attachments_attachment_unapproved";

$templatelist .= ",postbit_warninglevel_formatted,postbit_reputation_formatted_link,editpost_signature,attachment_icon,post_attachments_attachment,post_attachments_add,post_attachments,editpost_postoptions";

$templatelist .= ",postbit_warninglevel_formatted,postbit_reputation_formatted_link,editpost_signature,attachment_icon,post_attachments_attachment,post_attachments_add,post_attachments,editpost_postoptions,post_attachments_viewlink";

$templatelist .= ",postbit_attachments_images,global_moderation_notice,post_attachments_new,postbit_attachments,postbit_online,postbit_away,postbit_offline,postbit_gotopost,postbit_userstar,postbit_icon";

require_once "./global.php";

$templatelist .= ",postbit_attachments_images,global_moderation_notice,post_attachments_new,postbit_attachments,postbit_online,postbit_away,postbit_offline,postbit_gotopost,postbit_userstar,postbit_icon";

require_once "./global.php";

Zeile 71Zeile 71

if($thread['visible'] == 0 && !is_moderator($fid, "canviewunapprove") || $thread['visible'] == -1 && !is_moderator($fid, "canviewdeleted") || ($thread['visible'] < -1 && $thread['uid'] != $mybb->user['uid']))
{


if($thread['visible'] == 0 && !is_moderator($fid, "canviewunapprove") || $thread['visible'] == -1 && !is_moderator($fid, "canviewdeleted") || ($thread['visible'] < -1 && $thread['uid'] != $mybb->user['uid']))
{

	error($lang->error_invalidthread);




	if($thread['visible'] == 0 && !($mybb->settings['showownunapproved'] && $thread['uid'] == $mybb->user['uid']))
{
error($lang->error_invalidthread);
}

}
if(!$forum || $forum['type'] != "f")
{

}
if(!$forum || $forum['type'] != "f")
{

Zeile 124Zeile 127
			error($lang->redirect_threadclosed);
}
if($forumpermissions['candeleteposts'] == 0 && $pid != $thread['firstpost'] || $forumpermissions['candeletethreads'] == 0 && $pid == $thread['firstpost'])

			error($lang->redirect_threadclosed);
}
if($forumpermissions['candeleteposts'] == 0 && $pid != $thread['firstpost'] || $forumpermissions['candeletethreads'] == 0 && $pid == $thread['firstpost'])

		{
error_no_permission();
}

		{
error_no_permission();
}

		if($mybb->user['uid'] != $post['uid'])
{
error_no_permission();
}

		if($mybb->user['uid'] != $post['uid'])
{
error_no_permission();
}

		// User can't delete unapproved post
if($post['visible'] == 0)

		// User can't delete unapproved post unless allowed for own
if($post['visible'] == 0 && !($mybb->settings['showownunapproved'] && $post['uid'] == $mybb->user['uid']))

		{
error_no_permission();
}

		{
error_no_permission();
}

Zeile 162Zeile 165
			error_no_permission();
}
if($mybb->user['uid'] != $post['uid'])

			error_no_permission();
}
if($mybb->user['uid'] != $post['uid'])

		{
error_no_permission();

		{
error_no_permission();

		}
// Edit time limit
$time = TIME_NOW;

		}
// Edit time limit
$time = TIME_NOW;

Zeile 173Zeile 176
			error($lang->edit_time_limit);
}
// User can't edit unapproved post

			error($lang->edit_time_limit);
}
// User can't edit unapproved post

		if($post['visible'] == 0 || $post['visible'] == -1)

		if(($post['visible'] == 0 && !($mybb->settings['showownunapproved'] && $post['uid'] == $mybb->user['uid'])) || $post['visible'] == -1)

		{
error_no_permission();
}

		{
error_no_permission();
}

Zeile 184Zeile 187
check_forum_password($forum['fid']);

if((empty($_POST) && empty($_FILES)) && $mybb->get_input('processed', MyBB::INPUT_INT) == '1')

check_forum_password($forum['fid']);

if((empty($_POST) && empty($_FILES)) && $mybb->get_input('processed', MyBB::INPUT_INT) == '1')

{

{

	error($lang->error_empty_post_input);
}

$attacherror = '';

	error($lang->error_empty_post_input);
}

$attacherror = '';

if($mybb->settings['enableattachments'] == 1 && !$mybb->get_input('attachmentaid', MyBB::INPUT_INT) && ($mybb->get_input('newattachment') || $mybb->get_input('updateattachment') || ($mybb->input['action'] == "do_editpost" && isset($mybb->input['submit']) && $_FILES['attachment'])))

if($mybb->settings['enableattachments'] == 1 && ($mybb->get_input('newattachment') || $mybb->get_input('updateattachment') || ((($mybb->input['action'] == "do_editpost" && isset($mybb->input['submitbutton'])) || ($mybb->input['action'] == "editpost" && isset($mybb->input['previewpost']))) && $_FILES['attachments'])))

{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

Zeile 206Zeile 209
	$ret = add_attachments($pid, $forumpermissions, $attachwhere, "editpost");

if(!empty($ret['errors']))

	$ret = add_attachments($pid, $forumpermissions, $attachwhere, "editpost");

if(!empty($ret['errors']))

	{

	{

		$errors = $ret['errors'];

		$errors = $ret['errors'];

	}


	}


	// Do we have attachment errors?
if(!empty($errors))
{

	// Do we have attachment errors?
if(!empty($errors))
{

Zeile 217Zeile 220
	}

// If we were dealing with an attachment but didn't click 'Update Post', force the post edit page again.

	}

// If we were dealing with an attachment but didn't click 'Update Post', force the post edit page again.

	if(!isset($mybb->input['submit']))
{

	if(!isset($mybb->input['submitbutton']))
{

		$mybb->input['action'] = "editpost";
}
}

		$mybb->input['action'] = "editpost";
}
}

 

detect_attachmentact();


if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid', MyBB::INPUT_INT) && isset($mybb->input['attachmentact']) && $mybb->input['action'] == "do_editpost" && $mybb->request_method == "post") // Lets remove/approve/unapprove the attachment
{


if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid', MyBB::INPUT_INT) && isset($mybb->input['attachmentact']) && $mybb->input['action'] == "do_editpost" && $mybb->request_method == "post") // Lets remove/approve/unapprove the attachment
{

Zeile 240Zeile 245
		update_thread_counters($post['tid'], array('attachmentcount' => "+1"));
}
elseif($mybb->get_input('attachmentact') == "unapprove" && is_moderator($fid, 'canapproveunapproveattachs'))

		update_thread_counters($post['tid'], array('attachmentcount' => "+1"));
}
elseif($mybb->get_input('attachmentact') == "unapprove" && is_moderator($fid, 'canapproveunapproveattachs'))

	{

	{

		$update_sql = array("visible" => 0);
$db->update_query("attachments", $update_sql, "aid='{$mybb->input['attachmentaid']}'");
update_thread_counters($post['tid'], array('attachmentcount' => "-1"));

		$update_sql = array("visible" => 0);
$db->update_query("attachments", $update_sql, "aid='{$mybb->input['attachmentaid']}'");
update_thread_counters($post['tid'], array('attachmentcount' => "-1"));

	}
if(!isset($mybb->input['submit']))









	}

if($mybb->get_input('ajax', MyBB::INPUT_INT) == 1)
{
header("Content-type: application/json; charset={$lang->settings['charset']}");
echo json_encode(array("success" => true));
exit();
}

if(!isset($mybb->input['submitbutton']))

	{
$mybb->input['action'] = "editpost";
}
}

if($mybb->input['action'] == "deletepost" && $mybb->request_method == "post")

	{
$mybb->input['action'] = "editpost";
}
}

if($mybb->input['action'] == "deletepost" && $mybb->request_method == "post")

{
// Verify incoming POST request

{
// Verify incoming POST request

	verify_post_check($mybb->get_input('my_post_key'));

	verify_post_check($mybb->get_input('my_post_key'));





	$plugins->run_hooks("editpost_deletepost");

if($mybb->get_input('delete', MyBB::INPUT_INT) == 1)

	$plugins->run_hooks("editpost_deletepost");

if($mybb->get_input('delete', MyBB::INPUT_INT) == 1)

Zeile 263Zeile 276
		$query = $db->simple_select("posts", "pid", "tid='{$tid}'", array("limit" => 1, "order_by" => "dateline", "order_dir" => "asc"));
$firstcheck = $db->fetch_array($query);
if($firstcheck['pid'] == $pid)

		$query = $db->simple_select("posts", "pid", "tid='{$tid}'", array("limit" => 1, "order_by" => "dateline", "order_dir" => "asc"));
$firstcheck = $db->fetch_array($query);
if($firstcheck['pid'] == $pid)

		{

		{

			$firstpost = 1;

			$firstpost = 1;

		}

		}

		else
{
$firstpost = 0;

		else
{
$firstpost = 0;

Zeile 274Zeile 287
		$modlogdata['fid'] = $fid;
$modlogdata['tid'] = $tid;
if($firstpost)

		$modlogdata['fid'] = $fid;
$modlogdata['tid'] = $tid;
if($firstpost)

		{

		{

			if($forumpermissions['candeletethreads'] == 1 || is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads"))
{
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;

			if($forumpermissions['candeletethreads'] == 1 || is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads"))
{
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;





				if($mybb->settings['soft_delete'] == 1 || is_moderator($fid, "cansoftdeletethreads"))
{
$modlogdata['pid'] = $pid;

$moderation->soft_delete_threads(array($tid));
log_moderator_action($modlogdata, $lang->thread_soft_deleted);

				if($mybb->settings['soft_delete'] == 1 || is_moderator($fid, "cansoftdeletethreads"))
{
$modlogdata['pid'] = $pid;

$moderation->soft_delete_threads(array($tid));
log_moderator_action($modlogdata, $lang->thread_soft_deleted);

				}

				}

				else
{
$moderation->delete_thread($tid);

				else
{
$moderation->delete_thread($tid);

Zeile 330Zeile 343

$moderation->soft_delete_posts(array($pid));
log_moderator_action($modlogdata, $lang->post_soft_deleted);


$moderation->soft_delete_posts(array($pid));
log_moderator_action($modlogdata, $lang->post_soft_deleted);

				}
else

				}
else

				{
$moderation->delete_post($pid);
mark_reports($pid, "post");
log_moderator_action($modlogdata, $lang->post_deleted);

				{
$moderation->delete_post($pid);
mark_reports($pid, "post");
log_moderator_action($modlogdata, $lang->post_deleted);

				}

				}


$query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline <= '{$post['dateline']}'", array("limit" => 1, "order_by" => "dateline", "order_dir" => "desc"));
$next_post = $db->fetch_array($query);
if($next_post['pid'])


$query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline <= '{$post['dateline']}'", array("limit" => 1, "order_by" => "dateline", "order_dir" => "desc"));
$next_post = $db->fetch_array($query);
if($next_post['pid'])

				{

				{

					$redirect = get_post_link($next_post['pid'], $tid)."#pid{$next_post['pid']}";

					$redirect = get_post_link($next_post['pid'], $tid)."#pid{$next_post['pid']}";

				}
else
{

				}
else
{

					$redirect = get_thread_link($tid);
}


					$redirect = get_thread_link($tid);
}


Zeile 364Zeile 377
				else
{
redirect($redirect, $lang->redirect_postdeleted);

				else
{
redirect($redirect, $lang->redirect_postdeleted);

				}
}
else
{
error_no_permission();

				}
}
else
{
error_no_permission();

			}
}
}

			}
}
}

Zeile 402Zeile 415
		$modlogdata['tid'] = $tid;
$modlogdata['pid'] = $pid;
if($firstpost)

		$modlogdata['tid'] = $tid;
$modlogdata['pid'] = $pid;
if($firstpost)

		{

		{

			if(is_moderator($fid, "canrestorethreads"))
{
require_once MYBB_ROOT."inc/class_moderation.php";

			if(is_moderator($fid, "canrestorethreads"))
{
require_once MYBB_ROOT."inc/class_moderation.php";

Zeile 436Zeile 449
				$redirect = get_post_link($pid, $tid)."#pid{$pid}";

if($mybb->input['ajax'] == 1)

				$redirect = get_post_link($pid, $tid)."#pid{$pid}";

if($mybb->input['ajax'] == 1)

				{

				{

					header("Content-type: application/json; charset={$lang->settings['charset']}");
echo json_encode(array("data" => '1', "first" => '0'));
}

					header("Content-type: application/json; charset={$lang->settings['charset']}");
echo json_encode(array("data" => '1', "first" => '0'));
}

Zeile 480Zeile 493
		"edit_uid" => $mybb->user['uid'],
"message" => $mybb->get_input('message'),
"editreason" => $mybb->get_input('editreason'),

		"edit_uid" => $mybb->user['uid'],
"message" => $mybb->get_input('message'),
"editreason" => $mybb->get_input('editreason'),

	);


	);


	$postoptions = $mybb->get_input('postoptions', MyBB::INPUT_ARRAY);
if(!isset($postoptions['signature']))

	$postoptions = $mybb->get_input('postoptions', MyBB::INPUT_ARRAY);
if(!isset($postoptions['signature']))

	{

	{

		$postoptions['signature'] = 0;

		$postoptions['signature'] = 0;

	}

	}

	if(!isset($postoptions['subscriptionmethod']))
{
$postoptions['subscriptionmethod'] = 0;
}
if(!isset($postoptions['disablesmilies']))

	if(!isset($postoptions['subscriptionmethod']))
{
$postoptions['subscriptionmethod'] = 0;
}
if(!isset($postoptions['disablesmilies']))

	{

	{

		$postoptions['disablesmilies'] = 0;
}

		$postoptions['disablesmilies'] = 0;
}





	// Set up the post options from the input.
$post['options'] = array(
"signature" => $postoptions['signature'],

	// Set up the post options from the input.
$post['options'] = array(
"signature" => $postoptions['signature'],

Zeile 504Zeile 517
	);

$posthandler->set_data($post);

	);

$posthandler->set_data($post);





	// Now let the post handler do all the hard work.
if(!$posthandler->validate_post())
{

	// Now let the post handler do all the hard work.
if(!$posthandler->validate_post())
{

Zeile 527Zeile 540
		{
$url = "polls.php?action=newpoll&tid=$tid&polloptions=".$mybb->get_input('numpolloptions', MyBB::INPUT_INT);
$lang->redirect_postedited = $lang->redirect_postedited_poll;

		{
$url = "polls.php?action=newpoll&tid=$tid&polloptions=".$mybb->get_input('numpolloptions', MyBB::INPUT_INT);
$lang->redirect_postedited = $lang->redirect_postedited_poll;

		}

		}

		else if($visible == 0 && $first_post && !is_moderator($fid, "canviewunapprove", $mybb->user['uid']))

		else if($visible == 0 && $first_post && !is_moderator($fid, "canviewunapprove", $mybb->user['uid']))

		{

		{

			// Moderated post
$lang->redirect_postedited .= $lang->redirect_thread_moderation;
$url = get_forum_link($fid);

			// Moderated post
$lang->redirect_postedited .= $lang->redirect_thread_moderation;
$url = get_forum_link($fid);

Zeile 538Zeile 551
		{
$lang->redirect_postedited .= $lang->redirect_post_moderation;
$url = get_thread_link($tid);

		{
$lang->redirect_postedited .= $lang->redirect_post_moderation;
$url = get_thread_link($tid);

		}

		}

		// Otherwise, send them back to their post
else
{

		// Otherwise, send them back to their post
else
{

Zeile 561Zeile 574
	}

if($forum['allowpicons'] != 0)

	}

if($forum['allowpicons'] != 0)

	{

	{

		$posticons = get_post_icons();

		$posticons = get_post_icons();

	}


	}


	$mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']);
eval("\$loginbox = \"".$templates->get("changeuserbox")."\";");

$deletebox = '';

	$mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']);
eval("\$loginbox = \"".$templates->get("changeuserbox")."\";");

$deletebox = '';

	// Can we delete posts?
if($post['visible'] != -1 && (is_moderator($fid, "candeleteposts") || $forumpermissions['candeleteposts'] == 1 && $mybb->user['uid'] == $post['uid']))

	if($post['visible'] != -1 && (($thread['firstpost'] == $pid && (is_moderator($fid, "candeletethreads") || $forumpermissions['candeletethreads'] == 1 && $mybb->user['uid'] == $post['uid'])) || ($thread['firstpost'] != $pid && (is_moderator($fid, "candeleteposts") || $forumpermissions['candeleteposts'] == 1 && $mybb->user['uid'] == $post['uid']))))


	{
eval("\$deletebox = \"".$templates->get("editpost_delete")."\";");
}

	{
eval("\$deletebox = \"".$templates->get("editpost_delete")."\";");
}





	$bgcolor = "trow1";
if($mybb->settings['enableattachments'] != 0 && $forumpermissions['canpostattachments'] != 0)
{ // Get a listing of the current attachments, if there are any

	$bgcolor = "trow1";
if($mybb->settings['enableattachments'] != 0 && $forumpermissions['canpostattachments'] != 0)
{ // Get a listing of the current attachments, if there are any

Zeile 586Zeile 598
			$attachment['size'] = get_friendly_size($attachment['filesize']);
$attachment['icon'] = get_attachment_icon(get_extension($attachment['filename']));
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);

			$attachment['size'] = get_friendly_size($attachment['filesize']);
$attachment['icon'] = get_attachment_icon(get_extension($attachment['filename']));
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);





			if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && $mybb->user['showcodebuttons'] != 0)
{
eval("\$postinsert = \"".$templates->get("post_attachments_attachment_postinsert")."\";");

			if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && $mybb->user['showcodebuttons'] != 0)
{
eval("\$postinsert = \"".$templates->get("post_attachments_attachment_postinsert")."\";");

Zeile 609Zeile 621
			eval("\$attach_rem_options = \"".$templates->get("post_attachments_attachment_remove")."\";");

if($attachment['visible'] != 1)

			eval("\$attach_rem_options = \"".$templates->get("post_attachments_attachment_remove")."\";");

if($attachment['visible'] != 1)

			{

			{

				eval("\$attachments .= \"".$templates->get("post_attachments_attachment_unapproved")."\";");

				eval("\$attachments .= \"".$templates->get("post_attachments_attachment_unapproved")."\";");

			}

			}

			else
{
eval("\$attachments .= \"".$templates->get("post_attachments_attachment")."\";");

			else
{
eval("\$attachments .= \"".$templates->get("post_attachments_attachment")."\";");

Zeile 621Zeile 633
		$query = $db->simple_select("attachments", "SUM(filesize) AS ausage", "uid='".$mybb->user['uid']."'");
$usage = $db->fetch_array($query);
if($usage['ausage'] > ($mybb->usergroup['attachquota']*1024) && $mybb->usergroup['attachquota'] != 0)

		$query = $db->simple_select("attachments", "SUM(filesize) AS ausage", "uid='".$mybb->user['uid']."'");
$usage = $db->fetch_array($query);
if($usage['ausage'] > ($mybb->usergroup['attachquota']*1024) && $mybb->usergroup['attachquota'] != 0)

		{

		{

			$noshowattach = 1;
}
else

			$noshowattach = 1;
}
else

Zeile 636Zeile 648
		{
$friendlyquota = get_friendly_size($mybb->usergroup['attachquota']*1024);
}

		{
$friendlyquota = get_friendly_size($mybb->usergroup['attachquota']*1024);
}

		$friendlyusage = get_friendly_size($usage['ausage']);
$lang->attach_quota = $lang->sprintf($lang->attach_quota, $friendlyusage, $friendlyquota);














$lang->attach_quota = $lang->sprintf($lang->attach_quota, $friendlyquota);

if($usage['ausage'] !== NULL)
{
$friendlyusage = get_friendly_size($usage['ausage']);
$lang->attach_usage = $lang->sprintf($lang->attach_usage, $friendlyusage);
eval("\$link_viewattachments = \"".$templates->get("post_attachments_viewlink")."\";");
}
else
{
$lang->attach_usage = "";
}


		if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach)
{
eval("\$attach_add_options = \"".$templates->get("post_attachments_add")."\";");

		if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach)
{
eval("\$attach_add_options = \"".$templates->get("post_attachments_add")."\";");

		}


		}


		if(($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']) && $attachcount > 0)
{
eval("\$attach_update_options = \"".$templates->get("post_attachments_update")."\";");

		if(($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']) && $attachcount > 0)
{
eval("\$attach_update_options = \"".$templates->get("post_attachments_update")."\";");

Zeile 661Zeile 685
		$reason = htmlspecialchars_uni($post['editreason']);
}
else

		$reason = htmlspecialchars_uni($post['editreason']);
}
else

	{

	{

		$message = $mybb->get_input('message');
$subject = $mybb->get_input('subject');
$reason = htmlspecialchars_uni($mybb->get_input('editreason'));

		$message = $mybb->get_input('message');
$subject = $mybb->get_input('subject');
$reason = htmlspecialchars_uni($mybb->get_input('editreason'));

	}






	}

$previewmessage = $message;
$previewsubject = $subject;
$message = htmlspecialchars_uni($message);
$subject = htmlspecialchars_uni($subject);


if(!isset($post_errors))
{
$post_errors = '';
}


if(!isset($post_errors))
{
$post_errors = '';
}


$postoptions_subscriptionmethod_dont = $postoptions_subscriptionmethod_none = $postoptions_subscriptionmethod_email = $postoptions_subscriptionmethod_pm = '';


$subscribe = $nonesubscribe = $emailsubscribe = $pmsubscribe = '';

	$postoptionschecked = array('signature' => '', 'disablesmilies' => '');

if(!empty($mybb->input['previewpost']) || $post_errors)

	$postoptionschecked = array('signature' => '', 'disablesmilies' => '');

if(!empty($mybb->input['previewpost']) || $post_errors)

Zeile 702Zeile 731
		if(!isset($postoptions['emailnotify']))
{
$postoptions['emailnotify'] = 0;

		if(!isset($postoptions['emailnotify']))
{
$postoptions['emailnotify'] = 0;

		}
if(!isset($postoptions['disablesmilies']))
{
$postoptions['disablesmilies'] = 0;
}

		}
if(!isset($postoptions['disablesmilies']))
{
$postoptions['disablesmilies'] = 0;
}


// Set up the post options from the input.
$post['options'] = array(


// Set up the post options from the input.
$post['options'] = array(

Zeile 724Zeile 753
			$post_errors = inline_error($post_errors);
$mybb->input['action'] = "editpost";
$mybb->input['previewpost'] = 0;

			$post_errors = inline_error($post_errors);
$mybb->input['action'] = "editpost";
$mybb->input['previewpost'] = 0;

		}
else
{
$previewmessage = $message;
$previewsubject = $subject;
$message = htmlspecialchars_uni($message);
$subject = htmlspecialchars_uni($subject);

$postoptions = $mybb->get_input('postoptions', MyBB::INPUT_ARRAY);


		}
else
{

$postoptions = $mybb->get_input('postoptions', MyBB::INPUT_ARRAY);






			if(isset($postoptions['signature']) && $postoptions['signature'] == 1)

			if(isset($postoptions['signature']) && $postoptions['signature'] == 1)

			{

			{

				$postoptionschecked['signature'] = " checked=\"checked\"";

				$postoptionschecked['signature'] = " checked=\"checked\"";

			}

if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "none")
{
$postoptions_subscriptionmethod_none = "checked=\"checked\"";
}
else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "email")
{
$postoptions_subscriptionmethod_email = "checked=\"checked\"";
}
else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "pm")
{
$postoptions_subscriptionmethod_pm = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";
}

if(isset($postoptions['disablesmilies']) && $postoptions['disablesmilies'] == 1)
{
$postoptionschecked['disablesmilies'] = " checked=\"checked\"";
}
}
}


			}

if(isset($postoptions['disablesmilies']) && $postoptions['disablesmilies'] == 1)
{
$postoptionschecked['disablesmilies'] = " checked=\"checked\"";
}

$subscription_method = get_subscription_method($tid, $postoptions);
${$subscription_method.'subscribe'} = "checked=\"checked\" ";
}
}
















	if(!empty($mybb->input['previewpost']))
{
if(!$post['uid'])

	if(!empty($mybb->input['previewpost']))
{
if(!$post['uid'])

Zeile 783Zeile 794
			");
$postinfo = $db->fetch_array($query);
$postinfo['userusername'] = $postinfo['username'];

			");
$postinfo = $db->fetch_array($query);
$postinfo['userusername'] = $postinfo['username'];

		}


		}


		$query = $db->simple_select("attachments", "*", "pid='{$pid}'");
while($attachment = $db->fetch_array($query))
{

		$query = $db->simple_select("attachments", "*", "pid='{$pid}'");
while($attachment = $db->fetch_array($query))
{

Zeile 807Zeile 818
	}
else if(!$post_errors)
{

	}
else if(!$post_errors)
{

		$message = htmlspecialchars_uni($message);
$subject = htmlspecialchars_uni($subject);


 
		$preview = '';

if($post['includesig'] != 0)

		$preview = '';

if($post['includesig'] != 0)

Zeile 822Zeile 830
			$postoptionschecked['disablesmilies'] = " checked=\"checked\"";
}


			$postoptionschecked['disablesmilies'] = " checked=\"checked\"";
}


		$query = $db->simple_select("threadsubscriptions", "notification", "tid='{$tid}' AND uid='{$mybb->user['uid']}'");
if($db->num_rows($query) > 0)
{
$notification = $db->fetch_field($query, 'notification');

if($notification == 0)
{
$postoptions_subscriptionmethod_none = "checked=\"checked\"";
}
else if($notification == 1)
{
$postoptions_subscriptionmethod_email = "checked=\"checked\"";
}
else if($notification == 2)
{
$postoptions_subscriptionmethod_pm = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";
}
}

		$subscription_method = get_subscription_method($tid, $postoptions);
${$subscription_method.'subscribe'} = "checked=\"checked\" ";





















	}

// Generate thread prefix selector if this is the first post of the thread

	}

// Generate thread prefix selector if this is the first post of the thread