Vergleich inc/datahandlers/post.php - 1.6.8 - 1.6.10

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: post.php 5828 2012-05-08 16:06:16Z Tomm $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 206Zeile 206
			}
}


			}
}


		if(my_strlen($subject) > 85)












		// If post is reply and begins with "RE: ", remove 4 from subject length.
$subject_length = my_strlen($subject);
if($this->action == "post")
{
$position_re = my_strpos($subject, "RE: ");
if($position_re !== false && $position_re == 0)
{
$subject_length = $subject_length - 4;
}
}

if($subject_length > 85)

		{
// Subject is too long
$this->set_error('subject_too_long', my_strlen($subject));

		{
// Subject is too long
$this->set_error('subject_too_long', my_strlen($subject));

Zeile 391Zeile 402
			$user_check = "ipaddress='".$db->escape_string($session->ipaddress)."'";
}


			$user_check = "ipaddress='".$db->escape_string($session->ipaddress)."'";
}


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

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


		return $db->fetch_array($query);
}


Zeile 463Zeile 474
	{
global $mybb, $db;


	{
global $mybb, $db;


		$post = &$this->data;


		$post = &$this->data;


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


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


Zeile 807Zeile 818
				}

// Assign any uploaded attachments with the specific posthash to the merged post.

				}

// Assign any uploaded attachments with the specific posthash to the merged post.

				if($double_post['posthash'])






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

				{

				{

					$post['posthash'] = $db->escape_string($post['posthash']);
$double_post['posthash'] = $db->escape_string($double_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");





					// 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']}'");

				

				

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

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

$post['posthash'] = $double_post['posthash'];
}


 
				// Return the post's pid and whether or not it is visible.
return array(
"pid" => $double_post['pid'],

				// Return the post's pid and whether or not it is visible.
return array(
"pid" => $double_post['pid'],

Zeile 869Zeile 874
				"longipaddress" => intval(my_ip2long($post['ipaddress'])),
"includesig" => $post['options']['signature'],
"smilieoff" => $post['options']['disablesmilies'],

				"longipaddress" => intval(my_ip2long($post['ipaddress'])),
"includesig" => $post['options']['signature'],
"smilieoff" => $post['options']['disablesmilies'],

				"visible" => $visible,
"posthash" => $db->escape_string($post['posthash'])

				"visible" => $visible


			);

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

			);

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

Zeile 895Zeile 899
				"longipaddress" => intval(my_ip2long($post['ipaddress'])),
"includesig" => $post['options']['signature'],
"smilieoff" => $post['options']['disablesmilies'],

				"longipaddress" => intval(my_ip2long($post['ipaddress'])),
"includesig" => $post['options']['signature'],
"smilieoff" => $post['options']['disablesmilies'],

				"visible" => $visible,
"posthash" => $db->escape_string($post['posthash'])

				"visible" => $visible


			);

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

			);

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

Zeile 909Zeile 912
		{
$post['posthash'] = $db->escape_string($post['posthash']);
$attachmentassign = array(

		{
$post['posthash'] = $db->escape_string($post['posthash']);
$attachmentassign = array(

				"pid" => $this->pid


				"pid" => $this->pid,
"posthash" => ''

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

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

Zeile 1026Zeile 1030
			// Update the unapproved posts count for the current forum
update_thread_counters($post['tid'], array("replies" => "+1"));
update_forum_counters($post['fid'], array("unapprovedposts" => "+1"));

			// Update the unapproved posts count for the current forum
update_thread_counters($post['tid'], array("replies" => "+1"));
update_forum_counters($post['fid'], array("unapprovedposts" => "+1"));

 
		}

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

		}

// Return the post's pid and whether or not it is visible.

		}

// Return the post's pid and whether or not it is visible.

Zeile 1198Zeile 1209
				"ipaddress" => $db->escape_string(get_ip()),
"includesig" => $thread['options']['signature'],
"smilieoff" => $thread['options']['disablesmilies'],

				"ipaddress" => $db->escape_string(get_ip()),
"includesig" => $thread['options']['signature'],
"smilieoff" => $thread['options']['disablesmilies'],

				"visible" => $visible,
"posthash" => $db->escape_string($thread['posthash'])

				"visible" => $visible


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


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


Zeile 1215Zeile 1225
				"fid" => $thread['fid'],
"subject" => $db->escape_string($thread['subject']),
"prefix" => intval($thread['prefix']),

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

				"icon" => intval($thread['icon']),
"uid" => $thread['uid'],

				"icon" => intval($thread['icon']),
"uid" => $thread['uid'],

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

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

Zeile 1244Zeile 1254
				"longipaddress" => intval(my_ip2long(get_ip())),
"includesig" => $thread['options']['signature'],
"smilieoff" => $thread['options']['disablesmilies'],

				"longipaddress" => intval(my_ip2long(get_ip())),
"includesig" => $thread['options']['signature'],
"smilieoff" => $thread['options']['disablesmilies'],

				"visible" => $visible,
"posthash" => $db->escape_string($thread['posthash'])

				"visible" => $visible


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


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


Zeile 1444Zeile 1453
		{
$thread['posthash'] = $db->escape_string($thread['posthash']);
$attachmentassign = array(

		{
$thread['posthash'] = $db->escape_string($thread['posthash']);
$attachmentassign = array(

				"pid" => $this->pid


				"pid" => $this->pid,
"posthash" => ''

			);
$db->update_query("attachments", $attachmentassign, "posthash='{$thread['posthash']}'");
}

			);
$db->update_query("attachments", $attachmentassign, "posthash='{$thread['posthash']}'");
}