Vergleich editpost.php - 1.8.17 - 1.8.18

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 13Zeile 13

$templatelist = "editpost,previewpost,changeuserbox,codebuttons,post_attachments_attachment_postinsert,post_attachments_attachment_mod_unapprove,postbit_attachments_thumbnails,postbit_profilefield_multiselect_value";
$templatelist .= ",editpost_delete,forumdisplay_password_wrongpass,forumdisplay_password,editpost_reason,post_attachments_attachment_remove,post_attachments_update,post_subscription_method,postbit_profilefield_multiselect";


$templatelist = "editpost,previewpost,changeuserbox,codebuttons,post_attachments_attachment_postinsert,post_attachments_attachment_mod_unapprove,postbit_attachments_thumbnails,postbit_profilefield_multiselect_value";
$templatelist .= ",editpost_delete,forumdisplay_password_wrongpass,forumdisplay_password,editpost_reason,post_attachments_attachment_remove,post_attachments_update,post_subscription_method,postbit_profilefield_multiselect";

$templatelist .= ",postbit_avatar,postbit_find,postbit_pm,postbit_rep_button,postbit_www,postbit_email,postbit_reputation,postbit_warn,postbit_warninglevel,postbit_author_user,error_attacherror,posticons";

$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_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";

Zeile 49Zeile 49
	$post = get_post($pid);
}


	$post = get_post($pid);
}


if(!$post)

if(!$post || ($post['visible'] == -1 && $mybb->input['action'] != "restorepost"))

{
error($lang->error_invalidpost);
}

{
error($lang->error_invalidpost);
}

Zeile 194Zeile 194
	// 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'));


	// If there's an attachment, check it and upload it
if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0)

	if($pid)


	{

	{

		$query = $db->simple_select("attachments", "aid", "filename='".$db->escape_string($_FILES['attachment']['name'])."' AND pid='{$pid}'");
$updateattach = $db->fetch_field($query, "aid");


















		$attachwhere = "pid='{$pid}'";
}
else
{
$attachwhere = "posthash='".$db->escape_string($mybb->get_input('posthash'))."'";
}

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

if(!empty($ret['errors']))
{
$errors = $ret['errors'];
}

// Do we have attachment errors?
if(!empty($errors))
{
$attacherror = inline_error($errors);
}





		$update_attachment = false;
if($updateattach > 0 && $mybb->get_input('updateattachment') && ($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']))
{
$update_attachment = true;
}
$attachedfile = upload_attachment($_FILES['attachment'], $update_attachment);
}
if(!empty($attachedfile['error']))
{
eval("\$attacherror = \"".$templates->get("error_attacherror")."\";");
$mybb->input['action'] = "editpost";
}

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












	if(!isset($mybb->input['submit']))
{
$mybb->input['action'] = "editpost";

	if(!isset($mybb->input['submit']))
{
$mybb->input['action'] = "editpost";

Zeile 219Zeile 224
}

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

{
// 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'));


$mybb->input['attachmentaid'] = $mybb->get_input('attachmentaid', MyBB::INPUT_INT);
if($mybb->input['attachmentact'] == "remove")


$mybb->input['attachmentaid'] = $mybb->get_input('attachmentaid', MyBB::INPUT_INT);
if($mybb->input['attachmentact'] == "remove")

Zeile 265Zeile 270
		{
$firstpost = 0;
}

		{
$firstpost = 0;
}





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

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

Zeile 276Zeile 281
				$moderation = new Moderation;

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

				$moderation = new Moderation;

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

				{

				{

					$modlogdata['pid'] = $pid;

					$modlogdata['pid'] = $pid;





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

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

				}

				}

				else

				else

				{

				{

					$moderation->delete_thread($tid);
mark_reports($tid, "thread");
log_moderator_action($modlogdata, $lang->thread_deleted);

					$moderation->delete_thread($tid);
mark_reports($tid, "thread");
log_moderator_action($modlogdata, $lang->thread_deleted);

				}

if($mybb->input['ajax'] == 1)
{
header("Content-type: application/json; charset={$lang->settings['charset']}");
if(is_moderator($fid, "canviewdeleted"))
{
echo json_encode(array("data" => '1'));
}
else

				}

if($mybb->input['ajax'] == 1)
{
header("Content-type: application/json; charset={$lang->settings['charset']}");
if(is_moderator($fid, "canviewdeleted"))
{
echo json_encode(array("data" => '1', "first" => '1'));
}
else

					{
echo json_encode(array("data" => '3', "url" => get_forum_link($fid)));
}

					{
echo json_encode(array("data" => '3', "url" => get_forum_link($fid)));
}

Zeile 304Zeile 309
				else
{
redirect(get_forum_link($fid), $lang->redirect_threaddeleted);

				else
{
redirect(get_forum_link($fid), $lang->redirect_threaddeleted);

				}
}
else
{
error_no_permission();

				}
}
else
{
error_no_permission();

			}
}
else

			}
}
else

Zeile 331Zeile 336
					$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']}";
}
else
{
$redirect = get_thread_link($tid);

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

				}

				}


