Vergleich editpost.php - 1.8.21 - 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 192Zeile 192
}

$attacherror = '';

}

$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 220Zeile 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

{
// 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")
{
remove_attachment($pid, "", $mybb->input['attachmentaid']);

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

	}

	}

	elseif($mybb->get_input('attachmentact') == "approve" && is_moderator($fid, 'canapproveunapproveattachs'))
{
$update_sql = array("visible" => 1);
$db->update_query("attachments", $update_sql, "aid='{$mybb->input['attachmentaid']}'");
update_thread_counters($post['tid'], array('attachmentcount' => "+1"));

	elseif($mybb->get_input('attachmentact') == "approve" && is_moderator($fid, 'canapproveunapproveattachs'))
{
$update_sql = array("visible" => 1);
$db->update_query("attachments", $update_sql, "aid='{$mybb->input['attachmentaid']}'");
update_thread_counters($post['tid'], array('attachmentcount' => "+1"));

	}

	}

	elseif($mybb->get_input('attachmentact') == "unapprove" && is_moderator($fid, 'canapproveunapproveattachs'))
{
$update_sql = array("visible" => 0);

	elseif($mybb->get_input('attachmentact') == "unapprove" && is_moderator($fid, 'canapproveunapproveattachs'))
{
$update_sql = array("visible" => 0);

Zeile 256Zeile 258
		exit();
}


		exit();
}


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

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

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

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

Zeile 270Zeile 272
	$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)

	{
$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;
}
else
{
$firstpost = 0;

	{
$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;
}
else
{
$firstpost = 0;

		}

$modlogdata['fid'] = $fid;

		}

$modlogdata['fid'] = $fid;

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

				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);
}

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

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

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

				}
}
else
{
error_no_permission();
}
}
else
{
if($forumpermissions['candeleteposts'] == 1 || is_moderator($fid, "candeleteposts") || is_moderator($fid, "cansoftdeleteposts"))
{
// Select the first post before this

				}
}
else
{
error_no_permission();
}
}
else
{
if($forumpermissions['candeleteposts'] == 1 || is_moderator($fid, "candeleteposts") || is_moderator($fid, "cansoftdeleteposts"))
{
// Select the first post before this

				require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;

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

				require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;

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





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

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

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

					{

					{

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

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

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

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

				}
}
else
{
error_no_permission();
}
}
}
else

				}
}
else
{
error_no_permission();
}
}
}
else

	{
error($lang->redirect_nodelete);
}

	{
error($lang->redirect_nodelete);
}

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

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

		}

		}

		else
{
$firstpost = 0;

		else
{
$firstpost = 0;

Zeile 428Zeile 430
				else
{
redirect(get_forum_link($fid), $lang->redirect_threadrestored);

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

				}
}
else
{
error_no_permission();
}
}
else

				}
}
else
{
error_no_permission();
}
}
else

		{
if(is_moderator($fid, "canrestoreposts"))
{

		{
if(is_moderator($fid, "canrestoreposts"))
{

Zeile 540Zeile 542
			$lang->redirect_postedited = $lang->redirect_postedited_poll;
}
else if($visible == 0 && $first_post && !is_moderator($fid, "canviewunapprove", $mybb->user['uid']))

			$lang->redirect_postedited = $lang->redirect_postedited_poll;
}
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 580Zeile 582
	eval("\$loginbox = \"".$templates->get("changeuserbox")."\";");

$deletebox = '';

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

Zeile 647Zeile 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")."\";");