Vergleich editpost.php - 1.8.18 - 1.8.20

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

if($thread['visible'] == 0 && !is_moderator($fid, "canviewunapprove") || $thread['visible'] == -1 && !is_moderator($fid, "canviewdeleted") || ($thread['visible'] < -1 && $thread['uid'] != $mybb->user['uid']))
{


if($thread['visible'] == 0 && !is_moderator($fid, "canviewunapprove") || $thread['visible'] == -1 && !is_moderator($fid, "canviewdeleted") || ($thread['visible'] < -1 && $thread['uid'] != $mybb->user['uid']))
{

	error($lang->error_invalidthread);




	if($thread['visible'] == 0 && !($mybb->settings['showownunapproved'] && $thread['uid'] == $mybb->user['uid']))
{
error($lang->error_invalidthread);
}

}
if(!$forum || $forum['type'] != "f")
{

}
if(!$forum || $forum['type'] != "f")
{

Zeile 124Zeile 127
			error($lang->redirect_threadclosed);
}
if($forumpermissions['candeleteposts'] == 0 && $pid != $thread['firstpost'] || $forumpermissions['candeletethreads'] == 0 && $pid == $thread['firstpost'])

			error($lang->redirect_threadclosed);
}
if($forumpermissions['candeleteposts'] == 0 && $pid != $thread['firstpost'] || $forumpermissions['candeletethreads'] == 0 && $pid == $thread['firstpost'])

		{
error_no_permission();
}

		{
error_no_permission();
}

		if($mybb->user['uid'] != $post['uid'])
{
error_no_permission();
}

		if($mybb->user['uid'] != $post['uid'])
{
error_no_permission();
}

		// User can't delete unapproved post
if($post['visible'] == 0)

		// User can't delete unapproved post unless allowed for own
if($post['visible'] == 0 && !($mybb->settings['showownunapproved'] && $post['uid'] == $mybb->user['uid']))

		{
error_no_permission();
}

		{
error_no_permission();
}

Zeile 162Zeile 165
			error_no_permission();
}
if($mybb->user['uid'] != $post['uid'])

			error_no_permission();
}
if($mybb->user['uid'] != $post['uid'])

		{
error_no_permission();

		{
error_no_permission();

		}
// Edit time limit
$time = TIME_NOW;

		}
// Edit time limit
$time = TIME_NOW;

Zeile 173Zeile 176
			error($lang->edit_time_limit);
}
// User can't edit unapproved post

			error($lang->edit_time_limit);
}
// User can't edit unapproved post

		if($post['visible'] == 0 || $post['visible'] == -1)

		if(($post['visible'] == 0 && !($mybb->settings['showownunapproved'] && $post['uid'] == $mybb->user['uid'])) || $post['visible'] == -1)

		{
error_no_permission();
}

		{
error_no_permission();
}

Zeile 217Zeile 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['submit']))
{

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

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

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

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

	{

	{

		$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->get_input('ajax', MyBB::INPUT_INT) == 1)
{
header("Content-type: application/json; charset={$lang->settings['charset']}");
echo json_encode(array("success" => true));
exit();
}


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

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

Zeile 252Zeile 263
}

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

}

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

{

{

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

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

	$plugins->run_hooks("editpost_deletepost");

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

Zeile 263Zeile 274
		$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)

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

			$firstpost = 1;

		}

		}

		else
{
$firstpost = 0;

		else
{
$firstpost = 0;

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

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

		{

		{

			if($forumpermissions['candeletethreads'] == 1 || is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads"))
{
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;

			if($forumpermissions['candeletethreads'] == 1 || is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads"))
{
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;





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

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

				}

				}

				else
{
$moderation->delete_thread($tid);

				else
{
$moderation->delete_thread($tid);

Zeile 330Zeile 341

$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

				}
else

				{
$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'])
{
$redirect = get_post_link($next_post['pid'], $tid)."#pid{$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

				}
else

				{
$redirect = get_thread_link($tid);
}

				{
$redirect = get_thread_link($tid);
}

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

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

				}
}
else
{

				}
}
else
{

				error_no_permission();
}
}

				error_no_permission();
}
}

Zeile 390Zeile 401
		$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)

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

			$firstpost = 1;

		}

		}

		else

		else

		{

		{

			$firstpost = 0;
}


			$firstpost = 0;
}


Zeile 402Zeile 413
		$modlogdata['tid'] = $tid;
$modlogdata['pid'] = $pid;
if($firstpost)

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

		{

		{

			if(is_moderator($fid, "canrestorethreads"))
{
require_once MYBB_ROOT."inc/class_moderation.php";

			if(is_moderator($fid, "canrestorethreads"))
{
require_once MYBB_ROOT."inc/class_moderation.php";

Zeile 413Zeile 424
				{
header("Content-type: application/json; charset={$lang->settings['charset']}");
echo json_encode(array("data" => '1', "first" => '1'));

				{
header("Content-type: application/json; charset={$lang->settings['charset']}");
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);

Zeile 436Zeile 447
				$redirect = get_post_link($pid, $tid)."#pid{$pid}";

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

				$redirect = get_post_link($pid, $tid)."#pid{$pid}";

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

				{

				{

					header("Content-type: application/json; charset={$lang->settings['charset']}");
echo json_encode(array("data" => '1', "first" => '0'));
}

					header("Content-type: application/json; charset={$lang->settings['charset']}");
echo json_encode(array("data" => '1', "first" => '0'));
}

Zeile 672Zeile 683
		$post_errors = '';
}


		$post_errors = '';
}


	$postoptions_subscriptionmethod_dont = $postoptions_subscriptionmethod_none = $postoptions_subscriptionmethod_email = $postoptions_subscriptionmethod_pm = '';

	$subscribe = $nonesubscribe = $emailsubscribe = $pmsubscribe = '';

	$postoptionschecked = array('signature' => '', 'disablesmilies' => '');

if(!empty($mybb->input['previewpost']) || $post_errors)

	$postoptionschecked = array('signature' => '', 'disablesmilies' => '');

if(!empty($mybb->input['previewpost']) || $post_errors)

Zeile 737Zeile 748
			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")
{
$postoptions_subscriptionmethod_none = "checked=\"checked\"";
}
else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "email")
{
$postoptions_subscriptionmethod_email = "checked=\"checked\"";
}
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\"";
}

			}

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

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

		}
}

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

		}
}

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

	{

	{

		if(!$post['uid'])
{
$query = $db->simple_select('posts', 'username, dateline', "pid='{$pid}'");

		if(!$post['uid'])
{
$query = $db->simple_select('posts', 'username, dateline', "pid='{$pid}'");

Zeile 813Zeile 810
		$preview = '';

if($post['includesig'] != 0)

		$preview = '';

if($post['includesig'] != 0)

		{

		{

			$postoptionschecked['signature'] = " checked=\"checked\"";

			$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)
{
$postoptions_subscriptionmethod_none = "checked=\"checked\"";
}
else if($notification == 1)
{
$postoptions_subscriptionmethod_email = "checked=\"checked\"";
}
else if($notification == 2)
{
$postoptions_subscriptionmethod_pm = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "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

	}

// Generate thread prefix selector if this is the first post of the thread