if($mybb->input['ajax'] == 1)
{
header("Content-type: application/json; charset={$lang->settings['charset']}");
if(is_moderator($fid, "canviewdeleted"))
{


if($mybb->input['ajax'] == 1)
{
header("Content-type: application/json; charset={$lang->settings['charset']}");
if(is_moderator($fid, "canviewdeleted"))
{

						echo json_encode(array("data" => '1'));

						echo json_encode(array("data" => '1', "first" => '0'));

					}
else
{

					}
else
{

Zeile 366Zeile 371
				error_no_permission();
}
}

				error_no_permission();
}
}

	}

	}

	else
{
error($lang->redirect_nodelete);

	else
{
error($lang->redirect_nodelete);

Zeile 377Zeile 382
{
// 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'));





	$plugins->run_hooks("editpost_restorepost");

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

	$plugins->run_hooks("editpost_restorepost");

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

Zeile 387Zeile 392
		if($firstcheck['pid'] == $pid)
{
$firstpost = 1;

		if($firstcheck['pid'] == $pid)
{
$firstpost = 1;

		}
else

		}
else

		{
$firstpost = 0;
}

		{
$firstpost = 0;
}

Zeile 399Zeile 404
		if($firstpost)
{
if(is_moderator($fid, "canrestorethreads"))

		if($firstpost)
{
if(is_moderator($fid, "canrestorethreads"))

			{
require_once MYBB_ROOT."inc/class_moderation.php";

			{
require_once MYBB_ROOT."inc/class_moderation.php";

				$moderation = new Moderation;
$moderation->restore_threads(array($tid));
log_moderator_action($modlogdata, $lang->thread_restored);
if($mybb->input['ajax'] == 1)

				$moderation = new Moderation;
$moderation->restore_threads(array($tid));
log_moderator_action($modlogdata, $lang->thread_restored);
if($mybb->input['ajax'] == 1)

				{

				{

					header("Content-type: application/json; charset={$lang->settings['charset']}");

					header("Content-type: application/json; charset={$lang->settings['charset']}");

					echo json_encode(array("data" => '1'));

					echo json_encode(array("data" => '1', "first" => '1'));

				}
else
{
redirect(get_forum_link($fid), $lang->redirect_threadrestored);

				}
else
{
redirect(get_forum_link($fid), $lang->redirect_threadrestored);

				}

				}

			}
else
{

			}
else
{

Zeile 433Zeile 438
				if($mybb->input['ajax'] == 1)
{
header("Content-type: application/json; charset={$lang->settings['charset']}");

				if($mybb->input['ajax'] == 1)
{
header("Content-type: application/json; charset={$lang->settings['charset']}");

					echo json_encode(array("data" => '1'));

					echo json_encode(array("data" => '1', "first" => '0'));

				}
else
{

				}
else
{

Zeile 447Zeile 452
		}
}
else

		}
}
else

	{

	{

		error($lang->redirect_norestore);
}
}

		error($lang->redirect_norestore);
}
}

Zeile 481Zeile 486
	if(!isset($postoptions['signature']))
{
$postoptions['signature'] = 0;

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

	}

	}

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

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

Zeile 663Zeile 668
	}

if(!isset($post_errors))

	}

if(!isset($post_errors))

	{

	{

		$post_errors = '';
}


		$post_errors = '';
}


Zeile 701Zeile 706
		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(
"signature" => $postoptions['signature'],

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

Zeile 732Zeile 737
			if(isset($postoptions['signature']) && $postoptions['signature'] == 1)
{
$postoptionschecked['signature'] = " checked=\"checked\"";

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

			}

			}


if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "none")


if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "none")

			{

			{

				$postoptions_subscriptionmethod_none = "checked=\"checked\"";

				$postoptions_subscriptionmethod_none = "checked=\"checked\"";

			}

			}

			else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "email")

			else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "email")

			{

			{

				$postoptions_subscriptionmethod_email = "checked=\"checked\"";

				$postoptions_subscriptionmethod_email = "checked=\"checked\"";

			}

			}

			else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "pm")

			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\"";
}

			{
$postoptions_subscriptionmethod_pm = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";
}

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

		}
}


		}
}


