Vergleich newthread.php - 1.4.2 - 1.4.15

  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 4143 2008-08-22 02:47:25Z Tikitiki $

 * $Id: newthread.php 5379 2011-02-21 11:06:42Z Tomm $

 */

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'])))
{

 
	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


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

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

Zeile 149Zeile 152
	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 160Zeile 163
}

// Are we removing an attachment from the thread?

}

// Are we removing an attachment from the thread?

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

if($mybb->input['attachmentaid'] && $mybb->input['attachmentact'] == "remove" && $mybb->input['posthash'])

{

{

 
	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


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

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

Zeile 175Zeile 181

// Check the maximum posts per day for this user
if($mybb->settings['maxposts'] > 0 && $mybb->usergroup['cancp'] != 1)


// Check the maximum posts per day for this user
if($mybb->settings['maxposts'] > 0 && $mybb->usergroup['cancp'] != 1)

{

{

	$daycut = TIME_NOW-60*60*24;
$query = $db->simple_select("posts", "COUNT(*) AS posts_today", "uid='{$mybb->user['uid']}' AND visible='1' AND dateline>{$daycut}");
$post_count = $db->fetch_field($query, "posts_today");

	$daycut = TIME_NOW-60*60*24;
$query = $db->simple_select("posts", "COUNT(*) AS posts_today", "uid='{$mybb->user['uid']}' AND visible='1' AND dateline>{$daycut}");
$post_count = $db->fetch_field($query, "posts_today");

Zeile 217Zeile 223
			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);
}
error($lang->error_invalidpassword.$login_text);

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

			}

			}

			// Otherwise they've logged in successfully.

$mybb->input['username'] = $username = $mybb->user['username'];

			// Otherwise they've logged in successfully.

$mybb->input['username'] = $username = $mybb->user['username'];

Zeile 233Zeile 239
			// 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'];

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

Zeile 244Zeile 251
			// 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 270Zeile 277
	{
$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)

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

	{

	{

		$user_check = "p.uid='{$uid}'";

		$user_check = "p.uid='{$uid}'";

	}

	}

	else

	else

	{

	{

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

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

	}
if(!$mybb->input['savedraft'] && !$pid)
{

	}
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 317Zeile 324
	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;
}


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

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

 
		if($forum['allowpicons'] != 0)
{
$posticons = get_post_icons();
}

	}

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

	}

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

Zeile 727Zeile 738
	// Setup a unique posthash for attachment management
if(!$mybb->input['posthash'] && $mybb->input['action'] != "editdraft")
{

	// Setup a unique posthash for attachment management
if(!$mybb->input['posthash'] && $mybb->input['action'] != "editdraft")
{

	    mt_srand((double) microtime() * 1000000);
$posthash = md5($mybb->user['uid'].mt_rand());





	    $posthash = md5($mybb->user['uid'].random_str());
}
elseif($mybb->input['action'] == "editdraft")
{
// Drafts have posthashes, too...
$posthash = $post['posthash'];

	}
else
{

	}
else
{

Zeile 737Zeile 752

// Can we disable smilies or are they disabled already?
if($forum['allowsmilies'] != 0)


// Can we disable smilies or are they disabled already?
if($forum['allowsmilies'] != 0)

	{

	{

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

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

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

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

		}
else
{

		}
else
{

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

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

		}
else

		}
else

		{
$stickycheck = '';
}

		{
$stickycheck = '';
}

Zeile 769Zeile 784
		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 785Zeile 800
		if($mybb->input['action'] == "editdraft" || ($mybb->input['tid'] && $mybb->input['pid']))
{
$attachwhere = "pid='$pid'";

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

		}

		}

		else
{
$attachwhere = "posthash='".$db->escape_string($posthash)."'";

		else
{
$attachwhere = "posthash='".$db->escape_string($posthash)."'";

Zeile 793Zeile 808
		$query = $db->simple_select("attachments", "*", $attachwhere);
$attachments = '';
while($attachment = $db->fetch_array($query))

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

		{

		{

			$attachment['size'] = get_friendly_size($attachment['filesize']);
$attachment['icon'] = get_attachment_icon(get_extension($attachment['filename']));
if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && (!$mybb->user['uid'] || $mybb->user['showcodebuttons'] != 0))

			$attachment['size'] = get_friendly_size($attachment['filesize']);
$attachment['icon'] = get_attachment_icon(get_extension($attachment['filename']));
if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && (!$mybb->user['uid'] || $mybb->user['showcodebuttons'] != 0))

			{

			{

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

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

			}

			}

			$attach_mod_options = '';
if($attachment['visible'] != 1)
{
eval("\$attachments .= \"".$templates->get("post_attachments_attachment_unapproved")."\";");

			$attach_mod_options = '';
if($attachment['visible'] != 1)
{
eval("\$attachments .= \"".$templates->get("post_attachments_attachment_unapproved")."\";");

			}
else

			}
else

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

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

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

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

	}


	}


	// Show captcha image for guests if enabled
if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])
{

	// Show captcha image for guests if enabled
if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])
{

Zeile 884Zeile 899

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