Vergleich newthread.php - 1.6.10 - 1.6.16

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

$templatelist = "newthread,previewpost,loginbox,changeuserbox,newthread_postpoll,posticons,codebuttons,smilieinsert,newthread_multiquote_external,post_attachments_attachment_unapproved";
$templatelist .= ",newthread_disablesmilies,newreply_modoptions,post_attachments_new,post_attachments,post_savedraftbutton,post_subscription_method,post_attachments_attachment_remove";


$templatelist = "newthread,previewpost,loginbox,changeuserbox,newthread_postpoll,posticons,codebuttons,smilieinsert,newthread_multiquote_external,post_attachments_attachment_unapproved";
$templatelist .= ",newthread_disablesmilies,newreply_modoptions,post_attachments_new,post_attachments,post_savedraftbutton,post_subscription_method,post_attachments_attachment_remove";

$templatelist .= ",forumdisplay_rules,forumdisplay_rules_link,post_attachments_attachment_postinsert,post_attachments_attachment,newthread_options_signature";

$templatelist .= ",forumdisplay_rules,forumdisplay_rules_link,post_attachments_attachment_postinsert,post_attachments_attachment,post_attachments_add,newthread_options_signature";

$templatelist .= ",member_register_regimage,member_register_regimage_recaptcha,post_captcha_hidden,post_captcha,post_captcha_recaptcha,postbit_groupimage,postbit_online,postbit_away,postbit_offline";
$templatelist .= ",postbit_avatar,postbit_find,postbit_pm,postbit_rep_button,postbit_www,postbit_email,postbit_reputation,postbit_warn,postbit_warninglevel,postbit_author_user,postbit_author_guest";
$templatelist .= ",postbit_signature,postbit_classic,postbit,postbit_attachments_thumbnails_thumbnail,postbit_attachments_images_image,postbit_attachments_attachment,postbit_attachments_attachment_unapproved";

$templatelist .= ",member_register_regimage,member_register_regimage_recaptcha,post_captcha_hidden,post_captcha,post_captcha_recaptcha,postbit_groupimage,postbit_online,postbit_away,postbit_offline";
$templatelist .= ",postbit_avatar,postbit_find,postbit_pm,postbit_rep_button,postbit_www,postbit_email,postbit_reputation,postbit_warn,postbit_warninglevel,postbit_author_user,postbit_author_guest";
$templatelist .= ",postbit_signature,postbit_classic,postbit,postbit_attachments_thumbnails_thumbnail,postbit_attachments_images_image,postbit_attachments_attachment,postbit_attachments_attachment_unapproved";

Zeile 208Zeile 208
		$lang->error_maxposts = $lang->sprintf($lang->error_maxposts, $mybb->settings['maxposts']);
error($lang->error_maxposts);
}

		$lang->error_maxposts = $lang->sprintf($lang->error_maxposts, $mybb->settings['maxposts']);
error($lang->error_maxposts);
}

 
}

// If this isn't a logged in user, then we need to do some special validation.
if($mybb->user['uid'] == 0)
{
$username = htmlspecialchars_uni($mybb->input['username']);

// Check if username exists.
if(username_exists($mybb->input['username']))
{
// If it does throw back "username is taken"
error($lang->error_usernametaken);
}
// This username does not exist.
else
{
// If they didn't specify a username then give them "Guest"
if(!$mybb->input['username'])
{
$username = $lang->guest;
}
// Otherwise use the name they specified.
else
{
$username = htmlspecialchars_uni($mybb->input['username']);
}
$uid = 0;
}
}
// This user is logged in.
else
{
$username = $mybb->user['username'];
$uid = $mybb->user['uid'];

}

// Performing the posting of a new thread.
if($mybb->input['action'] == "do_newthread" && $mybb->request_method == "post")
{
// Verify incoming POST request

}

