Vergleich newthread.php - 1.8.28 - 1.8.39

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 36Zeile 36
{
$thread = get_thread($mybb->input['tid']);


{
$thread = get_thread($mybb->input['tid']);


	$query = $db->simple_select("posts", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."' AND visible='-2'", array('order_by' => 'dateline, pid', 'limit' => 1));

	$query = $db->simple_select("posts", "*", "tid='".$mybb->input['tid']."' AND visible='-2'", array('order_by' => 'dateline, pid', 'limit' => 1));

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


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


	if(!$thread['tid'] || !$post['pid'] || $thread['visible'] != -2 || $thread['uid'] != $mybb->user['uid'])

	if(!$thread || !$post || $thread['visible'] != -2 || $thread['uid'] != $mybb->user['uid'])

	{
error($lang->invalidthread);
}

	{
error($lang->invalidthread);
}

Zeile 95Zeile 95
check_forum_password($forum['fid']);

// If MyCode is on for this forum and the MyCode editor is enabled in the Admin CP, draw the code buttons and smilie inserter.

check_forum_password($forum['fid']);

// If MyCode is on for this forum and the MyCode editor is enabled in the Admin CP, draw the code buttons and smilie inserter.

 
$codebuttons = '';
$smilieinserter = '';

if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && (!$mybb->user['uid'] || $mybb->user['showcodebuttons'] != 0))
{
$codebuttons = build_mycode_inserter("message", $forum['allowsmilies']);

if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && (!$mybb->user['uid'] || $mybb->user['showcodebuttons'] != 0))
{
$codebuttons = build_mycode_inserter("message", $forum['allowsmilies']);

Zeile 103Zeile 105
		$smilieinserter = build_clickable_smilies();
}
}

		$smilieinserter = build_clickable_smilies();
}
}

 

$posticons = '';


// Does this forum allow post icons? If so, fetch the post icons.
if($forum['allowpicons'] != 0)


// Does this forum allow post icons? If so, fetch the post icons.
if($forum['allowpicons'] != 0)

Zeile 133Zeile 137

// If we're not performing a new thread insert and not editing a draft then we're posting a new thread.
if($mybb->input['action'] != "do_newthread" && $mybb->input['action'] != "editdraft")


// If we're not performing a new thread insert and not editing a draft then we're posting a new thread.
if($mybb->input['action'] != "do_newthread" && $mybb->input['action'] != "editdraft")

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


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


// Previewing a post, overwrite the action to the new thread action.
if(!empty($mybb->input['previewpost']))

// Previewing a post, overwrite the action to the new thread action.
if(!empty($mybb->input['previewpost']))

{

{

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

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

}

}


// Setup a unique posthash for attachment management
if(!$mybb->get_input('posthash') && !$pid)
{
$mybb->input['posthash'] = md5($mybb->user['uid'].random_str());


// Setup a unique posthash for attachment management
if(!$mybb->get_input('posthash') && !$pid)
{
$mybb->input['posthash'] = md5($mybb->user['uid'].random_str());

}


}


if((empty($_POST) && empty($_FILES)) && $mybb->get_input('processed', MyBB::INPUT_INT) == 1)

if((empty($_POST) && empty($_FILES)) && $mybb->get_input('processed', MyBB::INPUT_INT) == 1)

{

{

	error($lang->error_empty_post_input);
}

$errors = array();
$maximageserror = $attacherror = '';

	error($lang->error_empty_post_input);
}

$errors = array();
$maximageserror = $attacherror = '';





// Handle attachments if we've got any.

// Handle attachments if we've got any.

if($mybb->settings['enableattachments'] == 1 && ($mybb->get_input('newattachment') || $mybb->get_input('updateattachment') || ((($mybb->input['action'] == "do_newthread" && $mybb->get_input('submit')) || ($mybb->input['action'] == "newthread" && isset($mybb->input['previewpost'])) || isset($mybb->input['savedraft'])) && $_FILES['attachments'])))





if($mybb->settings['enableattachments'] == 1 && 
($mybb->get_input('newattachment') || $mybb->get_input('updateattachment') ||
((($mybb->input['action'] == "do_newthread" && $mybb->get_input('submit')) ||
($mybb->input['action'] == "newthread" && isset($mybb->input['previewpost'])) ||
isset($mybb->input['savedraft'])) && isset($_FILES['attachments']))))

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

if($mybb->input['action'] == "editdraft" || ($mybb->input['tid'] && $mybb->input['pid']))

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

if($mybb->input['action'] == "editdraft" || ($mybb->input['tid'] && $mybb->input['pid']))

	{

	{

		$attachwhere = "pid='{$pid}'";
}
else

		$attachwhere = "pid='{$pid}'";
}
else

Zeile 184Zeile 192
				eval("\$postinsert = \"".$templates->get("post_attachments_attachment_postinsert")."\";");
}
eval("\$attach_rem_options = \"".$templates->get("post_attachments_attachment_remove")."\";");

				eval("\$postinsert = \"".$templates->get("post_attachments_attachment_postinsert")."\";");
}
eval("\$attach_rem_options = \"".$templates->get("post_attachments_attachment_remove")."\";");

 
			$attach_mod_options = '';

			eval("\$attemplate = \"".$templates->get("post_attachments_attachment")."\";");
$ret['template'] = $attemplate;


			eval("\$attemplate = \"".$templates->get("post_attachments_attachment")."\";");
$ret['template'] = $attemplate;


Zeile 208Zeile 217
		$mybb->input['action'] = "newthread";
}
}

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


detect_attachmentact();


detect_attachmentact();


// Are we removing an attachment from the thread?
if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid', MyBB::INPUT_INT) && $mybb->get_input('attachmentact') == "remove")
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


