Zeile 3 | Zeile 3 |
---|
* MyBB 1.2 * Copyright � 2006 MyBB Group, All Rights Reserved *
|
* MyBB 1.2 * Copyright � 2006 MyBB Group, All Rights Reserved *
|
* Website: http://www.mybboard.com * License: http://www.mybboard.com/eula.html
| * Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html
|
*
|
*
|
* $Id: editpost.php 2154 2006-08-27 16:52:47Z Tikitiki $
| * $Id: editpost.php 3055 2007-05-13 15:01:15Z Tikitiki $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 88 | Zeile 88 |
---|
{ if($thread['closed'] == "yes") {
|
{ if($thread['closed'] == "yes") {
|
redirect("showthread.php?tid=$tid", $lang->redirect_threadclosed);
| error($lang->redirect_threadclosed);
|
} if($forumpermissions['candeleteposts'] == "no") {
| } if($forumpermissions['candeleteposts'] == "no") {
|
Zeile 106 | Zeile 106 |
---|
{ if($thread['closed'] == "yes") {
|
{ if($thread['closed'] == "yes") {
|
redirect("showthread.php?tid=$tid", $lang->redirect_threadclosed);
| error($lang->redirect_threadclosed);
|
} if($forumpermissions['caneditposts'] == "no") {
| } if($forumpermissions['caneditposts'] == "no") {
|
Zeile 193 | Zeile 193 |
---|
if($forumpermissions['candeletethreads'] == "yes") { delete_thread($tid);
|
if($forumpermissions['candeletethreads'] == "yes") { delete_thread($tid);
|
update_forum_count($fid);
| |
mark_reports($tid, "thread");
|
mark_reports($tid, "thread");
|
if(is_moderator($fid, "candeleteposts") != "yes") { log_moderator_action($modlogdata, "Deleted Thread"); }
| log_moderator_action($modlogdata, "Deleted Thread");
|
redirect("forumdisplay.php?fid=$fid", $lang->redirect_threaddeleted);
|
redirect("forumdisplay.php?fid=$fid", $lang->redirect_threaddeleted);
|
} else { error_no_permission(); } }
| } else { error_no_permission(); } }
|
else { if($forumpermissions['candeleteposts'] == "yes")
|
else { if($forumpermissions['candeleteposts'] == "yes")
|
{
| {
|
// Select the first post before this delete_post($pid, $tid);
|
// Select the first post before this delete_post($pid, $tid);
|
update_thread_count($tid); update_forum_count($fid);
| |
mark_reports($pid, "post");
|
mark_reports($pid, "post");
|
if(is_moderator($fid, "candeleteposts") != "yes") { log_moderator_action($modlogdata, "Deleted Post"); }
| log_moderator_action($modlogdata, "Deleted Post");
|
$query = $db->simple_select(TABLE_PREFIX."posts", "pid", "tid='{$tid}' AND dateline <= '{$post['dateline']}'", array("limit" => 1, "order_by" => "dateline", "order_dir" => "desc")); $next_post = $db->fetch_array($query); if($next_post['pid'])
| $query = $db->simple_select(TABLE_PREFIX."posts", "pid", "tid='{$tid}' AND dateline <= '{$post['dateline']}'", array("limit" => 1, "order_by" => "dateline", "order_dir" => "desc")); $next_post = $db->fetch_array($query); if($next_post['pid'])
|
Zeile 234 | Zeile 225 |
---|
else { error_no_permission();
|
else { error_no_permission();
|
} } } else { redirect("showthread.php?tid={$tid}", $lang->redirect_nodelete); }
| } } } else { error($lang->redirect_nodelete); }
|
}
if($mybb->input['action'] == "do_editpost" && $mybb->request_method == "post") {
|
}
if($mybb->input['action'] == "do_editpost" && $mybb->request_method == "post") {
|
|
|
$plugins->run_hooks("editpost_do_editpost_start");
// Set up posthandler.
| $plugins->run_hooks("editpost_do_editpost_start");
// Set up posthandler.
|
Zeile 262 | Zeile 253 |
---|
"username" => $mybb->user['username'], "edit_uid" => $mybb->user['uid'], "message" => $mybb->input['message'],
|
"username" => $mybb->user['username'], "edit_uid" => $mybb->user['uid'], "message" => $mybb->input['message'],
|
);
| );
|
// Set up the post options from the input. $post['options'] = array(
| // Set up the post options from the input. $post['options'] = array(
|
Zeile 275 | Zeile 266 |
---|
// Now let the post handler do all the hard work. if(!$posthandler->validate_post())
|
// Now let the post handler do all the hard work. if(!$posthandler->validate_post())
|
{
| {
|
$post_errors = $posthandler->get_friendly_errors(); $post_errors = inline_error($post_errors); $mybb->input['action'] = "editpost";
|
$post_errors = $posthandler->get_friendly_errors(); $post_errors = inline_error($post_errors); $mybb->input['action'] = "editpost";
|
}
| }
|
// No errors were found, we can call the update method. else {
| // No errors were found, we can call the update method. else {
|
Zeile 287 | Zeile 278 |
---|
// Help keep our attachments table clean. $db->delete_query(TABLE_PREFIX."attachments", "filename='' OR filesize<1");
|
// Help keep our attachments table clean. $db->delete_query(TABLE_PREFIX."attachments", "filename='' OR filesize<1");
|
|
|
// 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']) {
|
Zeile 309 | Zeile 300 |
---|
if(!$mybb->input['action'] || $mybb->input['action'] == "editpost") { $plugins->run_hooks("editpost_start");
|
if(!$mybb->input['action'] || $mybb->input['action'] == "editpost") { $plugins->run_hooks("editpost_start");
|
|
|
if(!$mybb->input['previewpost']) { $icon = $post['icon'];
|
if(!$mybb->input['previewpost']) { $icon = $post['icon'];
|
}
| }
|
if($forum['allowpicons'] != "no") {
| if($forum['allowpicons'] != "no") {
|
Zeile 321 | Zeile 312 |
---|
}
if($mybb->user['uid'] != 0)
|
}
if($mybb->user['uid'] != 0)
|
{
| {
|
eval("\$loginbox = \"".$templates->get("changeuserbox")."\";"); } else
| eval("\$loginbox = \"".$templates->get("changeuserbox")."\";"); } else
|
Zeile 337 | Zeile 328 |
---|
if($forumpermissions['canpostattachments'] != "no") { // Get a listing of the current attachments, if there are any $attachcount = 0;
|
if($forumpermissions['canpostattachments'] != "no") { // Get a listing of the current attachments, if there are any $attachcount = 0;
|
if($mybb->input['posthash']) { $posthash = "posthash='{$posthash}' OR "; }
| if($posthash) { $posthash_query = "posthash='{$posthash}' OR "; }
|
else
|
else
|
{ $posthash = "";
| { $posthash_query = "";
|
}
|
}
|
$query = $db->simple_select(TABLE_PREFIX."attachments", "*", "{$posthash}pid='{$pid}'");
| $query = $db->simple_select(TABLE_PREFIX."attachments", "*", "{$posthash_query}pid='{$pid}'");
|
$attachments = '';
|
$attachments = '';
|
while($attachment = $db->fetch_array($query)) {
| while($attachment = $db->fetch_array($query)) {
|
$attachment['size'] = get_friendly_size($attachment['filesize']); $attachment['icon'] = get_attachment_icon(get_extension($attachment['filename'])); if($forum['allowmycode'] != "no")
| $attachment['size'] = get_friendly_size($attachment['filesize']); $attachment['icon'] = get_attachment_icon(get_extension($attachment['filename'])); if($forum['allowmycode'] != "no")
|
Zeile 380 | Zeile 371 |
---|
} $query = $db->query("SELECT SUM(filesize) AS ausage FROM ".TABLE_PREFIX."attachments WHERE uid='".$mybb->user['uid']."'"); $usage = $db->fetch_array($query);
|
} $query = $db->query("SELECT SUM(filesize) AS ausage FROM ".TABLE_PREFIX."attachments WHERE uid='".$mybb->user['uid']."'"); $usage = $db->fetch_array($query);
|
if($usage['ausage'] > ($mybb->usergroup['attachquota']*1000) && $mybb->usergroup['attachquota'] != 0)
| if($usage['ausage'] > ($mybb->usergroup['attachquota']*1024) && $mybb->usergroup['attachquota'] != 0)
|
{ $noshowattach = 1; }
| { $noshowattach = 1; }
|
Zeile 390 | Zeile 381 |
---|
} else {
|
} else {
|
$friendlyquota = get_friendly_size($mybb->usergroup['attachquota']*1000);
| $friendlyquota = get_friendly_size($mybb->usergroup['attachquota']*1024);
|
} $friendlyusage = get_friendly_size($usage['ausage']); $lang->attach_quota = sprintf($lang->attach_quota, $friendlyusage, $friendlyquota);
| } $friendlyusage = get_friendly_size($usage['ausage']); $lang->attach_quota = sprintf($lang->attach_quota, $friendlyusage, $friendlyquota);
|
Zeile 418 | Zeile 409 |
---|
$lang->max_options = sprintf($lang->max_options, $mybb->settings['maxpolloptions']); $numpolloptions = "2"; eval("\$pollbox = \"".$templates->get("newthread_postpoll")."\";");
|
$lang->max_options = sprintf($lang->max_options, $mybb->settings['maxpolloptions']); $numpolloptions = "2"; eval("\$pollbox = \"".$templates->get("newthread_postpoll")."\";");
|
}
if($mybb->input['previewpost'] || $post_errors)
| }
if($mybb->input['previewpost'] && !$post_errors)
|
{
|
{
|
$previewmessage = $message; $message = htmlspecialchars_uni($message); $subject = htmlspecialchars_uni($subject);
$postoptions = $mybb->input['postoptions'];
if($postoptions['signature'] == "yes") { $postoptionschecked['signature'] = "checked=\"checked\""; } if($postoptions['emailnotify'] == "yes") { $postoptionschecked['emailnotify'] = "checked=\"checked\""; } if($postoptions['disablesmilies'] == "yes")
| // Set up posthandler. require_once MYBB_ROOT."inc/datahandlers/post.php"; $posthandler = new PostDataHandler("update"); $posthandler->action = "post"; // Set the post data that came from the input to the $post array. $post = array( "pid" => $mybb->input['pid'], "subject" => $mybb->input['subject'], "icon" => $mybb->input['icon'], "uid" => $mybb->user['uid'], "username" => $mybb->user['username'], "edit_uid" => $mybb->user['uid'], "message" => $mybb->input['message'], ); // Set up the post options from the input. $post['options'] = array( "signature" => $mybb->input['postoptions']['signature'], "emailnotify" => $mybb->input['postoptions']['emailnotify'], "disablesmilies" => $mybb->input['postoptions']['disablesmilies'] ); $posthandler->set_data($post); // Now let the post handler do all the hard work. if(!$posthandler->validate_post())
|
{
|
{
|
$postoptionschecked['disablesmilies'] = "checked=\"checked\"";
| $post_errors = $posthandler->get_friendly_errors(); $post_errors = inline_error($post_errors); $mybb->input['action'] = "editpost"; $mybb->input['previewpost'] = 0; } else { $previewmessage = $message; $message = htmlspecialchars_uni($message); $subject = htmlspecialchars_uni($subject); $postoptions = $mybb->input['postoptions']; if($postoptions['signature'] == "yes") { $postoptionschecked['signature'] = "checked=\"checked\""; } if($postoptions['emailnotify'] == "yes") { $postoptionschecked['emailnotify'] = "checked=\"checked\""; } if($postoptions['disablesmilies'] == "yes") { $postoptionschecked['disablesmilies'] = "checked=\"checked\""; } $pid = intval($mybb->input['pid']);
|
}
|
}
|
$pid = intval($mybb->input['pid']);
| |
}
if($mybb->input['previewpost'])
| }
if($mybb->input['previewpost'])
|
Zeile 475 | Zeile 502 |
---|
$postbit = build_postbit($postinfo, 1); eval("\$preview = \"".$templates->get("previewpost")."\";"); }
|
$postbit = build_postbit($postinfo, 1); eval("\$preview = \"".$templates->get("previewpost")."\";"); }
|
elseif(!$post_errors)
| else if(!$post_errors)
|
{ $message = htmlspecialchars_uni($message); $subject = htmlspecialchars_uni($subject);
| { $message = htmlspecialchars_uni($message); $subject = htmlspecialchars_uni($subject);
|
Zeile 487 | Zeile 514 |
---|
if($post['smilieoff'] == "yes") { $postoptionschecked['disablesmilies'] = "checked=\"checked\"";
|
if($post['smilieoff'] == "yes") { $postoptionschecked['disablesmilies'] = "checked=\"checked\"";
|
} // Can we disable smilies or are they disabled already? if($forum['allowsmilies'] != "no") { eval("\$disablesmilies = \"".$templates->get("editpost_disablesmilies")."\";"); } else { $disablesmilies = "<input type=\"hidden\" name=\"postoptions[disablesmilies]\" value=\"no\" />";
| |
} $query = $db->simple_select(TABLE_PREFIX."favorites", "*", "type='s' AND tid='{$tid}' AND uid='{$mybb->user['uid']}'"); $subcheck = $db->fetch_array($query);
| } $query = $db->simple_select(TABLE_PREFIX."favorites", "*", "type='s' AND tid='{$tid}' AND uid='{$mybb->user['uid']}'"); $subcheck = $db->fetch_array($query);
|
Zeile 503 | Zeile 521 |
---|
{ $postoptionschecked['emailnotify'] = "checked=\"checked\""; }
|
{ $postoptionschecked['emailnotify'] = "checked=\"checked\""; }
|
| }
// Can we disable smilies or are they disabled already? if($forum['allowsmilies'] != "no") { eval("\$disablesmilies = \"".$templates->get("editpost_disablesmilies")."\";"); } else { $disablesmilies = "<input type=\"hidden\" name=\"postoptions[disablesmilies]\" value=\"no\" />";
|
}
$plugins->run_hooks("editpost_end");
| }
$plugins->run_hooks("editpost_end");
|