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: newreply.php 3992 2008-07-06 17:27:56Z Tikitiki $
| * $Id: newreply.php 4277 2008-11-23 20:47:16Z Tikitiki $
|
*/
define("IN_MYBB", 1);
|
*/
define("IN_MYBB", 1);
|
| define('THIS_SCRIPT', 'newreply.php');
|
$templatelist = "newreply,previewpost,error_invalidforum,error_invalidthread,redirect_threadposted,loginbox,changeuserbox,posticons,newreply_threadreview,forumrules,attachments,newreply_threadreview_post"; $templatelist .= ",smilieinsert,codebuttons,post_attachments_new,post_attachments,post_savedraftbutton,newreply_modoptions,newreply_threadreview_more,newreply_disablesmilies,postbit_online,postbit_find,postbit_pm,postbit_www,postbit_email,postbit_reputation,postbit_warninglevel,postbit_author_user,postbit_edit,postbit_quickdelete,postbit_inlinecheck,postbit_posturl,postbit_quote,postbit_multiquote,postbit_report,postbit_seperator,postbit,post_subscription_method";
| $templatelist = "newreply,previewpost,error_invalidforum,error_invalidthread,redirect_threadposted,loginbox,changeuserbox,posticons,newreply_threadreview,forumrules,attachments,newreply_threadreview_post"; $templatelist .= ",smilieinsert,codebuttons,post_attachments_new,post_attachments,post_savedraftbutton,newreply_modoptions,newreply_threadreview_more,newreply_disablesmilies,postbit_online,postbit_find,postbit_pm,postbit_www,postbit_email,postbit_reputation,postbit_warninglevel,postbit_author_user,postbit_edit,postbit_quickdelete,postbit_inlinecheck,postbit_posturl,postbit_quote,postbit_multiquote,postbit_report,postbit_seperator,postbit,post_subscription_method";
|
Zeile 135 | Zeile 136 |
---|
} elseif($mybb->input['previewpost']) {
|
} elseif($mybb->input['previewpost']) {
|
$username = $mybb->input['username'];
| $username = htmlspecialchars_uni($mybb->input['username']);
|
} eval("\$loginbox = \"".$templates->get("loginbox")."\";");
|
} eval("\$loginbox = \"".$templates->get("loginbox")."\";");
|
}
| }
|
// Check to see if the thread is closed, and if the user is a mod. if(!is_moderator($fid, "caneditposts")) {
| // Check to see if the thread is closed, and if the user is a mod. if(!is_moderator($fid, "caneditposts")) {
|
Zeile 151 | Zeile 152 |
---|
// No weird actions allowed, show new reply form if no regular action. if($mybb->input['action'] != "do_newreply" && $mybb->input['action'] != "editdraft")
|
// No weird actions allowed, show new reply form if no regular action. if($mybb->input['action'] != "do_newreply" && $mybb->input['action'] != "editdraft")
|
{ $mybb->input['action'] = "newreply"; }
| { $mybb->input['action'] = "newreply"; }
|
// Even if we are previewing, still show the new reply form. if($mybb->input['previewpost'])
|
// Even if we are previewing, still show the new reply form. if($mybb->input['previewpost'])
|
{
| {
|
$mybb->input['action'] = "newreply";
|
$mybb->input['action'] = "newreply";
|
}
| }
|
if((empty($_POST) && empty($_FILES)) && $mybb->input['processed'] == '1') {
| if((empty($_POST) && empty($_FILES)) && $mybb->input['processed'] == '1') {
|
Zeile 167 | Zeile 168 |
---|
}
if(!$mybb->input['attachmentaid'] && ($mybb->input['newattachment'] || ($mybb->input['action'] == "do_newreply" && $mybb->input['submit'] && $_FILES['attachment'])))
|
}
if(!$mybb->input['attachmentaid'] && ($mybb->input['newattachment'] || ($mybb->input['action'] == "do_newreply" && $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']);
|
}
| }
|
if($attachedfile['error']) { eval("\$attacherror = \"".$templates->get("error_attacherror")."\";"); $mybb->input['action'] = "newreply"; }
|
if($attachedfile['error']) { eval("\$attacherror = \"".$templates->get("error_attacherror")."\";"); $mybb->input['action'] = "newreply"; }
|
|
|
if(!$mybb->input['submit']) { $mybb->input['action'] = "newreply";
| if(!$mybb->input['submit']) { $mybb->input['action'] = "newreply";
|
Zeile 201 | Zeile 215 |
---|
{ mt_srand ((double) microtime() * 1000000); $mybb->input['posthash'] = md5($thread['tid'].$mybb->user['uid'].mt_rand());
|
{ mt_srand ((double) microtime() * 1000000); $mybb->input['posthash'] = md5($thread['tid'].$mybb->user['uid'].mt_rand());
|
}
| }
|
$reply_errors = ""; $hide_captcha = false;
| $reply_errors = ""; $hide_captcha = false;
|
Zeile 249 | Zeile 263 |
---|
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);
|
}
| }
|
error($lang->error_invalidpassword.$login_text); } // Otherwise they've logged in successfully.
| error($lang->error_invalidpassword.$login_text); } // Otherwise they've logged in successfully.
|
Zeile 265 | Zeile 279 |
---|
// 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 444 | Zeile 459 |
---|
else { // Moderated post
|
else { // Moderated post
|
$lang->redirect_newreply .= $lang->redirect_newreply_moderation;
| $lang->redirect_newreply .= '<br />'.$lang->redirect_newreply_moderation;
|
$url = get_thread_link($tid); }
| $url = get_thread_link($tid); }
|