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

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 626Zeile 626
		}
else
{

		}
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 645Zeile 651
					$user = get_user($this->data['uid']);
}


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


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

				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;

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

Zeile 656Zeile 662
				// Decide whether this prefix can be used in our forum
$forums = explode(",", $prefix_cache['forums']);


				// 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 699Zeile 705
						}
}


						}
}


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

			}

			}


if($prefix == 0 && $num_prefixes)
{


if($prefix == 0 && $num_prefixes)
{

Zeile 731Zeile 730
	function validate_post()
{
global $mybb, $db, $plugins;

	function validate_post()
{
global $mybb, $db, $plugins;


$post = &$this->data;


$post = &$this->data;

		$time = TIME_NOW;

		$time = TIME_NOW;





		$this->action = "post";

if($this->method != "update" && !$post['savedraft'])

		$this->action = "post";

if($this->method != "update" && !$post['savedraft'])

		{

		{

			$this->verify_post_flooding();
}


			$this->verify_post_flooding();
}


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 762Zeile 761
			if($first_check['pid'] == $post['pid'])
{
$this->first_post = true;

			if($first_check['pid'] == $post['pid'])
{
$this->first_post = true;

			}
}

// Verify all post assets.

			}
}

// Verify all post assets.


if($this->method == "insert" || array_key_exists('uid', $post))
{
$this->verify_author();


if($this->method == "insert" || array_key_exists('uid', $post))
{
$this->verify_author();

		}

		}


if($this->method == "insert" || array_key_exists('subject', $post))
{


if($this->method == "insert" || array_key_exists('subject', $post))
{

Zeile 778Zeile 777
		}

if($this->method == "insert" || array_key_exists('message', $post))

		}

if($this->method == "insert" || array_key_exists('message', $post))

		{

		{

			$this->verify_message();
$this->verify_image_count();
$this->verify_video_count();

			$this->verify_message();
$this->verify_image_count();
$this->verify_video_count();

		}

		}


if($this->method == "insert" || array_key_exists('dateline', $post))
{


if($this->method == "insert" || array_key_exists('dateline', $post))
{

Zeile 790Zeile 789
		}

if($this->method == "insert" || array_key_exists('replyto', $post))

		}

if($this->method == "insert" || array_key_exists('replyto', $post))

		{

		{

			$this->verify_reply_to();
}

if($this->method == "insert" || array_key_exists('icon', $post))
{
$this->verify_post_icon();

			$this->verify_reply_to();
}

if($this->method == "insert" || array_key_exists('icon', $post))
{
$this->verify_post_icon();

		}


		}


		if($this->method == "insert" || array_key_exists('options', $post))
{
$this->verify_options();

		if($this->method == "insert" || array_key_exists('options', $post))
{
$this->verify_options();

		}


		}


		if($this->method == "update" && $this->first_post)
{
$this->verify_prefix();

		if($this->method == "update" && $this->first_post)
{
$this->verify_prefix();

		}

		}


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



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


Zeile 831Zeile 830
	function insert_post()
{
global $db, $mybb, $plugins, $cache, $lang;

	function insert_post()
{
global $db, $mybb, $plugins, $cache, $lang;





		$post = &$this->data;

// Yes, validating is required.

		$post = &$this->data;

// Yes, validating is required.

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