Vergleich newthread.php - 1.2.3 - 1.2.14

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html

 *

 *

 * $Id: newthread.php 2598 2007-01-02 17:17:32Z CraKteR $

 * $Id: newthread.php 4005 2008-07-10 17:53:25Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 66Zeile 66
{
error_no_permission();
}

{
error_no_permission();
}

// Check if this forum is password protected and if we've got the right password to access it.
check_forum_password($fid, $forum['password']);



// Check if this forum is password protected and we have a valid password
check_forum_password($forum['fid']);


// If MyCode is on for this forum and the MyCode editor is enabled inthe Admin CP, draw the code buttons and smilie inserter.
if($mybb->settings['bbcodeinserter'] != "off" && $forum['allowmycode'] != "no" && (!$mybb->user['uid'] || $mybb->user['showcodebuttons'] != 0))


// If MyCode is on for this forum and the MyCode editor is enabled inthe Admin CP, draw the code buttons and smilie inserter.
if($mybb->settings['bbcodeinserter'] != "off" && $forum['allowmycode'] != "no" && (!$mybb->user['uid'] || $mybb->user['showcodebuttons'] != 0))

Zeile 76Zeile 77
	if($forum['allowsmilies'] != "no")
{
$smilieinserter = build_clickable_smilies();

	if($forum['allowsmilies'] != "no")
{
$smilieinserter = build_clickable_smilies();

	}

	}

}

// Does this forum allow post icons? If so, fetch the post icons.
if($forum['allowpicons'] != "no")
{
$posticons = get_post_icons();

}

// Does this forum allow post icons? If so, fetch the post icons.
if($forum['allowpicons'] != "no")
{
$posticons = get_post_icons();

}

}


// If we have a currently logged in user then fetch the change user box.
if($mybb->user['uid'] != 0)


// If we have a currently logged in user then fetch the change user box.
if($mybb->user['uid'] != 0)

Zeile 113Zeile 114

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


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

{

{

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


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


Zeile 129Zeile 130
	
// Error with attachments - should use new inline errors?
if($attachedfile['error'])

	
// Error with attachments - should use new inline errors?
if($attachedfile['error'])

	{

	{

		eval("\$attacherror = \"".$templates->get("error_attacherror")."\";");
$mybb->input['action'] = "newthread";
}

// If we were dealing with an attachment but didn't click 'Post Thread', force the new thread page again.

		eval("\$attacherror = \"".$templates->get("error_attacherror")."\";");
$mybb->input['action'] = "newthread";
}

// If we were dealing with an attachment but didn't click 'Post Thread', force the new thread page again.

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

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

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

// Are we removing an attachment from the thread?

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

// Are we removing an attachment from the thread?

if($mybb->input['attachmentaid'])

if($mybb->input['attachmentaid'] && $mybb->input['posthash'])

{
require_once MYBB_ROOT."inc/functions_upload.php";
remove_attachment(0, $mybb->input['posthash'], $mybb->input['attachmentaid']);

{
require_once MYBB_ROOT."inc/functions_upload.php";
remove_attachment(0, $mybb->input['posthash'], $mybb->input['attachmentaid']);

Zeile 167Zeile 168
		error($lang->error_maxposts);
}
}

		error($lang->error_maxposts);
}
}





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

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


	$plugins->run_hooks("newthread_do_newthread_start");

// If this isn't a logged in user, then we need to do some special validation.

	$plugins->run_hooks("newthread_do_newthread_start");

// If this isn't a logged in user, then we need to do some special validation.

Zeile 190Zeile 194
			//Checks to make sure the user can login; they haven't had too many tries at logging in.
//Is a fatal call if user has had too many tries
$logins = login_attempt_check();

			//Checks to make sure the user can login; they haven't had too many tries at logging in.
//Is a fatal call if user has had too many tries
$logins = login_attempt_check();





			// If the user specified a password but it is wrong, throw back invalid password.
$mybb->user = validate_password_from_username($mybb->input['username'], $mybb->input['password']);
if(!$mybb->user['uid'])

			// If the user specified a password but it is wrong, throw back invalid password.
$mybb->user = validate_password_from_username($mybb->input['username'], $mybb->input['password']);
if(!$mybb->user['uid'])

Zeile 320Zeile 324
	if(!$valid_thread)
{
$post_errors = $posthandler->get_friendly_errors();

	if(!$valid_thread)
{
$post_errors = $posthandler->get_friendly_errors();

	}


	}	


	
