Vergleich editpost.php - 1.8.29 - 1.8.39

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

$attacherror = '';

}

$attacherror = '';

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'])))

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']))) && isset($_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 231Zeile 231
			$usage = $db->fetch_array($query);
$ret['usage'] = get_friendly_size($usage['ausage']);
}

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

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

	}

	}


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


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

	}


	}


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

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

Zeile 249Zeile 249
	}

// 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['submitbutton']))

	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

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_post_check($mybb->get_input('my_post_key'));


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


Zeile 266Zeile 266
	if($mybb->input['attachmentact'] == "remove")
{
remove_attachment($pid, "", $mybb->input['attachmentaid']);

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

	}
elseif($mybb->get_input('attachmentact') == "approve" && is_moderator($fid, 'canapproveunapproveattachs'))

	}
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_sql = array("visible" => 1);
$db->update_query("attachments", $update_sql, "aid='{$mybb->input['attachmentaid']}'");

Zeile 304Zeile 304
	$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, pid"));
$firstcheck = $db->fetch_array($query);
if($firstcheck['pid'] == $pid)
{
$firstpost = 1;
}
else
{
$firstpost = 0;
}

$modlogdata['fid'] = $fid;
$modlogdata['tid'] = $tid;

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

$modlogdata['fid'] = $fid;
$modlogdata['tid'] = $tid;

		if($firstpost)
{
if($forumpermissions['candeletethreads'] == 1 || is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads"))

		if($firstpost)
{
if($forumpermissions['candeletethreads'] == 1 || is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads"))

Zeile 326Zeile 326
				$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);

Zeile 337Zeile 337
					$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)
{


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

Zeile 375Zeile 375

$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
{
$moderation->delete_post($pid);

				else
{
$moderation->delete_post($pid);

Zeile 394Zeile 394
					$redirect = get_thread_link($tid);
}


					$redirect = get_thread_link($tid);
}


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

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

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

Zeile 488Zeile 488
				else
{
redirect($redirect, $lang->redirect_postrestored);

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

				}
}

				}
}

			else
{
error_no_permission();

			else
{
error_no_permission();

Zeile 602Zeile 602
{
$plugins->run_hooks("editpost_action_start");


{
$plugins->run_hooks("editpost_action_start");


	if(!isset($mybb->input['previewpost']))
{
$icon = $post['icon'];
}

	$preview = '';
$posticons = '';




if($forum['allowpicons'] != 0)
{
$posticons = get_post_icons();
}


if($forum['allowpicons'] != 0)
{
$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 = '';

	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']))))



if(isset($post['visible']) && $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 698Zeile 697
			$lang->attach_usage = "";
}


			$lang->attach_usage = "";
}


		$attach_update_options = '';


		$attach_add_options = '';


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


 
		$attach_update_options = '';

		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 810Zeile 809
			{
$postoptionschecked['disablesmilies'] = " checked=\"checked\"";
}

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

			



			$subscription_method = get_subscription_method($tid, $postoptions);
${$subscription_method.'subscribe'} = "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'])

		{

		{

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

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

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

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

		else
{
// Figure out the poster's other information.

		else
{
// Figure out the poster's other information.

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

		{

		{

			$attachcache[0][$attachment['aid']] = $attachment;
}

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

			$attachcache[0][$attachment['aid']] = $attachment;
}

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

		}


		}


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

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

		$postinfo['icon'] = $icon;

		$postinfo['icon'] = $post['icon'];

		$postinfo['smilieoff'] = $postoptions['disablesmilies'];

$postbit = build_postbit($postinfo, 1);

		$postinfo['smilieoff'] = $postoptions['disablesmilies'];

$postbit = build_postbit($postinfo, 1);

Zeile 870Zeile 869
		if($post['smilieoff'] == 1)
{
$postoptionschecked['disablesmilies'] = " checked=\"checked\"";

		if($post['smilieoff'] == 1)
{
$postoptionschecked['disablesmilies'] = " checked=\"checked\"";

		}

		}


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


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

Zeile 916Zeile 915
		$lang->max_options = $lang->sprintf($lang->max_options, $mybb->settings['maxpolloptions']);
$numpolloptions = $mybb->get_input('numpolloptions', MyBB::INPUT_INT);
$postpollchecked = '';

		$lang->max_options = $lang->sprintf($lang->max_options, $mybb->settings['maxpolloptions']);
$numpolloptions = $mybb->get_input('numpolloptions', MyBB::INPUT_INT);
$postpollchecked = '';

		



		if($numpolloptions < 1)

		if($numpolloptions < 1)

		{

		{

			$numpolloptions = 2;

			$numpolloptions = 2;

		}


		}


		if($mybb->get_input('postpoll', MyBB::INPUT_INT) == 1)
{
$postpollchecked = 'checked="checked"';
}

		if($mybb->get_input('postpoll', MyBB::INPUT_INT) == 1)
{
$postpollchecked = 'checked="checked"';
}

		



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

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