Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: newthread.php 3992 2008-07-06 17:27:56Z Tikitiki $
| * $Id: newthread.php 4265 2008-11-08 23:52:49Z Tikitiki $
|
*/
define("IN_MYBB", 1);
|
*/
define("IN_MYBB", 1);
|
| define('THIS_SCRIPT', 'newthread.php');
|
$templatelist = "newthread,previewpost,error_invalidforum,redirect_newthread,loginbox,changeuserbox,newthread_postpoll,posticons,attachment,newthread_postpoll,codebuttons,smilieinsert,error_nosubject"; $templatelist .= "posticons,newthread_disablesmilies,newreply_modoptions,post_attachments_new,post_attachments,post_savedraftbutton,post_subscription_method";
| $templatelist = "newthread,previewpost,error_invalidforum,redirect_newthread,loginbox,changeuserbox,newthread_postpoll,posticons,attachment,newthread_postpoll,codebuttons,smilieinsert,error_nosubject"; $templatelist .= "posticons,newthread_disablesmilies,newreply_modoptions,post_attachments_new,post_attachments,post_savedraftbutton,post_subscription_method";
|
Zeile 126 | Zeile 127 |
---|
// Handle attachments if we've got any. if(!$mybb->input['attachmentaid'] && ($mybb->input['newattachment'] || ($mybb->input['action'] == "do_newthread" && $mybb->input['submit'] && $_FILES['attachment']))) {
|
// Handle attachments if we've got any. if(!$mybb->input['attachmentaid'] && ($mybb->input['newattachment'] || ($mybb->input['action'] == "do_newthread" && $mybb->input['submit'] && $_FILES['attachment']))) {
|
// If there's an attachment, check it and upload it if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0)
| if($mybb->input['action'] == "editdraft" || ($mybb->input['tid'] && $mybb->input['pid'])) { $attachwhere = "pid='{$pid}'"; } else { $attachwhere = "posthash='".$db->escape_string($mybb->input['posthash'])."'"; } $query = $db->simple_select("attachments", "COUNT(aid) as numattachs", $attachwhere); $attachcount = $db->fetch_field($query, "numattachs"); // If there's an attachment, check it and upload it if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0 && ($mybb->settings['maxattachments'] == 0 || $attachcount < $mybb->settings['maxattachments']))
|
{ require_once MYBB_ROOT."inc/functions_upload.php"; $attachedfile = upload_attachment($_FILES['attachment']);
| { require_once MYBB_ROOT."inc/functions_upload.php"; $attachedfile = upload_attachment($_FILES['attachment']);
|
Zeile 137 | Zeile 149 |
---|
if($attachedfile['error']) { eval("\$attacherror = \"".$templates->get("error_attacherror")."\";");
|
if($attachedfile['error']) { eval("\$attacherror = \"".$templates->get("error_attacherror")."\";");
|
$mybb->input['action'] = "newthread"; }
| $mybb->input['action'] = "newthread"; }
|
// If we were dealing with an attachment but didn't click 'Post Thread', force the new thread page again. if(!$mybb->input['submit'])
| // If we were dealing with an attachment but didn't click 'Post Thread', force the new thread page again. if(!$mybb->input['submit'])
|
Zeile 173 | Zeile 185 |
---|
error($lang->error_maxposts); } }
|
error($lang->error_maxposts); } }
|
|
|
// Performing the posting of a new thread. if($mybb->input['action'] == "do_newthread" && $mybb->request_method == "post") {
| // Performing the posting of a new thread. if($mybb->input['action'] == "do_newthread" && $mybb->request_method == "post") {
|
Zeile 205 | Zeile 217 |
---|
if(!$mybb->user['uid']) { my_setcookie('loginattempts', $logins + 1);
|
if(!$mybb->user['uid']) { my_setcookie('loginattempts', $logins + 1);
|
$db->write_query("UPDATE ".TABLE_PREFIX."sessions SET loginattempts=loginattempts+1 WHERE sid = '{$session->sid}'");
| $db->write_query("UPDATE ".TABLE_PREFIX."users SET loginattempts=loginattempts+1 WHERE username = '".$db->escape_string($mybb->input['username'])."'");
|
if($mybb->settings['failedlogintext'] == 1) { $login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);
| if($mybb->settings['failedlogintext'] == 1) { $login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);
|
Zeile 221 | Zeile 233 |
---|
// Update the session to contain their user ID $updated_session = array( "uid" => $mybb->user['uid'],
|
// Update the session to contain their user ID $updated_session = array( "uid" => $mybb->user['uid'],
|
"loginattempts" => 0 );
| );
|
$db->update_query("sessions", $updated_session, "sid='{$session->sid}'");
|
$db->update_query("sessions", $updated_session, "sid='{$session->sid}'");
|
| $db->update_query("users", array("loginattempts" => 1), "uid='{$mybb->user['uid']}'");
|
// Set uid and username $uid = $mybb->user['uid'];
| // Set uid and username $uid = $mybb->user['uid'];
|
Zeile 315 | Zeile 328 |
---|
if(isset($thread['tid']) && $thread['visible'] == -2) { $new_thread['tid'] = $thread['tid'];
|
if(isset($thread['tid']) && $thread['visible'] == -2) { $new_thread['tid'] = $thread['tid'];
|
}
| }
|
// Set up the thread options from the input. $new_thread['options'] = array(
| // Set up the thread options from the input. $new_thread['options'] = array(
|
Zeile 575 | Zeile 588 |
---|
$postoptionschecked['disablesmilies'] = " checked=\"checked\""; } $icon = $post['icon'];
|
$postoptionschecked['disablesmilies'] = " checked=\"checked\""; } $icon = $post['icon'];
|
| $posticons = get_post_icons();
|
} // Otherwise, this is our initial visit to this page.
| } // Otherwise, this is our initial visit to this page.
|
Zeile 595 | Zeile 609 |
---|
else { $postoptions_subscriptionmethod_dont = "checked=\"checked\"";
|
else { $postoptions_subscriptionmethod_dont = "checked=\"checked\"";
|
}
| }
|
$numpolloptions = "2"; }
| $numpolloptions = "2"; }
|
Zeile 872 | Zeile 886 |
---|
$plugins->run_hooks("newthread_end");
|
$plugins->run_hooks("newthread_end");
|
| $forum['name'] = strip_tags($forum['name']);
|
$lang->newthread_in = $lang->sprintf($lang->newthread_in, $forum['name']);
|
$lang->newthread_in = $lang->sprintf($lang->newthread_in, $forum['name']);
|
$forum['name'] = strip_tags($forum['name']);
| |
eval("\$newthread = \"".$templates->get("newthread")."\";"); output_page($newthread);
| eval("\$newthread = \"".$templates->get("newthread")."\";"); output_page($newthread);
|