Vergleich inc/datahandlers/post.php - 1.8.7 - 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'));
$thread = $db->fetch_array($query);

		// 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'));
$thread = $db->fetch_array($query);

Zeile 623Zeile 623
		if(empty($prefix))
{
$prefix = 0;

		if(empty($prefix))
{
$prefix = 0;

		}
else

		}
else

		{
if(!empty($this->data['tid']))
{

		{
if(!empty($this->data['tid']))
{

Zeile 878Zeile 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 886Zeile 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);
}

// Open the thread.

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

// Open the thread.

				if($modoptions['closethread'] != 1 && $thread['closed'] == 1)

				if(empty($modoptions['closethread']) && $thread['closed'] == 1)

				{

				{

					$modoptions_update['closed'] = $closed = 1;

					$modoptions_update['closed'] = $closed = 0;

					log_moderator_action($modlogdata, $lang->thread_opened);

					log_moderator_action($modlogdata, $lang->thread_opened);

				}

if(!isset($modoptions['stickthread']))
{
$modoptions['stickthread'] = $thread['sticky'];

 
				}

// 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 935Zeile 925

// Fetch the forum this post is being made in
$forum = get_forum($post['fid']);


// Fetch the forum this post is being made in
$forum = get_forum($post['fid']);





			// Decide on the visibility of this post.
$forumpermissions = forum_permissions($post['fid'], $post['uid']);
if($forumpermissions['modposts'] == 1 && !$ismod)

			// Decide on the visibility of this post.
$forumpermissions = forum_permissions($post['fid'], $post['uid']);
if($forumpermissions['modposts'] == 1 && !$ismod)

			{

			{

				$visible = 0;

				$visible = 0;

			}

			}

			else
{
$visible = 1;

			else
{
$visible = 1;

			}


			}


			// Are posts from this user being moderated? Change visibility
if($mybb->user['uid'] == $post['uid'] && $mybb->user['moderateposts'] == 1)
{
$visible = 0;
}

			// Are posts from this user being moderated? Change visibility
if($mybb->user['uid'] == $post['uid'] && $mybb->user['moderateposts'] == 1)
{
$visible = 0;
}

		}


		}


		if(!isset($post['pid']))
{
$post['pid'] = 0;

		if(!isset($post['pid']))
{
$post['pid'] = 0;

		}


		}


		$post['pid'] = (int)$post['pid'];
$post['uid'] = (int)$post['uid'];


		$post['pid'] = (int)$post['pid'];
$post['uid'] = (int)$post['uid'];


Zeile 992Zeile 982
				if($draft_check)
{
$db->delete_query("posts", "pid='".$post['pid']."'");

				if($draft_check)
{
$db->delete_query("posts", "pid='".$post['pid']."'");

				}


				}


				if($post['posthash'])
{
// Assign any uploaded attachments with the specific posthash to the merged post.

				if($post['posthash'])
{
// Assign any uploaded attachments with the specific posthash to the merged post.

Zeile 1023Zeile 1013
				);

$plugins->run_hooks("datahandler_post_insert_merge", $this);

				);

$plugins->run_hooks("datahandler_post_insert_merge", $this);





				return $this->return_values;
}
}

				return $this->return_values;
}
}

Zeile 1049Zeile 1039
		{
// Update a post that is a draft
$this->post_update_data = array(

		{
// Update a post that is a draft
$this->post_update_data = array(

				"subject" => $db->escape_string($post['subject']),
"icon" => (int)$post['icon'],
"uid" => $post['uid'],
"username" => $db->escape_string($post['username']),

				"subject" => $db->escape_string($post['subject']),
"icon" => (int)$post['icon'],
"uid" => $post['uid'],
"username" => $db->escape_string($post['username']),

				"dateline" => (int)$post['dateline'],
"message" => $db->escape_string($post['message']),
"ipaddress" => $db->escape_binary($post['ipaddress']),

				"dateline" => (int)$post['dateline'],
"message" => $db->escape_string($post['message']),
"ipaddress" => $db->escape_binary($post['ipaddress']),

Zeile 1060Zeile 1050
				"smilieoff" => $post['options']['disablesmilies'],
"visible" => $visible
);

				"smilieoff" => $post['options']['disablesmilies'],
"visible" => $visible
);





			$plugins->run_hooks("datahandler_post_insert_post", $this);

$db->update_query("posts", $this->post_update_data, "pid='{$post['pid']}'");
$this->pid = $post['pid'];
}
else

			$plugins->run_hooks("datahandler_post_insert_post", $this);

$db->update_query("posts", $this->post_update_data, "pid='{$post['pid']}'");
$this->pid = $post['pid'];
}
else

		{

		{

			// Insert the post.
$this->post_insert_data = array(
"tid" => (int)$post['tid'],

			// Insert the post.
$this->post_insert_data = array(
"tid" => (int)$post['tid'],

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