Zeile 53 | Zeile 53 |
---|
* post = New post * thread = New thread * edit = Editing a thread or post
|
* post = New post * thread = New thread * edit = Editing a thread or post
|
| * * @var string
|
*/ public $action;
| */ public $action;
|
Zeile 104 | Zeile 106 |
---|
* @var array */ public $return_values = array();
|
* @var array */ public $return_values = array();
|
| /** * Is this the first post of a thread when editing * * @var boolean */ public $first_post = false;
|
/** * Verifies the author of a post and fetches the username if necessary.
| /** * Verifies the author of a post and fetches the username if necessary.
|
Zeile 112 | Zeile 121 |
---|
*/ function verify_author() {
|
*/ function verify_author() {
|
global $mybb;
| global $mybb, $lang;
|
$post = &$this->data;
// Don't have a user ID at all - not good (note, a user id of 0 will still work). if(!isset($post['uid']))
|
$post = &$this->data;
// Don't have a user ID at all - not good (note, a user id of 0 will still work). if(!isset($post['uid']))
|
{
| {
|
$this->set_error("invalid_user_id"); return false;
|
$this->set_error("invalid_user_id"); return false;
|
}
| }
|
// If we have a user id but no username then fetch the username. else if($post['uid'] > 0 && empty($post['username'])) { $user = get_user($post['uid']); $post['username'] = $user['username'];
|
// If we have a user id but no username then fetch the username. else if($post['uid'] > 0 && empty($post['username'])) { $user = get_user($post['uid']); $post['username'] = $user['username'];
|
}
| }
|
// if the uid is 0 verify the username else if($post['uid'] == 0 && $post['username'] != $lang->guest) {
| // if the uid is 0 verify the username else if($post['uid'] == 0 && $post['username'] != $lang->guest) {
|
Zeile 165 | Zeile 174 |
---|
/** * Verifies a post subject. *
|
/** * Verifies a post subject. *
|
* @param string True if the subject is valid, false if invalid.
| |
* @return boolean True when valid, false when not valid. */ function verify_subject()
| * @return boolean True when valid, false when not valid. */ function verify_subject()
|
Zeile 175 | Zeile 183 |
---|
$subject = &$post['subject']; $subject = trim_blank_chrs($subject);
|
$subject = &$post['subject']; $subject = trim_blank_chrs($subject);
|
// Are we editing an existing thread or post?
| |
if($this->method == "update" && $post['pid']) {
|
if($this->method == "update" && $post['pid']) {
|
if(empty($post['tid'])) { $query = $db->simple_select("posts", "tid", "pid='".(int)$post['pid']."'"); $post['tid'] = $db->fetch_field($query, "tid"); } // Here we determine if we're editing the first post of a thread or not. $options = array( "limit" => 1, "limit_start" => 0, "order_by" => "dateline", "order_dir" => "asc" ); $query = $db->simple_select("posts", "pid", "tid='".$post['tid']."'", $options); $first_check = $db->fetch_array($query); if($first_check['pid'] == $post['pid']) { $first_post = true; } else { $first_post = false; }
| |
// 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($subject) == 0 && $first_post)
| if(my_strlen($subject) == 0 && $this->first_post)
|
{ $this->set_error("firstpost_no_subject");
|
{ $this->set_error("firstpost_no_subject");
|
return false;
| 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")
|
{ if(my_strlen($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'];
|
}
| }
|
}
// This is a new thread and we require that a subject is present.
| }
// This is a new thread and we require that a subject is present.
|
Zeile 231 | Zeile 215 |
---|
{ $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.
| }
// If post is reply and begins with "RE: ", remove 4 from subject length.
|
Zeile 259 | Zeile 243 |
---|
/** * Verifies a post message. *
|
/** * Verifies a post message. *
|
* @param string The message content.
| * @return bool
|
*/ function verify_message() {
| */ function verify_message() {
|
Zeile 283 | Zeile 267 |
---|
}
// And if we've got a minimum message length do we meet that requirement too?
|
}
// And if we've got a minimum message length do we meet that requirement too?
|
else {
| else {
|
if(!isset($post['fid'])) { $post['fid'] = 0;
| if(!isset($post['fid'])) { $post['fid'] = 0;
|
Zeile 304 | Zeile 288 |
---|
} } else if(my_strlen($post['message']) < $mybb->settings['minmessagelength'] && $mybb->settings['minmessagelength'] > 0 && !is_moderator($post['fid'], "", $post['uid']))
|
} } 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; }
| $this->set_error("message_too_short", array($mybb->settings['minmessagelength'])); return false; }
|
Zeile 324 | Zeile 308 |
---|
// Verify yes/no options. $this->verify_yesno_option($options, 'signature', 0); $this->verify_yesno_option($options, 'disablesmilies', 0);
|
// Verify yes/no options. $this->verify_yesno_option($options, 'signature', 0); $this->verify_yesno_option($options, 'disablesmilies', 0);
|
return true;
| return true;
|
}
/** * Verify that the user is not flooding the system. *
|
}
/** * Verify that the user is not flooding the system. *
|
* @return boolean True
| * @return boolean
|
*/ function verify_post_flooding() {
| */ function verify_post_flooding() {
|
Zeile 370 | Zeile 354 |
---|
return true; }
|
return true; }
|
| /** * @param bool $simple_mode * * @return array|bool */
|
function verify_post_merge($simple_mode=false) { global $mybb, $db, $session;
| function verify_post_merge($simple_mode=false) { global $mybb, $db, $session;
|
Zeile 508 | Zeile 497 |
---|
return false; } }
|
return false; } }
|
| return true;
|
}
/**
| }
/**
|
Zeile 536 | Zeile 527 |
---|
return false; } }
|
return false; } }
|
| return true;
|
}
/**
| }
/**
|
Zeile 554 | Zeile 547 |
---|
$query = $db->simple_select("posts", "pid", "pid='".(int)$post['replyto']."'"); $valid_post = $db->fetch_array($query); if(!$valid_post['pid'])
|
$query = $db->simple_select("posts", "pid", "pid='".(int)$post['replyto']."'"); $valid_post = $db->fetch_array($query); if(!$valid_post['pid'])
|
{
| {
|
$post['replyto'] = 0;
|
$post['replyto'] = 0;
|
}
| }
|
else { return true; }
|
else { return true; }
|
}
| }
|
// If this post isn't a reply to a specific post, attach it to the first post. if(!$post['replyto'])
| // If this post isn't a reply to a specific post, attach it to the first post. if(!$post['replyto'])
|
Zeile 575 | Zeile 568 |
---|
$query = $db->simple_select("posts", "pid", "tid='{$post['tid']}'", $options); $reply_to = $db->fetch_array($query); $post['replyto'] = $reply_to['pid'];
|
$query = $db->simple_select("posts", "pid", "tid='{$post['tid']}'", $options); $reply_to = $db->fetch_array($query); $post['replyto'] = $reply_to['pid'];
|
}
return true;
| }
return true;
|
}
/**
| }
/**
|
Zeile 599 | Zeile 592 |
---|
$post['icon'] = 0; } return true;
|
$post['icon'] = 0; } return true;
|
}
| }
|
/** * Verify the dateline. *
| /** * Verify the dateline. *
|
Zeile 625 | Zeile 618 |
---|
function verify_prefix() { $prefix = &$this->data['prefix'];
|
function verify_prefix() { $prefix = &$this->data['prefix'];
|
$prefix_cache = build_prefixes();
| |
// If a valid prefix isn't supplied, don't assign one. if(empty($prefix))
|
// If a valid prefix isn't supplied, don't assign one. if(empty($prefix))
|
{
| {
|
$prefix = 0; } else {
|
$prefix = 0; } else {
|
| if(!empty($this->data['tid'])) { // Fetch the thread $thread = get_thread($this->data['tid']); }
|
$prefix_cache = build_prefixes($prefix);
if(empty($prefix_cache))
| $prefix_cache = build_prefixes($prefix);
if(empty($prefix_cache))
|
Zeile 654 | Zeile 651 |
---|
$user = get_user($this->data['uid']); }
|
$user = get_user($this->data['uid']); }
|
if(!is_member($prefix_cache['groups'], array('usergroup' => $user['usergroup'], 'additionalgroups' => $user['additionalgroups'])))
| if(!is_member($prefix_cache['groups'], array('usergroup' => $user['usergroup'], 'additionalgroups' => $user['additionalgroups'])) && (empty($this->data['tid']) || $prefix != $thread['prefix']))
|
{ $this->set_error('invalid_prefix'); return false;
| { $this->set_error('invalid_prefix'); return false;
|
Zeile 665 | Zeile 662 |
---|
// Decide whether this prefix can be used in our forum $forums = explode(",", $prefix_cache['forums']);
|
// Decide whether this prefix can be used in our forum $forums = explode(",", $prefix_cache['forums']);
|
if(!in_array($this->data['fid'], $forums))
| if(!in_array($this->data['fid'], $forums) && (empty($this->data['tid']) || $prefix != $thread['prefix']))
|
{ $this->set_error('invalid_prefix'); return false; } } }
|
{ $this->set_error('invalid_prefix'); return false; } } }
|
|
|
// Does this forum require a prefix? $forum = get_forum($this->data['fid']);
|
// Does this forum require a prefix? $forum = get_forum($this->data['fid']);
|
|
|
if($forum['requireprefix'] == 1) { $num_prefixes = false;
| if($forum['requireprefix'] == 1) { $num_prefixes = false;
|
Zeile 687 | Zeile 684 |
---|
$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']); }
|
|
|
$prefix_cache = build_prefixes();
if(!empty($prefix_cache)) { foreach($prefix_cache as $required)
|
$prefix_cache = build_prefixes();
if(!empty($prefix_cache)) { foreach($prefix_cache as $required)
|
{
| {
|
if($required['forums'] != "-1")
|
if($required['forums'] != "-1")
|
{
| {
|
// Decide whether this prefix can be used in our forum $forums = explode(",", $required['forums']);
|
// Decide whether this prefix can be used in our forum $forums = explode(",", $required['forums']);
|
|
|
if(!in_array($forum['fid'], $forums))
|
if(!in_array($forum['fid'], $forums))
|
{
| {
|
continue; } }
|
continue; } }
|
if($required['groups'] != "-1") { if(!is_member($required['groups'], array('usergroup' => $user['usergroup'], 'additionalgroups' => $user['additionalgroups']))) { $num_prefixes = true; } } else
| if(is_member($required['groups'], array('usergroup' => $user['usergroup'], 'additionalgroups' => $user['additionalgroups'])))
|
{ $num_prefixes = true; }
| { $num_prefixes = true; }
|
Zeile 743 | Zeile 733 |
---|
$post = &$this->data; $time = TIME_NOW;
|
$post = &$this->data; $time = TIME_NOW;
|
$this->action = "post";
| $this->action = "post";
|
if($this->method != "update" && !$post['savedraft']) { $this->verify_post_flooding();
|
if($this->method != "update" && !$post['savedraft']) { $this->verify_post_flooding();
|
}
// Verify all post assets.
| }
// Are we editing an existing thread or post? if($this->method == "update") { if(empty($post['tid'])) { $query = $db->simple_select("posts", "tid", "pid='".(int)$post['pid']."'"); $post['tid'] = $db->fetch_field($query, "tid"); } // Here we determine if we're editing the first post of a thread or not. $options = array( "limit" => 1, "limit_start" => 0, "order_by" => "dateline", "order_dir" => "asc" ); $query = $db->simple_select("posts", "pid", "tid='".$post['tid']."'", $options); $first_check = $db->fetch_array($query); if($first_check['pid'] == $post['pid']) { $this->first_post = true; } }
// Verify all post assets.
|
if($this->method == "insert" || array_key_exists('uid', $post))
|
if($this->method == "insert" || array_key_exists('uid', $post))
|
{
| {
|
$this->verify_author();
|
$this->verify_author();
|
}
| }
|
if($this->method == "insert" || array_key_exists('subject', $post)) { $this->verify_subject();
| if($this->method == "insert" || array_key_exists('subject', $post)) { $this->verify_subject();
|
Zeile 768 | Zeile 781 |
---|
$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)) {
| if($this->method == "insert" || array_key_exists('dateline', $post)) {
|
Zeile 788 | Zeile 801 |
---|
if($this->method == "insert" || array_key_exists('options', $post)) { $this->verify_options();
|
if($this->method == "insert" || array_key_exists('options', $post)) { $this->verify_options();
|
}
$plugins->run_hooks("datahandler_post_validate_post", $this);
| }
if($this->method == "update" && $this->first_post) { $this->verify_prefix(); }
$plugins->run_hooks("datahandler_post_validate_post", $this);
|
// We are done validating, return. $this->set_validated(true); if(count($this->get_errors()) > 0)
| // We are done validating, return. $this->set_validated(true); if(count($this->get_errors()) > 0)
|
Zeile 860 | 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 868 | 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); }
|
log_moderator_action($modlogdata, $lang->thread_closed); }
|
// Open the thread. if($modoptions['closethread'] != 1 && $thread['closed'] == 1) { $modoptions_update['closed'] = $closed = 1; log_moderator_action($modlogdata, $lang->thread_opened); }
if(!isset($modoptions['stickthread']))
| // Open the thread. if(empty($modoptions['closethread']) && $thread['closed'] == 1)
|
{
|
{
|
$modoptions['stickthread'] = $thread['sticky'];
| $modoptions_update['closed'] = $closed = 0; log_moderator_action($modlogdata, $lang->thread_opened);
|
}
// 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 969 | Zeile 977 |
---|
); $update_query['edituid'] = (int)$post['uid']; $update_query['edittime'] = TIME_NOW;
|
); $update_query['edituid'] = (int)$post['uid']; $update_query['edittime'] = TIME_NOW;
|
$query = $db->update_query("posts", $update_query, "pid='".$double_post['pid']."'");
| $db->update_query("posts", $update_query, "pid='".$double_post['pid']."'");
|
if($draft_check) {
| if($draft_check) {
|
Zeile 1104 | Zeile 1112 |
---|
// Fetch any users subscribed to this thread receiving instant notification and queue up their subscription notices $query = $db->query("
|
// Fetch any users subscribed to this thread receiving instant notification and queue up their subscription notices $query = $db->query("
|
SELECT u.username, u.email, u.uid, u.language, u.loginkey, u.salt, u.regdate, s.subscriptionkey, s.notification
| SELECT u.username, u.email, u.uid, u.language, u.loginkey, u.salt, u.regdate, s.notification
|
FROM ".TABLE_PREFIX."threadsubscriptions s LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=s.uid) WHERE (s.notification='1' OR s.notification='2') AND s.tid='{$post['tid']}'
| FROM ".TABLE_PREFIX."threadsubscriptions s LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=s.uid) WHERE (s.notification='1' OR s.notification='2') AND s.tid='{$post['tid']}'
|
Zeile 1186 | Zeile 1194 |
---|
$emailsubject = $lang->sprintf($emailsubject, $subject);
$post_code = md5($subscribedmember['loginkey'].$subscribedmember['salt'].$subscribedmember['regdate']);
|
$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'], $subscribedmember['subscriptionkey'], $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'], $post_code);
|
$new_email = array( "mailto" => $db->escape_string($subscribedmember['email']), "mailfrom" => '',
| $new_email = array( "mailto" => $db->escape_string($subscribedmember['email']), "mailfrom" => '',
|
Zeile 1203 | Zeile 1211 |
---|
$post_code = md5($subscribedmember['loginkey'].$subscribedmember['salt'].$subscribedmember['regdate']); $pm = array( 'subject' => array('pmsubject_subscription', $subject),
|
$post_code = md5($subscribedmember['loginkey'].$subscribedmember['salt'].$subscribedmember['regdate']); $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'], $subscribedmember['subscriptionkey'], $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'], $post_code),
|
'touid' => $subscribedmember['uid'], 'language' => $subscribedmember['language'], 'language_file' => 'messages'
| 'touid' => $subscribedmember['uid'], 'language' => $subscribedmember['language'], 'language_file' => 'messages'
|
Zeile 1453 | Zeile 1461 |
---|
"dateline" => (int)$thread['dateline'], "lastpost" => (int)$thread['dateline'], "lastposter" => $db->escape_string($thread['username']),
|
"dateline" => (int)$thread['dateline'], "lastpost" => (int)$thread['dateline'], "lastposter" => $db->escape_string($thread['username']),
|
| "lastposteruid" => $thread['uid'],
|
"views" => 0, "replies" => 0, "visible" => $visible,
| "views" => 0, "replies" => 0, "visible" => $visible,
|
Zeile 1508 | 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);
|
Zeile 1533 | Zeile 1542 |
---|
{ $modoptions_update['sticky'] = 1; log_moderator_action($modlogdata, $lang->thread_stuck);
|
{ $modoptions_update['sticky'] = 1; log_moderator_action($modlogdata, $lang->thread_stuck);
|
}
| }
|
// Execute moderation options. if($modoptions_update)
| // Execute moderation options. if($modoptions_update)
|
Zeile 1585 | Zeile 1594 |
---|
require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser; $excerpt = $parser->parse_badwords($excerpt);
|
require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser; $excerpt = $parser->parse_badwords($excerpt);
|
|
|
$query = $db->query(" SELECT u.username, u.email, u.uid, u.language, u.loginkey, u.salt, u.regdate FROM ".TABLE_PREFIX."forumsubscriptions fs
| $query = $db->query(" SELECT u.username, u.email, u.uid, u.language, u.loginkey, u.salt, u.regdate FROM ".TABLE_PREFIX."forumsubscriptions fs
|
Zeile 1601 | Zeile 1610 |
---|
if($done_users[$subscribedmember['uid']]) { continue;
|
if($done_users[$subscribedmember['uid']]) { continue;
|
}
| }
|
$done_users[$subscribedmember['uid']] = 1;
$forumpermissions = forum_permissions($thread['fid'], $subscribedmember['uid']);
| $done_users[$subscribedmember['uid']] = 1;
$forumpermissions = forum_permissions($thread['fid'], $subscribedmember['uid']);
|
Zeile 1611 | Zeile 1620 |
---|
}
if(!is_moderator($thread['fid'], "", $subscribedmember['uid']) && $forumpermissions['canonlyviewownthreads'] == 1)
|
}
if(!is_moderator($thread['fid'], "", $subscribedmember['uid']) && $forumpermissions['canonlyviewownthreads'] == 1)
|
{
| {
|
// In a 'view own only' forum and not a moderator continue; }
| // In a 'view own only' forum and not a moderator continue; }
|
Zeile 1689 | Zeile 1698 |
---|
update_last_post($this->tid); update_forum_counters($thread['fid'], array("threads" => "+1", "posts" => "+1")); update_forum_lastpost($thread['fid']);
|
update_last_post($this->tid); update_forum_counters($thread['fid'], array("threads" => "+1", "posts" => "+1")); update_forum_lastpost($thread['fid']);
|
}
| }
|
else if($visible == 0) { update_forum_counters($thread['fid'], array("unapprovedthreads" => "+1", "unapprovedposts" => "+1"));
| else if($visible == 0) { update_forum_counters($thread['fid'], array("unapprovedthreads" => "+1", "unapprovedposts" => "+1"));
|
Zeile 1717 | Zeile 1726 |
---|
/** * Updates a post that is already in the database. *
|
/** * Updates a post that is already in the database. *
|
| * @return array
|
*/ function update_post() {
| */ function update_post() {
|
Zeile 1742 | Zeile 1752 |
---|
$forum = get_forum($post['fid']); $forumpermissions = forum_permissions($post['fid'], $post['uid']);
|
$forum = get_forum($post['fid']); $forumpermissions = forum_permissions($post['fid'], $post['uid']);
|
// Check if this is the first post in a thread. $options = array( "order_by" => "dateline", "order_dir" => "asc", "limit_start" => 0, "limit" => 1 ); $query = $db->simple_select("posts", "pid", "tid='".(int)$post['tid']."'", $options); $first_post_check = $db->fetch_array($query); if($first_post_check['pid'] == $post['pid']) { $first_post = true; } else { $first_post = false; }
| |
// Decide on the visibility of this post. $ismod = is_moderator($post['fid'], "", $post['uid']);
| // Decide on the visibility of this post. $ismod = is_moderator($post['fid'], "", $post['uid']);
|
Zeile 1786 | Zeile 1778 |
---|
}
// Update the thread details that might have been changed first.
|
}
// Update the thread details that might have been changed first.
|
if($first_post)
| if($this->first_post)
|
{ $this->tid = $post['tid'];
| { $this->tid = $post['tid'];
|
Zeile 1887 | Zeile 1879 |
---|
// Return the thread's first post id and whether or not it is visible. $this->return_values = array( 'visible' => $visible,
|
// Return the thread's first post id and whether or not it is visible. $this->return_values = array( 'visible' => $visible,
|
'first_post' => $first_post
| 'first_post' => $this->first_post
|
);
$plugins->run_hooks("datahandler_post_update_end", $this);
| );
$plugins->run_hooks("datahandler_post_update_end", $this);
|