Vergleich editpost.php - 1.6.13 - 1.6.14

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 172Zeile 172
{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

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


$query = $db->simple_select("attachments", "COUNT(aid) as numattachs", "pid='{$pid}'");
$attachcount = $db->fetch_field($query, "numattachs");

 

// If there's an attachment, check it and upload it


// If there's an attachment, check it and upload it

	if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0 && ($mybb->settings['maxattachments'] == 0 || $attachcount < $mybb->settings['maxattachments']))

	if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0)

	{

	{

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


		$update_attachment = false;

		$update_attachment = false;

		if($mybb->input['updateattachment'] && ($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']))

		if($updateattach > 0 && $mybb->input['updateattachment'] && ($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']))

		{
$update_attachment = true;
}
$attachedfile = upload_attachment($_FILES['attachment'], $update_attachment);
}
if($attachedfile['error'])

		{
$update_attachment = true;
}
$attachedfile = upload_attachment($_FILES['attachment'], $update_attachment);
}
if($attachedfile['error'])

	{

	{

		eval("\$attacherror = \"".$templates->get("error_attacherror")."\";");

		eval("\$attacherror = \"".$templates->get("error_attacherror")."\";");

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

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

	}
}


	}
}


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

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

	{

	{

		$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(!$mybb->input['submit'])

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

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

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


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


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

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

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

			}

			}

			// Moderating options
$attach_mod_options = '';
if(is_moderator($fid))

			// Moderating options
$attach_mod_options = '';
if(is_moderator($fid))

Zeile 443Zeile 443
		if($usage['ausage'] > ($mybb->usergroup['attachquota']*1024) && $mybb->usergroup['attachquota'] != 0)
{
$noshowattach = 1;

		if($usage['ausage'] > ($mybb->usergroup['attachquota']*1024) && $mybb->usergroup['attachquota'] != 0)
{
$noshowattach = 1;

		}

		}

		if($mybb->usergroup['attachquota'] == 0)

		if($mybb->usergroup['attachquota'] == 0)

		{

		{

			$friendlyquota = $lang->unlimited;
}
else

			$friendlyquota = $lang->unlimited;
}
else

		{

		{

			$friendlyquota = get_friendly_size($mybb->usergroup['attachquota']*1024);
}
$friendlyusage = get_friendly_size($usage['ausage']);
$lang->attach_quota = $lang->sprintf($lang->attach_quota, $friendlyusage, $friendlyquota);
if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach)

			$friendlyquota = get_friendly_size($mybb->usergroup['attachquota']*1024);
}
$friendlyusage = get_friendly_size($usage['ausage']);
$lang->attach_quota = $lang->sprintf($lang->attach_quota, $friendlyusage, $friendlyquota);
if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach)

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







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

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

if($attach_add_options || $attach_update_options)
{

			eval("\$newattach = \"".$templates->get("post_attachments_new")."\";");
}

			eval("\$newattach = \"".$templates->get("post_attachments_new")."\";");
}

 


		eval("\$attachbox = \"".$templates->get("post_attachments")."\";");
}
if(!$mybb->input['attachmentaid'] && !$mybb->input['newattachment'] && !$mybb->input['updateattachment'] && !$mybb->input['previewpost'] && !$maximageserror)

		eval("\$attachbox = \"".$templates->get("post_attachments")."\";");
}
if(!$mybb->input['attachmentaid'] && !$mybb->input['newattachment'] && !$mybb->input['updateattachment'] && !$mybb->input['previewpost'] && !$maximageserror)

Zeile 471Zeile 477
		$subject = $post['subject'];
}
else

		$subject = $post['subject'];
}
else

	{

	{

		$message = $mybb->input['message'];
$subject = $mybb->input['subject'];
}

		$message = $mybb->input['message'];
$subject = $mybb->input['subject'];
}

Zeile 506Zeile 512
			"emailnotify" => $mybb->input['postoptions']['emailnotify'],
"disablesmilies" => $mybb->input['postoptions']['disablesmilies']
);

			"emailnotify" => $mybb->input['postoptions']['emailnotify'],
"disablesmilies" => $mybb->input['postoptions']['disablesmilies']
);





		$posthandler->set_data($post);

// Now let the post handler do all the hard work.

		$posthandler->set_data($post);

// Now let the post handler do all the hard work.

Zeile 516Zeile 522
			$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
{

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

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

Zeile 529Zeile 535
			if($postoptions['signature'] == 1)
{
$postoptionschecked['signature'] = " checked=\"checked\"";

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

			}

			}


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


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

Zeile 553Zeile 559

if($mybb->input['previewpost'])
{


if($mybb->input['previewpost'])
{

		// Figure out the poster's other information.
$query = $db->query("
SELECT u.*, f.*, p.dateline
FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.uid=u.uid)
WHERE u.uid='{$post['uid']}' AND p.pid='{$pid}'
LIMIT 1
");
$postinfo = $db->fetch_array($query);










		if(!$post['uid'])
{
$query = $db->simple_select('posts', 'username', "pid='{$pid}'");
$postinfo['username'] = $db->fetch_field($query, 'username');
}
else
{
// Figure out the poster's other information.
$query = $db->query("
SELECT u.*, f.*, p.dateline
FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.uid=u.uid)
WHERE u.uid='{$post['uid']}' AND p.pid='{$pid}'
LIMIT 1
");
$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 571Zeile 586
		}

// Set the values of the post info array.

		}

// Set the values of the post info array.

		$postinfo['userusername'] = $postinfo['username'];

 
		$postinfo['message'] = $previewmessage;
$postinfo['subject'] = $previewsubject;
$postinfo['icon'] = $icon;

		$postinfo['message'] = $previewmessage;
$postinfo['subject'] = $previewsubject;
$postinfo['icon'] = $icon;