Zeile 36 | Zeile 36 |
---|
{ $thread = get_thread($mybb->input['tid']);
|
{ $thread = get_thread($mybb->input['tid']);
|
$query = $db->simple_select("posts", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."' AND visible='-2'", array('order_by' => 'dateline, pid', 'limit' => 1));
| $query = $db->simple_select("posts", "*", "tid='".$mybb->input['tid']."' AND visible='-2'", array('order_by' => 'dateline, pid', 'limit' => 1));
|
$post = $db->fetch_array($query);
|
$post = $db->fetch_array($query);
|
if(!$thread['tid'] || !$post['pid'] || $thread['visible'] != -2 || $thread['uid'] != $mybb->user['uid'])
| if(!$thread || !$post || $thread['visible'] != -2 || $thread['uid'] != $mybb->user['uid'])
|
{ error($lang->invalidthread); }
| { error($lang->invalidthread); }
|
Zeile 105 | Zeile 105 |
---|
$smilieinserter = build_clickable_smilies(); } }
|
$smilieinserter = build_clickable_smilies(); } }
|
| $posticons = '';
|
// Does this forum allow post icons? If so, fetch the post icons. if($forum['allowpicons'] != 0)
| // Does this forum allow post icons? If so, fetch the post icons. if($forum['allowpicons'] != 0)
|
Zeile 135 | Zeile 137 |
---|
// If we're not performing a new thread insert and not editing a draft then we're posting a new thread. if($mybb->input['action'] != "do_newthread" && $mybb->input['action'] != "editdraft")
|
// If we're not performing a new thread insert and not editing a draft then we're posting a new thread. if($mybb->input['action'] != "do_newthread" && $mybb->input['action'] != "editdraft")
|
{ $mybb->input['action'] = "newthread"; }
| { $mybb->input['action'] = "newthread"; }
|
// Previewing a post, overwrite the action to the new thread action. if(!empty($mybb->input['previewpost']))
|
// Previewing a post, overwrite the action to the new thread action. if(!empty($mybb->input['previewpost']))
|
{
| {
|
$mybb->input['action'] = "newthread";
|
$mybb->input['action'] = "newthread";
|
}
| }
|
// Setup a unique posthash for attachment management if(!$mybb->get_input('posthash') && !$pid) { $mybb->input['posthash'] = md5($mybb->user['uid'].random_str());
|
// Setup a unique posthash for attachment management if(!$mybb->get_input('posthash') && !$pid) { $mybb->input['posthash'] = md5($mybb->user['uid'].random_str());
|
}
| }
|
if((empty($_POST) && empty($_FILES)) && $mybb->get_input('processed', MyBB::INPUT_INT) == 1)
|
if((empty($_POST) && empty($_FILES)) && $mybb->get_input('processed', MyBB::INPUT_INT) == 1)
|
{
| {
|
error($lang->error_empty_post_input); }
$errors = array(); $maximageserror = $attacherror = '';
|
error($lang->error_empty_post_input); }
$errors = array(); $maximageserror = $attacherror = '';
|
|
|
// Handle attachments if we've got any.
|
// Handle attachments if we've got any.
|
if($mybb->settings['enableattachments'] == 1 && ($mybb->get_input('newattachment') || $mybb->get_input('updateattachment') || ((($mybb->input['action'] == "do_newthread" && $mybb->get_input('submit')) || ($mybb->input['action'] == "newthread" && isset($mybb->input['previewpost'])) || isset($mybb->input['savedraft'])) && $_FILES['attachments'])))
| if($mybb->settings['enableattachments'] == 1 && ($mybb->get_input('newattachment') || $mybb->get_input('updateattachment') || ((($mybb->input['action'] == "do_newthread" && $mybb->get_input('submit')) || ($mybb->input['action'] == "newthread" && isset($mybb->input['previewpost'])) || isset($mybb->input['savedraft'])) && isset($_FILES['attachments']))))
|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if($mybb->input['action'] == "editdraft" || ($mybb->input['tid'] && $mybb->input['pid']))
|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if($mybb->input['action'] == "editdraft" || ($mybb->input['tid'] && $mybb->input['pid']))
|
{
| {
|
$attachwhere = "pid='{$pid}'"; } else
| $attachwhere = "pid='{$pid}'"; } else
|
Zeile 211 | Zeile 217 |
---|
$mybb->input['action'] = "newthread"; } }
|
$mybb->input['action'] = "newthread"; } }
|
detect_attachmentact();
| detect_attachmentact();
|
// Are we removing an attachment from the thread? if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid', MyBB::INPUT_INT) && $mybb->get_input('attachmentact') == "remove") { // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
// Are we removing an attachment from the thread? if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid', MyBB::INPUT_INT) && $mybb->get_input('attachmentact') == "remove") { // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
|
|
remove_attachment($pid, $mybb->get_input('posthash'), $mybb->get_input('attachmentaid', MyBB::INPUT_INT));
if(!$mybb->get_input('submit'))
| remove_attachment($pid, $mybb->get_input('posthash'), $mybb->get_input('attachmentaid', MyBB::INPUT_INT));
if(!$mybb->get_input('submit'))
|
Zeile 228 | Zeile 234 |
---|
}
if($mybb->get_input('ajax', MyBB::INPUT_INT) == 1)
|
}
if($mybb->get_input('ajax', MyBB::INPUT_INT) == 1)
|
{ $query = $db->simple_select("attachments", "SUM(filesize) AS ausage", "uid='".$mybb->user['uid']."'");
| { $query = $db->simple_select("attachments", "SUM(filesize) AS ausage", "uid='".$mybb->user['uid']."'");
|
$usage = $db->fetch_array($query);
header("Content-type: application/json; charset={$lang->settings['charset']}");
| $usage = $db->fetch_array($query);
header("Content-type: application/json; charset={$lang->settings['charset']}");
|
Zeile 473 | Zeile 479 |
---|
{ // Moderated thread $lang->redirect_newthread .= $lang->redirect_newthread_moderation;
|
{ // Moderated thread $lang->redirect_newthread .= $lang->redirect_newthread_moderation;
|
$url = get_forum_link($fid);
| $url = get_forum_link($fid);
|
// User must see moderation notice, regardless of redirect settings $force_redirect = true; }
| // User must see moderation notice, regardless of redirect settings $force_redirect = true; }
|
Zeile 504 | Zeile 510 |
---|
if($mybb->get_input('quoted_ids') == "all") { my_unsetcookie("multiquote");
|
if($mybb->get_input('quoted_ids') == "all") { my_unsetcookie("multiquote");
|
} }
| } }
|
$plugins->run_hooks("newthread_do_newthread_end");
| $plugins->run_hooks("newthread_do_newthread_end");
|
Zeile 521 | Zeile 527 |
---|
if($mybb->input['action'] == "newthread" || $mybb->input['action'] == "editdraft") { $plugins->run_hooks("newthread_start");
|
if($mybb->input['action'] == "newthread" || $mybb->input['action'] == "editdraft") { $plugins->run_hooks("newthread_start");
|
|
|
// Do we have attachment errors? if(count($errors) > 0) {
| // Do we have attachment errors? if(count($errors) > 0) {
|
Zeile 582 | Zeile 588 |
---|
} } if(!empty($onlyusfids))
|
} } if(!empty($onlyusfids))
|
{
| {
|
$onlyusforums = "AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))"; }
| $onlyusforums = "AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))"; }
|
Zeile 597 | Zeile 603 |
---|
ORDER BY p.dateline, p.pid "); while($quoted_post = $db->fetch_array($query))
|
ORDER BY p.dateline, p.pid "); while($quoted_post = $db->fetch_array($query))
|
{
| {
|
if($quoted_post['userusername']) { $quoted_post['username'] = $quoted_post['userusername'];
| if($quoted_post['userusername']) { $quoted_post['username'] = $quoted_post['userusername'];
|
Zeile 838 | Zeile 844 |
---|
$postbit = build_postbit($post, 1); eval("\$preview = \"".$templates->get("previewpost")."\";");
|
$postbit = build_postbit($post, 1); eval("\$preview = \"".$templates->get("previewpost")."\";");
|
} $message = htmlspecialchars_uni($mybb->get_input('message')); $subject = htmlspecialchars_uni($mybb->get_input('subject')); }
| } $message = htmlspecialchars_uni($mybb->get_input('message')); $subject = htmlspecialchars_uni($mybb->get_input('subject')); }
|
// Removing an attachment or adding a new one, or showing thread errors. else if($mybb->get_input('attachmentaid', MyBB::INPUT_INT) || $mybb->get_input('newattachment') || $mybb->get_input('updateattachment') || $thread_errors) {
| // Removing an attachment or adding a new one, or showing thread errors. else if($mybb->get_input('attachmentaid', MyBB::INPUT_INT) || $mybb->get_input('newattachment') || $mybb->get_input('updateattachment') || $thread_errors) {
|
Zeile 872 | Zeile 878 |
---|
if($forum['allowsmilies'] != 0) { eval("\$disablesmilies = \"".$templates->get("newthread_disablesmilies")."\";");
|
if($forum['allowsmilies'] != 0) { eval("\$disablesmilies = \"".$templates->get("newthread_disablesmilies")."\";");
|
}
| }
|
$postoptions = ''; if(!empty($signature) || !empty($disablesmilies)) {
| $postoptions = ''; if(!empty($signature) || !empty($disablesmilies)) {
|
Zeile 903 | Zeile 909 |
---|
if(isset($modoptions['stickthread']) && $modoptions['stickthread'] == 1) { $stickycheck = "checked=\"checked\"";
|
if(isset($modoptions['stickthread']) && $modoptions['stickthread'] == 1) { $stickycheck = "checked=\"checked\"";
|
} else
| } else
|
{ $stickycheck = '';
|
{ $stickycheck = '';
|
}
| }
|
$closeoption = ''; if(is_moderator($fid, "canopenclosethreads")) {
| $closeoption = ''; if(is_moderator($fid, "canopenclosethreads")) {
|
Zeile 919 | Zeile 925 |
---|
if(is_moderator($fid, "canstickunstickthreads")) { eval("\$stickoption = \"".$templates->get("newreply_modoptions_stick")."\";");
|
if(is_moderator($fid, "canstickunstickthreads")) { eval("\$stickoption = \"".$templates->get("newreply_modoptions_stick")."\";");
|
}
| }
|
if(!empty($closeoption) || !empty($stickoption)) {
| if(!empty($closeoption) || !empty($stickoption)) {
|
Zeile 950 | Zeile 956 |
---|
$attachwhere = "pid='$pid'"; } else
|
$attachwhere = "pid='$pid'"; } else
|
{
| {
|
$attachwhere = "posthash='".$db->escape_string($posthash)."'"; } $query = $db->simple_select("attachments", "*", $attachwhere);
| $attachwhere = "posthash='".$db->escape_string($posthash)."'"; } $query = $db->simple_select("attachments", "*", $attachwhere);
|
Zeile 960 | Zeile 966 |
---|
$attachment['size'] = get_friendly_size($attachment['filesize']); $attachment['icon'] = get_attachment_icon(get_extension($attachment['filename'])); $attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
|
$attachment['size'] = get_friendly_size($attachment['filesize']); $attachment['icon'] = get_attachment_icon(get_extension($attachment['filename'])); $attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
|
|
|
if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && (!$mybb->user['uid'] || $mybb->user['showcodebuttons'] != 0)) { eval("\$postinsert = \"".$templates->get("post_attachments_attachment_postinsert")."\";");
|
if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && (!$mybb->user['uid'] || $mybb->user['showcodebuttons'] != 0)) { eval("\$postinsert = \"".$templates->get("post_attachments_attachment_postinsert")."\";");
|
}
| }
|
eval("\$attach_rem_options = \"".$templates->get("post_attachments_attachment_remove")."\";");
$attach_mod_options = '';
| eval("\$attach_rem_options = \"".$templates->get("post_attachments_attachment_remove")."\";");
$attach_mod_options = '';
|
Zeile 1011 | Zeile 1017 |
---|
if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !isset($noshowattach)) { eval("\$attach_add_options = \"".$templates->get("post_attachments_add")."\";");
|
if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !isset($noshowattach)) { eval("\$attach_add_options = \"".$templates->get("post_attachments_add")."\";");
|
}
| }
|
$attach_update_options = ''; if(($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']) && $attachcount > 0)
|
$attach_update_options = ''; if(($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']) && $attachcount > 0)
|
{
| {
|
eval("\$attach_update_options = \"".$templates->get("post_attachments_update")."\";");
|
eval("\$attach_update_options = \"".$templates->get("post_attachments_update")."\";");
|
}
| }
|
if($attach_add_options || $attach_update_options) {
| if($attach_add_options || $attach_update_options) {
|
Zeile 1026 | Zeile 1032 |
---|
eval("\$attachbox = \"".$templates->get("post_attachments")."\";");
$bgcolor = alt_trow();
|
eval("\$attachbox = \"".$templates->get("post_attachments")."\";");
$bgcolor = alt_trow();
|
}
| }
|
else { $attachbox = ''; }
|
else { $attachbox = ''; }
|
| $savedraftbutton = '';
|
if($mybb->user['uid']) { eval("\$savedraftbutton = \"".$templates->get("post_savedraftbutton", 1, 0)."\";");
| if($mybb->user['uid']) { eval("\$savedraftbutton = \"".$templates->get("post_savedraftbutton", 1, 0)."\";");
|
Zeile 1056 | Zeile 1063 |
---|
// Generate a hidden list of items for our captcha $captcha = $post_captcha->build_hidden_captcha();
|
// Generate a hidden list of items for our captcha $captcha = $post_captcha->build_hidden_captcha();
|
} }
| } }
|
if(!$correct) {
| if(!$correct) {
|
Zeile 1088 | Zeile 1095 |
---|
$captcha = $post_captcha->html; } }
|
$captcha = $post_captcha->html; } }
|
| $pollbox = '';
|
if($forumpermissions['canpostpolls'] != 0) {
| if($forumpermissions['canpostpolls'] != 0) {
|