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: editpost.php 5568 2011-09-08 10:13:10Z Tomm $
|
*/
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 92 | Zeile 97 |
---|
}
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($forumpermissions['candeleteposts'] == 0) { error_no_permission(); }
| { if($thread['closed'] == 1) { error($lang->redirect_threadclosed); } if($forumpermissions['candeleteposts'] == 0) { error_no_permission(); }
|
if($mybb->user['uid'] != $post['uid']) { error_no_permission();
|
if($mybb->user['uid'] != $post['uid']) { error_no_permission();
|
}
| }
|
} } else
| } } else
|
Zeile 121 | Zeile 126 |
---|
if($thread['closed'] == 1) { error($lang->redirect_threadclosed);
|
if($thread['closed'] == 1) { error($lang->redirect_threadclosed);
|
}
| }
|
if($forumpermissions['caneditposts'] == 0) { error_no_permission();
| if($forumpermissions['caneditposts'] == 0) { error_no_permission();
|
Zeile 168 | Zeile 173 |
---|
if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0 && ($mybb->settings['maxattachments'] == 0 || $attachcount < $mybb->settings['maxattachments'])) { $update_attachment = false;
|
if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0 && ($mybb->settings['maxattachments'] == 0 || $attachcount < $mybb->settings['maxattachments'])) { $update_attachment = false;
|
if($mybb->input['updateattachment'])
| if($mybb->input['updateattachment'] && ($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']))
|
{ $update_attachment = true; }
| { $update_attachment = true; }
|
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_post_check($mybb->input['my_post_key']);
| { // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("editpost_deletepost");
| $plugins->run_hooks("editpost_deletepost");
|
Zeile 225 | Zeile 230 |
---|
if($firstcheck['pid'] == $pid) { $firstpost = 1;
|
if($firstcheck['pid'] == $pid) { $firstpost = 1;
|
} else
| } else
|
{ $firstpost = 0; }
| { $firstpost = 0; }
|
Zeile 243 | Zeile 248 |
---|
redirect(get_forum_link($fid), $lang->redirect_threaddeleted); } else
|
redirect(get_forum_link($fid), $lang->redirect_threaddeleted); } else
|
{
| {
|
error_no_permission(); } }
| error_no_permission(); } }
|
Zeile 260 | Zeile 265 |
---|
if($next_post['pid']) { $redirect = get_post_link($next_post['pid'], $tid)."#pid{$next_post['pid']}";
|
if($next_post['pid']) { $redirect = get_post_link($next_post['pid'], $tid)."#pid{$next_post['pid']}";
|
}
| }
|
else { $redirect = get_thread_link($tid);
| else { $redirect = get_thread_link($tid);
|
Zeile 353 | Zeile 358 |
---|
$url = get_post_link($pid, $tid)."#pid{$pid}"; } $plugins->run_hooks("editpost_do_editpost_end");
|
$url = get_post_link($pid, $tid)."#pid{$pid}"; } $plugins->run_hooks("editpost_do_editpost_end");
|
|
|
redirect($url, $lang->redirect_postedited); } }
| redirect($url, $lang->redirect_postedited); } }
|
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)
| $bgcolor = "trow1"; if($forumpermissions['canpostattachments'] != 0)
|
Zeile 419 | Zeile 424 |
---|
eval("\$attach_mod_options = \"".$templates->get("post_attachments_attachment_mod_approve")."\";"); } }
|
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")."\";");
|
if($attachment['visible'] != 1) { eval("\$attachments .= \"".$templates->get("post_attachments_attachment_unapproved")."\";");
|
}
| }
|
else { eval("\$attachments .= \"".$templates->get("post_attachments_attachment")."\";");
| else { eval("\$attachments .= \"".$templates->get("post_attachments_attachment")."\";");
|
Zeile 432 | Zeile 441 |
---|
$query = $db->simple_select("attachments", "SUM(filesize) AS ausage", "uid='".$mybb->user['uid']."'"); $usage = $db->fetch_array($query); if($usage['ausage'] > ($mybb->usergroup['attachquota']*1024) && $mybb->usergroup['attachquota'] != 0)
|
$query = $db->simple_select("attachments", "SUM(filesize) AS ausage", "uid='".$mybb->user['uid']."'"); $usage = $db->fetch_array($query); if($usage['ausage'] > ($mybb->usergroup['attachquota']*1024) && $mybb->usergroup['attachquota'] != 0)
|
{
| {
|
$noshowattach = 1; } if($mybb->usergroup['attachquota'] == 0)
|
$noshowattach = 1; } if($mybb->usergroup['attachquota'] == 0)
|
{
| {
|
$friendlyquota = $lang->unlimited; } else
| $friendlyquota = $lang->unlimited; } else
|
Zeile 447 | Zeile 456 |
---|
$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")."\";");
|