Zeile 261 | Zeile 261 |
---|
if(stripos($db->type, 'my') !== false) { $fields = $db->show_fields_from("posts");
|
if(stripos($db->type, 'my') !== false) { $fields = $db->show_fields_from("posts");
|
$dblimit = reset(array_filter(array_map(function($field)
| $type = $fields[array_search('message', array_column($fields, 'Field'))]['Type']; switch(strtolower($type))
|
{
|
{
|
if($field['Field'] == 'message') { switch(strtolower($field['Type'])) { case 'longtext': return 4294967295; break; case 'mediumtext': return 16777215; break; case 'text': default: return 65535; break; } } }, $fields)));
| case 'longtext': $dblimit = 4294967295; break; case 'mediumtext': $dblimit = 16777215; break; case 'text': default: $dblimit = 65535; break; }
|
}
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) { $limit = $is_moderator ? $dblimit : min($limit, $dblimit);
|
// 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);
| else { $limit = max($limit, $dblimit);
|
Zeile 298 | Zeile 310 |
---|
if(strlen($post['message']) > $limit && (!$is_moderator || $limit == $dblimit)) { $this->set_error("message_too_long", array($limit, strlen($post['message'])));
|
if(strlen($post['message']) > $limit && (!$is_moderator || $limit == $dblimit)) { $this->set_error("message_too_long", array($limit, strlen($post['message'])));
|
return false; } }
| return false; } }
|
if(!isset($post['fid'])) { $post['fid'] = 0;
| if(!isset($post['fid'])) { $post['fid'] = 0;
|
Zeile 324 | Zeile 336 |
---|
else if(my_strlen($post['message']) < $mybb->settings['minmessagelength'] && $mybb->settings['minmessagelength'] > 0 && !is_moderator($post['fid'], "", $post['uid'])) { $this->set_error("message_too_short", array($mybb->settings['minmessagelength']));
|
else if(my_strlen($post['message']) < $mybb->settings['minmessagelength'] && $mybb->settings['minmessagelength'] > 0 && !is_moderator($post['fid'], "", $post['uid'])) { $this->set_error("message_too_short", array($mybb->settings['minmessagelength']));
|
return false; }
| return false; }
|
} return true; }
| } return true; }
|
Zeile 398 | Zeile 410 |
---|
global $mybb, $db, $session;
$post = &$this->data;
|
global $mybb, $db, $session;
$post = &$this->data;
|
|
|
// Are we starting a new thread? if(empty($post['tid']))
|
// Are we starting a new thread? if(empty($post['tid']))
|
{ return true; }
| { return true; }
|
// Are we even turned on? if(empty($mybb->settings['postmergemins']))
|
// Are we even turned on? if(empty($mybb->settings['postmergemins']))
|
{ return true;
| { return true;
|
}
// Assign a default separator if none is specified if(trim($mybb->settings['postmergesep']) == "")
|
}
// Assign a default separator if none is specified if(trim($mybb->settings['postmergesep']) == "")
|
{
| {
|
$mybb->settings['postmergesep'] = "[hr]";
|
$mybb->settings['postmergesep'] = "[hr]";
|
}
| }
|
// Check to see if this person is in a usergroup that is excluded if(is_member($mybb->settings['postmergeuignore'], $post['uid']))
|
// Check to see if this person is in a usergroup that is excluded if(is_member($mybb->settings['postmergeuignore'], $post['uid']))
|
{ return true; }
| { return true; }
|
// Select the lastpost and fid information for this thread $query = $db->simple_select("threads", "lastpost,fid", "lastposteruid='".$post['uid']."' AND tid='".$post['tid']."'", array('limit' => '1')); $thread = $db->fetch_array($query);
// Check to see if the same author has posted within the merge post time limit
|
// 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(((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 461 | Zeile 478 |
---|
return false; }
|
return false; }
|
if($post['uid'])
| if(!empty($post['uid']))
|
{ $user_check = "uid='".$post['uid']."'"; }
| { $user_check = "uid='".$post['uid']."'"; }
|
Zeile 472 | Zeile 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.
| /** * Verifies the image count.
|
Zeile 482 | Zeile 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
|
// Fetch the forum this post is being made in
|
if(!$post['fid'])
| if(empty($post['fid']))
|
{ $query = $db->simple_select('posts', 'fid', "pid = '{$post['pid']}'"); $post['fid'] = $db->fetch_field($query, 'fid');
| { $query = $db->simple_select('posts', 'fid', "pid = '{$post['pid']}'"); $post['fid'] = $db->fetch_field($query, 'fid');
|
Zeile 511 | Zeile 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 545 | Zeile 571 |
---|
global $mybb, $db;
$post = &$this->data;
|
global $mybb, $db;
$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);
|
// 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 573 | Zeile 608 |
---|
function verify_reply_to() { global $db;
|
function verify_reply_to() { global $db;
|
$post = &$this->data;
| $post = &$this->data;
|
// Check if the post being replied to actually exists in this thread. if($post['replyto'])
| // Check if the post being replied to actually exists in this thread. if($post['replyto'])
|
Zeile 596 | Zeile 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 624 | Zeile 658 |
---|
if(empty($post['icon']) || !isset($posticons_cache[$post['icon']])) { $post['icon'] = 0;
|
if(empty($post['icon']) || !isset($posticons_cache[$post['icon']])) { $post['icon'] = 0;
|
}
| }
|
return true; }
| return true; }
|
Zeile 671 | Zeile 705 |
---|
if(empty($prefix_cache)) { $this->set_error('invalid_prefix');
|
if(empty($prefix_cache)) { $this->set_error('invalid_prefix');
|
return false; }
| return false; }
|
if($prefix_cache['groups'] != "-1") { if(!empty($this->data['edit_uid']))
| if($prefix_cache['groups'] != "-1") { if(!empty($this->data['edit_uid']))
|
Zeile 718 | Zeile 752 |
---|
$user = get_user($this->data['edit_uid']); } else
|
$user = get_user($this->data['edit_uid']); } else
|
{
| {
|
$user = get_user($this->data['uid']); }
| $user = get_user($this->data['uid']); }
|
Zeile 764 | Zeile 798 |
---|
function validate_post() { global $mybb, $db, $plugins;
|
function validate_post() { global $mybb, $db, $plugins;
|
$post = &$this->data;
| $post = &$this->data;
|
$time = TIME_NOW;
$this->action = "post";
| $time = TIME_NOW;
$this->action = "post";
|
Zeile 787 | Zeile 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 838 | Zeile 871 |
---|
}
if($this->method == "update" && $this->first_post)
|
}
if($this->method == "update" && $this->first_post)
|
{
| {
|
$this->verify_prefix();
|
$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)
|
$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 false; } else
|
Zeile 862 | Zeile 895 |
---|
* @return array Array of new post details, pid and visibility. */ function insert_post()
|
* @return array Array of new post details, pid and visibility. */ function insert_post()
|
{ global $db, $mybb, $plugins, $cache, $lang;
$post = &$this->data;
// Yes, validating is required. if(!$this->get_validated())
| { global $db, $mybb, $plugins, $cache, $lang;
$post = &$this->data;
// Yes, validating is required. if(!$this->get_validated())
|
{ die("The post needs to be validated before inserting it into the DB."); }
| { die("The post needs to be validated before inserting it into the DB."); }
|
Zeile 933 | Zeile 966 |
---|
{ $modoptions_update['closed'] = $closed = 1; log_moderator_action($modlogdata, $lang->thread_closed);
|
{ $modoptions_update['closed'] = $closed = 1; log_moderator_action($modlogdata, $lang->thread_closed);
|
}
| }
|
// Open the thread. if(empty($modoptions['closethread']) && $thread['closed'] == 1 && is_moderator($post['fid'], "canopenclosethreads", $post['uid']))
| // Open the thread. if(empty($modoptions['closethread']) && $thread['closed'] == 1 && is_moderator($post['fid'], "canopenclosethreads", $post['uid']))
|
Zeile 981 | Zeile 1014 |
---|
if($mybb->user['uid'] == $post['uid'] && $mybb->user['moderateposts'] == 1) { $visible = 0;
|
if($mybb->user['uid'] == $post['uid'] && $mybb->user['moderateposts'] == 1) { $visible = 0;
|
} }
| } }
|
if(!isset($post['pid'])) { $post['pid'] = 0;
| if(!isset($post['pid'])) { $post['pid'] = 0;
|
Zeile 998 | Zeile 1031 |
---|
$draft_check = $db->fetch_field($query, "tid"); } else
|
$draft_check = $db->fetch_field($query, "tid"); } else
|
{
| {
|
$draft_check = false; }
|
$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) {
|
// 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;
| |
} }
if($visible == 1)
|
} }
if($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}'"
|
$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}'"
|
);
| );
|
if($forum['usepostcounts'] != 0 && $thread['visible'] == 1) { $update_array['postnum'] = 'postnum+1';
| if($forum['usepostcounts'] != 0 && $thread['visible'] == 1) { $update_array['postnum'] = 'postnum+1';
|
Zeile 1084 | Zeile 1127 |
---|
"uid" => $post['uid'], "username" => $db->escape_string($post['username']), "dateline" => (int)$post['dateline'],
|
"uid" => $post['uid'], "username" => $db->escape_string($post['username']), "dateline" => (int)$post['dateline'],
|
"message" => $db->escape_string($post['message']), "ipaddress" => $db->escape_binary($post['ipaddress']), "includesig" => $post['options']['signature'], "smilieoff" => $post['options']['disablesmilies'], "visible" => $visible );
| "message" => $db->escape_string($post['message']), "ipaddress" => $db->escape_binary($post['ipaddress']), "includesig" => $post['options']['signature'], "smilieoff" => $post['options']['disablesmilies'], "visible" => $visible );
|
$plugins->run_hooks("datahandler_post_insert_post", $this);
$db->update_query("posts", $this->post_update_data, "pid='{$post['pid']}'");
| $plugins->run_hooks("datahandler_post_insert_post", $this);
$db->update_query("posts", $this->post_update_data, "pid='{$post['pid']}'");
|
Zeile 1167 | Zeile 1210 |
---|
while($subscribedmember = $db->fetch_array($query)) {
|
while($subscribedmember = $db->fetch_array($query)) {
|
if($done_users[$subscribedmember['uid']])
| if(isset($done_users[$subscribedmember['uid']]))
|
{ continue; }
| { continue; }
|
Zeile 1182 | Zeile 1225 |
---|
continue; }
|
continue; }
|
if($thread['uid'] != $subscribedmember['uid'] && $forumpermissions['canonlyviewownthread'] == 1 && !is_moderator($thread['fid'], "", $subscribedmember['uid']))
| if($thread['uid'] != $subscribedmember['uid'] && $forumpermissions['canonlyviewownthreads'] == 1 && !is_moderator($thread['fid'], "", $subscribedmember['uid']))
|
{ // User isn't a moderator or the author of the thread... continue;
| { // User isn't a moderator or the author of the thread... continue;
|
Zeile 1251 | Zeile 1294 |
---|
{ $emailsubject = $lang->sprintf($emailsubject, $subject);
|
{ $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);
| $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" => '',
| $new_email = array( "mailto" => $db->escape_string($subscribedmember['email']), "mailfrom" => '',
|
Zeile 1266 | Zeile 1308 |
---|
} elseif($subscribedmember['notification'] == 2) {
|
} 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' );
|
| // Workaround for eliminating PHP warnings in PHP 8. Ref: https://github.com/mybb/mybb/issues/4630#issuecomment-1369144163 $pm['sender']['uid'] = -1;
|
send_pm($pm, -1, true); } }
| send_pm($pm, -1, true); } }
|
Zeile 1431 | Zeile 1474 |
---|
$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 1479 | Zeile 1523 |
---|
// 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" => (int)$thread['icon'], "username" => $db->escape_string($thread['username']), "dateline" => (int)$thread['dateline'], "lastpost" => (int)$thread['dateline'], "lastposter" => $db->escape_string($thread['username']), "visible" => $visible );
$plugins->run_hooks("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" => (int)$thread['icon'], "username" => $db->escape_string($thread['username']), "dateline" => (int)$thread['dateline'],
|
"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'], "smilieoff" => $thread['options']['disablesmilies'],
| "lastpost" => (int)$thread['dateline'], "lastposter" => $db->escape_string($thread['username']),
|
"visible" => $visible );
|
"visible" => $visible );
|
$plugins->run_hooks("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" => (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'], "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 1565 | Zeile 1609 |
---|
if($thread['options']['subscriptionmethod'] != "" && $thread['uid'] > 0) { switch($thread['options']['subscriptionmethod'])
|
if($thread['options']['subscriptionmethod'] != "" && $thread['uid'] > 0) { switch($thread['options']['subscriptionmethod'])
|
{
| {
|
case "pm": $notification = 2; break;
| case "pm": $notification = 2; break;
|
Zeile 1642 | Zeile 1686 |
---|
{ $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 1675 | Zeile 1714 |
---|
"); while($subscribedmember = $db->fetch_array($query)) {
|
"); while($subscribedmember = $db->fetch_array($query)) {
|
if($done_users[$subscribedmember['uid']])
| if(!empty($done_users[$subscribedmember['uid']]))
|
{ continue; }
| { continue; }
|
Zeile 1743 | Zeile 1782 |
---|
} $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 1765 | Zeile 1803 |
---|
}
// Assign any uploaded attachments with the specific posthash to the newly created post.
|
}
// Assign any uploaded attachments with the specific posthash to the newly created post.
|
if($thread['posthash'])
| if(!empty($thread['posthash']))
|
{ $thread['posthash'] = $db->escape_string($thread['posthash']); $attachmentassign = array(
| { $thread['posthash'] = $db->escape_string($thread['posthash']); $attachmentassign = array(
|
Zeile 1831 | Zeile 1869 |
---|
$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); $editor_ismod = is_moderator($post['fid'], "", $mybb->user['uid']);
|
// Keep visibility for unapproved and deleted posts
|
// Keep visibility for unapproved and deleted posts
|
if($existing_post['visible'] == 0) {
| if($existing_post['visible'] == 0 && !$editor_ismod) {
|
$visible = 0; } elseif($existing_post['visible'] == -1) { $visible = -1;
|
$visible = 0; } elseif($existing_post['visible'] == -1) { $visible = -1;
|
} elseif($forumpermissions['mod_edit_posts'] == 1 && !$ismod)
| } elseif($forumpermissions['mod_edit_posts'] == 1 && !$ismod && !$editor_ismod)
|
{ $visible = 0; require_once MYBB_ROOT."inc/class_moderation.php"; $moderation = new Moderation; $moderation->unapprove_posts(array($post['pid']));
|
{ $visible = 0; require_once MYBB_ROOT."inc/class_moderation.php"; $moderation = new Moderation; $moderation->unapprove_posts(array($post['pid']));
|
}
| }
|
else { $visible = 1;
| else { $visible = 1;
|
Zeile 1865 | Zeile 1913 |
---|
$this->tid = $post['tid'];
if(isset($post['prefix']))
|
$this->tid = $post['tid'];
if(isset($post['prefix']))
|
{
| {
|
$this->thread_update_data['prefix'] = (int)$post['prefix']; }
| $this->thread_update_data['prefix'] = (int)$post['prefix']; }
|
Zeile 1877 | Zeile 1925 |
---|
if(isset($post['icon'])) { $this->thread_update_data['icon'] = (int)$post['icon'];
|
if(isset($post['icon'])) { $this->thread_update_data['icon'] = (int)$post['icon'];
|
}
| }
|
if(count($this->thread_update_data) > 0)
|
if(count($this->thread_update_data) > 0)
|
{
| {
|
$plugins->run_hooks("datahandler_post_update_thread", $this);
|
$plugins->run_hooks("datahandler_post_update_thread", $this);
|
|
|
$db->update_query("threads", $this->thread_update_data, "tid='".(int)$post['tid']."'");
|
$db->update_query("threads", $this->thread_update_data, "tid='".(int)$post['tid']."'");
|
| }
// Update any moved thread links to have corresponding new subject. if(isset($post['subject'])) { $query = $db->simple_select("threads", "tid, closed", "closed='moved|".$this->tid."'"); if($db->num_rows($query) > 0) { $update_data['subject'] = $db->escape_string($post['subject']); while($result = $db->fetch_array($query)) { $db->update_query("threads", $update_data, "tid='".(int)$result['tid']."'"); } }
|
} }
| } }
|
Zeile 1904 | Zeile 1966 |
---|
{ $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 1938 | Zeile 2000 |
---|
$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 1956 | Zeile 2018 |
---|
} 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']);
|