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 4081 2008-08-08 01:47:02Z Tikitiki $
| * $Id: newreply.php 4322 2009-02-21 23:00:49Z Tikitiki $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 132 | Zeile 132 |
---|
{ if(!$mybb->input['previewpost'] && $mybb->input['action'] != "do_newreply") {
|
{ if(!$mybb->input['previewpost'] && $mybb->input['action'] != "do_newreply") {
|
$username = $lang->guest;
| $username = '';
|
} 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")."\";"); }
|
Zeile 147 | Zeile 147 |
---|
if($thread['closed'] == 1) { error($lang->redirect_threadclosed);
|
if($thread['closed'] == 1) { error($lang->redirect_threadclosed);
|
}
| }
|
}
// 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"; }
|
Zeile 169 | Zeile 169 |
---|
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")."\";");
|
if($attachedfile['error']) { eval("\$attacherror = \"".$templates->get("error_attacherror")."\";");
|
$mybb->input['action'] = "newreply"; } if(!$mybb->input['submit']) { $mybb->input['action'] = "newreply";
| $mybb->input['action'] = "newreply"; } if(!$mybb->input['submit']) { $mybb->input['action'] = "newreply";
|
} }
| } }
|
Zeile 250 | 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 266 | 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 313 | Zeile 327 |
---|
else { $user_check = "p.ipaddress='".$db->escape_string($session->ipaddress)."'";
|
else { $user_check = "p.ipaddress='".$db->escape_string($session->ipaddress)."'";
|
} if(!$mybb->input['savedraft'])
| } if(!$mybb->input['savedraft'])
|
{ $query = $db->simple_select("posts p", "p.pid", "{$user_check} AND p.tid='{$thread['tid']}' AND p.subject='".$db->escape_string($mybb->input['subject'])."' AND p.message='".$db->escape_string($mybb->input['message'])."' AND p.posthash='".$db->escape_string($mybb->input['posthash'])."'"); $duplicate_check = $db->fetch_field($query, "pid");
| { $query = $db->simple_select("posts p", "p.pid", "{$user_check} AND p.tid='{$thread['tid']}' AND p.subject='".$db->escape_string($mybb->input['subject'])."' AND p.message='".$db->escape_string($mybb->input['message'])."' AND p.posthash='".$db->escape_string($mybb->input['posthash'])."'"); $duplicate_check = $db->fetch_field($query, "pid");
|
Zeile 378 | Zeile 392 |
---|
{ $post_errors = $posthandler->get_friendly_errors(); }
|
{ $post_errors = $posthandler->get_friendly_errors(); }
|
| // Mark thread as read require_once MYBB_ROOT."inc/functions_indicators.php"; mark_thread_read($tid, $fid);
|
// Check captcha image if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])
| // Check captcha image if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])
|
Zeile 443 | Zeile 462 |
---|
$url = get_post_link($pid, $tid)."#pid{$pid}"; } else
|
$url = get_post_link($pid, $tid)."#pid{$pid}"; } else
|
{
| {
|
// Moderated post
|
// 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); }
|
Zeile 471 | Zeile 490 |
---|
{ unset($multiquote[$key]); }
|
{ unset($multiquote[$key]); }
|
}
| }
|
// Still have an array - set the new cookie if(is_array($multiquote)) { $new_multiquote = implode(",", $multiquote); my_setcookie("multiquote", $new_multiquote);
|
// Still have an array - set the new cookie if(is_array($multiquote)) { $new_multiquote = implode(",", $multiquote); my_setcookie("multiquote", $new_multiquote);
|
}
| }
|
// Otherwise, unset it else {
| // Otherwise, unset it else {
|
Zeile 486 | Zeile 505 |
---|
} } }
|
} } }
|
// Mark thread as read require_once MYBB_ROOT."inc/functions_indicators.php"; mark_thread_read($tid, $fid);
|
|
$plugins->run_hooks("newreply_do_newreply_end"); // This was a post made via the ajax quick reply - we need to do some special things here
| $plugins->run_hooks("newreply_do_newreply_end"); // This was a post made via the ajax quick reply - we need to do some special things here
|