Vergleich inc/datahandlers/post.php - 1.8.6 - 1.8.9

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 153Zeile 153
				$this->errors = array_merge($this->errors, $userhandler->get_errors());
return false;
}

				$this->errors = array_merge($this->errors, $userhandler->get_errors());
return false;
}

			



			if($userhandler->verify_username_exists())
{
// username is in use
$this->errors = array_merge($this->errors, $userhandler->get_errors());
return false;
}

			if($userhandler->verify_username_exists())
{
// username is in use
$this->errors = array_merge($this->errors, $userhandler->get_errors());
return false;
}

		}


		}


		// After all of this, if we still don't have a username, force the username as "Guest" (Note, this is not translatable as it is always a fallback)
if(!$post['username'])
{
$post['username'] = "Guest";

		// After all of this, if we still don't have a username, force the username as "Guest" (Note, this is not translatable as it is always a fallback)
if(!$post['username'])
{
$post['username'] = "Guest";

		}

return true;

		}

return true;

	}

/**

	}

/**

Zeile 182Zeile 182
		$post = &$this->data;
$subject = &$post['subject'];
$subject = trim_blank_chrs($subject);

		$post = &$this->data;
$subject = &$post['subject'];
$subject = trim_blank_chrs($subject);





		if($this->method == "update" && $post['pid'])
{
// If this is the first post there needs to be a subject, else make it the default one.

		if($this->method == "update" && $post['pid'])
{
// If this is the first post there needs to be a subject, else make it the default one.

Zeile 190Zeile 190
			{
$this->set_error("firstpost_no_subject");
return false;

			{
$this->set_error("firstpost_no_subject");
return false;

			}

			}

			elseif(my_strlen($subject) == 0)

			elseif(my_strlen($subject) == 0)

			{
$thread = get_thread($post['tid']);
$subject = "RE: ".$thread['subject'];
}
}


			{
$thread = get_thread($post['tid']);
$subject = "RE: ".$thread['subject'];
}
}


		// This is a new post
else if($this->action == "post")
{

		// This is a new post
else if($this->action == "post")
{

Zeile 270Zeile 270
		else
{
if(!isset($post['fid']))

		else
{
if(!isset($post['fid']))

			{

			{

				$post['fid'] = 0;
}
if(!$mybb->settings['mycodemessagelength'])

				$post['fid'] = 0;
}
if(!$mybb->settings['mycodemessagelength'])

Zeile 298Zeile 298

/**
* Verifies the specified post options are correct.


/**
* Verifies the specified post options are correct.

	 *

	 *

	 * @return boolean True
*/
function verify_options()

	 * @return boolean True
*/
function verify_options()

