Vergleich editpost.php - 1.6.1 - 1.6.9

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 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 33Zeile 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 73Zeile 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 92Zeile 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 121Zeile 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 168Zeile 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 212Zeile 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 225Zeile 230
		if($firstcheck['pid'] == $pid)
{
$firstpost = 1;

		if($firstcheck['pid'] == $pid)
{
$firstpost = 1;

		}
else

		}
else

		{
$firstpost = 0;
}

		{
$firstpost = 0;
}

Zeile 243Zeile 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 260Zeile 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 388Zeile 393
	if($forumpermissions['canpostattachments'] != 0)
{ // Get a listing of the current attachments, if there are any
$attachcount = 0;

	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 413Zeile 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 447Zeile 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")."\";");