Zeile 11 | Zeile 11 |
---|
define("IN_MYBB", 1); define('THIS_SCRIPT', 'newthread.php');
|
define("IN_MYBB", 1); define('THIS_SCRIPT', 'newthread.php');
|
$templatelist = "newthread,previewpost,loginbox,changeuserbox,newthread_postpoll,posticons,codebuttons,postbit,post_attachments_attachment_unapproved,newthread_postoptions,postbit_icon"; $templatelist .= ",newthread_disablesmilies,post_attachments_new,post_attachments,post_savedraftbutton,post_subscription_method,post_attachments_attachment_remove,postbit_warninglevel_formatted";
| $templatelist = "newthread,previewpost,loginbox,changeuserbox,newthread_postpoll,posticons,codebuttons,postbit,post_attachments_attachment_unapproved,newreply_modoptions_close,newreply_modoptions_stick"; $templatelist .= ",newthread_disablesmilies,post_attachments_new,post_attachments,post_savedraftbutton,post_subscription_method,post_attachments_attachment_remove,postbit_warninglevel_formatted,postbit_icon";
|
$templatelist .= ",forumdisplay_rules,forumdisplay_rules_link,post_attachments_attachment_postinsert,post_attachments_attachment,newthread_signature,post_prefixselect_prefix,post_prefixselect_single";
|
$templatelist .= ",forumdisplay_rules,forumdisplay_rules_link,post_attachments_attachment_postinsert,post_attachments_attachment,newthread_signature,post_prefixselect_prefix,post_prefixselect_single";
|
$templatelist .= ",member_register_regimage,member_register_regimage_recaptcha,post_captcha_hidden,post_captcha,post_captcha_recaptcha,post_captcha_nocaptcha,postbit_gotopost,posticons_icon";
| $templatelist .= ",member_register_regimage,member_register_regimage_recaptcha,post_captcha_hidden,post_captcha,post_captcha_recaptcha,post_captcha_nocaptcha,postbit_gotopost,newthread_postoptions";
|
$templatelist .= ",postbit_avatar,postbit_find,postbit_pm,postbit_rep_button,postbit_www,postbit_email,postbit_reputation,postbit_warn,postbit_warninglevel,postbit_author_user,postbit_author_guest"; $templatelist .= ",postbit_signature,postbit_classic,postbit_attachments_thumbnails_thumbnail,postbit_attachments_images_image,postbit_attachments_attachment,postbit_attachments_attachment_unapproved";
|
$templatelist .= ",postbit_avatar,postbit_find,postbit_pm,postbit_rep_button,postbit_www,postbit_email,postbit_reputation,postbit_warn,postbit_warninglevel,postbit_author_user,postbit_author_guest"; $templatelist .= ",postbit_signature,postbit_classic,postbit_attachments_thumbnails_thumbnail,postbit_attachments_images_image,postbit_attachments_attachment,postbit_attachments_attachment_unapproved";
|
$templatelist .= ",postbit_attachments_thumbnails,postbit_attachments_images,postbit_attachments,postbit_reputation_formatted_link,post_attachments_update,postbit_offline,newreply_modoptions";
| $templatelist .= ",postbit_attachments_thumbnails,postbit_attachments_images,postbit_attachments,postbit_reputation_formatted_link,post_attachments_update,postbit_offline,newreply_modoptions,posticons_icon";
|
$templatelist .= ",newthread_draftinput,global_moderation_notice,postbit_online,postbit_away,attachment_icon,postbit_userstar,newthread_multiquote_external,postbit_groupimage,post_attachments_add";
require_once "./global.php";
| $templatelist .= ",newthread_draftinput,global_moderation_notice,postbit_online,postbit_away,attachment_icon,postbit_userstar,newthread_multiquote_external,postbit_groupimage,post_attachments_add";
require_once "./global.php";
|
Zeile 558 | Zeile 558 |
---|
else { $visible_where = "AND p.visible > 0";
|
else { $visible_where = "AND p.visible > 0";
|
| }
// Check group permissions if we can't view threads not started by us $group_permissions = forum_permissions(); $onlyusfids = array(); $onlyusforums = ''; foreach($group_permissions as $gpfid => $forum_permissions) { if(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1) { $onlyusfids[] = $gpfid; } } if(!empty($onlyusfids)) { $onlyusforums = "AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))";
|
}
if($mybb->get_input('load_all_quotes', MyBB::INPUT_INT) == 1)
| }
if($mybb->get_input('load_all_quotes', MyBB::INPUT_INT) == 1)
|
Zeile 567 | Zeile 583 |
---|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
|
WHERE p.pid IN ({$quoted_posts}) {$unviewable_forums} {$inactiveforums} {$visible_where}
| WHERE p.pid IN ({$quoted_posts}) {$unviewable_forums} {$inactiveforums} {$onlyusforums} {$visible_where}
|
ORDER BY p.dateline "); while($quoted_post = $db->fetch_array($query))
| ORDER BY p.dateline "); while($quoted_post = $db->fetch_array($query))
|
Zeile 590 | Zeile 606 |
---|
SELECT COUNT(*) AS quotes FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
|
SELECT COUNT(*) AS quotes FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
|
WHERE p.pid IN ({$quoted_posts}) {$unviewable_forums} {$inactiveforums} {$visible_where}
| WHERE p.pid IN ({$quoted_posts}) {$unviewable_forums} {$inactiveforums} {$onlyusforums} {$visible_where}
|
"); $external_quotes = $db->fetch_field($query, 'quotes');
| "); $external_quotes = $db->fetch_field($query, 'quotes');
|
Zeile 645 | Zeile 661 |
---|
$postoptions_subscriptionmethod_email = "checked=\"checked\""; } else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "pm")
|
$postoptions_subscriptionmethod_email = "checked=\"checked\""; } else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "pm")
|
{ $postoptions_subscriptionmethod_pm = "checked=\"checked\""; } else { $postoptions_subscriptionmethod_dont = "checked=\"checked\""; } if(isset($postoptions['disablesmilies']) && $postoptions['disablesmilies'] == 1) { $postoptionschecked['disablesmilies'] = " checked=\"checked\""; }
| { $postoptions_subscriptionmethod_pm = "checked=\"checked\""; } else { $postoptions_subscriptionmethod_dont = "checked=\"checked\""; } if(isset($postoptions['disablesmilies']) && $postoptions['disablesmilies'] == 1) { $postoptionschecked['disablesmilies'] = " checked=\"checked\""; }
|
if($mybb->get_input('postpoll', MyBB::INPUT_INT) == 1) { $postpollchecked = "checked=\"checked\""; } $numpolloptions = $mybb->get_input('numpolloptions', MyBB::INPUT_INT);
|
if($mybb->get_input('postpoll', MyBB::INPUT_INT) == 1) { $postpollchecked = "checked=\"checked\""; } $numpolloptions = $mybb->get_input('numpolloptions', MyBB::INPUT_INT);
|
}
| }
|
// Editing a draft thread else if($mybb->input['action'] == "editdraft" && $mybb->user['uid'])
| // Editing a draft thread else if($mybb->input['action'] == "editdraft" && $mybb->user['uid'])
|
Zeile 701 | Zeile 717 |
---|
}
// Otherwise, this is our initial visit to this page.
|
}
// Otherwise, this is our initial visit to this page.
|
else
| else
|
{ if($mybb->user['signature'] != '') { $postoptionschecked['signature'] = " checked=\"checked\"";
|
{ if($mybb->user['signature'] != '') { $postoptionschecked['signature'] = " checked=\"checked\"";
|
}
| }
|
if($mybb->user['subscriptionmethod'] == 1)
|
if($mybb->user['subscriptionmethod'] == 1)
|
{
| {
|
$postoptions_subscriptionmethod_none = "checked=\"checked\""; } else if($mybb->user['subscriptionmethod'] == 2)
|
$postoptions_subscriptionmethod_none = "checked=\"checked\""; } else if($mybb->user['subscriptionmethod'] == 2)
|
{
| {
|
$postoptions_subscriptionmethod_email = "checked=\"checked\"";
|
$postoptions_subscriptionmethod_email = "checked=\"checked\"";
|
}
| }
|
else if($mybb->user['subscriptionmethod'] == 3) { $postoptions_subscriptionmethod_pm = "checked=\"checked\"";
|
else if($mybb->user['subscriptionmethod'] == 3) { $postoptions_subscriptionmethod_pm = "checked=\"checked\"";
|
}
| }
|
else { $postoptions_subscriptionmethod_dont = "checked=\"checked\"";
| else { $postoptions_subscriptionmethod_dont = "checked=\"checked\"";
|
Zeile 747 | Zeile 763 |
---|
$uid = 0; } // This user is logged in.
|
$uid = 0; } // This user is logged in.
|
else {
| else {
|
$username = $mybb->user['username']; $uid = $mybb->user['uid']; }
| $username = $mybb->user['username']; $uid = $mybb->user['uid']; }
|
Zeile 772 | Zeile 788 |
---|
);
if($pid != '')
|
);
if($pid != '')
|
{
| {
|
$new_thread['pid'] = $pid; }
| $new_thread['pid'] = $pid; }
|
Zeile 784 | Zeile 800 |
---|
// guest post --> verify author if($new_thread['uid'] == 0)
|
// guest post --> verify author if($new_thread['uid'] == 0)
|
{
| {
|
$valid_username = $posthandler->verify_author(); } else
| $valid_username = $posthandler->verify_author(); } else
|
Zeile 795 | Zeile 811 |
---|
$post_errors = array(); // Fetch friendly error messages if this is an invalid post if(!$valid_thread || !$valid_subject || !$valid_username)
|
$post_errors = array(); // Fetch friendly error messages if this is an invalid post if(!$valid_thread || !$valid_subject || !$valid_username)
|
{
| {
|
$post_errors = $posthandler->get_friendly_errors(); }
// One or more errors returned, fetch error list and throw to newreply page if(count($post_errors) > 0)
|
$post_errors = $posthandler->get_friendly_errors(); }
// One or more errors returned, fetch error list and throw to newreply page if(count($post_errors) > 0)
|
{
| {
|
$thread_errors = inline_error($post_errors); } else { if(empty($mybb->input['username']))
|
$thread_errors = inline_error($post_errors); } else { if(empty($mybb->input['username']))
|
{
| {
|
$mybb->input['username'] = $lang->guest; } $query = $db->query("
| $mybb->input['username'] = $lang->guest; } $query = $db->query("
|
Zeile 818 | Zeile 834 |
---|
"); $post = $db->fetch_array($query); if(!$mybb->user['uid'] || !$post['username'])
|
"); $post = $db->fetch_array($query); if(!$mybb->user['uid'] || !$post['username'])
|
{
| {
|
$post['username'] = htmlspecialchars_uni($mybb->get_input('username')); } else
| $post['username'] = htmlspecialchars_uni($mybb->get_input('username')); } else
|
Zeile 841 | Zeile 857 |
---|
$post['includesig'] = $mybb->input['postoptions']['signature']; } if(!isset($post['includesig']) || $post['includesig'] != 1)
|
$post['includesig'] = $mybb->input['postoptions']['signature']; } if(!isset($post['includesig']) || $post['includesig'] != 1)
|
{
| {
|
$post['includesig'] = 0; }
// Fetch attachments assigned to this post if($mybb->get_input('pid', MyBB::INPUT_INT))
|
$post['includesig'] = 0; }
// Fetch attachments assigned to this post if($mybb->get_input('pid', MyBB::INPUT_INT))
|
{
| {
|
$attachwhere = "pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'"; } else { $attachwhere = "posthash='".$db->escape_string($mybb->get_input('posthash'))."'";
|
$attachwhere = "pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'"; } else { $attachwhere = "posthash='".$db->escape_string($mybb->get_input('posthash'))."'";
|
}
| }
|
$query = $db->simple_select("attachments", "*", $attachwhere); while($attachment = $db->fetch_array($query))
| $query = $db->simple_select("attachments", "*", $attachwhere); while($attachment = $db->fetch_array($query))
|
Zeile 864 | Zeile 880 |
---|
$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.
| }
// Removing an attachment or adding a new one, or showing thread errors.
|
Zeile 888 | Zeile 904 |
---|
// Hide signature option if no permission $signature = ''; if($mybb->usergroup['canusesig'] == 1 && !$mybb->user['suspendsignature'])
|
// Hide signature option if no permission $signature = ''; if($mybb->usergroup['canusesig'] == 1 && !$mybb->user['suspendsignature'])
|
{
| {
|
eval("\$signature = \"".$templates->get('newthread_signature')."\";"); }
| eval("\$signature = \"".$templates->get('newthread_signature')."\";"); }
|
Zeile 911 | Zeile 927 |
---|
$bgcolor = "trow1"; $bgcolor2 = "trow2"; }
|
$bgcolor = "trow1"; $bgcolor2 = "trow2"; }
|
|
|
$modoptions = ''; // Show the moderator options if(is_moderator($fid))
| $modoptions = ''; // Show the moderator options if(is_moderator($fid))
|
Zeile 931 | Zeile 947 |
---|
} else {
|
} else {
|
$stickycheck = '';
| $stickycheck = ''; }
$closeoption = ''; if(is_moderator($thread['fid'], "canopenclosethreads")) { eval("\$closeoption = \"".$templates->get("newreply_modoptions_close")."\";"); }
$stickoption = ''; if(is_moderator($thread['fid'], "canstickunstickthreads")) { eval("\$stickoption = \"".$templates->get("newreply_modoptions_stick")."\";"); }
if(!empty($closeoption) || !empty($stickoption)) { eval("\$modoptions = \"".$templates->get("newreply_modoptions")."\";"); $bgcolor = "trow1"; $bgcolor2 = "trow2"; } else { $bgcolor = "trow2"; $bgcolor2 = "trow1";
|
}
|
}
|
eval("\$modoptions = \"".$templates->get("newreply_modoptions")."\";"); $bgcolor = "trow1"; $bgcolor2 = "trow2";
| |
} else {
| } else {
|