Vergleich inc/datahandlers/post.php - 1.8.22 - 1.8.30

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 279Zeile 279

if($limit > 0 || $dblimit > 0)
{


if($limit > 0 || $dblimit > 0)
{

				$is_moderator = is_moderator($post['fid'], "", $post['uid']);


















				if(isset($post['fid']))
{
$fid = $post['fid'];
}
else
{
$fid = 0;
}
if(isset($post['uid']))
{
$uid = $post['uid'];
}
else
{
$uid = 0;
}

$is_moderator = is_moderator($fid, "", $uid);

				// Consider minimum in user defined and database limit other than 0
if($limit > 0 && $dblimit > 0)

				// Consider minimum in user defined and database limit other than 0
if($limit > 0 && $dblimit > 0)

				{

				{

					$limit = $is_moderator ? $dblimit : min($limit, $dblimit);
}
else
{
$limit = max($limit, $dblimit);

					$limit = $is_moderator ? $dblimit : min($limit, $dblimit);
}
else
{
$limit = max($limit, $dblimit);

				}

				}


if(strlen($post['message']) > $limit && (!$is_moderator || $limit == $dblimit))
{


if(strlen($post['message']) > $limit && (!$is_moderator || $limit == $dblimit))
{

Zeile 303Zeile 320
			}

if(!$mybb->settings['mycodemessagelength'])

			}

if(!$mybb->settings['mycodemessagelength'])

			{

			{

				// Check to see of the text is full of MyCode
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;

				// Check to see of the text is full of MyCode
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;

Zeile 350Zeile 367
	{
global $mybb;


	{
global $mybb;


		$post = &$this->data;


		$post = &$this->data;


		// Check if post flooding is enabled within MyBB or if the admin override option is specified.
if($mybb->settings['postfloodcheck'] == 1 && $post['uid'] != 0 && $this->admin_override == false)
{

		// Check if post flooding is enabled within MyBB or if the admin override option is specified.
if($mybb->settings['postfloodcheck'] == 1 && $post['uid'] != 0 && $this->admin_override == false)
{

Zeile 373Zeile 390
					$this->set_error("post_flooding_one_second");
}
else

					$this->set_error("post_flooding_one_second");
}
else

				{

				{

					$this->set_error("post_flooding", array($time_to_wait));
}
return false;

					$this->set_error("post_flooding", array($time_to_wait));
}
return false;

Zeile 396Zeile 413

// 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?

		}

// Are we even turned on?

Zeile 423Zeile 440
		$thread = $db->fetch_array($query);

// Check to see if the same author has posted within the merge post time limit

		$thread = $db->fetch_array($query);

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






		if(
!$thread || (
((int)$mybb->settings['postmergemins'] != 0 && trim($mybb->settings['postmergemins']) != "") &&
(TIME_NOW-$thread['lastpost']) > ((int)$mybb->settings['postmergemins']*60)
)
)

		{
return true;
}

		{
return true;
}

Zeile 456Zeile 478
			return false;
}


			return false;
}


		if($post['uid'])

		if(!empty($post['uid']))

		{
$user_check = "uid='".$post['uid']."'";
}

		{
$user_check = "uid='".$post['uid']."'";
}

Zeile 467Zeile 489

$query = $db->simple_select("posts", "pid,message,visible", "{$user_check} AND tid='".$post['tid']."' AND dateline='".$thread['lastpost']."'", array('order_by' => 'pid', 'order_dir' => 'DESC', 'limit' => 1));
return $db->fetch_array($query);


$query = $db->simple_select("posts", "pid,message,visible", "{$user_check} AND tid='".$post['tid']."' AND dateline='".$thread['lastpost']."'", array('order_by' => 'pid', 'order_dir' => 'DESC', 'limit' => 1));
return $db->fetch_array($query);

	}

/**

	}

/**

	* Verifies the image count.
*
* @return boolean True when valid, false when not valid.

	* Verifies the image count.
*
* @return boolean True when valid, false when not valid.

Zeile 477Zeile 499
	function verify_image_count()
{
global $mybb, $db;

	function verify_image_count()
{
global $mybb, $db;





		$post = &$this->data;

		$post = &$this->data;

 

if(isset($post['uid']))
{
$uid = $post['uid'];
}
else
{
$uid = null;
}


// Get the permissions of the user who is making this post or thread


// Get the permissions of the user who is making this post or thread

		$permissions = user_permissions($post['uid']);

		$permissions = user_permissions($uid);


// Fetch the forum this post is being made in
if(!$post['fid'])


// Fetch the forum this post is being made in
if(!$post['fid'])

Zeile 506Zeile 537
				"filter_badwords" => 1
);


				"filter_badwords" => 1
);


			if($post['options']['disablesmilies'] != 1)

			if(empty($post['options']['disablesmilies']))

			{
$parser_options['allow_smilies'] = $forum['allowsmilies'];
}

			{
$parser_options['allow_smilies'] = $forum['allowsmilies'];
}

Zeile 541Zeile 572

$post = &$this->data;



$post = &$this->data;


		// Get the permissions of the user who is making this post or thread
$permissions = user_permissions($post['uid']);










		if(isset($post['uid']))
{
$uid = $post['uid'];
}
else
{
$uid = null;
}

// Get the permissions of the user who is making this post or thread
$permissions = user_permissions($uid);


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


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

Zeile 566Zeile 606
	* @return boolean True when valid, false when not valid.
*/
function verify_reply_to()

	* @return boolean True when valid, false when not valid.
*/
function verify_reply_to()

	{

	{

		global $db;
$post = &$this->data;


		global $db;
$post = &$this->data;


Zeile 591Zeile 631
			$options = array(
"limit_start" => 0,
"limit" => 1,

			$options = array(
"limit_start" => 0,
"limit" => 1,

				"order_by" => "dateline",
"order_dir" => "asc"

				"order_by" => "dateline, pid",


			);
$query = $db->simple_select("posts", "pid", "tid='{$post['tid']}'", $options);
$reply_to = $db->fetch_array($query);

			);
$query = $db->simple_select("posts", "pid", "tid='{$post['tid']}'", $options);
$reply_to = $db->fetch_array($query);

Zeile 638Zeile 677
			$dateline = TIME_NOW;
}
}

			$dateline = TIME_NOW;
}
}





	/**
* Verify thread prefix.
*

	/**
* Verify thread prefix.
*

Zeile 659Zeile 698
			{
// Fetch the thread
$thread = get_thread($this->data['tid']);

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

			}

$prefix_cache = build_prefixes($prefix);

			}

$prefix_cache = build_prefixes($prefix);


if(empty($prefix_cache))
{


if(empty($prefix_cache))
{

Zeile 700Zeile 739
		}

// 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)
{
$num_prefixes = false;

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

Zeile 766Zeile 805
		$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 782Zeile 821
			$options = array(
"limit" => 1,
"limit_start" => 0,

			$options = array(
"limit" => 1,
"limit_start" => 0,

				"order_by" => "dateline",
"order_dir" => "asc"

				"order_by" => "dateline, pid",


			);
$query = $db->simple_select("posts", "pid", "tid='".$post['tid']."'", $options);
$first_check = $db->fetch_array($query);

			);
$query = $db->simple_select("posts", "pid", "tid='".$post['tid']."'", $options);
$first_check = $db->fetch_array($query);

Zeile 810Zeile 848
			$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))
{
$this->verify_dateline();

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

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

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

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

// We are done validating, return.
$this->set_validated(true);
if(count($this->get_errors()) > 0)
{
return false;
}
else
{
return true;
}
}

/**

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

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

// We are done validating, return.
$this->set_validated(true);
if(count($this->get_errors()) > 0)
{
return false;
}
else
{
return true;
}
}

/**

	 * Insert a post into the database.
*
* @return array Array of new post details, pid and visibility.

	 * Insert a post into the database.
*
* @return array Array of new post details, pid and visibility.

Zeile 893Zeile 931
				if($post['options']['subscriptionmethod'] == "")
{
remove_subscribed_thread($post['tid'], $post['uid']);

				if($post['options']['subscriptionmethod'] == "")
{
remove_subscribed_thread($post['tid'], $post['uid']);

				}
else

				}
else

				{
switch($post['options']['subscriptionmethod'])
{

				{
switch($post['options']['subscriptionmethod'])
{

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

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

				}


				}


				// Stick the thread.
if(!empty($modoptions['stickthread']) && $thread['sticky'] != 1 && is_moderator($post['fid'], "canstickunstickthreads", $post['uid']))
{

				// Stick the thread.
if(!empty($modoptions['stickthread']) && $thread['sticky'] != 1 && is_moderator($post['fid'], "canstickunstickthreads", $post['uid']))
{

Zeile 1000Zeile 1038
		if($this->method != "update" && $visible == 1)
{
$double_post = $this->verify_post_merge();

		if($this->method != "update" && $visible == 1)
{
$double_post = $this->verify_post_merge();





			// Only combine if they are both invisible (mod queue'd forum) or both visible
if($double_post !== true && $double_post['visible'] == $visible)
{

			// Only combine if they are both invisible (mod queue'd forum) or both visible
if($double_post !== true && $double_post['visible'] == $visible)
{

				$this->pid = $double_post['pid'];


				$_message = $post['message'];


				$post['message'] = $double_post['message'] .= "\n".$mybb->settings['postmergesep']."\n".$post['message'];

				$post['message'] = $double_post['message'] .= "\n".$mybb->settings['postmergesep']."\n".$post['message'];

				$update_query = array(
"message" => $db->escape_string($double_post['message'])
);
$update_query['edituid'] = (int)$post['uid'];
$update_query['edittime'] = TIME_NOW;
$db->update_query("posts", $update_query, "pid='".$double_post['pid']."'");

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

if($post['posthash'])

				
if ($this->validate_post())












				{

				{

					// Assign any uploaded attachments with the specific posthash to the merged post.
$post['posthash'] = $db->escape_string($post['posthash']);

$query = $db->simple_select("attachments", "COUNT(aid) AS attachmentcount", "pid='0' AND visible='1' AND posthash='{$post['posthash']}'");
$attachmentcount = $db->fetch_field($query, "attachmentcount");

if($attachmentcount > 0)




					$this->pid = $double_post['pid'];

$update_query = array(
"message" => $db->escape_string($double_post['message'])
);
$update_query['edituid'] = (int)$post['uid'];
$update_query['edittime'] = TIME_NOW;
$db->update_query("posts", $update_query, "pid='".$double_post['pid']."'");

if($draft_check)

					{

					{

						// Update forum count
update_thread_counters($post['tid'], array('attachmentcount' => "+{$attachmentcount}"));

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


					}

					}


$attachmentassign = array(























					
if($post['posthash'])
{
// Assign any uploaded attachments with the specific posthash to the merged post.
$post['posthash'] = $db->escape_string($post['posthash']);

$query = $db->simple_select("attachments", "COUNT(aid) AS attachmentcount", "pid='0' AND visible='1' AND posthash='{$post['posthash']}'");
$attachmentcount = $db->fetch_field($query, "attachmentcount");

if($attachmentcount > 0)
{
// Update forum count
update_thread_counters($post['tid'], array('attachmentcount' => "+{$attachmentcount}"));
}

$attachmentassign = array(
"pid" => $double_post['pid'],
"posthash" => ''
);
$db->update_query("attachments", $attachmentassign, "posthash='{$post['posthash']}' AND pid='0'");
}

// Return the post's pid and whether or not it is visible.
$this->return_values = array(

						"pid" => $double_post['pid'],

						"pid" => $double_post['pid'],

						"posthash" => ''


						"visible" => $visible,
"merge" => true

					);

					);

					$db->update_query("attachments", $attachmentassign, "posthash='{$post['posthash']}' AND pid='0'");








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

return $this->return_values;
}
else
{
$post['message'] = $_message;

				}

				}


// Return the post's pid and whether or not it is visible.
$this->return_values = array(
"pid" => $double_post['pid'],
"visible" => $visible,
"merge" => true
);

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

return $this->return_values;

 
			}
}


			}
}


Zeile 1243Zeile 1291
				}

if($subscribedmember['notification'] == 1)

				}

if($subscribedmember['notification'] == 1)

				{
$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'], $post_code);
$new_email = array(
"mailto" => $db->escape_string($subscribedmember['email']),
"mailfrom" => '',
"subject" => $db->escape_string($emailsubject),
"message" => $db->escape_string($emailmessage),
"headers" => ''
);
$db->insert_query("mailqueue", $new_email);
unset($userlang);

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

$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']);
$new_email = array(
"mailto" => $db->escape_string($subscribedmember['email']),
"mailfrom" => '',
"subject" => $db->escape_string($emailsubject),
"message" => $db->escape_string($emailmessage),
"headers" => ''
);
$db->insert_query("mailqueue", $new_email);
unset($userlang);


					$queued_email = 1;
}
elseif($subscribedmember['notification'] == 2)
{

					$queued_email = 1;
}
elseif($subscribedmember['notification'] == 2)
{

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

 
					$pm = array(
'subject' => array('pmsubject_subscription', $subject),

					$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'], $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']),

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

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

Zeile 1279Zeile 1325
			if(isset($queued_email) && $queued_email == 1)
{
$cache->update_mailqueue();

			if(isset($queued_email) && $queued_email == 1)
{
$cache->update_mailqueue();

			}

$thread_update = array('replies' => '+1');


			}

$thread_update = array('replies' => '+1');


			// Update counters
update_last_post($post['tid']);
update_forum_counters($post['fid'], array("posts" => "+1"));

			// Update counters
update_last_post($post['tid']);
update_forum_counters($post['fid'], array("posts" => "+1"));

Zeile 1329Zeile 1375
			"visible" => $visible,
"closed" => $closed
);

			"visible" => $visible,
"closed" => $closed
);





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

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





		return $this->return_values;
}

		return $this->return_values;
}





	/**
* Validate a thread.
*

	/**
* Validate a thread.
*

Zeile 1345Zeile 1391
		global $mybb, $db, $plugins;

$thread = &$this->data;

		global $mybb, $db, $plugins;

$thread = &$this->data;





		// Validate all thread assets.

if(!$thread['savedraft'])
{
$this->verify_post_flooding();

		// Validate all thread assets.

if(!$thread['savedraft'])
{
$this->verify_post_flooding();

		}


		}


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

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

Zeile 1397Zeile 1443
		if(count($this->get_errors()) > 0)
{
return false;

		if(count($this->get_errors()) > 0)
{
return false;

		}
else
{

		}
else
{

			return true;
}
}

			return true;
}
}

Zeile 1421Zeile 1467
		if(count($this->get_errors()) > 0)
{
die("The thread is not valid.");

		if(count($this->get_errors()) > 0)
{
die("The thread is not valid.");

		}


		}


		$thread = &$this->data;

// Fetch the forum this thread is being made in

		$thread = &$this->data;

// Fetch the forum this thread is being made in

		$forum = get_forum($thread['fid']);


		$query = $db->simple_select("forums", "*", "fid='{$thread['fid']}'");
$forum = $db->fetch_array($query);


// This thread is being saved as a draft.
if($thread['savedraft'])


// This thread is being saved as a draft.
if($thread['savedraft'])

Zeile 1446Zeile 1493
			else
{
$visible = 1;

			else
{
$visible = 1;

			}

			}


// Are posts from this user being moderated? Change visibility
if($mybb->user['uid'] == $thread['uid'] && $mybb->user['moderateposts'] == 1)


// Are posts from this user being moderated? Change visibility
if($mybb->user['uid'] == $thread['uid'] && $mybb->user['moderateposts'] == 1)

Zeile 1470Zeile 1517
		else
{
$draft_check = false;

		else
{
$draft_check = false;

		}

		}


// Are we updating a post which is already a draft? Perhaps changing it into a visible post?
if($draft_check)
{
$this->thread_insert_data = array(


// Are we updating a post which is already a draft? Perhaps changing it into a visible post?
if($draft_check)
{
$this->thread_insert_data = array(

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

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

				"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']),

Zeile 1488Zeile 1535
			$plugins->run_hooks("datahandler_post_insert_thread", $this);

$db->update_query("threads", $this->thread_insert_data, "tid='{$thread['tid']}'");

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

$db->update_query("threads", $this->thread_insert_data, "tid='{$thread['tid']}'");


$this->post_insert_data = array(
"subject" => $db->escape_string($thread['subject']),
"icon" => (int)$thread['icon'],
"username" => $db->escape_string($thread['username']),
"dateline" => (int)$thread['dateline'],


$this->post_insert_data = array(
"subject" => $db->escape_string($thread['subject']),
"icon" => (int)$thread['icon'],
"username" => $db->escape_string($thread['username']),
"dateline" => (int)$thread['dateline'],

				"message" => $db->escape_string($thread['message']),
"ipaddress" => $db->escape_binary(my_inet_pton(get_ip())),
"includesig" => $thread['options']['signature'],

				"message" => $db->escape_string($thread['message']),
"ipaddress" => $db->escape_binary(my_inet_pton(get_ip())),
"includesig" => $thread['options']['signature'],

Zeile 1514Zeile 1561
				"fid" => $thread['fid'],
"subject" => $db->escape_string($thread['subject']),
"prefix" => (int)$thread['prefix'],

				"fid" => $thread['fid'],
"subject" => $db->escape_string($thread['subject']),
"prefix" => (int)$thread['prefix'],

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

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

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

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

Zeile 1585Zeile 1632
				if(isset($thread['tid']))
{
$modlogdata['tid'] = $thread['tid'];

				if(isset($thread['tid']))
{
$modlogdata['tid'] = $thread['tid'];

				}

$modoptions_update = array();

				}

$modoptions_update = array();


// Close the thread.
if(!empty($modoptions['closethread']) && is_moderator($thread['fid'], "canopenclosethreads", $thread['uid']))


// Close the thread.
if(!empty($modoptions['closethread']) && is_moderator($thread['fid'], "canopenclosethreads", $thread['uid']))

Zeile 1634Zeile 1681

// Only update the table if we need to.
if(!empty($update_query))


// Only update the table if we need to.
if(!empty($update_query))

					{

					{

						$db->update_query("users", $update_query, "uid='{$thread['uid']}'", 1, true);
}

						$db->update_query("users", $update_query, "uid='{$thread['uid']}'", 1, true);
}

				}

if(!isset($forum['lastpost']))
{
$forum['lastpost'] = 0;

 
				}

$done_users = array();

				}

$done_users = array();

Zeile 1683Zeile 1725
					}

if(!is_moderator($thread['fid'], "", $subscribedmember['uid']) && $forumpermissions['canonlyviewownthreads'] == 1)

					}

if(!is_moderator($thread['fid'], "", $subscribedmember['uid']) && $forumpermissions['canonlyviewownthreads'] == 1)

					{

					{

						// In a 'view own only' forum and not a moderator
continue;
}

						// In a 'view own only' forum and not a moderator
continue;
}

Zeile 1694Zeile 1736
						$uselang = $subscribedmember['language'];
}
else if($mybb->settings['bblanguage'])

						$uselang = $subscribedmember['language'];
}
else if($mybb->settings['bblanguage'])

					{

					{

						$uselang = $mybb->settings['bblanguage'];
}
else

						$uselang = $mybb->settings['bblanguage'];
}
else

Zeile 1706Zeile 1748
					{
$emailsubject = $lang->emailsubject_forumsubscription;
$emailmessage = $lang->email_forumsubscription;

					{
$emailsubject = $lang->emailsubject_forumsubscription;
$emailmessage = $lang->email_forumsubscription;


// If the poster is unregistered and hasn't set a username, call them Guest


// If the poster is unregistered and hasn't set a username, call them Guest

						if(!$thread['uid'] && !$thread['username'])
{
$thread['username'] = htmlspecialchars_uni($lang->guest);

						if(!$thread['uid'] && !$thread['username'])
{
$thread['username'] = htmlspecialchars_uni($lang->guest);

Zeile 1738Zeile 1780
					}
$emailsubject = $lang->sprintf($emailsubject, $forum['name']);


					}
$emailsubject = $lang->sprintf($emailsubject, $forum['name']);


					$post_code = md5($subscribedmember['loginkey'].$subscribedmember['salt'].$subscribedmember['regdate']);
$emailmessage = $lang->sprintf($emailmessage, $subscribedmember['username'], $thread['username'], $forum['name'], $mybb->settings['bbname'], $thread['subject'], $excerpt, $mybb->settings['bburl'], get_thread_link($this->tid), $thread['fid'], $post_code);

					$emailmessage = $lang->sprintf($emailmessage, $subscribedmember['username'], $thread['username'], $forum['name'], $mybb->settings['bbname'], $thread['subject'], $excerpt, $mybb->settings['bburl'], get_thread_link($this->tid), $thread['fid']);


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

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

Zeile 1779Zeile 1820
		else if($visible == 0)
{
update_forum_counters($thread['fid'], array("unapprovedthreads" => "+1", "unapprovedposts" => "+1"));

		else if($visible == 0)
{
update_forum_counters($thread['fid'], array("unapprovedthreads" => "+1", "unapprovedposts" => "+1"));

		}

		}


$query = $db->simple_select("attachments", "COUNT(aid) AS attachmentcount", "pid='{$this->pid}' AND visible='1'");
$attachmentcount = $db->fetch_field($query, "attachmentcount");


$query = $db->simple_select("attachments", "COUNT(aid) AS attachmentcount", "pid='{$this->pid}' AND visible='1'");
$attachmentcount = $db->fetch_field($query, "attachmentcount");

Zeile 1826Zeile 1867
		$existing_post = get_post($post['pid']);
$post['tid'] = $existing_post['tid'];
$post['fid'] = $existing_post['fid'];

		$existing_post = get_post($post['pid']);
$post['tid'] = $existing_post['tid'];
$post['fid'] = $existing_post['fid'];

 

if(isset($post['uid']))
{
$uid = $post['uid'];
}
else
{
$uid = 0;
}


$forum = get_forum($post['fid']);


$forum = get_forum($post['fid']);

		$forumpermissions = forum_permissions($post['fid'], $post['uid']);

		$forumpermissions = forum_permissions($post['fid'], $uid);


// Decide on the visibility of this post.


// Decide on the visibility of this post.

		$ismod = is_moderator($post['fid'], "", $post['uid']);

		$ismod = is_moderator($post['fid'], "", $uid);


// Keep visibility for unapproved and deleted posts
if($existing_post['visible'] == 0)


// Keep visibility for unapproved and deleted posts
if($existing_post['visible'] == 0)

Zeile 1913Zeile 1963
		{
$this->post_update_data['editreason'] = $db->escape_string(trim($post['editreason']));
}

		{
$this->post_update_data['editreason'] = $db->escape_string(trim($post['editreason']));
}

		elseif($post['editreason'] == '')

		elseif(empty($post['editreason']))

		{
$this->post_update_data['editreason'] = '';
}

		{
$this->post_update_data['editreason'] = '';
}

Zeile 1947Zeile 1997
		$db->update_query("posts", $this->post_update_data, "pid='".(int)$post['pid']."'");

// Automatic subscription to the thread

		$db->update_query("posts", $this->post_update_data, "pid='".(int)$post['pid']."'");

// Automatic subscription to the thread

		if($post['options']['subscriptionmethod'] != "" && $post['uid'] > 0)

		if($post && !empty($post['options']['subscriptionmethod']) && $uid > 0)

		{
switch($post['options']['subscriptionmethod'])
{

		{
switch($post['options']['subscriptionmethod'])
{

Zeile 1965Zeile 2015
		}
else
{

		}
else
{

			$db->delete_query("threadsubscriptions", "uid='".(int)$post['uid']."' AND tid='".(int)$post['tid']."'");

			$db->delete_query("threadsubscriptions", "uid='".(int)$uid."' AND tid='".(int)$post['tid']."'");

		}

update_forum_lastpost($post['fid']);

		}

update_forum_lastpost($post['fid']);