Vergleich editpost.php - 1.8.26 - 1.8.27

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 207Zeile 207
	}

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

	}

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

 

if($mybb->get_input('ajax', MyBB::INPUT_INT) == 1)
{
if(isset($ret['success']))
{
$attachment = array('aid'=>'{1}', 'icon'=>'{2}', 'filename'=>'{3}', 'size'=>'{4}');
if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && $mybb->user['showcodebuttons'] != 0)
{
eval("\$postinsert = \"".$templates->get("post_attachments_attachment_postinsert")."\";");
}
// Moderating options
$attach_mod_options = '';
if(is_moderator($fid))
{
eval("\$attach_mod_options = \"".$templates->get("post_attachments_attachment_mod_unapprove")."\";");
}
eval("\$attach_rem_options = \"".$templates->get("post_attachments_attachment_remove")."\";");
eval("\$attemplate = \"".$templates->get("post_attachments_attachment")."\";");
$ret['template'] = $attemplate;

$query = $db->simple_select("attachments", "SUM(filesize) AS ausage", "uid='".$mybb->user['uid']."'");
$usage = $db->fetch_array($query);
$ret['usage'] = get_friendly_size($usage['ausage']);
}

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


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


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

Zeile 229Zeile 258
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

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

{
// Verify incoming POST request

{
// Verify incoming POST request

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

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

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

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

Zeile 253Zeile 282

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


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

 
		$query = $db->simple_select("attachments", "SUM(filesize) AS ausage", "uid='".$mybb->user['uid']."'");
$usage = $db->fetch_array($query);


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

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

		echo json_encode(array("success" => true));

		echo json_encode(array("success" => true, "usage" => get_friendly_size($usage['ausage'])));

		exit();
}


		exit();
}


Zeile 273Zeile 305

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


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

		$query = $db->simple_select("posts", "pid", "tid='{$tid}'", array("limit" => 1, "order_by" => "dateline, pid"));

		$firstcheck = $db->fetch_array($query);
if($firstcheck['pid'] == $pid)
{
$firstpost = 1;

		$firstcheck = $db->fetch_array($query);
if($firstcheck['pid'] == $pid)
{
$firstpost = 1;

		}

		}

		else
{
$firstpost = 0;

		else
{
$firstpost = 0;

Zeile 299Zeile 331

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

				{
$moderation->delete_thread($tid);
mark_reports($tid, "thread");

Zeile 351Zeile 383
					log_moderator_action($modlogdata, $lang->post_deleted);
}


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

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

				$next_post = $db->fetch_array($query);
if($next_post['pid'])
{

				$next_post = $db->fetch_array($query);
if($next_post['pid'])
{

Zeile 400Zeile 432

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


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

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

		$query = $db->simple_select("posts", "pid", "tid='{$tid}'", array("limit" => 1, "order_by" => "dateline, pid"));

		$firstcheck = $db->fetch_array($query);
if($firstcheck['pid'] == $pid)
{

		$firstcheck = $db->fetch_array($query);
if($firstcheck['pid'] == $pid)
{

Zeile 469Zeile 501
		error($lang->redirect_norestore);
}
}

		error($lang->redirect_norestore);
}
}

 

$postoptions = array();


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


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

Zeile 650Zeile 684
		}

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

		}

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

 

$link_viewattachments = '';


if($usage['ausage'] !== NULL)


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

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

Zeile 661Zeile 697
		{
$lang->attach_usage = "";
}

		{
$lang->attach_usage = "";
}

 

$attach_update_options = '';


if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach)


if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach)

		{

		{

			eval("\$attach_add_options = \"".$templates->get("post_attachments_add")."\";");
}


			eval("\$attach_add_options = \"".$templates->get("post_attachments_add")."\";");
}


Zeile 685Zeile 723
		$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'));

Zeile 753Zeile 791
			$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

		}
else

		{

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

		{

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

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

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

		{

		{

			$query = $db->simple_select('posts', 'username, dateline', "pid='{$pid}'");
$postinfo = $db->fetch_array($query);
}

			$query = $db->simple_select('posts', 'username, dateline', "pid='{$pid}'");
$postinfo = $db->fetch_array($query);
}

Zeile 833Zeile 871
		$subscription_method = get_subscription_method($tid, $postoptions);
${$subscription_method.'subscribe'} = "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
if($thread['firstpost'] == $pid)
{

	// Generate thread prefix selector if this is the first post of the thread
if($thread['firstpost'] == $pid)
{

Zeile 843Zeile 881
		}

$prefixselect = build_prefix_select($forum['fid'], $mybb->get_input('threadprefix', MyBB::INPUT_INT), 0, $thread['prefix']);

		}

$prefixselect = build_prefix_select($forum['fid'], $mybb->get_input('threadprefix', MyBB::INPUT_INT), 0, $thread['prefix']);

	}
else

	}
else

	{
$prefixselect = "";
}

	{
$prefixselect = "";
}

Zeile 864Zeile 902

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


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


$query = $db->simple_select("posts", "*", "tid='{$tid}'", array("limit" => 1, "order_by" => "dateline", "order_dir" => "asc"));


$query = $db->simple_select("posts", "*", "tid='{$tid}'", array("limit" => 1, "order_by" => "dateline, pid"));

	$firstcheck = $db->fetch_array($query);

$time = TIME_NOW;

	$firstcheck = $db->fetch_array($query);

$time = TIME_NOW;

Zeile 886Zeile 924
		}

eval("\$pollbox = \"".$templates->get("newthread_postpoll")."\";");

		}

eval("\$pollbox = \"".$templates->get("newthread_postpoll")."\";");

	}

	}

	else

	else

	{

	{

		$pollbox = '';

		$pollbox = '';

	}

	}


// Hide signature option if no permission
$signature = '';
if($mybb->usergroup['canusesig'] == 1 && !$mybb->user['suspendsignature'])
{
eval("\$signature = \"".$templates->get('editpost_signature')."\";");


// Hide signature option if no permission
$signature = '';
if($mybb->usergroup['canusesig'] == 1 && !$mybb->user['suspendsignature'])
{
eval("\$signature = \"".$templates->get('editpost_signature')."\";");

	}

	}


// Can we disable smilies or are they disabled already?
$disablesmilies = '';


// Can we disable smilies or are they disabled already?
$disablesmilies = '';

Zeile 918Zeile 956
		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;

		if($forumpermissions['mod_edit_posts'] == 1)
{
$moderation_text = $lang->moderation_forum_edits;

Zeile 931Zeile 969
		}
}


		}
}


	$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_upload_size = get_php_upload_limit();












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


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