Zeile 766Zeile 771
			$postinfo = $db->fetch_array($query);
}
else

			$postinfo = $db->fetch_array($query);
}
else

		{

		{

			// Figure out the poster's other information.
$query = $db->query("
SELECT u.*, f.*, p.dateline

			// Figure out the poster's other information.
$query = $db->query("
SELECT u.*, f.*, p.dateline

Zeile 789Zeile 794
		if(!isset($postoptions['disablesmilies']))
{
$postoptions['disablesmilies'] = 0;

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

		}

		}


// Set the values of the post info array.
$postinfo['message'] = $previewmessage;


// Set the values of the post info array.
$postinfo['message'] = $previewmessage;

Zeile 810Zeile 815
		if($post['includesig'] != 0)
{
$postoptionschecked['signature'] = " checked=\"checked\"";

		if($post['includesig'] != 0)
{
$postoptionschecked['signature'] = " checked=\"checked\"";

		}


		}


		if($post['smilieoff'] == 1)

		if($post['smilieoff'] == 1)

		{

		{

			$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)

		$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_none = "checked=\"checked\"";
}
else if($notification == 1)

Zeile 845Zeile 850
	if($thread['firstpost'] == $pid)
{
if(!$mybb->get_input('threadprefix', MyBB::INPUT_INT))

	if($thread['firstpost'] == $pid)
{
if(!$mybb->get_input('threadprefix', MyBB::INPUT_INT))

		{

		{

			$mybb->input['threadprefix'] = $thread['prefix'];
}


			$mybb->input['threadprefix'] = $thread['prefix'];
}


Zeile 867Zeile 872
	{
$bgcolor = "trow1";
$bgcolor2 = "trow2";

	{
$bgcolor = "trow1";
$bgcolor2 = "trow2";

	}


	}


	// Fetch subscription select box
eval("\$subscriptionmethod = \"".$templates->get("post_subscription_method")."\";");


	// Fetch subscription select box
eval("\$subscriptionmethod = \"".$templates->get("post_subscription_method")."\";");


Zeile 902Zeile 907
	// Hide signature option if no permission
$signature = '';
if($mybb->usergroup['canusesig'] == 1 && !$mybb->user['suspendsignature'])

	// Hide signature option if no permission
$signature = '';
if($mybb->usergroup['canusesig'] == 1 && !$mybb->user['suspendsignature'])

	{

	{

		eval("\$signature = \"".$templates->get('editpost_signature')."\";");
}


		eval("\$signature = \"".$templates->get('editpost_signature')."\";");
}


Zeile 925Zeile 930
		if($forumpermissions['modattachments'] == 1  && $forumpermissions['canpostattachments'] != 0)
{
$moderation_text = $lang->moderation_forum_attachments;

		if($forumpermissions['modattachments'] == 1  && $forumpermissions['canpostattachments'] != 0)
{
$moderation_text = $lang->moderation_forum_attachments;

			eval('$moderation_notice = "'.$templates->get('global_moderation_notice').'";');
}
}


			eval('$moderation_notice = "'.$templates->get('global_moderation_notice').'";');
}
}


	if(!is_moderator($forum['fid'], "canapproveunapproveposts"))

	if(!is_moderator($forum['fid'], "canapproveunapproveposts"))

	{

	{

		if($forumpermissions['mod_edit_posts'] == 1)
{
$moderation_text = $lang->moderation_forum_edits;
eval('$moderation_notice = "'.$templates->get('global_moderation_notice').'";');
}
}

		if($forumpermissions['mod_edit_posts'] == 1)
{
$moderation_text = $lang->moderation_forum_edits;
eval('$moderation_notice = "'.$templates->get('global_moderation_notice').'";');
}
}

 

$php_max_upload_filesize = return_bytes(ini_get('max_upload_filesize'));
$php_post_max_size = return_bytes(ini_get('post_max_size'));

if ($php_max_upload_filesize != 0 && $php_post_max_size != 0)
{
$php_max_upload_size = min($php_max_upload_filesize, $php_post_max_size);
}
else
{
$php_max_upload_size = max($php_max_upload_filesize, $php_post_max_size);
}

$php_max_file_uploads = (int)ini_get('max_file_uploads');
eval("\$post_javascript = \"".$templates->get("post_javascript")."\";");


$plugins->run_hooks("editpost_end");



$plugins->run_hooks("editpost_end");