Zeile 192 | Zeile 192 |
---|
}
$attacherror = '';
|
}
$attacherror = '';
|
if($mybb->settings['enableattachments'] == 1 && ($mybb->get_input('newattachment') || $mybb->get_input('updateattachment') || ((($mybb->input['action'] == "do_editpost" && isset($mybb->input['submitbutton'])) || ($mybb->input['action'] == "editpost" && isset($mybb->input['previewpost']))) && $_FILES['attachments'])))
| if($mybb->settings['enableattachments'] == 1 && ($mybb->get_input('newattachment') || $mybb->get_input('updateattachment') || ((($mybb->input['action'] == "do_editpost" && isset($mybb->input['submitbutton'])) || ($mybb->input['action'] == "editpost" && isset($mybb->input['previewpost']))) && isset($_FILES['attachments']))))
|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
| { // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
Zeile 231 | Zeile 231 |
---|
$usage = $db->fetch_array($query); $ret['usage'] = get_friendly_size($usage['ausage']); }
|
$usage = $db->fetch_array($query); $ret['usage'] = get_friendly_size($usage['ausage']); }
|
|
|
header("Content-type: application/json; charset={$lang->settings['charset']}"); echo json_encode($ret); exit();
|
header("Content-type: application/json; charset={$lang->settings['charset']}"); echo json_encode($ret); exit();
|
}
| }
|
if(!empty($ret['errors'])) { $errors = $ret['errors'];
|
if(!empty($ret['errors'])) { $errors = $ret['errors'];
|
}
| }
|
// Do we have attachment errors? if(!empty($errors)) {
| // Do we have attachment errors? if(!empty($errors)) {
|
Zeile 249 | Zeile 249 |
---|
}
// If we were dealing with an attachment but didn't click 'Update Post', force the post edit page again.
|
}
// If we were dealing with an attachment but didn't click 'Update Post', force the post edit page again.
|
if(!isset($mybb->input['submitbutton']))
| if(!isset($mybb->input['submitbutton']))
|
{ $mybb->input['action'] = "editpost"; } }
|
{ $mybb->input['action'] = "editpost"; } }
|
|
|
detect_attachmentact();
if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid', MyBB::INPUT_INT) && isset($mybb->input['attachmentact']) && $mybb->input['action'] == "do_editpost" && $mybb->request_method == "post") // Lets remove/approve/unapprove the attachment
|
detect_attachmentact();
if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid', MyBB::INPUT_INT) && 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->get_input('my_post_key'));
| // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
Zeile 266 | Zeile 266 |
---|
if($mybb->input['attachmentact'] == "remove") { remove_attachment($pid, "", $mybb->input['attachmentaid']);
|
if($mybb->input['attachmentact'] == "remove") { remove_attachment($pid, "", $mybb->input['attachmentaid']);
|
} elseif($mybb->get_input('attachmentact') == "approve" && is_moderator($fid, 'canapproveunapproveattachs'))
| } elseif($mybb->get_input('attachmentact') == "approve" && is_moderator($fid, 'canapproveunapproveattachs'))
|
{ $update_sql = array("visible" => 1); $db->update_query("attachments", $update_sql, "aid='{$mybb->input['attachmentaid']}'");
| { $update_sql = array("visible" => 1); $db->update_query("attachments", $update_sql, "aid='{$mybb->input['attachmentaid']}'");
|
Zeile 304 | Zeile 304 |
---|
$plugins->run_hooks("editpost_deletepost");
if($mybb->get_input('delete', MyBB::INPUT_INT) == 1)
|
$plugins->run_hooks("editpost_deletepost");
if($mybb->get_input('delete', MyBB::INPUT_INT) == 1)
|
{ $query = $db->simple_select("posts", "pid", "tid='{$tid}'", array("limit" => 1, "order_by" => "dateline, pid")); $firstcheck = $db->fetch_array($query); if($firstcheck['pid'] == $pid) { $firstpost = 1; } else { $firstpost = 0; }
$modlogdata['fid'] = $fid; $modlogdata['tid'] = $tid; if($firstpost)
| { $query = $db->simple_select("posts", "pid", "tid='{$tid}'", array("limit" => 1, "order_by" => "dateline, pid")); $firstcheck = $db->fetch_array($query); if($firstcheck['pid'] == $pid) { $firstpost = 1; } else { $firstpost = 0; }
$modlogdata['fid'] = $fid; $modlogdata['tid'] = $tid; if($firstpost)
|
{ if($forumpermissions['candeletethreads'] == 1 || is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads")) {
| { if($forumpermissions['candeletethreads'] == 1 || is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads")) {
|
Zeile 488 | Zeile 488 |
---|
else { redirect($redirect, $lang->redirect_postrestored);
|
else { redirect($redirect, $lang->redirect_postrestored);
|
} } else
| } } else
|
{ error_no_permission(); } }
|
{ error_no_permission(); } }
|
}
| }
|
else { error($lang->redirect_norestore); } }
|
else { error($lang->redirect_norestore); } }
|
|
|
$postoptions = array();
if($mybb->input['action'] == "do_editpost" && $mybb->request_method == "post")
| $postoptions = array();
if($mybb->input['action'] == "do_editpost" && $mybb->request_method == "post")
|
Zeile 533 | Zeile 533 |
---|
if(!isset($postoptions['signature'])) { $postoptions['signature'] = 0;
|
if(!isset($postoptions['signature'])) { $postoptions['signature'] = 0;
|
}
| }
|
if(!isset($postoptions['subscriptionmethod'])) { $postoptions['subscriptionmethod'] = 0;
| if(!isset($postoptions['subscriptionmethod'])) { $postoptions['subscriptionmethod'] = 0;
|
Zeile 576 | Zeile 576 |
---|
$lang->redirect_postedited = $lang->redirect_postedited_poll; } else if($visible == 0 && $first_post && !is_moderator($fid, "canviewunapprove", $mybb->user['uid']))
|
$lang->redirect_postedited = $lang->redirect_postedited_poll; } else if($visible == 0 && $first_post && !is_moderator($fid, "canviewunapprove", $mybb->user['uid']))
|
{
| {
|
// Moderated post $lang->redirect_postedited .= $lang->redirect_thread_moderation; $url = get_forum_link($fid);
| // Moderated post $lang->redirect_postedited .= $lang->redirect_thread_moderation; $url = get_forum_link($fid);
|
Zeile 597 | Zeile 597 |
---|
redirect($url, $lang->redirect_postedited); } }
|
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");
|
|
|
$preview = '';
|
$preview = '';
|
if(!isset($mybb->input['previewpost'])) { $icon = $post['icon']; }
| $posticons = '';
|
if($forum['allowpicons'] != 0) { $posticons = get_post_icons();
|
if($forum['allowpicons'] != 0) { $posticons = get_post_icons();
|
}
| }
|
$mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']); eval("\$loginbox = \"".$templates->get("changeuserbox")."\";");
|
$mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']); eval("\$loginbox = \"".$templates->get("changeuserbox")."\";");
|
|
|
$deletebox = '';
|
$deletebox = '';
|
|
|
if(isset($post['visible']) && $post['visible'] != -1 && (($thread['firstpost'] == $pid && (is_moderator($fid, "candeletethreads") || $forumpermissions['candeletethreads'] == 1 && $mybb->user['uid'] == $post['uid'])) || ($thread['firstpost'] != $pid && (is_moderator($fid, "candeleteposts") || $forumpermissions['candeleteposts'] == 1 && $mybb->user['uid'] == $post['uid'])))) { eval("\$deletebox = \"".$templates->get("editpost_delete")."\";"); }
|
if(isset($post['visible']) && $post['visible'] != -1 && (($thread['firstpost'] == $pid && (is_moderator($fid, "candeletethreads") || $forumpermissions['candeletethreads'] == 1 && $mybb->user['uid'] == $post['uid'])) || ($thread['firstpost'] != $pid && (is_moderator($fid, "candeleteposts") || $forumpermissions['candeleteposts'] == 1 && $mybb->user['uid'] == $post['uid'])))) { eval("\$deletebox = \"".$templates->get("editpost_delete")."\";"); }
|
|
|
$bgcolor = "trow1"; if($mybb->settings['enableattachments'] != 0 && $forumpermissions['canpostattachments'] != 0) { // Get a listing of the current attachments, if there are any
| $bgcolor = "trow1"; if($mybb->settings['enableattachments'] != 0 && $forumpermissions['canpostattachments'] != 0) { // Get a listing of the current attachments, if there are any
|
Zeile 665 | Zeile 662 |
---|
eval("\$attachments .= \"".$templates->get("post_attachments_attachment")."\";"); } $attachcount++;
|
eval("\$attachments .= \"".$templates->get("post_attachments_attachment")."\";"); } $attachcount++;
|
}
| }
|
$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;
|
$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;
|
}
| }
|
else { $noshowattach = 0;
| else { $noshowattach = 0;
|
Zeile 679 | Zeile 676 |
---|
if($mybb->usergroup['attachquota'] == 0) { $friendlyquota = $lang->unlimited;
|
if($mybb->usergroup['attachquota'] == 0) { $friendlyquota = $lang->unlimited;
|
} else {
| } else {
|
$friendlyquota = get_friendly_size($mybb->usergroup['attachquota']*1024);
|
$friendlyquota = get_friendly_size($mybb->usergroup['attachquota']*1024);
|
}
$lang->attach_quota = $lang->sprintf($lang->attach_quota, $friendlyquota);
| }
$lang->attach_quota = $lang->sprintf($lang->attach_quota, $friendlyquota);
|
$link_viewattachments = '';
if($usage['ausage'] !== NULL)
| $link_viewattachments = '';
if($usage['ausage'] !== NULL)
|
Zeile 696 | Zeile 693 |
---|
eval("\$link_viewattachments = \"".$templates->get("post_attachments_viewlink")."\";"); } else
|
eval("\$link_viewattachments = \"".$templates->get("post_attachments_viewlink")."\";"); } else
|
{
| {
|
$lang->attach_usage = ""; }
|
$lang->attach_usage = ""; }
|
$attach_update_options = '';
| $attach_add_options = '';
|
if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach) { eval("\$attach_add_options = \"".$templates->get("post_attachments_add")."\";"); }
|
if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach) { eval("\$attach_add_options = \"".$templates->get("post_attachments_add")."\";"); }
|
| $attach_update_options = '';
|
if(($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']) && $attachcount > 0) { eval("\$attach_update_options = \"".$templates->get("post_attachments_update")."\";");
| if(($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']) && $attachcount > 0) { eval("\$attach_update_options = \"".$templates->get("post_attachments_update")."\";");
|
Zeile 812 | Zeile 809 |
---|
{ $postoptionschecked['disablesmilies'] = " checked=\"checked\""; }
|
{ $postoptionschecked['disablesmilies'] = " checked=\"checked\""; }
|
|
|
$subscription_method = get_subscription_method($tid, $postoptions); ${$subscription_method.'subscribe'} = "checked=\"checked\" "; }
| $subscription_method = get_subscription_method($tid, $postoptions); ${$subscription_method.'subscribe'} = "checked=\"checked\" "; }
|
Zeile 838 | Zeile 835 |
---|
"); $postinfo = $db->fetch_array($query); $postinfo['userusername'] = $postinfo['username'];
|
"); $postinfo = $db->fetch_array($query); $postinfo['userusername'] = $postinfo['username'];
|
}
| }
|
$query = $db->simple_select("attachments", "*", "pid='{$pid}'"); while($attachment = $db->fetch_array($query))
| $query = $db->simple_select("attachments", "*", "pid='{$pid}'"); while($attachment = $db->fetch_array($query))
|
Zeile 849 | Zeile 846 |
---|
if(!isset($postoptions['disablesmilies'])) { $postoptions['disablesmilies'] = 0;
|
if(!isset($postoptions['disablesmilies'])) { $postoptions['disablesmilies'] = 0;
|
}
| }
|
// Set the values of the post info array. $postinfo['message'] = $previewmessage; $postinfo['subject'] = $previewsubject;
|
// Set the values of the post info array. $postinfo['message'] = $previewmessage; $postinfo['subject'] = $previewsubject;
|
$postinfo['icon'] = $icon;
| $postinfo['icon'] = $post['icon'];
|
$postinfo['smilieoff'] = $postoptions['disablesmilies'];
$postbit = build_postbit($postinfo, 1); eval("\$preview = \"".$templates->get("previewpost")."\";"); } else if(!$post_errors)
|
$postinfo['smilieoff'] = $postoptions['disablesmilies'];
$postbit = build_postbit($postinfo, 1); eval("\$preview = \"".$templates->get("previewpost")."\";"); } else if(!$post_errors)
|
{
| {
|
$preview = '';
|
$preview = '';
|
|
|
if($post['includesig'] != 0) { $postoptionschecked['signature'] = " checked=\"checked\"";
| if($post['includesig'] != 0) { $postoptionschecked['signature'] = " checked=\"checked\"";
|
Zeile 872 | Zeile 869 |
---|
if($post['smilieoff'] == 1) { $postoptionschecked['disablesmilies'] = " checked=\"checked\"";
|
if($post['smilieoff'] == 1) { $postoptionschecked['disablesmilies'] = " checked=\"checked\"";
|
}
| }
|
$subscription_method = get_subscription_method($tid, $postoptions); ${$subscription_method.'subscribe'} = "checked=\"checked\" ";
| $subscription_method = get_subscription_method($tid, $postoptions); ${$subscription_method.'subscribe'} = "checked=\"checked\" ";
|
Zeile 882 | Zeile 879 |
---|
if($thread['firstpost'] == $pid) { if(!$mybb->get_input('threadprefix', MyBB::INPUT_INT))
|
if($thread['firstpost'] == $pid) { if(!$mybb->get_input('threadprefix', MyBB::INPUT_INT))
|
{
| {
|
$mybb->input['threadprefix'] = $thread['prefix']; }
| $mybb->input['threadprefix'] = $thread['prefix']; }
|
Zeile 918 | Zeile 915 |
---|
$lang->max_options = $lang->sprintf($lang->max_options, $mybb->settings['maxpolloptions']); $numpolloptions = $mybb->get_input('numpolloptions', MyBB::INPUT_INT); $postpollchecked = '';
|
$lang->max_options = $lang->sprintf($lang->max_options, $mybb->settings['maxpolloptions']); $numpolloptions = $mybb->get_input('numpolloptions', MyBB::INPUT_INT); $postpollchecked = '';
|
|
|
if($numpolloptions < 1)
|
if($numpolloptions < 1)
|
{
| {
|
$numpolloptions = 2;
|
$numpolloptions = 2;
|
}
| }
|
if($mybb->get_input('postpoll', MyBB::INPUT_INT) == 1) { $postpollchecked = 'checked="checked"'; }
|
if($mybb->get_input('postpoll', MyBB::INPUT_INT) == 1) { $postpollchecked = 'checked="checked"'; }
|
|
|
eval("\$pollbox = \"".$templates->get("newthread_postpoll")."\";"); } else
| eval("\$pollbox = \"".$templates->get("newthread_postpoll")."\";"); } else
|