Zeile 208 | Zeile 208 |
---|
$lang->error_maxposts = $lang->sprintf($lang->error_maxposts, $mybb->settings['maxposts']); error($lang->error_maxposts); }
|
$lang->error_maxposts = $lang->sprintf($lang->error_maxposts, $mybb->settings['maxposts']); error($lang->error_maxposts); }
|
| }
// If this isn't a logged in user, then we need to do some special validation. if($mybb->user['uid'] == 0) { $username = htmlspecialchars_uni($mybb->input['username']);
// Check if username exists. if(username_exists($mybb->input['username'])) { // If it does throw back "username is taken" error($lang->error_usernametaken); } // This username does not exist. else { // If they didn't specify a username then give them "Guest" if(!$mybb->input['username']) { $username = $lang->guest; } // Otherwise use the name they specified. else { $username = htmlspecialchars_uni($mybb->input['username']); } $uid = 0; } } // This user is logged in. else { $username = $mybb->user['username']; $uid = $mybb->user['uid'];
|
}
// Performing the posting of a new thread.
| }
// Performing the posting of a new thread.
|
Zeile 217 | Zeile 251 |
---|
verify_post_check($mybb->input['my_post_key']);
$plugins->run_hooks("newthread_do_newthread_start");
|
verify_post_check($mybb->input['my_post_key']);
$plugins->run_hooks("newthread_do_newthread_start");
|
// If this isn't a logged in user, then we need to do some special validation. if($mybb->user['uid'] == 0) { $username = htmlspecialchars_uni($mybb->input['username']);
// Check if username exists. if(username_exists($mybb->input['username'])) { // If it does throw back "username is taken" error($lang->error_usernametaken); } // This username does not exist. else { // If they didn't specify a username then give them "Guest" if(!$mybb->input['username']) { $username = $lang->guest; } // Otherwise use the name they specified. else { $username = htmlspecialchars_uni($mybb->input['username']); } $uid = 0; } } // This user is logged in. else { $username = $mybb->user['username']; $uid = $mybb->user['uid']; }
| |
// Attempt to see if this post is a duplicate or not if($uid > 0)
| // Attempt to see if this post is a duplicate or not if($uid > 0)
|
Zeile 334 | Zeile 334 |
---|
// Check captcha image if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
|
// Check captcha image if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
|
{
| {
|
require_once MYBB_ROOT.'inc/class_captcha.php'; $post_captcha = new captcha;
| require_once MYBB_ROOT.'inc/class_captcha.php'; $post_captcha = new captcha;
|
Zeile 347 | Zeile 347 |
---|
} } else
|
} } else
|
{
| {
|
$hide_captcha = true; } }
| $hide_captcha = true; } }
|
Zeile 367 | Zeile 367 |
---|
// Invalidate solved captcha if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
|
// Invalidate solved captcha if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
|
{
| {
|
$post_captcha->invalidate_captcha(); }
| $post_captcha->invalidate_captcha(); }
|
Zeile 380 | Zeile 380 |
---|
{ $lang->redirect_newthread = $lang->draft_saved; $url = "usercp.php?action=drafts";
|
{ $lang->redirect_newthread = $lang->draft_saved; $url = "usercp.php?action=drafts";
|
}
| }
|
// A poll was being posted with this thread, throw them to poll posting page. else if($mybb->input['postpoll'] && $forumpermissions['canpostpolls']) { $url = "polls.php?action=newpoll&tid=$tid&polloptions=".intval($mybb->input['numpolloptions']); $lang->redirect_newthread .= $lang->redirect_newthread_poll;
|
// A poll was being posted with this thread, throw them to poll posting page. else if($mybb->input['postpoll'] && $forumpermissions['canpostpolls']) { $url = "polls.php?action=newpoll&tid=$tid&polloptions=".intval($mybb->input['numpolloptions']); $lang->redirect_newthread .= $lang->redirect_newthread_poll;
|
}
| }
|
// This thread is stuck in the moderation queue, send them back to the forum. else if(!$visible) {
| // This thread is stuck in the moderation queue, send them back to the forum. else if(!$visible) {
|
Zeile 546 | Zeile 546 |
---|
{ $postoptions = $mybb->input['postoptions']; if($postoptions['signature'] == 1)
|
{ $postoptions = $mybb->input['postoptions']; if($postoptions['signature'] == 1)
|
{ $postoptionschecked['signature'] = " checked=\"checked\""; } if($postoptions['subscriptionmethod'] == "none") { $postoptions_subscriptionmethod_none = "checked=\"checked\""; } else if($postoptions['subscriptionmethod'] == "instant") { $postoptions_subscriptionmethod_instant = "checked=\"checked\""; } else { $postoptions_subscriptionmethod_dont = "checked=\"checked\""; } if($postoptions['disablesmilies'] == 1) { $postoptionschecked['disablesmilies'] = " checked=\"checked\""; }
| { $postoptionschecked['signature'] = " checked=\"checked\""; } if($postoptions['subscriptionmethod'] == "none") { $postoptions_subscriptionmethod_none = "checked=\"checked\""; } else if($postoptions['subscriptionmethod'] == "instant") { $postoptions_subscriptionmethod_instant = "checked=\"checked\""; } else { $postoptions_subscriptionmethod_dont = "checked=\"checked\""; } if($postoptions['disablesmilies'] == 1) { $postoptionschecked['disablesmilies'] = " checked=\"checked\""; }
|
if($mybb->input['postpoll'] == 1) { $postpollchecked = "checked=\"checked\""; } $numpolloptions = intval($mybb->input['numpolloptions']);
|
if($mybb->input['postpoll'] == 1) { $postpollchecked = "checked=\"checked\""; } $numpolloptions = intval($mybb->input['numpolloptions']);
|
}
| }
|
// 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 583 | Zeile 583 |
---|
$postoptionschecked['signature'] = " checked=\"checked\""; } if($post['smilieoff'] == 1)
|
$postoptionschecked['signature'] = " checked=\"checked\""; } if($post['smilieoff'] == 1)
|
{
| {
|
$postoptionschecked['disablesmilies'] = " checked=\"checked\""; } $icon = $post['icon'];
| $postoptionschecked['disablesmilies'] = " checked=\"checked\""; } $icon = $post['icon'];
|
Zeile 596 | Zeile 596 |
---|
$postoptions_subscriptionmethod_none = "checked=\"checked\""; } else if($postoptions['subscriptionmethod'] == "instant")
|
$postoptions_subscriptionmethod_none = "checked=\"checked\""; } else if($postoptions['subscriptionmethod'] == "instant")
|
{ $postoptions_subscriptionmethod_instant = "checked=\"checked\""; } else { $postoptions_subscriptionmethod_dont = "checked=\"checked\""; } }
| { $postoptions_subscriptionmethod_instant = "checked=\"checked\""; } else { $postoptions_subscriptionmethod_dont = "checked=\"checked\""; } }
|
// Otherwise, this is our initial visit to this page. else { if($mybb->user['signature'] != '') { $postoptionschecked['signature'] = " checked=\"checked\"";
|
// Otherwise, this is our initial visit to this page. else { if($mybb->user['signature'] != '') { $postoptionschecked['signature'] = " checked=\"checked\"";
|
}
| }
|
if($mybb->user['subscriptionmethod'] == 1) { $postoptions_subscriptionmethod_none = "checked=\"checked\"";
| if($mybb->user['subscriptionmethod'] == 1) { $postoptions_subscriptionmethod_none = "checked=\"checked\"";
|
Zeile 651 | Zeile 651 |
---|
if($pid != '') { $new_thread['pid'] = $pid;
|
if($pid != '') { $new_thread['pid'] = $pid;
|
}
| }
|
$posthandler->set_data($new_thread);
|
$posthandler->set_data($new_thread);
|
|
|
// Now let the post handler do all the hard work. $valid_thread = $posthandler->verify_message(); $valid_subject = $posthandler->verify_subject();
|
// Now let the post handler do all the hard work. $valid_thread = $posthandler->verify_message(); $valid_subject = $posthandler->verify_subject();
|
| // guest post --> verify author if($new_thread['uid'] == 0) { $valid_username = $posthandler->verify_author(); } else { $valid_username = true; }
|
$post_errors = array(); // Fetch friendly error messages if this is an invalid post
|
$post_errors = array(); // Fetch friendly error messages if this is an invalid post
|
if(!$valid_thread || !$valid_subject)
| if(!$valid_thread || !$valid_subject || !$valid_username)
|
{ $post_errors = $posthandler->get_friendly_errors(); }
| { $post_errors = $posthandler->get_friendly_errors(); }
|