Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: newreply.php 5605 2011-09-19 11:17:26Z Tomm $
| * $Id$
|
*/
define("IN_MYBB", 1); define('THIS_SCRIPT', 'newreply.php');
|
*/
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 = "newreply,previewpost,error_invalidforum,error_invalidthread,redirect_threadposted,loginbox,changeuserbox,posticons,newreply_threadreview,forumrules,attachments,newreply_threadreview_post,forumdisplay_rules,forumdisplay_rules_link";
|
$templatelist .= ",smilieinsert,smilieinsert_getmore,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_ignored,postbit,post_subscription_method";
require_once "./global.php";
| $templatelist .= ",smilieinsert,smilieinsert_getmore,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_ignored,postbit,post_subscription_method";
require_once "./global.php";
|
Zeile 285 | Zeile 285 |
---|
// Check if username exists. if(username_exists($mybb->input['username'])) {
|
// Check if username exists. if(username_exists($mybb->input['username'])) {
|
// If it does and no password is given throw back "username is taken" if(!$mybb->input['password']) { error($lang->error_usernametaken); } // Checks to make sure the user can login; they haven't had too many tries at logging in. // Is a fatal call if user has had too many tries $logins = login_attempt_check();
// If the user specified a password but it is wrong, throw back invalid password. $mybb->user = validate_password_from_username($mybb->input['username'], $mybb->input['password']); if(!$mybb->user['uid']) { my_setcookie('loginattempts', $logins + 1); $db->update_query("users", array('loginattempts' => 'loginattempts+1'), "LOWER(username) = '".$db->escape_string(my_strtolower($mybb->input['username']))."'", 1, true); 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.
$mybb->input['username'] = $username = $mybb->user['username']; my_setcookie("mybbuser", $mybb->user['uid']."_".$mybb->user['loginkey'], null, true); my_setcookie('loginattempts', 1); // Update the session to contain their user ID $updated_session = array( "uid" => $mybb->user['uid'], ); $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']; $username = $mybb->user['username']; // Check if this user is allowed to post here $mybb->usergroup = &$groupscache[$mybb->user['usergroup']]; $forumpermissions = forum_permissions($fid); if($forumpermissions['canview'] == 0 || $forumpermissions['canpostreplys'] == 0 || $mybb->user['suspendposting'] == 1) { error_no_permission(); }
| // If it does throw back "username is taken" error($lang->error_usernametaken);
|
} // This username does not exist. else
| } // This username does not exist. else
|
Zeile 543 | Zeile 498 |
---|
} // Still have an array - set the new cookie if(is_array($multiquote))
|
} // Still have an array - set the new cookie if(is_array($multiquote))
|
{
| {
|
$new_multiquote = implode(",", $multiquote); my_setcookie("multiquote", $new_multiquote); }
| $new_multiquote = implode(",", $multiquote); my_setcookie("multiquote", $new_multiquote); }
|
Zeile 572 | Zeile 527 |
---|
else { $postcounter = $thread['replies'] + 1;
|
else { $postcounter = $thread['replies'] + 1;
|
}
| }
|
// Was there a new post since we hit the quick reply button? if($mybb->input['lastpid'])
| // Was there a new post since we hit the quick reply button? if($mybb->input['lastpid'])
|
Zeile 600 | Zeile 555 |
---|
{ redirect(get_thread_link($tid, 0, "lastpost")); exit;
|
{ redirect(get_thread_link($tid, 0, "lastpost")); exit;
|
}
| }
|
// Return the post HTML and display it inline $query = $db->query("
| // Return the post HTML and display it inline $query = $db->query("
|
Zeile 628 | Zeile 583 |
---|
else { $altbg = "trow2";
|
else { $altbg = "trow2";
|
}
| }
|
$charset = "UTF-8"; if($lang->settings['charset'])
| $charset = "UTF-8"; if($lang->settings['charset'])
|
Zeile 656 | Zeile 611 |
---|
{ redirect(get_thread_link($tid, 0, "lastpost"), $lang->redirect_newreply_moderation); exit;
|
{ redirect(get_thread_link($tid, 0, "lastpost"), $lang->redirect_newreply_moderation); exit;
|
}
| }
|
} else {
| } else {
|
Zeile 671 | Zeile 626 |
---|
if($mybb->input['action'] == "newreply" || $mybb->input['action'] == "editdraft") { $plugins->run_hooks("newreply_start");
|
if($mybb->input['action'] == "newreply" || $mybb->input['action'] == "editdraft") { $plugins->run_hooks("newreply_start");
|
|
|
$quote_ids = ''; // If this isn't a preview and we're not editing a draft, then handle quoted posts if(!$mybb->input['previewpost'] && !$reply_errors && $mybb->input['action'] != "editdraft" && !$mybb->input['attachmentaid'] && !$mybb->input['newattachment'] && !$mybb->input['updateattachment'] && !$mybb->input['rem'])
| $quote_ids = ''; // If this isn't a preview and we're not editing a draft, then handle quoted posts if(!$mybb->input['previewpost'] && !$reply_errors && $mybb->input['action'] != "editdraft" && !$mybb->input['attachmentaid'] && !$mybb->input['newattachment'] && !$mybb->input['updateattachment'] && !$mybb->input['rem'])
|
Zeile 685 | Zeile 640 |
---|
foreach($multiquoted as $post) { $quoted_posts[$post] = intval($post);
|
foreach($multiquoted as $post) { $quoted_posts[$post] = intval($post);
|
}
| }
|
} // Handle incoming 'quote' button if($mybb->input['pid'])
| } // Handle incoming 'quote' button if($mybb->input['pid'])
|
Zeile 769 | Zeile 724 |
---|
}
if($mybb->input['quoted_ids'])
|
}
if($mybb->input['quoted_ids'])
|
{
| {
|
$quoted_ids = htmlspecialchars_uni($mybb->input['quoted_ids']); }
if($mybb->input['previewpost']) { $previewmessage = $mybb->input['message'];
|
$quoted_ids = htmlspecialchars_uni($mybb->input['quoted_ids']); }
if($mybb->input['previewpost']) { $previewmessage = $mybb->input['message'];
|
}
| }
|
if(!$message) { $message = $mybb->input['message'];
| if(!$message) { $message = $mybb->input['message'];
|
Zeile 788 | Zeile 743 |
---|
{ $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\"";
| { $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) {
| } if($postoptions['disablesmilies'] == 1) {
|
Zeile 820 | Zeile 775 |
---|
if($post['smilieoff'] == 1) { $postoptionschecked['disablesmilies'] = " checked=\"checked\"";
|
if($post['smilieoff'] == 1) { $postoptionschecked['disablesmilies'] = " 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\"";
|
} $mybb->input['icon'] = $post['icon']; }
| } $mybb->input['icon'] = $post['icon']; }
|
Zeile 904 | Zeile 871 |
---|
if(!$mybb->input['username']) { $mybb->input['username'] = $lang->guest;
|
if(!$mybb->input['username']) { $mybb->input['username'] = $lang->guest;
|
} if($mybb->input['username'] && !$mybb->user['uid']) { $mybb->user = validate_password_from_username($mybb->input['username'], $mybb->input['password']);
| |
} $mybb->input['icon'] = intval($mybb->input['icon']); $query = $db->query("
| } $mybb->input['icon'] = intval($mybb->input['icon']); $query = $db->query("
|
Zeile 1225 | Zeile 1188 |
---|
$lang->post_reply_to = $lang->sprintf($lang->post_reply_to, $thread['subject']); $lang->reply_to = $lang->sprintf($lang->reply_to, $thread['subject']);
|
$lang->post_reply_to = $lang->sprintf($lang->post_reply_to, $thread['subject']); $lang->reply_to = $lang->sprintf($lang->reply_to, $thread['subject']);
|
| // Do we have any forum rules to show for this forum? $forumrules = ''; if($forum['rulestype'] >= 2 && $forum['rules']) { if(!$forum['rulestitle']) { $forum['rulestitle'] = $lang->sprintf($lang->forum_rules, $forum['name']); }
if(!$parser) { require_once MYBB_ROOT.'inc/class_parser.php'; $parser = new postParser; }
$rules_parser = array( "allow_html" => 1, "allow_mycode" => 1, "allow_smilies" => 1, "allow_imgcode" => 1 );
$forum['rules'] = $parser->parse_message($forum['rules'], $rules_parser); $foruminfo = $forum;
if($forum['rulestype'] == 3) { eval("\$forumrules = \"".$templates->get("forumdisplay_rules")."\";"); } else if($forum['rulestype'] == 2) { eval("\$forumrules = \"".$templates->get("forumdisplay_rules_link")."\";"); } }
|
$plugins->run_hooks("newreply_end");
| $plugins->run_hooks("newreply_end");
|