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: editpost.php 4044 2008-07-26 00:22:41Z Tikitiki $
| * $Id: editpost.php 5379 2011-02-21 11:06:42Z Tomm $
|
*/
define("IN_MYBB", 1);
|
*/
define("IN_MYBB", 1);
|
| define('THIS_SCRIPT', 'editpost.php');
|
$templatelist = "editpost,previewpost,redirect_postedited,loginbox,posticons,changeuserbox,attachment,posticons,codebuttons,smilieinsert,post_attachments_attachment_postinsert,post_attachments_attachment_mod_approve,post_attachments_attachment_unapproved,post_attachments_attachment_mod_unapprove,post_attachments_attachment,post_attachments_new,post_attachments,newthread_postpoll,editpost_disablesmilies,post_subscription_method";
| $templatelist = "editpost,previewpost,redirect_postedited,loginbox,posticons,changeuserbox,attachment,posticons,codebuttons,smilieinsert,post_attachments_attachment_postinsert,post_attachments_attachment_mod_approve,post_attachments_attachment_unapproved,post_attachments_attachment_mod_unapprove,post_attachments_attachment,post_attachments_new,post_attachments,newthread_postpoll,editpost_disablesmilies,post_subscription_method";
|
Zeile 19 | Zeile 20 |
---|
// Load global language phrases $lang->load("editpost");
|
// Load global language phrases $lang->load("editpost");
|
| $plugins->run_hooks("editpost_start");
|
// No permission for guests if(!$mybb->user['uid'])
| // No permission for guests if(!$mybb->user['uid'])
|
Zeile 52 | Zeile 55 |
---|
if(!$thread['tid']) { error($lang->error_invalidthread);
|
if(!$thread['tid']) { error($lang->error_invalidthread);
|
}
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
| }
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
|
// Get forum info $fid = $post['fid']; $forum = get_forum($fid);
| // Get forum info $fid = $post['fid']; $forum = get_forum($fid);
|
Zeile 144 | Zeile 147 |
---|
if(!$mybb->input['attachmentaid'] && ($mybb->input['newattachment'] || ($mybb->input['action'] == "do_editpost" && $mybb->input['submit'] && $_FILES['attachment']))) {
|
if(!$mybb->input['attachmentaid'] && ($mybb->input['newattachment'] || ($mybb->input['action'] == "do_editpost" && $mybb->input['submit'] && $_FILES['attachment']))) {
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']); if($mybb->input['posthash']) { $posthash_query = "posthash='".$db->escape_string($mybb->input['posthash'])."' OR "; } else { $posthash_query = ""; } $query = $db->simple_select("attachments", "COUNT(aid) as numattachs", "{$posthash_query}pid='{$pid}'"); $attachcount = $db->fetch_field($query, "numattachs");
|
// If there's an attachment, check it and upload it
|
// If there's an attachment, check it and upload it
|
if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0)
| if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0 && ($mybb->settings['maxattachments'] == 0 || $attachcount < $mybb->settings['maxattachments']))
|
{ $attachedfile = upload_attachment($_FILES['attachment']); }
| { $attachedfile = upload_attachment($_FILES['attachment']); }
|
Zeile 163 | Zeile 180 |
---|
if($mybb->input['attachmentaid'] && isset($mybb->input['attachmentact']) && $mybb->input['action'] == "do_editpost" && $mybb->request_method == "post") // Lets remove/approve/unapprove the attachment {
|
if($mybb->input['attachmentaid'] && isset($mybb->input['attachmentact']) && $mybb->input['action'] == "do_editpost" && $mybb->request_method == "post") // Lets remove/approve/unapprove the attachment {
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$mybb->input['attachmentaid'] = intval($mybb->input['attachmentaid']); if($mybb->input['attachmentact'] == "remove") {
| $mybb->input['attachmentaid'] = intval($mybb->input['attachmentaid']); if($mybb->input['attachmentact'] == "remove") {
|
Zeile 207 | Zeile 227 |
---|
$modlogdata['tid'] = $tid; if($firstpost) {
|
$modlogdata['tid'] = $tid; if($firstpost) {
|
if($forumpermissions['candeletethreads'] == 1)
| if($forumpermissions['candeletethreads'] == 1 || is_moderator($fid, "candeleteposts"))
|
{ delete_thread($tid); mark_reports($tid, "thread");
| { delete_thread($tid); mark_reports($tid, "thread");
|
Zeile 221 | Zeile 241 |
---|
} else {
|
} else {
|
if($forumpermissions['candeleteposts'] == 1)
| if($forumpermissions['candeleteposts'] == 1 || is_moderator($fid, "candeleteposts"))
|
{ // Select the first post before this delete_post($pid, $tid);
| { // Select the first post before this delete_post($pid, $tid);
|
Zeile 303 | Zeile 323 |
---|
// Did the user choose to post a poll? Redirect them to the poll posting page. if($mybb->input['postpoll'] && $forumpermissions['canpostpolls']) {
|
// Did the user choose to post a poll? Redirect them to the poll posting page. if($mybb->input['postpoll'] && $forumpermissions['canpostpolls']) {
|
$url = "polls.php?action=newpoll&tid=$tid&polloptions=".$mybb->input['numpolloptions'];
| $url = "polls.php?action=newpoll&tid=$tid&polloptions=".intval($mybb->input['numpolloptions']);
|
$lang->redirect_postedited = $lang->redirect_postedited_poll; } else if($visible == 0 && $first_post && !is_moderator($fid, "", $mybb->user['uid']))
| $lang->redirect_postedited = $lang->redirect_postedited_poll; } else if($visible == 0 && $first_post && !is_moderator($fid, "", $mybb->user['uid']))
|
Zeile 331 | Zeile 351 |
---|
if(!$mybb->input['action'] || $mybb->input['action'] == "editpost") {
|
if(!$mybb->input['action'] || $mybb->input['action'] == "editpost") {
|
$plugins->run_hooks("editpost_start");
| $plugins->run_hooks("editpost_action_start");
|
if(!$mybb->input['previewpost']) {
| if(!$mybb->input['previewpost']) {
|
Zeile 353 | Zeile 373 |
---|
}
// Setup a unique posthash for attachment management
|
}
// Setup a unique posthash for attachment management
|
$posthash = $post['posthash'];
| $posthash = htmlspecialchars_uni($post['posthash']);
|
$bgcolor = "trow1"; if($forumpermissions['canpostattachments'] != 0)
| $bgcolor = "trow1"; if($forumpermissions['canpostattachments'] != 0)
|