Vergleich newreply.php - 1.4.8 - 1.4.14

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: newreply.php 4322 2009-02-21 23:00:49Z Tikitiki $

 * $Id: newreply.php 5087 2010-07-11 11:46:40Z Huji $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 169Zeile 169

if(!$mybb->input['attachmentaid'] && ($mybb->input['newattachment'] || ($mybb->input['action'] == "do_newreply" && $mybb->input['submit'] && $_FILES['attachment'])))
{


if(!$mybb->input['attachmentaid'] && ($mybb->input['newattachment'] || ($mybb->input['action'] == "do_newreply" && $mybb->input['submit'] && $_FILES['attachment'])))
{

 
	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


	if($mybb->input['action'] == "editdraft" || ($mybb->input['tid'] && $mybb->input['pid']))
{
$attachwhere = "pid='{$pid}'";

	if($mybb->input['action'] == "editdraft" || ($mybb->input['tid'] && $mybb->input['pid']))
{
$attachwhere = "pid='{$pid}'";

Zeile 185Zeile 188
	{
require_once MYBB_ROOT."inc/functions_upload.php";
$attachedfile = upload_attachment($_FILES['attachment']);

	{
require_once MYBB_ROOT."inc/functions_upload.php";
$attachedfile = upload_attachment($_FILES['attachment']);

	}

	}

	
if($attachedfile['error'])
{

	
if($attachedfile['error'])
{

Zeile 196Zeile 199
	if(!$mybb->input['submit'])
{
$mybb->input['action'] = "newreply";

	if(!$mybb->input['submit'])
{
$mybb->input['action'] = "newreply";

 
		$editdraftpid = "<input type=\"hidden\" name=\"pid\" value=\"$pid\" />";

	}
}

// Remove an attachment.
if($mybb->input['attachmentaid'] && $mybb->input['posthash'])
{

	}
}

// Remove an attachment.
if($mybb->input['attachmentaid'] && $mybb->input['posthash'])
{

 
	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


	require_once MYBB_ROOT."inc/functions_upload.php";
remove_attachment(0, $mybb->input['posthash'], $mybb->input['attachmentaid']);
if(!$mybb->input['submit'])
{
$mybb->input['action'] = "newreply";

	require_once MYBB_ROOT."inc/functions_upload.php";
remove_attachment(0, $mybb->input['posthash'], $mybb->input['attachmentaid']);
if(!$mybb->input['submit'])
{
$mybb->input['action'] = "newreply";

 
		$editdraftpid = "<input type=\"hidden\" name=\"pid\" value=\"$pid\" />";

	}
}

// Setup our posthash for managing attachments.
if(!$mybb->input['posthash'] && $mybb->input['action'] != "editdraft")
{

	}
}

// Setup our posthash for managing attachments.
if(!$mybb->input['posthash'] && $mybb->input['action'] != "editdraft")
{

	mt_srand ((double) microtime() * 1000000);
$mybb->input['posthash'] = md5($thread['tid'].$mybb->user['uid'].mt_rand());

	$mybb->input['posthash'] = md5($thread['tid'].$mybb->user['uid'].random_str());


}

$reply_errors = "";

}

$reply_errors = "";

Zeile 330Zeile 337
	}
if(!$mybb->input['savedraft'])
{

	}
if(!$mybb->input['savedraft'])
{

		$query = $db->simple_select("posts p", "p.pid", "{$user_check} AND p.tid='{$thread['tid']}' AND p.subject='".$db->escape_string($mybb->input['subject'])."' AND p.message='".$db->escape_string($mybb->input['message'])."' AND p.posthash='".$db->escape_string($mybb->input['posthash'])."'");

		$query = $db->simple_select("posts p", "p.pid", "{$user_check} AND p.tid='{$thread['tid']}' AND p.subject='".$db->escape_string($mybb->input['subject'])."' AND p.message='".$db->escape_string($mybb->input['message'])."' AND p.posthash='".$db->escape_string($mybb->input['posthash'])."' AND p.visible != '-2'");

		$duplicate_check = $db->fetch_field($query, "pid");
if($duplicate_check)
{

		$duplicate_check = $db->fetch_field($query, "pid");
if($duplicate_check)
{

Zeile 354Zeile 361
		"message" => $mybb->input['message'],
"ipaddress" => get_ip(),
"posthash" => $mybb->input['posthash']

		"message" => $mybb->input['message'],
"ipaddress" => get_ip(),
"posthash" => $mybb->input['posthash']

	);

	);


if($mybb->input['pid'])
{


if($mybb->input['pid'])
{

Zeile 537Zeile 544
				else
{
$post_page = intval(($postcounter) / $mybb->settings['postsperpage']) + 1;

				else
{
$post_page = intval(($postcounter) / $mybb->settings['postsperpage']) + 1;

				}

				}


if($mybb->input['from_page'] && $post_page > $mybb->input['from_page'])
{


if($mybb->input['from_page'] && $post_page > $mybb->input['from_page'])
{

Zeile 559Zeile 566
				// Now lets fetch all of the attachments for this post
$query = $db->simple_select("attachments", "*", "pid='{$pid}'");
while($attachment = $db->fetch_array($query))

				// Now lets fetch all of the attachments for this post
$query = $db->simple_select("attachments", "*", "pid='{$pid}'");
while($attachment = $db->fetch_array($query))

				{

				{

					$attachcache[$attachment['pid']][$attachment['aid']] = $attachment;

					$attachcache[$attachment['pid']][$attachment['aid']] = $attachment;

				}

				}


// Is the currently logged in user a moderator of this forum?
if(is_moderator($fid))
{
$ismod = true;


// Is the currently logged in user a moderator of this forum?
if(is_moderator($fid))
{
$ismod = true;

				}

				}

				else
{
$ismod = false;

				else
{
$ismod = false;

				}


				}


				// Establish altbg - may seem like this is backwards, but build_postbit reverses it
if(($postcounter - $mybb->settings['postsperpage']) % 2 != 0)

				// Establish altbg - may seem like this is backwards, but build_postbit reverses it
if(($postcounter - $mybb->settings['postsperpage']) % 2 != 0)

				{

				{

					$altbg = "trow1";

					$altbg = "trow1";

				}

				}

				else
{
$altbg = "trow2";
}

				else
{
$altbg = "trow2";
}





				require_once MYBB_ROOT."inc/functions_post.php";
$pid = $post['pid'];
$post = build_postbit($post);
echo $post;

// Build a new posthash incase the user wishes to quick reply again

				require_once MYBB_ROOT."inc/functions_post.php";
$pid = $post['pid'];
$post = build_postbit($post);
echo $post;

// Build a new posthash incase the user wishes to quick reply again

				mt_srand((double) microtime() * 1000000);
$new_posthash = md5($mybb->user['uid'].mt_rand());

			    $new_posthash = md5($mybb->user['uid'].random_str());


				echo "<script type=\"text/javascript\">\n"; 
echo "var hash = document.getElementById('posthash'); if(hash) { hash.value = '{$new_posthash}'; }\n";
echo "if(typeof(inlineModeration) != 'undefined') { Event.observe($('inlinemod_{$pid}'), 'click', inlineModeration.checkItem); }\n";

				echo "<script type=\"text/javascript\">\n"; 
echo "var hash = document.getElementById('posthash'); if(hash) { hash.value = '{$new_posthash}'; }\n";
echo "if(typeof(inlineModeration) != 'undefined') { Event.observe($('inlinemod_{$pid}'), 'click', inlineModeration.checkItem); }\n";

Zeile 620Zeile 626

$quote_ids = '';
// If this isn't a preview and we're not editing a draft, then handle quoted posts


$quote_ids = '';
// If this isn't a preview and we're not editing a draft, then handle quoted posts

	if(!$mybb->input['previewpost'] && !$reply_errors && $mybb->input['action'] != "editdraft")

	if(!$mybb->input['previewpost'] && !$reply_errors && $mybb->input['action'] != "editdraft" && !$mybb->input['attachmentaid'] && !$mybb->input['newattachment'] && !$mybb->input['updateattachment'] && !$mybb->input['rem'])

	{
$message = '';
$quoted_posts = array();

	{
$message = '';
$quoted_posts = array();

Zeile 631Zeile 637
			foreach($multiquoted as $post)
{
$quoted_posts[$post] = intval($post);

			foreach($multiquoted as $post)
{
$quoted_posts[$post] = intval($post);

			}
}

			}
}

		// Handle incoming 'quote' button
if($mybb->input['pid'])
{

		// Handle incoming 'quote' button
if($mybb->input['pid'])
{

Zeile 652Zeile 658
			if(is_moderator($fid))
{
$visible_where = "AND p.visible != 2";

			if(is_moderator($fid))
{
$visible_where = "AND p.visible != 2";

			}

			}

			else
{
$visible_where = "AND p.visible > 0";

			else
{
$visible_where = "AND p.visible > 0";

Zeile 696Zeile 702
			if($external_quotes > 0)
{
if($external_quotes == 1)

			if($external_quotes > 0)
{
if($external_quotes == 1)

				{

				{

					$multiquote_text = $lang->multiquote_external_one;
$multiquote_deselect = $lang->multiquote_external_one_deselect;
$multiquote_quote = $lang->multiquote_external_one_quote;

					$multiquote_text = $lang->multiquote_external_one;
$multiquote_deselect = $lang->multiquote_external_one_deselect;
$multiquote_quote = $lang->multiquote_external_one_quote;

Zeile 720Zeile 726
	{
$quoted_ids = htmlspecialchars_uni($mybb->input['quoted_ids']);
}

	{
$quoted_ids = htmlspecialchars_uni($mybb->input['quoted_ids']);
}


if($mybb->input['previewpost'])
{
$previewmessage = $mybb->input['message'];
}


if($mybb->input['previewpost'])
{
$previewmessage = $mybb->input['message'];
}

	if(!$message)
{
$message = $mybb->input['message'];

	if(!$message)
{
$message = $mybb->input['message'];

Zeile 733Zeile 739

// Set up the post options.
if($mybb->input['previewpost'] || $maximageserror || $reply_errors != '')


// Set up the post options.
if($mybb->input['previewpost'] || $maximageserror || $reply_errors != '')

	{

	{

		$postoptions = $mybb->input['postoptions'];
if($postoptions['signature'] == 1)

		$postoptions = $mybb->input['postoptions'];
if($postoptions['signature'] == 1)

		{

		{

			$postoptionschecked['signature'] = " checked=\"checked\"";

			$postoptionschecked['signature'] = " checked=\"checked\"";

		}

		}

		if($postoptions['subscriptionmethod'] == "none")
{

		if($postoptions['subscriptionmethod'] == "none")
{

			$postoptions_subscriptionmethod_none = "checked=\"checked\"";
}
else if($postoptions['subscriptionmethod'] == "instant")
{
$postoptions_subscriptionmethod_instant = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";

			$postoptions_subscriptionmethod_none = "checked=\"checked\"";
}
else if($postoptions['subscriptionmethod'] == "instant")
{
$postoptions_subscriptionmethod_instant = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";

		}
if($postoptions['disablesmilies'] == 1)
{

		}
if($postoptions['disablesmilies'] == 1)
{

Zeile 768Zeile 774
		if($post['smilieoff'] == 1)
{
$postoptionschecked['disablesmilies'] = " checked=\"checked\"";

		if($post['smilieoff'] == 1)
{
$postoptionschecked['disablesmilies'] = " checked=\"checked\"";

		}

		}

		$mybb->input['icon'] = $post['icon'];
}
else

		$mybb->input['icon'] = $post['icon'];
}
else

Zeile 776Zeile 782
		if($mybb->user['signature'] != '')
{
$postoptionschecked['signature'] = " checked=\"checked\"";

		if($mybb->user['signature'] != '')
{
$postoptionschecked['signature'] = " checked=\"checked\"";

		}

		}

		if($mybb->user['subscriptionmethod'] ==  1)
{
$postoptions_subscriptionmethod_none = "checked=\"checked\"";

		if($mybb->user['subscriptionmethod'] ==  1)
{
$postoptions_subscriptionmethod_none = "checked=\"checked\"";

Zeile 794Zeile 800
	if($forum['allowpicons'] != 0)
{
$posticons = get_post_icons();

	if($forum['allowpicons'] != 0)
{
$posticons = get_post_icons();

 
	}

// No subject, but post info?
if(!$subject && $mybb->input['subject'])
{
$subject = $mybb->input['subject'];

	}

// Preview a post that was written.

	}

// Preview a post that was written.

Zeile 905Zeile 917
	{
$subject = "RE: " . $thread['subject'];
}

	{
$subject = "RE: " . $thread['subject'];
}

 


	// Setup a unique posthash for attachment management
if(!$mybb->input['posthash'] && $mybb->input['action'] != "editdraft")
{

	// Setup a unique posthash for attachment management
if(!$mybb->input['posthash'] && $mybb->input['action'] != "editdraft")
{

	    mt_srand ((double) microtime() * 1000000);
$posthash = md5($mybb->user['uid'].mt_rand());





	    $posthash = md5($mybb->user['uid'].random_str());
}
elseif($mybb->input['action'] == "editdraft")
{
// Drafts have posthashes, too...
$posthash = $post['posthash'];

	}
else
{

	}
else
{