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: editpost.php 5087 2010-07-11 11:46:40Z Huji $
| * $Id$
|
*/
define("IN_MYBB", 1); define('THIS_SCRIPT', 'editpost.php');
|
*/
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,post_attachments_attachment_remove";
|
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 33 | Zeile 33 |
---|
$pid = intval($mybb->input['pid']);
// if we already have the post information...
|
$pid = intval($mybb->input['pid']);
// if we already have the post information...
|
if(isset($style) && $style['pid'] == $pid)
| if(isset($style) && $style['pid'] == $pid && $style['type'] != 'f')
|
{ $post = &$style; }
| { $post = &$style; }
|
Zeile 73 | Zeile 73 |
---|
// Add prefix to breadcrumb $query = $db->simple_select('threadprefixes', 'displaystyle', "pid='{$thread['prefix']}'");
|
// Add prefix to breadcrumb $query = $db->simple_select('threadprefixes', 'displaystyle', "pid='{$thread['prefix']}'");
|
$breadcrumbprefix = $db->fetch_field($query, 'displaystyle').' ';
| $breadcrumbprefix = $db->fetch_field($query, 'displaystyle');
if($breadcrumbprefix) { $breadcrumbprefix .= ' '; }
|
// Make navigation build_forum_breadcrumb($fid);
| // Make navigation build_forum_breadcrumb($fid);
|
Zeile 166 | Zeile 171 |
---|
// 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']))
|
{
| {
|
$update_attachment = false;
|
$update_attachment = false;
|
if($mybb->input['updateattachment'])
| if($mybb->input['updateattachment'] && ($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']))
|
{ $update_attachment = true; }
| { $update_attachment = true; }
|
Zeile 177 | Zeile 182 |
---|
if($attachedfile['error']) { eval("\$attacherror = \"".$templates->get("error_attacherror")."\";");
|
if($attachedfile['error']) { eval("\$attacherror = \"".$templates->get("error_attacherror")."\";");
|
$mybb->input['action'] = "editpost"; } if(!$mybb->input['submit']) { $mybb->input['action'] = "editpost"; } }
| $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 {
|
Zeile 212 | Zeile 217 |
---|
}
if($mybb->input['action'] == "deletepost" && $mybb->request_method == "post")
|
}
if($mybb->input['action'] == "deletepost" && $mybb->request_method == "post")
|
{ // Verify incoming POST request
| { // Verify incoming POST request
|
verify_post_check($mybb->input['my_post_key']);
$plugins->run_hooks("editpost_deletepost");
| verify_post_check($mybb->input['my_post_key']);
$plugins->run_hooks("editpost_deletepost");
|
Zeile 351 | Zeile 356 |
---|
{ $lang->redirect_postedited .= $lang->redirect_postedited_redirect; $url = get_post_link($pid, $tid)."#pid{$pid}";
|
{ $lang->redirect_postedited .= $lang->redirect_postedited_redirect; $url = get_post_link($pid, $tid)."#pid{$pid}";
|
}
| }
|
$plugins->run_hooks("editpost_do_editpost_end");
redirect($url, $lang->redirect_postedited); } }
|
$plugins->run_hooks("editpost_do_editpost_end");
redirect($url, $lang->redirect_postedited); } }
|
|
|
if(!$mybb->input['action'] || $mybb->input['action'] == "editpost") { $plugins->run_hooks("editpost_action_start");
| if(!$mybb->input['action'] || $mybb->input['action'] == "editpost") { $plugins->run_hooks("editpost_action_start");
|
Zeile 382 | Zeile 387 |
---|
}
// 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) { // Get a listing of the current attachments, if there are any $attachcount = 0;
|
$bgcolor = "trow1"; if($forumpermissions['canpostattachments'] != 0) { // Get a listing of the current attachments, if there are any $attachcount = 0;
|
| $posthash_query = '';
|
if($posthash) {
|
if($posthash) {
|
$posthash_query = "posthash='{$posthash}' OR "; } else { $posthash_query = "";
| $posthash_query = "posthash='".$db->escape_string($posthash)."' OR ";
|
}
|
}
|
|
|
$query = $db->simple_select("attachments", "*", "{$posthash_query}pid='{$pid}'"); $attachments = ''; while($attachment = $db->fetch_array($query)) { $attachment['size'] = get_friendly_size($attachment['filesize']); $attachment['icon'] = get_attachment_icon(get_extension($attachment['filename']));
|
$query = $db->simple_select("attachments", "*", "{$posthash_query}pid='{$pid}'"); $attachments = ''; while($attachment = $db->fetch_array($query)) { $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)) { eval("\$postinsert = \"".$templates->get("post_attachments_attachment_postinsert")."\";");
| if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && (!$mybb->user['uid'] || $mybb->user['showcodebuttons'] != 0)) { eval("\$postinsert = \"".$templates->get("post_attachments_attachment_postinsert")."\";");
|
Zeile 413 | Zeile 419 |
---|
if($attachment['visible'] == 1) { eval("\$attach_mod_options = \"".$templates->get("post_attachments_attachment_mod_unapprove")."\";");
|
if($attachment['visible'] == 1) { eval("\$attach_mod_options = \"".$templates->get("post_attachments_attachment_mod_unapprove")."\";");
|
}
| }
|
else { eval("\$attach_mod_options = \"".$templates->get("post_attachments_attachment_mod_approve")."\";"); }
|
else { eval("\$attach_mod_options = \"".$templates->get("post_attachments_attachment_mod_approve")."\";"); }
|
}
| }
// Remove Attachment eval("\$attach_rem_options = \"".$templates->get("post_attachments_attachment_remove")."\";");
|
if($attachment['visible'] != 1) { eval("\$attachments .= \"".$templates->get("post_attachments_attachment_unapproved")."\";"); } else
|
if($attachment['visible'] != 1) { eval("\$attachments .= \"".$templates->get("post_attachments_attachment_unapproved")."\";"); } else
|
{
| {
|
eval("\$attachments .= \"".$templates->get("post_attachments_attachment")."\";"); } $attachcount++;
| eval("\$attachments .= \"".$templates->get("post_attachments_attachment")."\";"); } $attachcount++;
|
Zeile 447 | Zeile 457 |
---|
$lang->attach_quota = $lang->sprintf($lang->attach_quota, $friendlyusage, $friendlyquota); if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach) {
|
$lang->attach_quota = $lang->sprintf($lang->attach_quota, $friendlyusage, $friendlyquota); if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach) {
|
| if($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']) { eval("\$attach_update_options = \"".$templates->get("post_attachments_update")."\";"); }
|
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")."\";");
|