// Are we removing an attachment from the thread?
if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid', MyBB::INPUT_INT) && $mybb->get_input('attachmentact') == "remove")
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





	remove_attachment($pid, $mybb->get_input('posthash'), $mybb->get_input('attachmentaid', MyBB::INPUT_INT));

if(!$mybb->get_input('submit'))

	remove_attachment($pid, $mybb->get_input('posthash'), $mybb->get_input('attachmentaid', MyBB::INPUT_INT));

if(!$mybb->get_input('submit'))

Zeile 225Zeile 234
	}

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

	{
$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']}");
echo json_encode(array("success" => true, "usage" => get_friendly_size($usage['ausage'])));


header("Content-type: application/json; charset={$lang->settings['charset']}");
echo json_encode(array("success" => true, "usage" => get_friendly_size($usage['ausage'])));

Zeile 594Zeile 603
					ORDER BY p.dateline, p.pid
");
while($quoted_post = $db->fetch_array($query))

					ORDER BY p.dateline, p.pid
");
while($quoted_post = $db->fetch_array($query))

				{

				{

					if($quoted_post['userusername'])
{
$quoted_post['username'] = $quoted_post['userusername'];

					if($quoted_post['userusername'])
{
$quoted_post['username'] = $quoted_post['userusername'];

Zeile 606Zeile 615
				}

$quoted_ids = "all";

				}

$quoted_ids = "all";

			}

			}

			else
{
$query = $db->query("

			else
{
$query = $db->query("

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

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

		}

		}

		$subscription_method = get_subscription_method($tid, $postoptions);
$numpolloptions = $mybb->get_input('numpolloptions', MyBB::INPUT_INT);
}

		$subscription_method = get_subscription_method($tid, $postoptions);
$numpolloptions = $mybb->get_input('numpolloptions', MyBB::INPUT_INT);
}

Zeile 678Zeile 687
		$message = htmlspecialchars_uni($post['message']);
$subject = htmlspecialchars_uni($post['subject']);
if($post['includesig'] != 0)

		$message = htmlspecialchars_uni($post['message']);
$subject = htmlspecialchars_uni($post['subject']);
if($post['includesig'] != 0)

		{

		{

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

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

		}

		}

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

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

		}

		}

		$icon = $post['icon'];
if($forum['allowpicons'] != 0)
{
$posticons = get_post_icons();
}
$subscription_method = get_subscription_method($tid); // Subscription method doesn't get saved in drafts

		$icon = $post['icon'];
if($forum['allowpicons'] != 0)
{
$posticons = get_post_icons();
}
$subscription_method = get_subscription_method($tid); // Subscription method doesn't get saved in drafts

 
		$numpolloptions = "2";

	}

// Otherwise, this is our initial visit to this page.

	}

// Otherwise, this is our initial visit to this page.

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

			}


			}


			eval("\$attach_rem_options = \"".$templates->get("post_attachments_attachment_remove")."\";");

$attach_mod_options = '';

			eval("\$attach_rem_options = \"".$templates->get("post_attachments_attachment_remove")."\";");

$attach_mod_options = '';

Zeile 1007Zeile 1017
		if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !isset($noshowattach))
{
eval("\$attach_add_options = \"".$templates->get("post_attachments_add")."\";");

		if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !isset($noshowattach))
{
eval("\$attach_add_options = \"".$templates->get("post_attachments_add")."\";");

		}

		}


$attach_update_options = '';
if(($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']) && $attachcount > 0)


$attach_update_options = '';
if(($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']) && $attachcount > 0)

		{

		{

			eval("\$attach_update_options = \"".$templates->get("post_attachments_update")."\";");

			eval("\$attach_update_options = \"".$templates->get("post_attachments_update")."\";");

		}

		}


if($attach_add_options || $attach_update_options)
{


if($attach_add_options || $attach_update_options)
{

Zeile 1022Zeile 1032
		eval("\$attachbox = \"".$templates->get("post_attachments")."\";");

$bgcolor = alt_trow();

		eval("\$attachbox = \"".$templates->get("post_attachments")."\";");

$bgcolor = alt_trow();

	}

	}

	else
{
$attachbox = '';
}


	else
{
$attachbox = '';
}


 
	$savedraftbutton = '';

	if($mybb->user['uid'])
{
eval("\$savedraftbutton = \"".$templates->get("post_savedraftbutton", 1, 0)."\";");

	if($mybb->user['uid'])
{
eval("\$savedraftbutton = \"".$templates->get("post_savedraftbutton", 1, 0)."\";");

Zeile 1052Zeile 1063

// Generate a hidden list of items for our captcha
$captcha = $post_captcha->build_hidden_captcha();


// Generate a hidden list of items for our captcha
$captcha = $post_captcha->build_hidden_captcha();

			}
}

			}
}


if(!$correct)
{


if(!$correct)
{

Zeile 1084Zeile 1095
			$captcha = $post_captcha->html;
}
}

			$captcha = $post_captcha->html;
}
}

 

$pollbox = '';


if($forumpermissions['canpostpolls'] != 0)
{


if($forumpermissions['canpostpolls'] != 0)
{

Zeile 1100Zeile 1113
			$forum['rulestitle'] = $lang->sprintf($lang->forum_rules, $forum['name']);
}


			$forum['rulestitle'] = $lang->sprintf($lang->forum_rules, $forum['name']);
}


		if(!$parser)

		if(empty($parser))

		{
require_once MYBB_ROOT.'inc/class_parser.php';
$parser = new postParser;

		{
require_once MYBB_ROOT.'inc/class_parser.php';
$parser = new postParser;