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 4143 2008-08-22 02:47:25Z Tikitiki $
| * $Id: newthread.php 4864 2010-04-10 09:13:19Z RyanGordon $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 98 | Zeile 98 |
---|
{ if(!$mybb->input['previewpost'] && $mybb->input['action'] != "do_newthread") {
|
{ if(!$mybb->input['previewpost'] && $mybb->input['action'] != "do_newthread") {
|
$username = $lang->guest;
| $username = '';
|
} else {
| } else {
|
Zeile 160 | Zeile 160 |
---|
}
// Are we removing an attachment from the thread?
|
}
// Are we removing an attachment from the thread?
|
if($mybb->input['attachmentaid'] && $mybb->input['posthash'])
| if($mybb->input['attachmentaid'] && $mybb->input['attachmentact'] == "remove" && $mybb->input['posthash'])
|
{ require_once MYBB_ROOT."inc/functions_upload.php"; remove_attachment(0, $mybb->input['posthash'], $mybb->input['attachmentaid']);
| { require_once MYBB_ROOT."inc/functions_upload.php"; remove_attachment(0, $mybb->input['posthash'], $mybb->input['attachmentaid']);
|
Zeile 217 | 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 233 | 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 244 | Zeile 245 |
---|
// Check if this user is allowed to post here $mybb->usergroup = &$groupscache[$mybb->user['usergroup']]; $forumpermissions = forum_permissions($fid);
|
// 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)
| if($forumpermissions['canview'] == 0 || $forumpermissions['canpostthreads'] == 0 || $mybb->user['suspendposting'] == 1)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 256 | Zeile 257 |
---|
if(!$mybb->input['username']) { $username = $lang->guest;
|
if(!$mybb->input['username']) { $username = $lang->guest;
|
}
| }
|
// Otherwise use the name they specified. else {
| // Otherwise use the name they specified. else {
|
Zeile 266 | Zeile 267 |
---|
} } // This user is logged in.
|
} } // This user is logged in.
|
else {
| else {
|
$username = $mybb->user['username']; $uid = $mybb->user['uid'];
|
$username = $mybb->user['username']; $uid = $mybb->user['uid'];
|
}
| }
|
// Attempt to see if this post is a duplicate or not if($uid > 0) { $user_check = "p.uid='{$uid}'";
|
// Attempt to see if this post is a duplicate or not if($uid > 0) { $user_check = "p.uid='{$uid}'";
|
}
| }
|
else { $user_check = "p.ipaddress='".$db->escape_string($session->ipaddress)."'";
| else { $user_check = "p.ipaddress='".$db->escape_string($session->ipaddress)."'";
|
Zeile 317 | Zeile 318 |
---|
if($mybb->input['savedraft'] && $mybb->user['uid']) { $new_thread['savedraft'] = 1;
|
if($mybb->input['savedraft'] && $mybb->user['uid']) { $new_thread['savedraft'] = 1;
|
} else
| } else
|
{ $new_thread['savedraft'] = 0; }
| { $new_thread['savedraft'] = 0; }
|
Zeile 349 | Zeile 350 |
---|
if(!$valid_thread) { $post_errors = $posthandler->get_friendly_errors();
|
if(!$valid_thread) { $post_errors = $posthandler->get_friendly_errors();
|
}
| }
|
// 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 359 | Zeile 360 |
---|
$query = $db->simple_select("captcha", "*", "imagehash='$imagehash'"); $imgcheck = $db->fetch_array($query); if(my_strtolower($imgcheck['imagestring']) != my_strtolower($imagestring) || !$imgcheck['imagehash'])
|
$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; } else
| $post_errors[] = $lang->invalid_captcha; } else
|
Zeile 389 | Zeile 390 |
---|
// We were updating a draft thread, send them back to the draft listing. if($new_thread['savedraft'] == 1)
|
// We were updating a draft thread, send them back to the draft listing. if($new_thread['savedraft'] == 1)
|
{
| {
|
$lang->redirect_newthread = $lang->draft_saved; $url = "usercp.php?action=drafts"; }
| $lang->redirect_newthread = $lang->draft_saved; $url = "usercp.php?action=drafts"; }
|
Zeile 399 | Zeile 400 |
---|
{ $url = "polls.php?action=newpoll&tid=$tid&polloptions=".intval($mybb->input['numpolloptions']); $lang->redirect_newthread .= $lang->redirect_newthread_poll;
|
{ $url = "polls.php?action=newpoll&tid=$tid&polloptions=".intval($mybb->input['numpolloptions']); $lang->redirect_newthread .= $lang->redirect_newthread_poll;
|
}
| }
|
// This thread is stuck in the moderation queue, send them back to the forum. else if(!$visible)
| // This thread is stuck in the moderation queue, send them back to the forum. else if(!$visible)
|
Zeile 440 | Zeile 441 |
---|
if($mybb->input['action'] == "newthread" || $mybb->input['action'] == "editdraft") {
|
if($mybb->input['action'] == "newthread" || $mybb->input['action'] == "editdraft") {
|
|
|
$plugins->run_hooks("newthread_start"); $quote_ids = '';
| $plugins->run_hooks("newthread_start"); $quote_ids = '';
|
Zeile 480 | Zeile 481 |
---|
} if(intval($mybb->input['load_all_quotes']) == 1)
|
} if(intval($mybb->input['load_all_quotes']) == 1)
|
{
| {
|
$query = $db->query(" SELECT p.subject, p.message, p.pid, p.tid, p.username, p.dateline, u.username AS userusername FROM ".TABLE_PREFIX."posts p
| $query = $db->query(" SELECT p.subject, p.message, p.pid, p.tid, p.username, p.dateline, u.username AS userusername FROM ".TABLE_PREFIX."posts p
|
Zeile 489 | Zeile 490 |
---|
WHERE p.pid IN ($quoted_posts) {$unviewable_forums} {$visible_where} "); while($quoted_post = $db->fetch_array($query))
|
WHERE p.pid IN ($quoted_posts) {$unviewable_forums} {$visible_where} "); while($quoted_post = $db->fetch_array($query))
|
{
| {
|
if($quoted_post['userusername']) { $quoted_post['username'] = $quoted_post['userusername'];
| if($quoted_post['userusername']) { $quoted_post['username'] = $quoted_post['userusername'];
|
Zeile 498 | Zeile 499 |
---|
$quoted_post['message'] = preg_replace('#(^|\r|\n)/slap ([^\r\n<]*)#i', "\\1* {$quoted_post['username']} {$lang->slaps} \\2 {$lang->with_trout}", $quoted_post['message']); $quoted_post['message'] = preg_replace("#\[attachment=([0-9]+?)\]#i", '', $quoted_post['message']); $message .= "[quote='{$quoted_post['username']}' pid='{$quoted_post['pid']}' dateline='{$quoted_post['dateline']}']\n{$quoted_post['message']}\n[/quote]\n\n";
|
$quoted_post['message'] = preg_replace('#(^|\r|\n)/slap ([^\r\n<]*)#i', "\\1* {$quoted_post['username']} {$lang->slaps} \\2 {$lang->with_trout}", $quoted_post['message']); $quoted_post['message'] = preg_replace("#\[attachment=([0-9]+?)\]#i", '', $quoted_post['message']); $message .= "[quote='{$quoted_post['username']}' pid='{$quoted_post['pid']}' dateline='{$quoted_post['dateline']}']\n{$quoted_post['message']}\n[/quote]\n\n";
|
}
| }
|
$quoted_ids = "all"; }
| $quoted_ids = "all"; }
|
Zeile 556 | Zeile 557 |
---|
} else if($postoptions['subscriptionmethod'] == "instant") {
|
} else if($postoptions['subscriptionmethod'] == "instant") {
|
$postoptions_subscriptionmethod_instant = "checked=\"checked\""; } else { $postoptions_subscriptionmethod_dont = "checked=\"checked\""; } if($postoptions['disablesmilies'] == 1) {
| $postoptions_subscriptionmethod_instant = "checked=\"checked\""; } else { $postoptions_subscriptionmethod_dont = "checked=\"checked\""; } if($postoptions['disablesmilies'] == 1) {
|
$postoptionschecked['disablesmilies'] = " checked=\"checked\""; } if($mybb->input['postpoll'] == 1)
| $postoptionschecked['disablesmilies'] = " checked=\"checked\""; } if($mybb->input['postpoll'] == 1)
|
Zeile 571 | Zeile 572 |
---|
$postpollchecked = "checked=\"checked\""; } $numpolloptions = intval($mybb->input['numpolloptions']);
|
$postpollchecked = "checked=\"checked\""; } $numpolloptions = intval($mybb->input['numpolloptions']);
|
}
| }
|
// Editing a draft thread else if($mybb->input['action'] == "editdraft" && $mybb->user['uid']) {
| // Editing a draft thread else if($mybb->input['action'] == "editdraft" && $mybb->user['uid']) {
|
Zeile 587 | Zeile 588 |
---|
$postoptionschecked['disablesmilies'] = " checked=\"checked\""; } $icon = $post['icon'];
|
$postoptionschecked['disablesmilies'] = " checked=\"checked\""; } $icon = $post['icon'];
|
| if($forum['allowpicons'] != 0) { $posticons = get_post_icons(); }
|
} // Otherwise, this is our initial visit to this page.
| } // Otherwise, this is our initial visit to this page.
|
Zeile 642 | Zeile 647 |
---|
// Now let the post handler do all the hard work. $valid_thread = $posthandler->verify_message(); $valid_subject = $posthandler->verify_subject();
|
// Now let the post handler do all the hard work. $valid_thread = $posthandler->verify_message(); $valid_subject = $posthandler->verify_subject();
|
|
|
$post_errors = array(); // Fetch friendly error messages if this is an invalid post if(!$valid_thread || !$valid_subject)
| $post_errors = array(); // Fetch friendly error messages if this is an invalid post if(!$valid_thread || !$valid_subject)
|
Zeile 691 | Zeile 696 |
---|
if($post['includesig'] != 1) { $post['includesig'] = 0;
|
if($post['includesig'] != 1) { $post['includesig'] = 0;
|
}
| }
|
// Fetch attachments assigned to this post
| // Fetch attachments assigned to this post
|
Zeile 722 | Zeile 727 |
---|
{ $message = htmlspecialchars_uni($mybb->input['message']); $subject = htmlspecialchars_uni($mybb->input['subject']);
|
{ $message = htmlspecialchars_uni($mybb->input['message']); $subject = htmlspecialchars_uni($mybb->input['subject']);
|
}
| }
|
// Setup a unique posthash for attachment management if(!$mybb->input['posthash'] && $mybb->input['action'] != "editdraft") {
|
// Setup a unique posthash for attachment management if(!$mybb->input['posthash'] && $mybb->input['action'] != "editdraft") {
|
mt_srand((double) microtime() * 1000000); $posthash = md5($mybb->user['uid'].mt_rand());
| $posthash = md5($mybb->user['uid'].random_str()); } elseif($mybb->input['action'] == "editdraft") { // Drafts have posthashes, too... $posthash = $post['posthash'];
|
} else {
| } else {
|
Zeile 756 | Zeile 765 |
---|
else { $closecheck = '';
|
else { $closecheck = '';
|
}
| }
|
if($modoptions['stickthread'] == 1) { $stickycheck = "checked=\"checked\"";
| if($modoptions['stickthread'] == 1) { $stickycheck = "checked=\"checked\"";
|
Zeile 804 | Zeile 813 |
---|
if($attachment['visible'] != 1) { eval("\$attachments .= \"".$templates->get("post_attachments_attachment_unapproved")."\";");
|
if($attachment['visible'] != 1) { eval("\$attachments .= \"".$templates->get("post_attachments_attachment_unapproved")."\";");
|
} else {
| } else {
|
eval("\$attachments .= \"".$templates->get("post_attachments_attachment")."\";"); } $attachcount++;
| eval("\$attachments .= \"".$templates->get("post_attachments_attachment")."\";"); } $attachcount++;
|
Zeile 837 | Zeile 846 |
---|
}
if($mybb->user['uid'])
|
}
if($mybb->user['uid'])
|
{
| {
|
eval("\$savedraftbutton = \"".$templates->get("post_savedraftbutton", 1, 0)."\";"); }
| eval("\$savedraftbutton = \"".$templates->get("post_savedraftbutton", 1, 0)."\";"); }
|
Zeile 884 | Zeile 893 |
---|
$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);
|