Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: post.php 5380 2011-02-21 12:04:43Z Tomm $
| * $Id$
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 145 | Zeile 145 |
---|
global $db; $post = &$this->data; $subject = &$post['subject'];
|
global $db; $post = &$this->data; $subject = &$post['subject'];
|
| $subject = trim_blank_chrs($subject); $subject = utf8_handle_4byte_string($subject);
|
// Are we editing an existing thread or post? if($this->method == "update" && $post['pid'])
| // Are we editing an existing thread or post? if($this->method == "update" && $post['pid'])
|
Zeile 173 | Zeile 175 |
---|
}
// If this is the first post there needs to be a subject, else make it the default one.
|
}
// If this is the first post there needs to be a subject, else make it the default one.
|
if(my_strlen(trim_blank_chrs($subject)) == 0 && $first_post)
| if(my_strlen($subject) == 0 && $first_post)
|
{ $this->set_error("firstpost_no_subject"); return false;
| { $this->set_error("firstpost_no_subject"); return false;
|
Zeile 188 | Zeile 190 |
---|
// This is a new post else if($this->action == "post") {
|
// This is a new post else if($this->action == "post") {
|
if(my_strlen(trim_blank_chrs($subject)) == 0)
| if(my_strlen($subject) == 0)
|
{ $thread = get_thread($post['tid']); $subject = "RE: ".$thread['subject'];
| { $thread = get_thread($post['tid']); $subject = "RE: ".$thread['subject'];
|
Zeile 198 | Zeile 200 |
---|
// This is a new thread and we require that a subject is present. else {
|
// This is a new thread and we require that a subject is present. else {
|
if(my_strlen(trim_blank_chrs($subject)) == 0)
| if(my_strlen($subject) == 0)
|
{ $this->set_error("missing_subject"); return false; }
|
{ $this->set_error("missing_subject"); return false; }
|
| }
// 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)); return false;
|
}
// Subject is valid - return true. return true; }
|
}
// Subject is valid - return true. return true; }
|
|
|
/** * Verifies a post message. *
| /** * Verifies a post message. *
|
Zeile 217 | Zeile 237 |
---|
function verify_message() { global $mybb;
|
function verify_message() { global $mybb;
|
|
|
$post = &$this->data;
|
$post = &$this->data;
|
| $post['message'] = trim_blank_chrs($post['message']); $post['message'] = utf8_handle_4byte_string($post['message']);
|
// Do we even have a message at all?
|
// Do we even have a message at all?
|
if(my_strlen(trim_blank_chrs($post['message'])) == 0)
| if(my_strlen($post['message']) == 0)
|
{ $this->set_error("missing_message"); return false;
| { $this->set_error("missing_message"); return false;
|
Zeile 267 | Zeile 289 |
---|
function verify_post_flooding() { global $mybb;
|
function verify_post_flooding() { 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 277 | Zeile 299 |
---|
{ return true; }
|
{ return true; }
|
|
|
// Fetch the user information for this post - used to check their last post date. $user = get_user($post['uid']);
| // Fetch the user information for this post - used to check their last post date. $user = get_user($post['uid']);
|
Zeile 300 | Zeile 322 |
---|
// All is well that ends well - return true. return true; }
|
// All is well that ends well - return true. return true; }
|
|
|
function verify_post_merge($simple_mode=false) { global $mybb, $db, $session;
|
function verify_post_merge($simple_mode=false) { global $mybb, $db, $session;
|
|
|
$post = &$this->data;
|
$post = &$this->data;
|
|
|
// Are we starting a new thread? if(!$post['tid']) { return true; }
|
// Are we starting a new thread? if(!$post['tid']) { 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']) == "") { $mybb->settings['postmergesep'] = "[hr]"; }
|
// Assign a default separator if none is specified if(trim($mybb->settings['postmergesep']) == "") { $mybb->settings['postmergesep'] = "[hr]"; }
|
|
|
// Check to see if this person is in a usergroup that is excluded if(trim($mybb->settings['postmergeuignore']) != "") { $gids = explode(',', $mybb->settings['postmergeuignore']); $gids = array_map('intval', $gids);
|
// Check to see if this person is in a usergroup that is excluded if(trim($mybb->settings['postmergeuignore']) != "") { $gids = explode(',', $mybb->settings['postmergeuignore']); $gids = array_map('intval', $gids);
|
|
|
$user_usergroups = explode(',', $mybb->user['usergroup'].",".$mybb->user['additionalgroups']); if(count(array_intersect($user_usergroups, $gids)) > 0) { return true;
|
$user_usergroups = explode(',', $mybb->user['usergroup'].",".$mybb->user['additionalgroups']); if(count(array_intersect($user_usergroups, $gids)) > 0) { 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);
|
|
|
// Check to see if the same author has posted within the merge post time limit if((intval($mybb->settings['postmergemins']) != 0 && trim($mybb->settings['postmergemins']) != "") && (TIME_NOW-$thread['lastpost']) > (intval($mybb->settings['postmergemins'])*60)) { return true; }
|
// Check to see if the same author has posted within the merge post time limit if((intval($mybb->settings['postmergemins']) != 0 && trim($mybb->settings['postmergemins']) != "") && (TIME_NOW-$thread['lastpost']) > (intval($mybb->settings['postmergemins'])*60)) { return true; }
|
|
|
if(strstr($mybb->settings['postmergefignore'], ',')) { $fids = explode(',', $mybb->settings['postmergefignore']); foreach($fids as $key => $forumid)
|
if(strstr($mybb->settings['postmergefignore'], ',')) { $fids = explode(',', $mybb->settings['postmergefignore']); foreach($fids as $key => $forumid)
|
{
| {
|
$fid[] = intval($forumid);
|
$fid[] = intval($forumid);
|
}
| }
|
if(in_array($thread['fid'], $fid)) { return true; }
|
if(in_array($thread['fid'], $fid)) { return true; }
|
}
| }
|
else if(trim($mybb->settings['postmergefignore']) != "" && $thread['fid'] == intval($mybb->settings['postmergefignore'])) { return true; }
|
else if(trim($mybb->settings['postmergefignore']) != "" && $thread['fid'] == intval($mybb->settings['postmergefignore'])) { return true; }
|
|
|
if($simple_mode == true)
|
if($simple_mode == true)
|
{
| {
|
return false; }
|
return false; }
|
|
|
if($post['uid']) { $user_check = "uid='".$post['uid']."'";
| if($post['uid']) { $user_check = "uid='".$post['uid']."'";
|
Zeile 381 | Zeile 403 |
---|
{ $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 392 | Zeile 414 |
---|
* @return boolean True when valid, false when not valid. */ function verify_image_count()
|
* @return boolean True when valid, false when not valid. */ function verify_image_count()
|
{
| {
|
global $mybb, $db;
$post = &$this->data;
| global $mybb, $db;
$post = &$this->data;
|
Zeile 413 | Zeile 435 |
---|
{ require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser;
|
{ require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser;
|
|
|
// Parse the message. $parser_options = array( "allow_html" => $forum['allowhtml'],
| // Parse the message. $parser_options = array( "allow_html" => $forum['allowhtml'],
|
Zeile 444 | Zeile 466 |
---|
} } }
|
} } }
|
|
|
/** * Verifies the video count. *
| /** * Verifies the video count. *
|
Zeile 463 | Zeile 485 |
---|
if($post['savedraft'] != 1 && $mybb->settings['maxpostvideos'] != 0 && $permissions['cancp'] != 1) { // And count the number of video tags in the message.
|
if($post['savedraft'] != 1 && $mybb->settings['maxpostvideos'] != 0 && $permissions['cancp'] != 1) { // And count the number of video tags in the message.
|
$video_count = substr_count($post['message'], "[video]");
| $video_count = substr_count($post['message'], "[video=");
|
if($video_count > $mybb->settings['maxpostvideos']) { // Throw back a message if over the count with the number of images as well as the maximum number of images per post.
| if($video_count > $mybb->settings['maxpostvideos']) { // Throw back a message if over the count with the number of images as well as the maximum number of images per post.
|
Zeile 475 | Zeile 497 |
---|
/** * 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() { global $db;
| function verify_reply_to() { global $db;
|
Zeile 517 | Zeile 539 |
---|
/** * Verify the post icon.
|
/** * Verify the post icon.
|
* * @return boolean True when valid, false when not valid. */
| * * @return boolean True when valid, false when not valid. */
|
function verify_post_icon() { global $cache;
$post = &$this->data;
|
function verify_post_icon() { global $cache;
$post = &$this->data;
|
|
|
// If we don't assign it as 0. if(!$post['icon'] || $post['icon'] < 0) {
| // If we don't assign it as 0. if(!$post['icon'] || $post['icon'] < 0) {
|
Zeile 540 | Zeile 562 |
---|
* @return boolean True when valid, false when not valid. */ function verify_dateline()
|
* @return boolean True when valid, false when not valid. */ function verify_dateline()
|
{
| {
|
$dateline = &$this->data['dateline'];
// The date has to be numeric and > 0. if($dateline < 0 || is_numeric($dateline) == false)
|
$dateline = &$this->data['dateline'];
// The date has to be numeric and > 0. if($dateline < 0 || is_numeric($dateline) == false)
|
{
| {
|
$dateline = TIME_NOW; } }
|
$dateline = TIME_NOW; } }
|
|
|
/** * Verify thread prefix.
|
/** * Verify thread prefix.
|
*
| *
|
* @return boolean True when valid, false when not valid. */ function verify_prefix() { $prefix = &$this->data['prefix'];
|
* @return boolean True when valid, false when not valid. */ function verify_prefix() { $prefix = &$this->data['prefix'];
|
|
|
// If a valid prefix isn't supplied, don't assign one. if(!$prefix || $prefix < 1) { $prefix = 0;
|
// If a valid prefix isn't supplied, don't assign one. if(!$prefix || $prefix < 1) { $prefix = 0;
|
}
| }
|
return true; }
| return true; }
|
Zeile 576 | Zeile 598 |
---|
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";
|
$this->action = "post";
|
|
|
if($this->method != "update" && !$post['savedraft'])
|
if($this->method != "update" && !$post['savedraft'])
|
{
| {
|
$this->verify_post_flooding(); }
|
$this->verify_post_flooding(); }
|
|
|
// Verify all post assets.
if($this->method == "insert" || array_key_exists('uid', $post)) { $this->verify_author();
|
// Verify all post assets.
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))
|
{
| {
|
$this->verify_subject(); }
| $this->verify_subject(); }
|
Zeile 604 | Zeile 626 |
---|
$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();
|
}
| }
|
if($this->method == "insert" || array_key_exists('replyto', $post)) {
| if($this->method == "insert" || array_key_exists('replyto', $post)) {
|
Zeile 617 | Zeile 639 |
---|
}
if($this->method == "insert" || array_key_exists('icon', $post))
|
}
if($this->method == "insert" || array_key_exists('icon', $post))
|
{
| {
|
$this->verify_post_icon();
|
$this->verify_post_icon();
|
}
| }
|
if($this->method == "insert" || array_key_exists('options', $post))
|
if($this->method == "insert" || array_key_exists('options', $post))
|
{
| {
|
$this->verify_options(); }
|
$this->verify_options(); }
|
$plugins->run_hooks_by_ref("datahandler_post_validate_post", $this);
| $plugins->run_hooks("datahandler_post_validate_post", $this);
|
// We are done validating, return. $this->set_validated(true);
|
// We are done validating, return. $this->set_validated(true);
|
if(count($this->get_errors()) > 0) {
| if(count($this->get_errors()) > 0) {
|
return false; } else
| return false; } else
|
Zeile 656 | Zeile 678 |
---|
if(!$this->get_validated()) { die("The post needs to be validated before inserting it into the DB.");
|
if(!$this->get_validated()) { die("The post needs to be validated before inserting it into the DB.");
|
}
| }
|
if(count($this->get_errors()) > 0)
|
if(count($this->get_errors()) > 0)
|
{
| {
|
die("The post is not valid."); }
|
die("The post is not valid."); }
|
|
|
// Fetch the thread $thread = get_thread($post['tid']);
| // Fetch the thread $thread = get_thread($post['tid']);
|
Zeile 670 | Zeile 692 |
---|
{ $visible = -2; }
|
{ $visible = -2; }
|
|
|
// Otherwise this post is being made now and we have a bit to do. else {
| // Otherwise this post is being made now and we have a bit to do. else {
|
Zeile 723 | Zeile 745 |
---|
// Unstick the thread. if($modoptions['stickthread'] != 1 && $thread['sticky']) {
|
// Unstick the thread. if($modoptions['stickthread'] != 1 && $thread['sticky']) {
|
$newstick = "sticky='0'";
| $newstick = "sticky='0'";
|
log_moderator_action($modlogdata, $lang->thread_unstuck); }
| log_moderator_action($modlogdata, $lang->thread_unstuck); }
|
Zeile 761 | Zeile 783 |
---|
$visible = 0; } }
|
$visible = 0; } }
|
| $post['pid'] = intval($post['pid']); $post['uid'] = intval($post['uid']);
if($post['pid'] > 0) { $query = $db->simple_select("posts", "tid", "pid='{$post['pid']}' AND uid='{$post['uid']}' AND visible='-2'"); $draft_check = $db->fetch_field($query, "tid"); } else { $draft_check = false; }
|
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) { $this->pid = $double_post['pid'];
|
// 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'];
|
$post['message'] = $double_post['message'] .= $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'] = intval($post['uid']); $update_query['edittime'] = TIME_NOW; $query = $db->update_query("posts", $update_query, "pid='".$double_post['pid']."'");
|
$update_query = array( "message" => $db->escape_string($double_post['message']) ); $update_query['edituid'] = intval($post['uid']); $update_query['edittime'] = TIME_NOW; $query = $db->update_query("posts", $update_query, "pid='".$double_post['pid']."'");
|
// Assign any uploaded attachments with the specific posthash to the merged post. if($double_post['posthash'])
| 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.
|
$post['posthash'] = $db->escape_string($post['posthash']);
|
$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");
|
$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}")); }
|
if($attachmentcount > 0) { // Update forum count update_thread_counters($post['tid'], array('attachmentcount' => "+{$attachmentcount}")); }
|
|
|
$attachmentassign = array( "pid" => $double_post['pid'],
|
$attachmentassign = array( "pid" => $double_post['pid'],
|
"posthash" => $double_post['posthash'],
| "posthash" => ''
|
);
|
);
|
$db->update_query("attachments", $attachmentassign, "posthash='{$post['posthash']}'"); $post['posthash'] = $double_post['posthash'];
| $db->update_query("attachments", $attachmentassign, "posthash='{$post['posthash']}' AND pid='0'");
|
}
|
}
|
|
|
// Return the post's pid and whether or not it is visible. return array( "pid" => $double_post['pid'], "visible" => $visible );
|
// Return the post's pid and whether or not it is visible. return array( "pid" => $double_post['pid'], "visible" => $visible );
|
} } if($visible == 1 && $thread['visible'] == 1) { $now = TIME_NOW;
| } }
if($visible == 1 && $thread['visible'] == 1) { $now = TIME_NOW;
|
// Yes, the value to the lastpost key in this array has single quotes within double quotes. It's not a bug. $update_array = array( 'lastpost' => "'{$now}'"
| // Yes, the value to the lastpost key in this array has single quotes within double quotes. It's not a bug. $update_array = array( 'lastpost' => "'{$now}'"
|
Zeile 823 | Zeile 860 |
---|
{ $update_array['postnum'] = 'postnum+1'; }
|
{ $update_array['postnum'] = 'postnum+1'; }
|
|
|
$db->update_query("users", $update_array, "uid='{$post['uid']}'", 1, true);
|
$db->update_query("users", $update_array, "uid='{$post['uid']}'", 1, true);
|
}
$post['pid'] = intval($post['pid']); $post['uid'] = intval($post['uid']);
if($post['pid'] > 0) { $query = $db->simple_select("posts", "tid", "pid='{$post['pid']}' AND uid='{$post['uid']}' AND visible='-2'"); $draft_check = $db->fetch_field($query, "tid"); } else { $draft_check = false;
| |
}
// Are we updating a post which is already a draft? Perhaps changing it into a visible post?
| }
// Are we updating a post which is already a draft? Perhaps changing it into a visible post?
|
Zeile 845 | Zeile 869 |
---|
{ // 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" => intval($post['icon']), "uid" => $post['uid'], "username" => $db->escape_string($post['username']),
| "subject" => $db->escape_string($post['subject']), "icon" => intval($post['icon']), "uid" => $post['uid'], "username" => $db->escape_string($post['username']),
|
"dateline" => intval($post['dateline']), "message" => $db->escape_string($post['message']), "ipaddress" => $db->escape_string($post['ipaddress']), "longipaddress" => intval(my_ip2long($post['ipaddress'])), "includesig" => $post['options']['signature'], "smilieoff" => $post['options']['disablesmilies'],
|
"dateline" => intval($post['dateline']), "message" => $db->escape_string($post['message']), "ipaddress" => $db->escape_string($post['ipaddress']), "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_by_ref("datahandler_post_insert_post", $this);
| $plugins->run_hooks("datahandler_post_insert_post", $this);
|
$db->update_query("posts", $this->post_update_data, "pid='{$post['pid']}'"); $this->pid = $post['pid'];
| $db->update_query("posts", $this->post_update_data, "pid='{$post['pid']}'"); $this->pid = $post['pid'];
|
Zeile 881 | Zeile 904 |
---|
"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_by_ref("datahandler_post_insert_post", $this);
| $plugins->run_hooks("datahandler_post_insert_post", $this);
|
$this->pid = $db->insert_query("posts", $this->post_insert_data);
|
$this->pid = $db->insert_query("posts", $this->post_insert_data);
|
}
| }
|
// Assign any uploaded attachments with the specific posthash to the newly created post. if($post['posthash'])
|
// Assign any uploaded attachments with the specific posthash to the newly created post. if($post['posthash'])
|
{
| {
|
$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']}' AND pid='0'");
|
}
if($visible == 1 && $thread['visible'] == 1)
| }
if($visible == 1 && $thread['visible'] == 1)
|
Zeile 905 | Zeile 928 |
---|
$thread = get_thread($post['tid']); require_once MYBB_ROOT.'inc/class_parser.php'; $parser = new Postparser;
|
$thread = get_thread($post['tid']); require_once MYBB_ROOT.'inc/class_parser.php'; $parser = new Postparser;
|
|
|
$done_users = array();
|
$done_users = array();
|
|
|
$subject = $parser->parse_badwords($thread['subject']); $excerpt = $parser->text_parse_message($post['message'], array('me_username' => $post['username'], 'filter_badwords' => 1, 'safe_html' => 1)); $excerpt = my_substr($excerpt, 0, $mybb->settings['subscribeexcerpt']).$lang->emailbit_viewthread;
| $subject = $parser->parse_badwords($thread['subject']); $excerpt = $parser->text_parse_message($post['message'], array('me_username' => $post['username'], 'filter_badwords' => 1, 'safe_html' => 1)); $excerpt = my_substr($excerpt, 0, $mybb->settings['subscribeexcerpt']).$lang->emailbit_viewthread;
|
Zeile 928 | Zeile 951 |
---|
continue; } $done_users[$subscribedmember['uid']] = 1;
|
continue; } $done_users[$subscribedmember['uid']] = 1;
|
|
|
$forumpermissions = forum_permissions($thread['fid'], $subscribedmember['uid']); if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0) {
| $forumpermissions = forum_permissions($thread['fid'], $subscribedmember['uid']); if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0) {
|
Zeile 940 | Zeile 963 |
---|
// User isn't a moderator or the author of the thread... continue; }
|
// User isn't a moderator or the author of the thread... continue; }
|
|
|
if($subscribedmember['language'] != '' && $lang->language_exists($subscribedmember['language'])) { $uselang = $subscribedmember['language'];
| if($subscribedmember['language'] != '' && $lang->language_exists($subscribedmember['language'])) { $uselang = $subscribedmember['language'];
|
Zeile 975 | Zeile 998 |
---|
$emailmessage = $langcache[$uselang]['email_subscription']; } $emailsubject = $lang->sprintf($emailsubject, $subject);
|
$emailmessage = $langcache[$uselang]['email_subscription']; } $emailsubject = $lang->sprintf($emailsubject, $subject);
|
$post_code = md5($subscribedmember['loginkey'].$subscribedmember['salt'].$subscribedmember['regdate']);
| $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); $new_email = array( "mailto" => $db->escape_string($subscribedmember['email']),
| $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); $new_email = array( "mailto" => $db->escape_string($subscribedmember['email']),
|
Zeile 1012 | Zeile 1035 |
---|
// 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 1019 | Zeile 1049 |
---|
"pid" => $this->pid, "visible" => $visible );
|
"pid" => $this->pid, "visible" => $visible );
|
}
| }
|
/** * Validate a thread. *
| /** * Validate a thread. *
|
Zeile 1030 | Zeile 1060 |
---|
{ global $mybb, $db, $plugins;
|
{ global $mybb, $db, $plugins;
|
$thread = &$this->data;
| $thread = &$this->data;
|
// Validate all thread assets.
|
// Validate all thread assets.
|
|
|
if(!$thread['savedraft']) { $this->verify_post_flooding();
| if(!$thread['savedraft']) { $this->verify_post_flooding();
|
Zeile 1043 | Zeile 1073 |
---|
{ $this->verify_author(); }
|
{ $this->verify_author(); }
|
|
|
if($this->method == "insert" || array_key_exists('prefix', $thread)) { $this->verify_prefix();
| if($this->method == "insert" || array_key_exists('prefix', $thread)) { $this->verify_prefix();
|
Zeile 1076 | Zeile 1106 |
---|
$this->verify_options(); }
|
$this->verify_options(); }
|
$plugins->run_hooks_by_ref("datahandler_post_validate_thread", $this);
| $plugins->run_hooks("datahandler_post_validate_thread", $this);
|
// We are done validating, return. $this->set_validated(true);
| // We are done validating, return. $this->set_validated(true);
|
Zeile 1101 | Zeile 1131 |
---|
// Yes, validating is required. if(!$this->get_validated())
|
// Yes, validating is required. if(!$this->get_validated())
|
{
| {
|
die("The thread needs to be validated before inserting it into the DB.");
|
die("The thread needs to be validated before inserting it into the DB.");
|
}
| }
|
if(count($this->get_errors()) > 0)
|
if(count($this->get_errors()) > 0)
|
{
| {
|
die("The thread is not valid.");
|
die("The thread is not valid.");
|
}
$thread = &$this->data;
| }
$thread = &$this->data;
|
// Fetch the forum this thread is being made in $forum = get_forum($thread['fid']);
|
// Fetch the forum this thread is being made in $forum = get_forum($thread['fid']);
|
|
|
// This thread is being saved as a draft. if($thread['savedraft']) {
| // This thread is being saved as a draft. if($thread['savedraft']) {
|
Zeile 1121 | Zeile 1151 |
---|
}
// Thread is being made now and we have a bit to do.
|
}
// Thread is being made now and we have a bit to do.
|
else {
| else {
|
// Decide on the visibility of this post. if(($forum['modthreads'] == 1 || $forum['modposts'] == 1) && !is_moderator($thread['fid'], "", $thread['uid'])) {
|
// Decide on the visibility of this post. if(($forum['modthreads'] == 1 || $forum['modposts'] == 1) && !is_moderator($thread['fid'], "", $thread['uid'])) {
|
$visible = 0; } else {
| $visible = 0; } else {
|
$visible = 1; }
|
$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 1143 | Zeile 1173 |
---|
// Have a post ID but not a thread ID - fetch thread ID if($thread['pid'] && !$thread['tid'])
|
// Have a post ID but not a thread ID - fetch thread ID if($thread['pid'] && !$thread['tid'])
|
{
| {
|
$query = $db->simple_select("posts", "tid", "pid='{$thread['pid']}"); $thread['tid'] = $db->fetch_field($query, "tid");
|
$query = $db->simple_select("posts", "tid", "pid='{$thread['pid']}"); $thread['tid'] = $db->fetch_field($query, "tid");
|
}
| }
|
if($thread['pid'] > 0)
|
if($thread['pid'] > 0)
|
{
| {
|
$query = $db->simple_select("posts", "pid", "pid='{$thread['pid']}' AND uid='{$thread['uid']}' AND visible='-2'"); $draft_check = $db->fetch_field($query, "pid"); }
| $query = $db->simple_select("posts", "pid", "pid='{$thread['pid']}' AND uid='{$thread['uid']}' AND visible='-2'"); $draft_check = $db->fetch_field($query, "pid"); }
|
Zeile 1160 | Zeile 1190 |
---|
// Are we updating a post which is already a draft? Perhaps changing it into a visible post? if($draft_check)
|
// 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" => intval($thread['icon']), "username" => $db->escape_string($thread['username']), "dateline" => intval($thread['dateline']), "lastpost" => intval($thread['dateline']), "lastposter" => $db->escape_string($thread['username']), "visible" => $visible );
$plugins->run_hooks_by_ref("datahandler_post_insert_thread", $this);
$db->update_query("threads", $this->thread_insert_data, "tid='{$thread['tid']}'");
$this->post_insert_data = array(
| { $this->thread_insert_data = array(
|
"subject" => $db->escape_string($thread['subject']), "icon" => intval($thread['icon']), "username" => $db->escape_string($thread['username']), "dateline" => intval($thread['dateline']),
|
"subject" => $db->escape_string($thread['subject']), "icon" => intval($thread['icon']), "username" => $db->escape_string($thread['username']), "dateline" => intval($thread['dateline']),
|
"message" => $db->escape_string($thread['message']), "ipaddress" => $db->escape_string(get_ip()), "includesig" => $thread['options']['signature'], "smilieoff" => $thread['options']['disablesmilies'], "visible" => $visible, "posthash" => $db->escape_string($thread['posthash'])
| "lastpost" => intval($thread['dateline']), "lastposter" => $db->escape_string($thread['username']), "visible" => $visible
|
);
|
);
|
$plugins->run_hooks_by_ref("datahandler_post_insert_thread_post", $this);
| $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" => intval($thread['icon']), "username" => $db->escape_string($thread['username']), "dateline" => intval($thread['dateline']), "message" => $db->escape_string($thread['message']), "ipaddress" => $db->escape_string(get_ip()), "includesig" => $thread['options']['signature'], "smilieoff" => $thread['options']['disablesmilies'], "visible" => $visible ); $plugins->run_hooks("datahandler_post_insert_thread_post", $this);
|
$db->update_query("posts", $this->post_insert_data, "pid='{$thread['pid']}'"); $this->tid = $thread['tid'];
| $db->update_query("posts", $this->post_insert_data, "pid='{$thread['pid']}'"); $this->tid = $thread['tid'];
|
Zeile 1213 | Zeile 1242 |
---|
"notes" => '' );
|
"notes" => '' );
|
$plugins->run_hooks_by_ref("datahandler_post_insert_thread", $this);
| $plugins->run_hooks("datahandler_post_insert_thread", $this);
|
$this->tid = $db->insert_query("threads", $this->thread_insert_data);
| $this->tid = $db->insert_query("threads", $this->thread_insert_data);
|
Zeile 1230 | Zeile 1259 |
---|
"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_by_ref("datahandler_post_insert_thread_post", $this);
| $plugins->run_hooks("datahandler_post_insert_thread_post", $this);
|
$this->pid = $db->insert_query("posts", $this->post_insert_data);
| $this->pid = $db->insert_query("posts", $this->post_insert_data);
|
Zeile 1264 | Zeile 1292 |
---|
if(is_moderator($thread['fid'], "", $thread['uid']) && is_array($thread['modoptions'])) { $lang->load($this->language_file, true);
|
if(is_moderator($thread['fid'], "", $thread['uid']) && is_array($thread['modoptions'])) { $lang->load($this->language_file, true);
|
|
|
$modoptions = $thread['modoptions']; $modlogdata['fid'] = $this->tid; $modlogdata['tid'] = $thread['tid'];
|
$modoptions = $thread['modoptions']; $modlogdata['fid'] = $this->tid; $modlogdata['tid'] = $thread['tid'];
|
|
|
// Close the thread. if($modoptions['closethread'] == 1) { $newclosed = "closed=1"; log_moderator_action($modlogdata, $lang->thread_closed);
|
// Close the thread. if($modoptions['closethread'] == 1) { $newclosed = "closed=1"; log_moderator_action($modlogdata, $lang->thread_closed);
|
}
| }
|
// Stick the thread. if($modoptions['stickthread'] == 1)
|
// Stick the thread. if($modoptions['stickthread'] == 1)
|
{
| {
|
$newstick = "sticky='1'"; log_moderator_action($modlogdata, $lang->thread_stuck);
|
$newstick = "sticky='1'"; log_moderator_action($modlogdata, $lang->thread_stuck);
|
}
| }
|
// Execute moderation options. if($newstick && $newclosed)
| // Execute moderation options. if($newstick && $newclosed)
|
Zeile 1295 | Zeile 1323 |
---|
SET $newclosed$sep$newstick WHERE tid='{$this->tid}' ");
|
SET $newclosed$sep$newstick WHERE tid='{$this->tid}' ");
|
} }
| } }
|
if($visible == 1) { // If we have a registered user then update their post count and last post times.
| if($visible == 1) { // If we have a registered user then update their post count and last post times.
|
Zeile 1322 | Zeile 1350 |
---|
$db->update_query("users", $update_query, "uid='{$thread['uid']}'", 1, true); } }
|
$db->update_query("users", $update_query, "uid='{$thread['uid']}'", 1, true); } }
|
|
|
if(!$forum['lastpost']) { $forum['lastpost'] = 0; }
|
if(!$forum['lastpost']) { $forum['lastpost'] = 0; }
|
|
|
$done_users = array();
|
$done_users = array();
|
|
|
// Queue up any forum subscription notices to users who are subscribed to this forum. $excerpt = my_substr($thread['message'], 0, $mybb->settings['subscribeexcerpt']).$lang->emailbit_viewthread;
|
// Queue up any forum subscription notices to users who are subscribed to this forum. $excerpt = my_substr($thread['message'], 0, $mybb->settings['subscribeexcerpt']).$lang->emailbit_viewthread;
|
|
|
// Parse badwords require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser;
| // Parse badwords require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser;
|
Zeile 1355 | Zeile 1383 |
---|
continue; } $done_users[$subscribedmember['uid']] = 1;
|
continue; } $done_users[$subscribedmember['uid']] = 1;
|
|
|
$forumpermissions = forum_permissions($thread['fid'], $subscribedmember['uid']); if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0) { continue;
|
$forumpermissions = forum_permissions($thread['fid'], $subscribedmember['uid']); if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0) { continue;
|
}
| }
|
if(!is_moderator($thread['fid'], "", $subscribedmember['uid']) && $forumpermissions['canonlyviewownthreads'] == 1) { // In a 'view own only' forum and not a moderator continue;
|
if(!is_moderator($thread['fid'], "", $subscribedmember['uid']) && $forumpermissions['canonlyviewownthreads'] == 1) { // In a 'view own only' forum and not a moderator continue;
|
}
| }
|
// Determine the language pack we'll be using to send this email in and load it if it isn't already. if($subscribedmember['language'] != '' && $lang->language_exists($subscribedmember['language']))
| // Determine the language pack we'll be using to send this email in and load it if it isn't already. if($subscribedmember['language'] != '' && $lang->language_exists($subscribedmember['language']))
|
Zeile 1374 | Zeile 1402 |
---|
$uselang = $subscribedmember['language']; } else if($mybb->settings['bblanguage'])
|
$uselang = $subscribedmember['language']; } else if($mybb->settings['bblanguage'])
|
{
| {
|
$uselang = $mybb->settings['bblanguage']; } else { $uselang = "english";
|
$uselang = $mybb->settings['bblanguage']; } else { $uselang = "english";
|
}
| }
|
if($uselang == $mybb->settings['bblanguage']) { $emailsubject = $lang->emailsubject_forumsubscription;
| if($uselang == $mybb->settings['bblanguage']) { $emailsubject = $lang->emailsubject_forumsubscription;
|
Zeile 1403 | Zeile 1431 |
---|
$emailmessage = $langcache[$uselang]['email_forumsubscription']; } $emailsubject = $lang->sprintf($emailsubject, $forum['name']);
|
$emailmessage = $langcache[$uselang]['email_forumsubscription']; } $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); $new_email = array(
| $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); $new_email = array(
|
Zeile 1430 | Zeile 1458 |
---|
{ $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']}' AND pid='0'");
|
}
|
}
|
|
|
if($visible == 1)
|
if($visible == 1)
|
{ update_thread_data($this->tid);
| { update_thread_data($this->tid);
|
update_forum_counters($thread['fid'], array("threads" => "+1", "posts" => "+1"));
|
update_forum_counters($thread['fid'], array("threads" => "+1", "posts" => "+1"));
|
}
| }
|
else if($visible == 0) { update_thread_data($this->tid); update_thread_counters($this->tid, array("replies" => 0)); update_forum_counters($thread['fid'], array("unapprovedthreads" => "+1", "unapprovedposts" => "+1")); }
|
else if($visible == 0) { update_thread_data($this->tid); update_thread_counters($this->tid, array("replies" => 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"); if($attachmentcount > 0)
| $query = $db->simple_select("attachments", "COUNT(aid) AS attachmentcount", "pid='{$this->pid}' AND visible='1'"); $attachmentcount = $db->fetch_field($query, "attachmentcount"); if($attachmentcount > 0)
|
Zeile 1483 | Zeile 1512 |
---|
$post = &$this->data;
$post['pid'] = intval($post['pid']);
|
$post = &$this->data;
$post['pid'] = intval($post['pid']);
|
|
|
$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'];
|
$forum = get_forum($post['fid']);
| $forum = get_forum($post['fid']);
|
// Decide on the visibility of this post. if(isset($post['visible']) && $post['visible'] != $existing_post['visible'])
| // Decide on the visibility of this post. if(isset($post['visible']) && $post['visible'] != $existing_post['visible'])
|
Zeile 1500 | Zeile 1529 |
---|
update_thread_data($existing_post['tid']); update_thread_counters($existing_post['tid'], array('replies' => '-1', 'unapprovedposts' => '+1')); update_forum_counters($existing_post['fid'], array('unapprovedthreads' => '+1', 'unapprovedposts' => '+1'));
|
update_thread_data($existing_post['tid']); update_thread_counters($existing_post['tid'], array('replies' => '-1', 'unapprovedposts' => '+1')); update_forum_counters($existing_post['fid'], array('unapprovedthreads' => '+1', 'unapprovedposts' => '+1'));
|
|
|
// Subtract from the users post count
|
// Subtract from the users post count
|
// Update the post count if this forum allows post counts to be tracked
| // Update the post count if this forum allows post counts to be tracked
|
if($forum['usepostcounts'] != 0) { $db->write_query("UPDATE ".TABLE_PREFIX."users SET postnum=postnum-1 WHERE uid='{$existing_post['uid']}'");
| if($forum['usepostcounts'] != 0) { $db->write_query("UPDATE ".TABLE_PREFIX."users SET postnum=postnum-1 WHERE uid='{$existing_post['uid']}'");
|
Zeile 1517 | Zeile 1546 |
---|
update_thread_data($existing_post['tid']); update_thread_counters($existing_post['tid'], array('replies' => '+1', 'unapprovedposts' => '-1')); update_forum_counters($existing_post['fid'], array('unapprovedthreads' => '-1', 'unapprovedposts' => '-1'));
|
update_thread_data($existing_post['tid']); update_thread_counters($existing_post['tid'], array('replies' => '+1', 'unapprovedposts' => '-1')); update_forum_counters($existing_post['fid'], array('unapprovedthreads' => '-1', 'unapprovedposts' => '-1'));
|
|
|
// Update the post count if this forum allows post counts to be tracked if($forum['usepostcounts'] != 0) {
| // Update the post count if this forum allows post counts to be tracked if($forum['usepostcounts'] != 0) {
|
Zeile 1553 | Zeile 1582 |
---|
{ $first_post = false; }
|
{ $first_post = false; }
|
|
|
if($existing_post['visible'] == 0)
|
if($existing_post['visible'] == 0)
|
{
| {
|
$visible = 0; }
|
$visible = 0; }
|
|
|
// Update the thread details that might have been changed first. if($first_post)
|
// Update the thread details that might have been changed first. if($first_post)
|
{
| {
|
$this->tid = $post['tid'];
$this->thread_update_data['visible'] = $visible;
|
$this->tid = $post['tid'];
$this->thread_update_data['visible'] = $visible;
|
|
|
if(isset($post['prefix']))
|
if(isset($post['prefix']))
|
{
| {
|
$this->thread_update_data['prefix'] = intval($post['prefix']); }
if(isset($post['subject'])) { $this->thread_update_data['subject'] = $db->escape_string($post['subject']);
|
$this->thread_update_data['prefix'] = intval($post['prefix']); }
if(isset($post['subject'])) { $this->thread_update_data['subject'] = $db->escape_string($post['subject']);
|
}
| }
|
if(isset($post['icon'])) { $this->thread_update_data['icon'] = intval($post['icon']); } if(count($this->thread_update_data) > 0) {
|
if(isset($post['icon'])) { $this->thread_update_data['icon'] = intval($post['icon']); } if(count($this->thread_update_data) > 0) {
|
$plugins->run_hooks_by_ref("datahandler_post_update_thread", $this);
| $plugins->run_hooks("datahandler_post_update_thread", $this);
|
$db->update_query("threads", $this->thread_update_data, "tid='".intval($post['tid'])."'"); } }
|
$db->update_query("threads", $this->thread_update_data, "tid='".intval($post['tid'])."'"); } }
|
// Prepare array for post updating.
| // Prepare array for post updating.
|
$this->pid = $post['pid'];
if(isset($post['subject']))
|
$this->pid = $post['pid'];
if(isset($post['subject']))
|
{
| {
|
$this->post_update_data['subject'] = $db->escape_string($post['subject']);
|
$this->post_update_data['subject'] = $db->escape_string($post['subject']);
|
}
| }
|
if(isset($post['message']))
|
if(isset($post['message']))
|
{
| {
|
$this->post_update_data['message'] = $db->escape_string($post['message']);
|
$this->post_update_data['message'] = $db->escape_string($post['message']);
|
}
| }
|
if(isset($post['icon'])) {
| if(isset($post['icon'])) {
|
Zeile 1610 | Zeile 1639 |
---|
if(isset($post['options'])) { if(isset($post['options']['disablesmilies']))
|
if(isset($post['options'])) { if(isset($post['options']['disablesmilies']))
|
{
| {
|
$this->post_update_data['smilieoff'] = $db->escape_string($post['options']['disablesmilies']);
|
$this->post_update_data['smilieoff'] = $db->escape_string($post['options']['disablesmilies']);
|
}
| }
|
if(isset($post['options']['signature'])) { $this->post_update_data['includesig'] = $db->escape_string($post['options']['signature']); }
|
if(isset($post['options']['signature'])) { $this->post_update_data['includesig'] = $db->escape_string($post['options']['signature']); }
|
}
| }
|
// If we need to show the edited by, let's do so. if(($mybb->settings['showeditedby'] == 1 && !is_moderator($post['fid'], "caneditposts", $post['edit_uid'])) || ($mybb->settings['showeditedbyadmin'] == 1 && is_moderator($post['fid'], "caneditposts", $post['edit_uid']))) {
| // If we need to show the edited by, let's do so. if(($mybb->settings['showeditedby'] == 1 && !is_moderator($post['fid'], "caneditposts", $post['edit_uid'])) || ($mybb->settings['showeditedbyadmin'] == 1 && is_moderator($post['fid'], "caneditposts", $post['edit_uid']))) {
|
Zeile 1627 | Zeile 1656 |
---|
}
$this->post_update_data['visible'] = $visible;
|
}
$this->post_update_data['visible'] = $visible;
|
$plugins->run_hooks_by_ref("datahandler_post_update", $this);
| $plugins->run_hooks("datahandler_post_update", $this);
|
$db->update_query("posts", $this->post_update_data, "pid='".intval($post['pid'])."'");
| $db->update_query("posts", $this->post_update_data, "pid='".intval($post['pid'])."'");
|