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 5380 2011-02-21 12:04:43Z Tomm $
| * $Id: newreply.php 5746 2012-02-03 10:03:25Z Tomm $
|
*/
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 .= ",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_ignored,postbit,post_subscription_method";
| $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"; require_once MYBB_ROOT."inc/functions_post.php";
| require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php";
|
Zeile 107 | Zeile 107 |
---|
error_no_permission(); }
|
error_no_permission(); }
|
if($forumpermissions['canonlyviewthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])
| if($forumpermissions['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 435 | Zeile 435 |
---|
mark_thread_read($tid, $fid);
// Check captcha image
|
mark_thread_read($tid, $fid);
// Check captcha image
|
if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])
| if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
|
{
|
{
|
$imagehash = $db->escape_string($mybb->input['imagehash']); $imagestring = $db->escape_string($mybb->input['imagestring']); $query = $db->simple_select("captcha", "*", "imagehash='$imagehash'"); $imgcheck = $db->fetch_array($query); if(my_strtolower($imgcheck['imagestring']) != my_strtolower($imagestring) || !$imgcheck['imagehash']) { $post_errors[] = $lang->invalid_captcha; }
| require_once MYBB_ROOT.'inc/class_captcha.php'; $post_captcha = new captcha(false, "post_captcha");
if($post_captcha->validate_captcha() == false) { // CAPTCHA validation failed foreach($post_captcha->get_errors() as $error) { $post_errors[] = $error; } }
|
else
|
else
|
{ $db->delete_query("captcha", "imagehash='$imagehash'");
| {
|
$hide_captcha = true; }
|
$hide_captcha = true; }
|
// if we're using AJAX, and we have a captcha, regenerate a new one
|
|
if($mybb->input['ajax']) {
|
if($mybb->input['ajax']) {
|
$randomstr = random_str(5); $imagehash = md5(random_str(12)); $imagearray = array( "imagehash" => $imagehash, "imagestring" => $randomstr, "dateline" => TIME_NOW ); $db->insert_query("captcha", $imagearray); header("Content-type: text/html; charset={$lang->settings['charset']}"); echo "<captcha>$imagehash"; if($hide_captcha)
| if($post_captcha->type == 1) { $randomstr = random_str(5); $imagehash = md5(random_str(12));
$imagearray = array( "imagehash" => $imagehash, "imagestring" => $randomstr, "dateline" => TIME_NOW );
$db->insert_query("captcha", $imagearray);
header("Content-type: text/html; charset={$lang->settings['charset']}"); echo "<captcha>$imagehash";
if($hide_captcha) { echo "|$randomstr"; }
echo "</captcha>"; } else if($post_captcha->type == 2)
|
{
|
{
|
echo "|$randomstr";
| header("Content-type: text/html; charset={$lang->settings['charset']}"); echo "<captcha>reload</captcha>";
|
}
|
}
|
echo "</captcha>";
| |
} }
| } }
|
Zeile 614 | Zeile 628 |
---|
else { $altbg = "trow2";
|
else { $altbg = "trow2";
|
| }
$charset = "UTF-8"; if($lang->settings['charset']) { $charset = $lang->settings['charset'];
|
}
require_once MYBB_ROOT."inc/functions_post.php"; $pid = $post['pid']; $post = build_postbit($post);
|
}
require_once MYBB_ROOT."inc/functions_post.php"; $pid = $post['pid']; $post = build_postbit($post);
|
| header("Content-type: text/plain; charset={$charset}");
|
echo $post;
// Build a new posthash incase the user wishes to quick reply again
| echo $post;
// Build a new posthash incase the user wishes to quick reply again
|
Zeile 638 | Zeile 660 |
---|
} else {
|
} else {
|
$lang->redirect_newreply .= $lang->sprintf($lang->redirect_return_forum, get_forum_link($fid));
| $lang->redirect_newreply .= $lang->sprintf($lang->redirect_return_thread, get_forum_link($fid));
|
redirect($url, $lang->redirect_newreply); exit; }
| redirect($url, $lang->redirect_newreply); exit; }
|
Zeile 822 | Zeile 844 |
---|
}
if($forum['allowpicons'] != 0)
|
}
if($forum['allowpicons'] != 0)
|
{ $posticons = get_post_icons();
| { $posticons = get_post_icons();
|
}
// No subject, but post info?
| }
// No subject, but post info?
|
Zeile 869 | Zeile 891 |
---|
if(!$valid_post || !$valid_subject) { $post_errors = $posthandler->get_friendly_errors();
|
if(!$valid_post || !$valid_subject) { $post_errors = $posthandler->get_friendly_errors();
|
}
| }
|
// One or more errors returned, fetch error list and throw to newreply page if(count($post_errors) > 0)
| // One or more errors returned, fetch error list and throw to newreply page if(count($post_errors) > 0)
|
Zeile 880 | Zeile 902 |
---|
{ $quote_ids = htmlspecialchars_uni($mybb->input['quote_ids']); if(!$mybb->input['username'])
|
{ $quote_ids = htmlspecialchars_uni($mybb->input['quote_ids']); if(!$mybb->input['username'])
|
{
| {
|
$mybb->input['username'] = $lang->guest; } if($mybb->input['username'] && !$mybb->user['uid'])
| $mybb->input['username'] = $lang->guest; } if($mybb->input['username'] && !$mybb->user['uid'])
|
Zeile 913 | Zeile 935 |
---|
if($post['includesig'] != 1) { $post['includesig'] = 0;
|
if($post['includesig'] != 1) { $post['includesig'] = 0;
|
}
| }
|
// Fetch attachments assigned to this post. if($mybb->input['pid']) {
| // Fetch attachments assigned to this post. if($mybb->input['pid']) {
|
Zeile 972 | Zeile 994 |
---|
$attachwhere = "pid='$pid'"; } else
|
$attachwhere = "pid='$pid'"; } else
|
{
| {
|
$attachwhere = "posthash='".$db->escape_string($posthash)."'"; } $attachments = '';
| $attachwhere = "posthash='".$db->escape_string($posthash)."'"; } $attachments = '';
|
Zeile 981 | Zeile 1003 |
---|
{ $attachment['size'] = get_friendly_size($attachment['filesize']); $attachment['icon'] = get_attachment_icon(get_extension($attachment['filename']));
|
{ $attachment['size'] = get_friendly_size($attachment['filesize']); $attachment['icon'] = get_attachment_icon(get_extension($attachment['filename']));
|
| $attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
|
if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && (!$mybb->user['uid'] || $mybb->user['showcodebuttons'] != 0))
|
if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && (!$mybb->user['uid'] || $mybb->user['showcodebuttons'] != 0))
|
{
| {
|
eval("\$postinsert = \"".$templates->get("post_attachments_attachment_postinsert")."\";"); } $attach_mod_options = '';
| eval("\$postinsert = \"".$templates->get("post_attachments_attachment_postinsert")."\";"); } $attach_mod_options = '';
|
Zeile 1006 | Zeile 1029 |
---|
if($mybb->usergroup['attachquota'] == 0) { $friendlyquota = $lang->unlimited;
|
if($mybb->usergroup['attachquota'] == 0) { $friendlyquota = $lang->unlimited;
|
}
| }
|
else { $friendlyquota = get_friendly_size($mybb->usergroup['attachquota']*1024);
| else { $friendlyquota = get_friendly_size($mybb->usergroup['attachquota']*1024);
|
Zeile 1018 | Zeile 1041 |
---|
eval("\$newattach = \"".$templates->get("post_attachments_new")."\";"); } eval("\$attachbox = \"".$templates->get("post_attachments")."\";");
|
eval("\$newattach = \"".$templates->get("post_attachments_new")."\";"); } eval("\$attachbox = \"".$templates->get("post_attachments")."\";");
|
}
| }
|
// If the user is logged in, provide a save draft button. if($mybb->user['uid']) {
| // If the user is logged in, provide a save draft button. if($mybb->user['uid']) {
|
Zeile 1027 | Zeile 1050 |
---|
}
// Show captcha image for guests if enabled
|
}
// Show captcha image for guests if enabled
|
if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])
| if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
|
{ $correct = false;
|
{ $correct = false;
|
// If previewing a post - check their current captcha input - if correct, hide the captcha input area
| require_once MYBB_ROOT.'inc/class_captcha.php';
|
if($mybb->input['previewpost'] || $hide_captcha == true)
|
if($mybb->input['previewpost'] || $hide_captcha == true)
|
{ $imagehash = $db->escape_string($mybb->input['imagehash']); $imagestring = $db->escape_string($mybb->input['imagestring']); $query = $db->simple_select("captcha", "*", "imagehash='$imagehash' AND imagestring='$imagestring'"); $imgcheck = $db->fetch_array($query); if($imgcheck['dateline'] > 0) { eval("\$captcha = \"".$templates->get("post_captcha_hidden")."\";"); $correct = true; } else
| { // If previewing a post - check their current captcha input - if correct, hide the captcha input area $post_captcha = new captcha;
if($post_captcha->validate_captcha() == true)
|
{
|
{
|
$db->delete_query("captcha", "imagehash='$imagehash'");
| $correct = true;
// Generate a hidden list of items for our captcha $captcha = $post_captcha->build_hidden_captcha();
|
} }
|
} }
|
|
|
if(!$correct) {
|
if(!$correct) {
|
$randomstr = random_str(5); $imagehash = md5(random_str(12)); $imagearray = array( "imagehash" => $imagehash, "imagestring" => $randomstr, "dateline" => TIME_NOW ); $db->insert_query("captcha", $imagearray); eval("\$captcha = \"".$templates->get("post_captcha")."\";");
| $post_captcha = new captcha(true, "post_captcha");
if($post_captcha->html) { $captcha = $post_captcha->html; }
|
} }
| } }
|
Zeile 1206 | Zeile 1225 |
---|
$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");
|