Vergleich newthread.php - 1.4.1 - 1.4.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: newthread.php 4081 2008-08-08 01:47:02Z Tikitiki $

 * $Id: newthread.php 4352 2009-04-18 22:25:55Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 98Zeile 98
{
if(!$mybb->input['previewpost'] && $mybb->input['action'] != "do_newthread")
{

{
if(!$mybb->input['previewpost'] && $mybb->input['action'] != "do_newthread")
{

		$username = $lang->guest;

		$username = '';

	}
else
{

	}
else
{

Zeile 127Zeile 127
// Handle attachments if we've got any.
if(!$mybb->input['attachmentaid'] && ($mybb->input['newattachment'] || ($mybb->input['action'] == "do_newthread" && $mybb->input['submit'] && $_FILES['attachment'])))
{

// Handle attachments if we've got any.
if(!$mybb->input['attachmentaid'] && ($mybb->input['newattachment'] || ($mybb->input['action'] == "do_newthread" && $mybb->input['submit'] && $_FILES['attachment'])))
{

	// If there's an attachment, check it and upload it
if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0)












	if($mybb->input['action'] == "editdraft" || ($mybb->input['tid'] && $mybb->input['pid']))
{
$attachwhere = "pid='{$pid}'";
}
else
{
$attachwhere = "posthash='".$db->escape_string($mybb->input['posthash'])."'";
}
$query = $db->simple_select("attachments", "COUNT(aid) as numattachs", $attachwhere);
$attachcount = $db->fetch_field($query, "numattachs");

// If there's an attachment, check it and upload it
if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0 && ($mybb->settings['maxattachments'] == 0 || $attachcount < $mybb->settings['maxattachments']))

	{
require_once MYBB_ROOT."inc/functions_upload.php";
$attachedfile = upload_attachment($_FILES['attachment']);

	{
require_once MYBB_ROOT."inc/functions_upload.php";
$attachedfile = upload_attachment($_FILES['attachment']);

Zeile 138Zeile 149
	if($attachedfile['error'])
{
eval("\$attacherror = \"".$templates->get("error_attacherror")."\";");

	if($attachedfile['error'])
{
eval("\$attacherror = \"".$templates->get("error_attacherror")."\";");

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

		$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 we were dealing with an attachment but didn't click 'Post Thread', force the new thread page again.
if(!$mybb->input['submit'])

Zeile 174Zeile 185
		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")
{

Zeile 206Zeile 217
			if(!$mybb->user['uid'])
{
my_setcookie('loginattempts', $logins + 1);

			if(!$mybb->user['uid'])
{
my_setcookie('loginattempts', $logins + 1);

				$db->write_query("UPDATE ".TABLE_PREFIX."sessions SET loginattempts=loginattempts+1 WHERE sid = '{$session->sid}'");

				$db->write_query("UPDATE ".TABLE_PREFIX."users SET loginattempts=loginattempts+1 WHERE username = '".$db->escape_string($mybb->input['username'])."'");

				if($mybb->settings['failedlogintext'] == 1)
{
$login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);

				if($mybb->settings['failedlogintext'] == 1)
{
$login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);

Zeile 222Zeile 233
			// Update the session to contain their user ID
$updated_session = array(
"uid" => $mybb->user['uid'],

			// Update the session to contain their user ID
$updated_session = array(
"uid" => $mybb->user['uid'],

				"loginattempts" => 0
);

			);


			$db->update_query("sessions", $updated_session, "sid='{$session->sid}'");

			$db->update_query("sessions", $updated_session, "sid='{$session->sid}'");

			



			
$db->update_query("users", array("loginattempts" => 1), "uid='{$mybb->user['uid']}'");


			// Set uid and username
$uid = $mybb->user['uid'];
$username = $mybb->user['username'];

			// Set uid and username
$uid = $mybb->user['uid'];
$username = $mybb->user['username'];

Zeile 233Zeile 245
			// Check if this user is allowed to post here
$mybb->usergroup = &$groupscache[$mybb->user['usergroup']];
$forumpermissions = forum_permissions($fid);

			// Check if this user is allowed to post here
$mybb->usergroup = &$groupscache[$mybb->user['usergroup']];
$forumpermissions = forum_permissions($fid);

			if($forumpermissions['canview'] == 0 || $forumpermissions['canpostreplys'] == 0 || $mybb->user['suspendposting'] == 1)

			if($forumpermissions['canview'] == 0 || $forumpermissions['canpostthreads'] == 0 || $mybb->user['suspendposting'] == 1)

			{
error_no_permission();

			{
error_no_permission();

			}

			}

		}
// This username does not exist.
else

		}
// This username does not exist.
else

Zeile 259Zeile 271
	{
$username = $mybb->user['username'];
$uid = $mybb->user['uid'];

	{
$username = $mybb->user['username'];
$uid = $mybb->user['uid'];

	}

	}

	
// Attempt to see if this post is a duplicate or not
if($uid > 0)
{
$user_check = "p.uid='{$uid}'";

	
// 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)."'";
}
if(!$mybb->input['savedraft'] && !$pid)

	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.posthash='".$db->escape_string($mybb->input['posthash'])."'");
$duplicate_check = $db->fetch_field($query, "pid");
if($duplicate_check)

		$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.posthash='".$db->escape_string($mybb->input['posthash'])."'");
$duplicate_check = $db->fetch_field($query, "pid");
if($duplicate_check)

Zeile 306Zeile 318
	if($mybb->input['savedraft'] && $mybb->user['uid'])
{
$new_thread['savedraft'] = 1;

	if($mybb->input['savedraft'] && $mybb->user['uid'])
{
$new_thread['savedraft'] = 1;

	}

	}

	else

	else

	{

	{

		$new_thread['savedraft'] = 0;

		$new_thread['savedraft'] = 0;

	}

	}

	
// Is this thread already a draft and we're updating it?
if(isset($thread['tid']) && $thread['visible'] == -2)
{
$new_thread['tid'] = $thread['tid'];

	
// Is this thread already a draft and we're updating it?
if(isset($thread['tid']) && $thread['visible'] == -2)
{
$new_thread['tid'] = $thread['tid'];

	}


	}


	// Set up the thread options from the input.
$new_thread['options'] = array(
"signature" => $mybb->input['postoptions']['signature'],

	// Set up the thread options from the input.
$new_thread['options'] = array(
"signature" => $mybb->input['postoptions']['signature'],

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

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

 
		$posticons = get_post_icons();

	}

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

	}

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

Zeile 873Zeile 886

$plugins->run_hooks("newthread_end");



$plugins->run_hooks("newthread_end");


 
	$forum['name'] = strip_tags($forum['name']);

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


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


	$forum['name'] = strip_tags($forum['name']);


 
	eval("\$newthread = \"".$templates->get("newthread")."\";");
output_page($newthread);


	eval("\$newthread = \"".$templates->get("newthread")."\";");
output_page($newthread);