Vergleich newthread.php - 1.2.0 - 1.2.13

  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 2192 2006-09-03 12:27:37Z chris $

 * $Id: newthread.php 3596 2008-01-20 08:27:39Z 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 154Zeile 155

$thread_errors = "";
$hide_captcha = false;


$thread_errors = "";
$hide_captcha = false;

 

// Check the maximum posts per day for this user
if($mybb->settings['maxposts'] > 0 && $mybb->usergroup['cancp'] != "yes")
{
$daycut = time()-60*60*24;
$query = $db->simple_select(TABLE_PREFIX."posts", "COUNT(*) AS posts_today", "uid='{$mybb->user['uid']}' AND visible='1' AND dateline>{$daycut}");
$post_count = $db->fetch_field($query, "posts_today");
if($post_count >= $mybb->settings['maxposts'])
{
$lang->error_maxposts = sprintf($lang->error_maxposts, $mybb->settings['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");

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

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

Zeile 188Zeile 206
					$login_text = sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);
}
error($lang->error_invalidpassword.$login_text);

					$login_text = 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'];

			my_setcookie("mybbuser", $mybb->user['uid']."_".$mybb->user['loginkey']);

			my_setcookie("mybbuser", $mybb->user['uid']."_".$mybb->user['loginkey'], null, true);

			my_setcookie('loginattempts', 1);

// Update the session to contain their user ID

			my_setcookie('loginattempts', 1);

// Update the session to contain their user ID

Zeile 236Zeile 254
	}
else
{

	}
else
{

		$user_check = "p.ipaddress='{$session->ipaddress}'";

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

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

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

Zeile 369Zeile 387
			// Visible thread
$lang->redirect_newthread .= $lang->redirect_newthread_thread;
$url = "showthread.php?tid=$tid";

			// Visible thread
$lang->redirect_newthread .= $lang->redirect_newthread_thread;
$url = "showthread.php?tid=$tid";

		}

		}


$plugins->run_hooks("newthread_do_newthread_end");



$plugins->run_hooks("newthread_do_newthread_end");


Zeile 377Zeile 395
		if(!$mybb->input['postpoll'])
{
$lang->redirect_newthread .= sprintf($lang->redirect_return_forum, $fid);

		if(!$mybb->input['postpoll'])
{
$lang->redirect_newthread .= sprintf($lang->redirect_return_forum, $fid);

		}

		}

		redirect($url, $lang->redirect_newthread);
}
}

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

		redirect($url, $lang->redirect_newthread);
}
}

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





	$plugins->run_hooks("newthread_start");

// Check the various post options if we're

	$plugins->run_hooks("newthread_start");

// Check the various post options if we're

Zeile 392Zeile 410
	// b -> removing an attachment
// c -> adding a new attachment
// d -> have errors from posting

	// b -> removing an attachment
// c -> adding a new attachment
// d -> have errors from posting

	

	

	if($mybb->input['previewpost'] || $mybb->input['attachmentaid'] || $mybb->input['newattachment'] || $thread_errors)
{
$postoptions = $mybb->input['postoptions'];
if($postoptions['signature'] == "yes")

	if($mybb->input['previewpost'] || $mybb->input['attachmentaid'] || $mybb->input['newattachment'] || $thread_errors)
{
$postoptions = $mybb->input['postoptions'];
if($postoptions['signature'] == "yes")

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

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

		if($postoptions['emailnotify'] == "yes")
{
$postoptionschecked['emailnotify'] = "checked=\"checked\"";
}
if($postoptions['disablesmilies'] == "yes")

		if($postoptions['emailnotify'] == "yes")
{
$postoptionschecked['emailnotify'] = "checked=\"checked\"";
}
if($postoptions['disablesmilies'] == "yes")

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

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

		if($mybb->input['postpoll'] == "yes")
{
$postpollchecked = "checked=\"checked\"";

		if($mybb->input['postpoll'] == "yes")
{
$postpollchecked = "checked=\"checked\"";

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

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

	}

	}

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

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

Zeile 525Zeile 543
			{
$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 549Zeile 566
		$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 611Zeile 628
	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 642Zeile 659
		}
$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 652Zeile 669
		}
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);