// Check captcha image
if($mybb->settings['captchaimage'] == "on" && function_exists("imagepng") && !$mybb->user['uid'])

	
// Check captcha image
if($mybb->settings['captchaimage'] == "on" && function_exists("imagepng") && !$mybb->user['uid'])

Zeile 333Zeile 336
		if(strtolower($imgcheck['imagestring']) != strtolower($imagestring) || !$imgcheck['imagehash'])
{
$post_errors[] = $lang->invalid_captcha;

		if(strtolower($imgcheck['imagestring']) != strtolower($imagestring) || !$imgcheck['imagehash'])
{
$post_errors[] = $lang->invalid_captcha;

		}

		}

		else
{
$db->delete_query(TABLE_PREFIX."captcha", "imagehash='$imagehash'");
$hide_captcha = true;
}
}

		else
{
$db->delete_query(TABLE_PREFIX."captcha", "imagehash='$imagehash'");
$hide_captcha = true;
}
}



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

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

Zeile 439Zeile 441
			$postoptionschecked['signature'] = "checked=\"checked\"";
}
if($post['smilieoff'] == "yes")

			$postoptionschecked['signature'] = "checked=\"checked\"";
}
if($post['smilieoff'] == "yes")

		{

		{

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

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

Zeile 539Zeile 541
			{
$post['includesig'] = "no";
}

			{
$post['includesig'] = "no";
}

	





			// Fetch attachments assigned to this post
if($mybb->input['pid'])
{

			// Fetch attachments assigned to this post
if($mybb->input['pid'])
{

				$attachwhere = "pid='".intval($mybb->input['pid'])."'";

				$attachwhere = "pid='".intval($mybb->input['pid'])."'";				

			}
else
{
$attachwhere = "posthash='".$db->escape_string($mybb->input['posthash'])."'";

			}
else
{
$attachwhere = "posthash='".$db->escape_string($mybb->input['posthash'])."'";

			}

			}

	
$query = $db->simple_select(TABLE_PREFIX."attachments", "*", $attachwhere);
while($attachment = $db->fetch_array($query))

	
$query = $db->simple_select(TABLE_PREFIX."attachments", "*", $attachwhere);
while($attachment = $db->fetch_array($query))

Zeile 563Zeile 564
		$message = htmlspecialchars_uni($mybb->input['message']);
$subject = htmlspecialchars_uni($mybb->input['subject']);
}

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

	



	// Removing an attachment or adding a new one, or showting thread errors.
else if($mybb->input['attachmentaid'] || $mybb->input['newattachment'] || $thread_errors)
{

	// Removing an attachment or adding a new one, or showting thread errors.
else if($mybb->input['attachmentaid'] || $mybb->input['newattachment'] || $thread_errors)
{

Zeile 625Zeile 626
	if($forumpermissions['canpostattachments'] != "no")
{ // Get a listing of the current attachments, if there are any
$attachcount = 0;

	if($forumpermissions['canpostattachments'] != "no")
{ // Get a listing of the current attachments, if there are any
$attachcount = 0;

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

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

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

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

Zeile 656Zeile 657
		}
$query = $db->simple_select(TABLE_PREFIX."attachments", "SUM(filesize) AS ausage", "uid='".$mybb->user['uid']."'");
$usage = $db->fetch_array($query);

		}
$query = $db->simple_select(TABLE_PREFIX."attachments", "SUM(filesize) AS ausage", "uid='".$mybb->user['uid']."'");
$usage = $db->fetch_array($query);

		if($usage['ausage'] > ($mybb->usergroup['attachquota']*1000) && $mybb->usergroup['attachquota'] != 0)

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

		{
$noshowattach = 1;
}

		{
$noshowattach = 1;
}

Zeile 666Zeile 667
		}
else
{

		}
else
{

			$friendlyquota = get_friendly_size($mybb->usergroup['attachquota']*1000);

			$friendlyquota = get_friendly_size($mybb->usergroup['attachquota']*1024);

		}
$friendlyusage = get_friendly_size($usage['ausage']);
$lang->attach_quota = sprintf($lang->attach_quota, $friendlyusage, $friendlyquota);

		}
$friendlyusage = get_friendly_size($usage['ausage']);
$lang->attach_quota = sprintf($lang->attach_quota, $friendlyusage, $friendlyquota);