// Performing the posting of a new thread.
if($mybb->input['action'] == "do_newthread" && $mybb->request_method == "post")
{
// Verify incoming POST request

	verify_post_check($mybb->input['my_post_key']);


	verify_post_check($mybb->input['my_post_key']);


	$plugins->run_hooks("newthread_do_newthread_start");

	$plugins->run_hooks("newthread_do_newthread_start");


// If this isn't a logged in user, then we need to do some special validation.
if($mybb->user['uid'] == 0)
{
$username = htmlspecialchars_uni($mybb->input['username']);

// Check if username exists.
if(username_exists($mybb->input['username']))
{
// If it does throw back "username is taken"
error($lang->error_usernametaken);
}
// This username does not exist.
else
{
// If they didn't specify a username then give them "Guest"
if(!$mybb->input['username'])
{
$username = $lang->guest;
}
// Otherwise use the name they specified.
else
{
$username = htmlspecialchars_uni($mybb->input['username']);
}
$uid = 0;
}
}
// This user is logged in.
else
{
$username = $mybb->user['username'];
$uid = $mybb->user['uid'];
}

 

// Attempt to see if this post is a duplicate or not
if($uid > 0)


// Attempt to see if this post is a duplicate or not
if($uid > 0)

	{

	{

		$user_check = "p.uid='{$uid}'";
}
else
{
$user_check = "p.ipaddress='".$db->escape_string($session->ipaddress)."'";

		$user_check = "p.uid='{$uid}'";
}
else
{
$user_check = "p.ipaddress='".$db->escape_string($session->ipaddress)."'";

	}

	}

	if(!$mybb->input['savedraft'] && !$pid)
{
$query = $db->simple_select("posts p", "p.pid", "$user_check AND p.fid='{$forum['fid']}' AND p.subject='".$db->escape_string($mybb->input['subject'])."' AND p.message='".$db->escape_string($mybb->input['message'])."' AND p.dateline>".(TIME_NOW-600));

	if(!$mybb->input['savedraft'] && !$pid)
{
$query = $db->simple_select("posts p", "p.pid", "$user_check AND p.fid='{$forum['fid']}' AND p.subject='".$db->escape_string($mybb->input['subject'])."' AND p.message='".$db->escape_string($mybb->input['message'])."' AND p.dateline>".(TIME_NOW-600));

Zeile 292Zeile 292
	if($pid != '')
{
$new_thread['pid'] = $pid;

	if($pid != '')
{
$new_thread['pid'] = $pid;

	}


	}


	// Are we saving a draft thread?
if($mybb->input['savedraft'] && $mybb->user['uid'])
{

	// Are we saving a draft thread?
if($mybb->input['savedraft'] && $mybb->user['uid'])
{

Zeile 316Zeile 316
		"subscriptionmethod" => $mybb->input['postoptions']['subscriptionmethod'],
"disablesmilies" => $mybb->input['postoptions']['disablesmilies']
);

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





	// Apply moderation options if we have them
$new_thread['modoptions'] = $mybb->input['modoptions'];


	// Apply moderation options if we have them
$new_thread['modoptions'] = $mybb->input['modoptions'];


	$posthandler->set_data($new_thread);


	$posthandler->set_data($new_thread);


	// Now let the post handler do all the hard work.
$valid_thread = $posthandler->validate_thread();

$post_errors = array();
// Fetch friendly error messages if this is an invalid thread
if(!$valid_thread)

	// Now let the post handler do all the hard work.
$valid_thread = $posthandler->validate_thread();

$post_errors = array();
// Fetch friendly error messages if this is an invalid thread
if(!$valid_thread)

	{

	{

		$post_errors = $posthandler->get_friendly_errors();
}

		$post_errors = $posthandler->get_friendly_errors();
}





	// Check captcha image
if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
{

	// Check captcha image
if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
{

Zeile 339Zeile 339
		$post_captcha = new captcha;

if($post_captcha->validate_captcha() == false)

		$post_captcha = new captcha;

if($post_captcha->validate_captcha() == false)

		{

		{

			// CAPTCHA validation failed
foreach($post_captcha->get_errors() as $error)
{
$post_errors[] = $error;
}

			// CAPTCHA validation failed
foreach($post_captcha->get_errors() as $error)
{
$post_errors[] = $error;
}

		}

		}

		else
{
$hide_captcha = true;

		else
{
$hide_captcha = true;

		}
}


		}
}


	// One or more errors returned, fetch error list and throw to newthread page
if(count($post_errors) > 0)
{

	// One or more errors returned, fetch error list and throw to newthread page
if(count($post_errors) > 0)
{

Zeile 364Zeile 364
		$thread_info = $posthandler->insert_thread();
$tid = $thread_info['tid'];
$visible = $thread_info['visible'];

		$thread_info = $posthandler->insert_thread();
$tid = $thread_info['tid'];
$visible = $thread_info['visible'];

 

// Invalidate solved captcha
if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
{
$post_captcha->invalidate_captcha();
}


// Mark thread as read
require_once MYBB_ROOT."inc/functions_indicators.php";


// Mark thread as read
require_once MYBB_ROOT."inc/functions_indicators.php";

Zeile 385Zeile 391

// This thread is stuck in the moderation queue, send them back to the forum.
else if(!$visible)


// This thread is stuck in the moderation queue, send them back to the forum.
else if(!$visible)

		{

		{

			// Moderated thread
if($mybb->user['showredirect'] != 1)
{
// User must see moderation notice, regardless of redirect settings
$mybb->user['showredirect'] = 1;
}

			// Moderated thread
if($mybb->user['showredirect'] != 1)
{
// User must see moderation notice, regardless of redirect settings
$mybb->user['showredirect'] = 1;
}





			$lang->redirect_newthread .= $lang->redirect_newthread_moderation;
$url = get_forum_link($fid);

			$lang->redirect_newthread .= $lang->redirect_newthread_moderation;
$url = get_forum_link($fid);

		}


		}


		// This is just a normal thread - send them to it.
else
{

		// This is just a normal thread - send them to it.
else
{

Zeile 407Zeile 413

// Mark any quoted posts so they're no longer selected - attempts to maintain those which weren't selected
if($mybb->input['quoted_ids'] && $mybb->cookies['multiquote'] && $mybb->settings['multiquote'] != 0)


// Mark any quoted posts so they're no longer selected - attempts to maintain those which weren't selected
if($mybb->input['quoted_ids'] && $mybb->cookies['multiquote'] && $mybb->settings['multiquote'] != 0)

		{

		{

			// We quoted all posts - remove the entire cookie
if($mybb->input['quoted_ids'] == "all")
{
my_unsetcookie("multiquote");
}

			// We quoted all posts - remove the entire cookie
if($mybb->input['quoted_ids'] == "all")
{
my_unsetcookie("multiquote");
}

		}

$plugins->run_hooks("newthread_do_newthread_end");


		}

$plugins->run_hooks("newthread_do_newthread_end");


		// Hop to it! Send them to the next page.
if(!$mybb->input['postpoll'])
{

		// Hop to it! Send them to the next page.
if(!$mybb->input['postpoll'])
{

Zeile 428Zeile 434

if($mybb->input['action'] == "newthread" || $mybb->input['action'] == "editdraft")
{


if($mybb->input['action'] == "newthread" || $mybb->input['action'] == "editdraft")
{



 
	$plugins->run_hooks("newthread_start");

	$plugins->run_hooks("newthread_start");

 

// Do we have attachment errors?
if(count($errors) > 0)
{
$thread_errors = inline_error($errors);
}


// If this isn't a preview and we're not editing a draft, then handle quoted posts
if(!$mybb->input['previewpost'] && !$thread_errors && $mybb->input['action'] != "editdraft")


// If this isn't a preview and we're not editing a draft, then handle quoted posts
if(!$mybb->input['previewpost'] && !$thread_errors && $mybb->input['action'] != "editdraft")

Zeile 564Zeile 575
	// Editing a draft thread
else if($mybb->input['action'] == "editdraft" && $mybb->user['uid'])
{

	// Editing a draft thread
else if($mybb->input['action'] == "editdraft" && $mybb->user['uid'])
{

 
		$mybb->input['threadprefix'] = $thread['prefix'];

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

Zeile 584Zeile 596
			$postoptions_subscriptionmethod_none = "checked=\"checked\"";
}
else if($postoptions['subscriptionmethod'] == "instant")

			$postoptions_subscriptionmethod_none = "checked=\"checked\"";
}
else if($postoptions['subscriptionmethod'] == "instant")

		{
$postoptions_subscriptionmethod_instant = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";

		{
$postoptions_subscriptionmethod_instant = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";

		}
}


		}
}


Zeile 603Zeile 615
		if($mybb->user['subscriptionmethod'] ==  1)
{
$postoptions_subscriptionmethod_none = "checked=\"checked\"";

		if($mybb->user['subscriptionmethod'] ==  1)
{
$postoptions_subscriptionmethod_none = "checked=\"checked\"";

		}

		}

		else if($mybb->user['subscriptionmethod'] == 2)
{
$postoptions_subscriptionmethod_instant = "checked=\"checked\"";

		else if($mybb->user['subscriptionmethod'] == 2)
{
$postoptions_subscriptionmethod_instant = "checked=\"checked\"";

Zeile 646Zeile 658
		// Now let the post handler do all the hard work.
$valid_thread = $posthandler->verify_message();
$valid_subject = $posthandler->verify_subject();

		// Now let the post handler do all the hard work.
$valid_thread = $posthandler->verify_message();
$valid_subject = $posthandler->verify_subject();

 

// guest post --> verify author
if($new_thread['uid'] == 0)
{
$valid_username = $posthandler->verify_author();
}
else
{
$valid_username = true;
}


$post_errors = array();
// Fetch friendly error messages if this is an invalid post


$post_errors = array();
// Fetch friendly error messages if this is an invalid post

		if(!$valid_thread || !$valid_subject)

		if(!$valid_thread || !$valid_subject || !$valid_username)

		{
$post_errors = $posthandler->get_friendly_errors();
}

		{
$post_errors = $posthandler->get_friendly_errors();
}

Zeile 721Zeile 743
	{
$message = htmlspecialchars_uni($mybb->input['message']);
$subject = htmlspecialchars_uni($mybb->input['subject']);

	{
$message = htmlspecialchars_uni($mybb->input['message']);
$subject = htmlspecialchars_uni($mybb->input['subject']);

	}

// Do we have attachment errors?
if(count($errors) > 0)
{
$thread_errors = inline_error($errors);

 
	}

// Generate thread prefix selector
if(!intval($mybb->input['threadprefix']))
{
$mybb->input['threadprefix'] = 0;

	}

// Generate thread prefix selector
if(!intval($mybb->input['threadprefix']))
{
$mybb->input['threadprefix'] = 0;

	}


	}


	$prefixselect = build_prefix_select($forum['fid'], $mybb->input['threadprefix']);

$posthash = htmlspecialchars_uni($mybb->input['posthash']);

	$prefixselect = build_prefix_select($forum['fid'], $mybb->input['threadprefix']);

$posthash = htmlspecialchars_uni($mybb->input['posthash']);

Zeile 745Zeile 761
		eval("\$disablesmilies = \"".$templates->get("newthread_disablesmilies")."\";");
}
else

		eval("\$disablesmilies = \"".$templates->get("newthread_disablesmilies")."\";");
}
else

	{

	{

		$disablesmilies = "<input type=\"hidden\" name=\"postoptions[disablesmilies]\" value=\"no\" />";
}


		$disablesmilies = "<input type=\"hidden\" name=\"postoptions[disablesmilies]\" value=\"no\" />";
}


Zeile 756Zeile 772
		if($modoptions['closethread'] == 1)
{
$closecheck = "checked=\"checked\"";

		if($modoptions['closethread'] == 1)
{
$closecheck = "checked=\"checked\"";

		}

		}

		else
{
$closecheck = '';

		else
{
$closecheck = '';

Zeile 773Zeile 789
		eval("\$modoptions = \"".$templates->get("newreply_modoptions")."\";");
$bgcolor = "trow1";
$bgcolor2 = "trow2";

		eval("\$modoptions = \"".$templates->get("newreply_modoptions")."\";");
$bgcolor = "trow1";
$bgcolor2 = "trow2";

	}

	}

	else
{
$bgcolor = "trow2";

	else
{
$bgcolor = "trow2";

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


			}

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


			$attach_mod_options = '';
if($attachment['visible'] != 1)

			$attach_mod_options = '';
if($attachment['visible'] != 1)

			{

			{

				eval("\$attachments .= \"".$templates->get("post_attachments_attachment_unapproved")."\";");

				eval("\$attachments .= \"".$templates->get("post_attachments_attachment_unapproved")."\";");

			}

			}

			else
{
eval("\$attachments .= \"".$templates->get("post_attachments_attachment")."\";");
}
$attachcount++;

			else
{
eval("\$attachments .= \"".$templates->get("post_attachments_attachment")."\";");
}
$attachcount++;

		}

		}

		$query = $db->simple_select("attachments", "SUM(filesize) AS ausage", "uid='".$mybb->user['uid']."'");
$usage = $db->fetch_array($query);
if($usage['ausage'] > ($mybb->usergroup['attachquota']*1024) && $mybb->usergroup['attachquota'] != 0)

		$query = $db->simple_select("attachments", "SUM(filesize) AS ausage", "uid='".$mybb->user['uid']."'");
$usage = $db->fetch_array($query);
if($usage['ausage'] > ($mybb->usergroup['attachquota']*1024) && $mybb->usergroup['attachquota'] != 0)

Zeile 838Zeile 854
		$lang->attach_quota = $lang->sprintf($lang->attach_quota, $friendlyusage, $friendlyquota);
if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach)
{

		$lang->attach_quota = $lang->sprintf($lang->attach_quota, $friendlyusage, $friendlyquota);
if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach)
{

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

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

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

Zeile 864Zeile 881
			if($post_captcha->validate_captcha() == true)
{
$correct = true;

			if($post_captcha->validate_captcha() == true)
{
$correct = true;





				// 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();
}

Zeile 887Zeile 904
			}
}
else if($correct && $post_captcha->type == 2)

			}
}
else if($correct && $post_captcha->type == 2)

		{

		{

			$post_captcha->build_recaptcha();

if($post_captcha->html)

			$post_captcha->build_recaptcha();

if($post_captcha->html)

Zeile 910Zeile 927
		if(!$forum['rulestitle'])
{
$forum['rulestitle'] = $lang->sprintf($lang->forum_rules, $forum['name']);

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

		}

		}


if(!$parser)
{


if(!$parser)
{

Zeile 944Zeile 961
	$lang->newthread_in = $lang->sprintf($lang->newthread_in, $forum['name']);

$newthread_template = $templates->get("newthread");

	$lang->newthread_in = $lang->sprintf($lang->newthread_in, $forum['name']);

$newthread_template = $templates->get("newthread");





	// Hide signature option if no permission
$option_signature = '';
if($mybb->usergroup['canusesig'] && !$mybb->user['suspendsignature'])

	// Hide signature option if no permission
$option_signature = '';
if($mybb->usergroup['canusesig'] && !$mybb->user['suspendsignature'])

Zeile 955Zeile 972

eval("\$newthread = \"".$newthread_template."\";");
output_page($newthread);


eval("\$newthread = \"".$newthread_template."\";");
output_page($newthread);



 
}
?>

}
?>