Zeile 153 | Zeile 153 |
---|
$this->errors = array_merge($this->errors, $userhandler->get_errors()); return false; }
|
$this->errors = array_merge($this->errors, $userhandler->get_errors()); return false; }
|
|
|
if($userhandler->verify_username_exists()) { // username is in use $this->errors = array_merge($this->errors, $userhandler->get_errors()); return false; }
|
if($userhandler->verify_username_exists()) { // username is in use $this->errors = array_merge($this->errors, $userhandler->get_errors()); return false; }
|
}
| }
|
// After all of this, if we still don't have a username, force the username as "Guest" (Note, this is not translatable as it is always a fallback) if(!$post['username']) { $post['username'] = "Guest";
|
// After all of this, if we still don't have a username, force the username as "Guest" (Note, this is not translatable as it is always a fallback) if(!$post['username']) { $post['username'] = "Guest";
|
}
return true;
| }
return true;
|
}
/**
| }
/**
|
Zeile 182 | Zeile 182 |
---|
$post = &$this->data; $subject = &$post['subject']; $subject = trim_blank_chrs($subject);
|
$post = &$this->data; $subject = &$post['subject']; $subject = trim_blank_chrs($subject);
|
|
|
if($this->method == "update" && $post['pid']) { // If this is the first post there needs to be a subject, else make it the default one.
| if($this->method == "update" && $post['pid']) { // If this is the first post there needs to be a subject, else make it the default one.
|
Zeile 190 | Zeile 190 |
---|
{ $this->set_error("firstpost_no_subject"); return false;
|
{ $this->set_error("firstpost_no_subject"); return false;
|
}
| }
|
elseif(my_strlen($subject) == 0)
|
elseif(my_strlen($subject) == 0)
|
{ $thread = get_thread($post['tid']); $subject = "RE: ".$thread['subject']; } }
| { $thread = get_thread($post['tid']); $subject = "RE: ".$thread['subject']; } }
|
// This is a new post else if($this->action == "post") {
| // This is a new post else if($this->action == "post") {
|
Zeile 270 | Zeile 270 |
---|
else { if(!isset($post['fid']))
|
else { if(!isset($post['fid']))
|
{
| {
|
$post['fid'] = 0; } if(!$mybb->settings['mycodemessagelength'])
| $post['fid'] = 0; } if(!$mybb->settings['mycodemessagelength'])
|
Zeile 298 | Zeile 298 |
---|
/** * Verifies the specified post options are correct.
|
/** * Verifies the specified post options are correct.
|
*
| *
|
* @return boolean True */ function verify_options()
| * @return boolean True */ function verify_options()
|
Zeile 327 | Zeile 327 |
---|
if($mybb->settings['postfloodcheck'] == 1 && $post['uid'] != 0 && $this->admin_override == false) { if($this->verify_post_merge(true) !== true)
|
if($mybb->settings['postfloodcheck'] == 1 && $post['uid'] != 0 && $this->admin_override == false) { if($this->verify_post_merge(true) !== true)
|
{
| {
|
return true; }
| return true; }
|
Zeile 367 | Zeile 367 |
---|
// 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);
| // 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);
|
Zeile 623 | Zeile 623 |
---|
if(empty($prefix)) { $prefix = 0;
|
if(empty($prefix)) { $prefix = 0;
|
} else
| } else
|
{ if(!empty($this->data['tid'])) {
| { if(!empty($this->data['tid'])) {
|
Zeile 878 | Zeile 878 |
---|
// Perform any selected moderation tools. $ismod = is_moderator($post['fid'], "", $post['uid']);
|
// Perform any selected moderation tools. $ismod = is_moderator($post['fid'], "", $post['uid']);
|
if($ismod)
| if($ismod && isset($post['modoptions']))
|
{ $lang->load($this->language_file, true);
| { $lang->load($this->language_file, true);
|
Zeile 886 | Zeile 886 |
---|
$modlogdata['fid'] = $thread['fid']; $modlogdata['tid'] = $thread['tid'];
|
$modlogdata['fid'] = $thread['fid']; $modlogdata['tid'] = $thread['tid'];
|
if(!isset($modoptions['closethread'])) { $modoptions['closethread'] = $closed; }
$modoptions_update = array();
| $modoptions_update = array();
|
// Close the thread.
|
// Close the thread.
|
if($modoptions['closethread'] == 1 && $thread['closed'] != 1) { $modoptions_update['closed'] = $closed = 0;
| if(!empty($modoptions['closethread']) && $thread['closed'] != 1) { $modoptions_update['closed'] = $closed = 1;
|
log_moderator_action($modlogdata, $lang->thread_closed); }
// Open the thread.
|
log_moderator_action($modlogdata, $lang->thread_closed); }
// Open the thread.
|
if($modoptions['closethread'] != 1 && $thread['closed'] == 1)
| if(empty($modoptions['closethread']) && $thread['closed'] == 1)
|
{
|
{
|
$modoptions_update['closed'] = $closed = 1;
| $modoptions_update['closed'] = $closed = 0;
|
log_moderator_action($modlogdata, $lang->thread_opened);
|
log_moderator_action($modlogdata, $lang->thread_opened);
|
}
if(!isset($modoptions['stickthread'])) { $modoptions['stickthread'] = $thread['sticky'];
| |
}
// Stick the thread.
|
}
// Stick the thread.
|
if($modoptions['stickthread'] == 1 && $thread['sticky'] != 1)
| if(!empty($modoptions['stickthread']) && $thread['sticky'] != 1)
|
{ $modoptions_update['sticky'] = 1; log_moderator_action($modlogdata, $lang->thread_stuck); }
// Unstick the thread.
|
{ $modoptions_update['sticky'] = 1; log_moderator_action($modlogdata, $lang->thread_stuck); }
// Unstick the thread.
|
if($modoptions['stickthread'] != 1 && $thread['sticky'])
| if(empty($modoptions['stickthread']) && $thread['sticky'] == 1)
|
{ $modoptions_update['sticky'] = 0; log_moderator_action($modlogdata, $lang->thread_unstuck);
| { $modoptions_update['sticky'] = 0; log_moderator_action($modlogdata, $lang->thread_unstuck);
|
Zeile 935 | Zeile 925 |
---|
// Fetch the forum this post is being made in $forum = get_forum($post['fid']);
|
// Fetch the forum this post is being made in $forum = get_forum($post['fid']);
|
|
|
// Decide on the visibility of this post. $forumpermissions = forum_permissions($post['fid'], $post['uid']); if($forumpermissions['modposts'] == 1 && !$ismod)
|
// Decide on the visibility of this post. $forumpermissions = forum_permissions($post['fid'], $post['uid']); if($forumpermissions['modposts'] == 1 && !$ismod)
|
{
| {
|
$visible = 0;
|
$visible = 0;
|
}
| }
|
else { $visible = 1;
|
else { $visible = 1;
|
}
| }
|
// Are posts from this user being moderated? Change visibility if($mybb->user['uid'] == $post['uid'] && $mybb->user['moderateposts'] == 1) { $visible = 0; }
|
// Are posts from this user being moderated? Change visibility 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;
|
}
| }
|
$post['pid'] = (int)$post['pid']; $post['uid'] = (int)$post['uid'];
| $post['pid'] = (int)$post['pid']; $post['uid'] = (int)$post['uid'];
|
Zeile 992 | Zeile 982 |
---|
if($draft_check) { $db->delete_query("posts", "pid='".$post['pid']."'");
|
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.
| if($post['posthash']) { // Assign any uploaded attachments with the specific posthash to the merged post.
|
Zeile 1023 | Zeile 1013 |
---|
);
$plugins->run_hooks("datahandler_post_insert_merge", $this);
|
);
$plugins->run_hooks("datahandler_post_insert_merge", $this);
|
|
|
return $this->return_values; } }
| return $this->return_values; } }
|
Zeile 1049 | Zeile 1039 |
---|
{ // 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" => (int)$post['icon'], "uid" => $post['uid'], "username" => $db->escape_string($post['username']),
| "subject" => $db->escape_string($post['subject']), "icon" => (int)$post['icon'], "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']),
| "dateline" => (int)$post['dateline'], "message" => $db->escape_string($post['message']), "ipaddress" => $db->escape_binary($post['ipaddress']),
|
Zeile 1060 | Zeile 1050 |
---|
"smilieoff" => $post['options']['disablesmilies'], "visible" => $visible );
|
"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']}'"); $this->pid = $post['pid']; } else
|
$plugins->run_hooks("datahandler_post_insert_post", $this);
$db->update_query("posts", $this->post_update_data, "pid='{$post['pid']}'"); $this->pid = $post['pid']; } else
|
{
| {
|
// Insert the post. $this->post_insert_data = array( "tid" => (int)$post['tid'],
| // Insert the post. $this->post_insert_data = array( "tid" => (int)$post['tid'],
|
Zeile 1111 | Zeile 1101 |
---|
$done_users = array();
$subject = $parser->parse_badwords($thread['subject']);
|
$done_users = array();
$subject = $parser->parse_badwords($thread['subject']);
|
|
|
$parser_options = array( 'me_username' => $post['username'], 'filter_badwords' => 1
| $parser_options = array( 'me_username' => $post['username'], 'filter_badwords' => 1
|
Zeile 1527 | Zeile 1517 |
---|
}
// Perform any selected moderation tools.
|
}
// Perform any selected moderation tools.
|
if(is_moderator($thread['fid'], "", $thread['uid']) && is_array($thread['modoptions']))
| if(is_moderator($thread['fid'], "", $thread['uid']) && isset($thread['modoptions']))
|
{ $lang->load($this->language_file, true);
| { $lang->load($this->language_file, true);
|