Zeile 327Zeile 327
		if($mybb->settings['postfloodcheck'] == 1 && $post['uid'] != 0 && $this->admin_override == false)
{
if($this->verify_post_merge(true) !== true)

		if($mybb->settings['postfloodcheck'] == 1 && $post['uid'] != 0 && $this->admin_override == false)
{
if($this->verify_post_merge(true) !== true)

			{

			{

				return true;
}


				return true;
}


Zeile 367Zeile 367

// Are we starting a new thread?
if(empty($post['tid']))


// Are we starting a new thread?
if(empty($post['tid']))

		{
return true;
}


		{
return true;
}


		// Are we even turned on?
if(empty($mybb->settings['postmergemins']))

		// Are we even turned on?
if(empty($mybb->settings['postmergemins']))

		{
return true;
}


		{
return true;
}


		// Assign a default separator if none is specified
if(trim($mybb->settings['postmergesep']) == "")

		// Assign a default separator if none is specified
if(trim($mybb->settings['postmergesep']) == "")

		{

		{

			$mybb->settings['postmergesep'] = "[hr]";

			$mybb->settings['postmergesep'] = "[hr]";

		}

		}


// Check to see if this person is in a usergroup that is excluded
if(is_member($mybb->settings['postmergeuignore'], $post['uid']))


// Check to see if this person is in a usergroup that is excluded
if(is_member($mybb->settings['postmergeuignore'], $post['uid']))

		{
return true;
}

		{
return true;
}


// Select the lastpost and fid information for this thread
$query = $db->simple_select("threads", "lastpost,fid", "lastposteruid='".$post['uid']."' AND tid='".$post['tid']."'", array('limit' => '1'));


// Select the lastpost and fid information for this thread
$query = $db->simple_select("threads", "lastpost,fid", "lastposteruid='".$post['uid']."' AND tid='".$post['tid']."'", array('limit' => '1'));

Zeile 395Zeile 395

// Check to see if the same author has posted within the merge post time limit
if(((int)$mybb->settings['postmergemins'] != 0 && trim($mybb->settings['postmergemins']) != "") && (TIME_NOW-$thread['lastpost']) > ((int)$mybb->settings['postmergemins']*60))


// Check to see if the same author has posted within the merge post time limit
if(((int)$mybb->settings['postmergemins'] != 0 && trim($mybb->settings['postmergemins']) != "") && (TIME_NOW-$thread['lastpost']) > ((int)$mybb->settings['postmergemins']*60))

		{

		{

			return true;
}

if($mybb->settings['postmergefignore'] == -1)
{
return true;

			return true;
}

if($mybb->settings['postmergefignore'] == -1)
{
return true;

		}

		}

		elseif($mybb->settings['postmergefignore'] != '')
{
$fids = explode(',', (string)$mybb->settings['postmergefignore']);

		elseif($mybb->settings['postmergefignore'] != '')
{
$fids = explode(',', (string)$mybb->settings['postmergefignore']);

Zeile 461Zeile 461
			$post['fid'] = $db->fetch_field($query, 'fid');
}
$forum = get_forum($post['fid']);

			$post['fid'] = $db->fetch_field($query, 'fid');
}
$forum = get_forum($post['fid']);





		// Check if this post contains more images than the forum allows
if((!isset($post['savedraft']) || $post['savedraft'] != 1) && $mybb->settings['maxpostimages'] != 0 && $permissions['cancp'] != 1)
{

		// Check if this post contains more images than the forum allows
if((!isset($post['savedraft']) || $post['savedraft'] != 1) && $mybb->settings['maxpostimages'] != 0 && $permissions['cancp'] != 1)
{

Zeile 503Zeile 503

/**
* Verifies the video count.


/**
* Verifies the video count.

	*
* @return boolean True when valid, false when not valid.

	*
* @return boolean True when valid, false when not valid.

	*/
function verify_video_count()
{

	*/
function verify_video_count()
{

Zeile 533Zeile 533

/**
* Verify the reply-to post.


/**
* Verify the reply-to post.

	*
* @return boolean True when valid, false when not valid.

	*
* @return boolean True when valid, false when not valid.

	*/
function verify_reply_to()
{

	*/
function verify_reply_to()
{

Zeile 592Zeile 592
			$post['icon'] = 0;
}
return true;

			$post['icon'] = 0;
}
return true;

	}

	}


/**
* Verify the dateline.


/**
* Verify the dateline.

Zeile 621Zeile 621

// If a valid prefix isn't supplied, don't assign one.
if(empty($prefix))


// If a valid prefix isn't supplied, don't assign one.
if(empty($prefix))

		{

		{

			$prefix = 0;
}
else
{

			$prefix = 0;
}
else
{

 
			if(!empty($this->data['tid']))
{
// Fetch the thread
$thread = get_thread($this->data['tid']);
}


			$prefix_cache = build_prefixes($prefix);

if(empty($prefix_cache))

			$prefix_cache = build_prefixes($prefix);

if(empty($prefix_cache))

Zeile 643Zeile 649
				else
{
$user = get_user($this->data['uid']);

				else
{
$user = get_user($this->data['uid']);

				}

if(!is_member($prefix_cache['groups'], array('usergroup' => $user['usergroup'], 'additionalgroups' => $user['additionalgroups'])))
{
$this->set_error('invalid_prefix');
return false;
}

				}

if(!is_member($prefix_cache['groups'], array('usergroup' => $user['usergroup'], 'additionalgroups' => $user['additionalgroups'])) && (empty($this->data['tid']) || $prefix != $thread['prefix']))
{
$this->set_error('invalid_prefix');
return false;
}

			}
if($prefix_cache['forums'] != "-1")
{
// Decide whether this prefix can be used in our forum
$forums = explode(",", $prefix_cache['forums']);

			}
if($prefix_cache['forums'] != "-1")
{
// Decide whether this prefix can be used in our forum
$forums = explode(",", $prefix_cache['forums']);


if(!in_array($this->data['fid'], $forums))


if(!in_array($this->data['fid'], $forums) && (empty($this->data['tid']) || $prefix != $thread['prefix']))

				{
$this->set_error('invalid_prefix');
return false;

				{
$this->set_error('invalid_prefix');
return false;

Zeile 665Zeile 671
		}

// Does this forum require a prefix?

		}

// Does this forum require a prefix?

		$forum = get_forum($this->data['fid']);

		$forum = get_forum($this->data['fid']);


if($forum['requireprefix'] == 1)
{


if($forum['requireprefix'] == 1)
{

Zeile 694Zeile 700
						$forums = explode(",", $required['forums']);

if(!in_array($forum['fid'], $forums))

						$forums = explode(",", $required['forums']);

if(!in_array($forum['fid'], $forums))

						{

						{

							continue;
}
}

							continue;
}
}


if($required['groups'] != "-1")
{
if(!is_member($required['groups'], array('usergroup' => $user['usergroup'], 'additionalgroups' => $user['additionalgroups'])))
{
$num_prefixes = true;
}
}
else


if(is_member($required['groups'], array('usergroup' => $user['usergroup'], 'additionalgroups' => $user['additionalgroups'])))








					{
$num_prefixes = true;
}

					{
$num_prefixes = true;
}

Zeile 746Zeile 745
		if($this->method == "update")
{
if(empty($post['tid']))

		if($this->method == "update")
{
if(empty($post['tid']))

			{

			{

				$query = $db->simple_select("posts", "tid", "pid='".(int)$post['pid']."'");
$post['tid'] = $db->fetch_field($query, "tid");
}

				$query = $db->simple_select("posts", "tid", "pid='".(int)$post['pid']."'");
$post['tid'] = $db->fetch_field($query, "tid");
}

Zeile 879Zeile 878

// Perform any selected moderation tools.
$ismod = is_moderator($post['fid'], "", $post['uid']);


// Perform any selected moderation tools.
$ismod = is_moderator($post['fid'], "", $post['uid']);

			if($ismod)

			if($ismod && isset($post['modoptions']))

			{
$lang->load($this->language_file, true);


			{
$lang->load($this->language_file, true);


Zeile 887Zeile 886
				$modlogdata['fid'] = $thread['fid'];
$modlogdata['tid'] = $thread['tid'];


				$modlogdata['fid'] = $thread['fid'];
$modlogdata['tid'] = $thread['tid'];


				if(!isset($modoptions['closethread']))
{
$modoptions['closethread'] = $closed;
}

$modoptions_update = array();

				$modoptions_update = array();







// Close the thread.


// Close the thread.

				if($modoptions['closethread'] == 1 && $thread['closed'] != 1)
{
$modoptions_update['closed'] = $closed = 0;

				if(!empty($modoptions['closethread']) && $thread['closed'] != 1)
{
$modoptions_update['closed'] = $closed = 1;

					log_moderator_action($modlogdata, $lang->thread_closed);
}


					log_moderator_action($modlogdata, $lang->thread_closed);
}


				// Open the thread.
if($modoptions['closethread'] != 1 && $thread['closed'] == 1)
{
$modoptions_update['closed'] = $closed = 1;
log_moderator_action($modlogdata, $lang->thread_opened);
}

if(!isset($modoptions['stickthread']))

				// Open the thread.
if(empty($modoptions['closethread']) && $thread['closed'] == 1)







				{

				{

					$modoptions['stickthread'] = $thread['sticky'];


					$modoptions_update['closed'] = $closed = 0;
log_moderator_action($modlogdata, $lang->thread_opened);

				}

// Stick the thread.

				}

// Stick the thread.

				if($modoptions['stickthread'] == 1 && $thread['sticky'] != 1)

				if(!empty($modoptions['stickthread']) && $thread['sticky'] != 1)

				{
$modoptions_update['sticky'] = 1;
log_moderator_action($modlogdata, $lang->thread_stuck);
}

// Unstick the thread.

				{
$modoptions_update['sticky'] = 1;
log_moderator_action($modlogdata, $lang->thread_stuck);
}

// Unstick the thread.

				if($modoptions['stickthread'] != 1 && $thread['sticky'])

				if(empty($modoptions['stickthread']) && $thread['sticky'] == 1)

				{
$modoptions_update['sticky'] = 0;
log_moderator_action($modlogdata, $lang->thread_unstuck);

				{
$modoptions_update['sticky'] = 0;
log_moderator_action($modlogdata, $lang->thread_unstuck);

Zeile 1112Zeile 1101
			$done_users = array();

$subject = $parser->parse_badwords($thread['subject']);

			$done_users = array();

$subject = $parser->parse_badwords($thread['subject']);

			



			$parser_options = array(
'me_username' => $post['username'],
'filter_badwords' => 1

			$parser_options = array(
'me_username' => $post['username'],
'filter_badwords' => 1

Zeile 1123Zeile 1112

// Fetch any users subscribed to this thread receiving instant notification and queue up their subscription notices
$query = $db->query("


// Fetch any users subscribed to this thread receiving instant notification and queue up their subscription notices
$query = $db->query("

				SELECT u.username, u.email, u.uid, u.language, u.loginkey, u.salt, u.regdate, s.subscriptionkey, s.notification

				SELECT u.username, u.email, u.uid, u.language, u.loginkey, u.salt, u.regdate, s.notification

				FROM ".TABLE_PREFIX."threadsubscriptions s
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=s.uid)
WHERE (s.notification='1' OR s.notification='2') AND s.tid='{$post['tid']}'

				FROM ".TABLE_PREFIX."threadsubscriptions s
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=s.uid)
WHERE (s.notification='1' OR s.notification='2') AND s.tid='{$post['tid']}'

Zeile 1205Zeile 1194
					$emailsubject = $lang->sprintf($emailsubject, $subject);

$post_code = md5($subscribedmember['loginkey'].$subscribedmember['salt'].$subscribedmember['regdate']);

					$emailsubject = $lang->sprintf($emailsubject, $subject);

$post_code = md5($subscribedmember['loginkey'].$subscribedmember['salt'].$subscribedmember['regdate']);

					$emailmessage = $lang->sprintf($emailmessage, $subscribedmember['username'], $post['username'], $mybb->settings['bbname'], $subject, $excerpt, $mybb->settings['bburl'], str_replace("&", "&", get_thread_link($thread['tid'], 0, "newpost")), $thread['tid'], $subscribedmember['subscriptionkey'], $post_code);

					$emailmessage = $lang->sprintf($emailmessage, $subscribedmember['username'], $post['username'], $mybb->settings['bbname'], $subject, $excerpt, $mybb->settings['bburl'], str_replace("&", "&", get_thread_link($thread['tid'], 0, "newpost")), $thread['tid'], $post_code);

					$new_email = array(
"mailto" => $db->escape_string($subscribedmember['email']),
"mailfrom" => '',

					$new_email = array(
"mailto" => $db->escape_string($subscribedmember['email']),
"mailfrom" => '',

Zeile 1222Zeile 1211
					$post_code = md5($subscribedmember['loginkey'].$subscribedmember['salt'].$subscribedmember['regdate']);
$pm = array(
'subject' => array('pmsubject_subscription', $subject),

					$post_code = md5($subscribedmember['loginkey'].$subscribedmember['salt'].$subscribedmember['regdate']);
$pm = array(
'subject' => array('pmsubject_subscription', $subject),

						'message' => array('pm_subscription', $subscribedmember['username'], $post['username'], $subject, $excerpt, $mybb->settings['bburl'], str_replace("&", "&", get_thread_link($thread['tid'], 0, "newpost")), $thread['tid'], $subscribedmember['subscriptionkey'], $post_code),

						'message' => array('pm_subscription', $subscribedmember['username'], $post['username'], $subject, $excerpt, $mybb->settings['bburl'], str_replace("&", "&", get_thread_link($thread['tid'], 0, "newpost")), $thread['tid'], $post_code),

						'touid' => $subscribedmember['uid'],
'language' => $subscribedmember['language'],
'language_file' => 'messages'

						'touid' => $subscribedmember['uid'],
'language' => $subscribedmember['language'],
'language_file' => 'messages'

Zeile 1472Zeile 1461
				"dateline" => (int)$thread['dateline'],
"lastpost" => (int)$thread['dateline'],
"lastposter" => $db->escape_string($thread['username']),

				"dateline" => (int)$thread['dateline'],
"lastpost" => (int)$thread['dateline'],
"lastposter" => $db->escape_string($thread['username']),

 
				"lastposteruid" => $thread['uid'],

				"views" => 0,
"replies" => 0,
"visible" => $visible,

				"views" => 0,
"replies" => 0,
"visible" => $visible,

Zeile 1527Zeile 1517
			}

// Perform any selected moderation tools.

			}

// Perform any selected moderation tools.

			if(is_moderator($thread['fid'], "", $thread['uid']) && is_array($thread['modoptions']))

			if(is_moderator($thread['fid'], "", $thread['uid']) && isset($thread['modoptions']))

			{
$lang->load($this->language_file, true);


			{
$lang->load($this->language_file, true);