Vergleich newthread.php - 1.4.3 - 1.4.8

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

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

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

Zeile 256Zeile 257
			if(!$mybb->input['username'])
{
$username = $lang->guest;

			if(!$mybb->input['username'])
{
$username = $lang->guest;

			}

			}

			// Otherwise use the name they specified.
else
{

			// Otherwise use the name they specified.
else
{

Zeile 266Zeile 267
		}
}
// This user is logged in.

		}
}
// This user is logged in.

	else
{

	else
{

		$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)."'";

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

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


Zeile 340Zeile 341
	$new_thread['modoptions'] = $mybb->input['modoptions'];

$posthandler->set_data($new_thread);

	$new_thread['modoptions'] = $mybb->input['modoptions'];

$posthandler->set_data($new_thread);

	

	

	// Now let the post handler do all the hard work.
$valid_thread = $posthandler->validate_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 = array();
// Fetch friendly error messages if this is an invalid thread
if(!$valid_thread)
{
$post_errors = $posthandler->get_friendly_errors();

	}


	}


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

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

Zeile 399Zeile 400
		{
$url = "polls.php?action=newpoll&tid=$tid&polloptions=".intval($mybb->input['numpolloptions']);
$lang->redirect_newthread .= $lang->redirect_newthread_poll;

		{
$url = "polls.php?action=newpoll&tid=$tid&polloptions=".intval($mybb->input['numpolloptions']);
$lang->redirect_newthread .= $lang->redirect_newthread_poll;

		}


		}


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

Zeile 411Zeile 412

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


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

		{

		{

			// Visible thread
$lang->redirect_newthread .= $lang->redirect_newthread_thread;
$url = get_thread_link($tid);

			// Visible thread
$lang->redirect_newthread .= $lang->redirect_newthread_thread;
$url = get_thread_link($tid);

Zeile 431Zeile 432
		
// 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'])

		{

		{

			$lang->redirect_newthread .= $lang->sprintf($lang->redirect_return_forum, get_forum_link($fid));
}
redirect($url, $lang->redirect_newthread);

			$lang->redirect_newthread .= $lang->sprintf($lang->redirect_return_forum, get_forum_link($fid));
}
redirect($url, $lang->redirect_newthread);

Zeile 451Zeile 452
		$quoted_posts = array();
// Handle multiquote
if($mybb->cookies['multiquote'] && $mybb->settings['multiquote'] != 0)

		$quoted_posts = array();
// Handle multiquote
if($mybb->cookies['multiquote'] && $mybb->settings['multiquote'] != 0)

		{

		{

			$multiquoted = explode("|", $mybb->cookies['multiquote']);
foreach($multiquoted as $post)
{

			$multiquoted = explode("|", $mybb->cookies['multiquote']);
foreach($multiquoted as $post)
{

Zeile 471Zeile 472
			}

if(is_moderator($fid))

			}

if(is_moderator($fid))

			{

			{

				$visible_where = "AND p.visible != 2";

				$visible_where = "AND p.visible != 2";

			}

			}

			else

			else

			{

			{

				$visible_where = "AND p.visible > 0";
}

if(intval($mybb->input['load_all_quotes']) == 1)

				$visible_where = "AND p.visible > 0";
}

if(intval($mybb->input['load_all_quotes']) == 1)

			{
$query = $db->query("

			{
$query = $db->query("

					SELECT p.subject, p.message, p.pid, p.tid, p.username, p.dateline, u.username AS userusername
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

					SELECT p.subject, p.message, p.pid, p.tid, p.username, p.dateline, u.username AS userusername
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

Zeile 489Zeile 490
					WHERE p.pid IN ($quoted_posts) {$unviewable_forums} {$visible_where}
");
while($quoted_post = $db->fetch_array($query))

					WHERE p.pid IN ($quoted_posts) {$unviewable_forums} {$visible_where}
");
while($quoted_post = $db->fetch_array($query))

				{

				{

					if($quoted_post['userusername'])
{
$quoted_post['username'] = $quoted_post['userusername'];

					if($quoted_post['userusername'])
{
$quoted_post['username'] = $quoted_post['userusername'];

Zeile 498Zeile 499
					$quoted_post['message'] = preg_replace('#(^|\r|\n)/slap ([^\r\n<]*)#i', "\\1* {$quoted_post['username']} {$lang->slaps} \\2 {$lang->with_trout}", $quoted_post['message']);
$quoted_post['message'] = preg_replace("#\[attachment=([0-9]+?)\]#i", '', $quoted_post['message']);
$message .= "[quote='{$quoted_post['username']}' pid='{$quoted_post['pid']}' dateline='{$quoted_post['dateline']}']\n{$quoted_post['message']}\n[/quote]\n\n";

					$quoted_post['message'] = preg_replace('#(^|\r|\n)/slap ([^\r\n<]*)#i', "\\1* {$quoted_post['username']} {$lang->slaps} \\2 {$lang->with_trout}", $quoted_post['message']);
$quoted_post['message'] = preg_replace("#\[attachment=([0-9]+?)\]#i", '', $quoted_post['message']);
$message .= "[quote='{$quoted_post['username']}' pid='{$quoted_post['pid']}' dateline='{$quoted_post['dateline']}']\n{$quoted_post['message']}\n[/quote]\n\n";

				}

				}


$quoted_ids = "all";
}


$quoted_ids = "all";
}

Zeile 556Zeile 557
		}
else if($postoptions['subscriptionmethod'] == "instant")
{

		}
else if($postoptions['subscriptionmethod'] == "instant")
{

			$postoptions_subscriptionmethod_instant = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";
}
if($postoptions['disablesmilies'] == 1)
{

			$postoptions_subscriptionmethod_instant = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";
}
if($postoptions['disablesmilies'] == 1)
{

			$postoptionschecked['disablesmilies'] = " checked=\"checked\"";
}
if($mybb->input['postpoll'] == 1)

			$postoptionschecked['disablesmilies'] = " checked=\"checked\"";
}
if($mybb->input['postpoll'] == 1)

Zeile 587Zeile 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 804Zeile 806
			if($attachment['visible'] != 1)
{
eval("\$attachments .= \"".$templates->get("post_attachments_attachment_unapproved")."\";");

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

			}
else
{

			}
else
{

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

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

Zeile 837Zeile 839
	}

if($mybb->user['uid'])

	}

if($mybb->user['uid'])

	{

	{

		eval("\$savedraftbutton = \"".$templates->get("post_savedraftbutton", 1, 0)."\";");
}


		eval("\$savedraftbutton = \"".$templates->get("post_savedraftbutton", 1, 0)."\";");
}


Zeile 884Zeile 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);