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 4143 2008-08-22 02:47:25Z Tikitiki $
| * $Id: editpost.php 5087 2010-07-11 11:46:40Z Huji $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 20 | 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 29 | Zeile 31 |
---|
// Get post info $pid = intval($mybb->input['pid']);
|
// Get post info $pid = intval($mybb->input['pid']);
|
|
|
// if we already have the post information... if(isset($style) && $style['pid'] == $pid) { $post = &$style;
|
// if we already have the post information... if(isset($style) && $style['pid'] == $pid) { $post = &$style;
|
}
| }
|
else { $query = $db->simple_select("posts", "*", "pid='$pid'"); $post = $db->fetch_array($query);
|
else { $query = $db->simple_select("posts", "*", "pid='$pid'"); $post = $db->fetch_array($query);
|
}
| }
|
if(!$post['pid']) { error($lang->error_invalidpost);
| if(!$post['pid']) { error($lang->error_invalidpost);
|
Zeile 78 | Zeile 80 |
---|
if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && $mybb->user['showcodebuttons'] != 0)
|
if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && $mybb->user['showcodebuttons'] != 0)
|
{
| {
|
$codebuttons = build_mycode_inserter(); } if($mybb->settings['smilieinserter'] != 0) { $smilieinserter = build_clickable_smilies();
|
$codebuttons = build_mycode_inserter(); } if($mybb->settings['smilieinserter'] != 0) { $smilieinserter = build_clickable_smilies();
|
}
| }
|
if(!$mybb->input['action'] || $mybb->input['previewpost'])
|
if(!$mybb->input['action'] || $mybb->input['previewpost'])
|
{
| {
|
$mybb->input['action'] = "editpost"; }
if($mybb->input['action'] == "deletepost" && $mybb->request_method == "post") { if(!is_moderator($fid, "candeleteposts"))
|
$mybb->input['action'] = "editpost"; }
if($mybb->input['action'] == "deletepost" && $mybb->request_method == "post") { if(!is_moderator($fid, "candeleteposts"))
|
{ if($thread['closed'] == 1) { error($lang->redirect_threadclosed);
| { if($thread['closed'] == 1) { error($lang->redirect_threadclosed);
|
} if($forumpermissions['candeleteposts'] == 0) {
| } if($forumpermissions['candeleteposts'] == 0) {
|
Zeile 136 | Zeile 138 |
---|
}
// Check if this forum is password protected and we have a valid password
|
}
// Check if this forum is password protected and we have a valid password
|
check_forum_password($forum['fid']);
| check_forum_password($forum['fid']);
|
if((empty($_POST) && empty($_FILES)) && $mybb->input['processed'] == '1')
|
if((empty($_POST) && empty($_FILES)) && $mybb->input['processed'] == '1')
|
{
| {
|
error($lang->error_cannot_upload_php_post); }
if(!$mybb->input['attachmentaid'] && ($mybb->input['newattachment'] || ($mybb->input['action'] == "do_editpost" && $mybb->input['submit'] && $_FILES['attachment']))) {
|
error($lang->error_cannot_upload_php_post); }
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'])
|
if($mybb->input['posthash'])
|
{
| {
|
$posthash_query = "posthash='".$db->escape_string($mybb->input['posthash'])."' OR ";
|
$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");
|
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($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0 && ($mybb->settings['maxattachments'] == 0 || $attachcount < $mybb->settings['maxattachments']))
|
// 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']))
|
{
| {
|
$attachedfile = upload_attachment($_FILES['attachment']);
|
$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'] = "editpost"; }
| $mybb->input['action'] = "editpost"; }
|
if(!$mybb->input['submit']) { $mybb->input['action'] = "editpost"; } }
|
if(!$mybb->input['submit']) { $mybb->input['action'] = "editpost"; } }
|
|
|
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 219 | 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 233 | 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 315 | 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 343 | 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']) {
|