Vergleich newreply.php - 1.6.4 - 1.6.7

  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: newreply.php 5407 2011-03-20 01:41:12Z jammerx2 $

 * $Id: newreply.php 5746 2012-02-03 10:03:25Z Tomm $

 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'newreply.php');


 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'newreply.php');


$templatelist = "newreply,previewpost,error_invalidforum,error_invalidthread,redirect_threadposted,loginbox,changeuserbox,posticons,newreply_threadreview,forumrules,attachments,newreply_threadreview_post";

$templatelist = "newreply,previewpost,error_invalidforum,error_invalidthread,redirect_threadposted,loginbox,changeuserbox,posticons,newreply_threadreview,forumrules,attachments,newreply_threadreview_post,forumdisplay_rules,forumdisplay_rules_link";

$templatelist .= ",smilieinsert,smilieinsert_getmore,codebuttons,post_attachments_new,post_attachments,post_savedraftbutton,newreply_modoptions,newreply_threadreview_more,newreply_disablesmilies,postbit_online,postbit_find,postbit_pm,postbit_www,postbit_email,postbit_reputation,postbit_warninglevel,postbit_author_user,postbit_edit,postbit_quickdelete,postbit_inlinecheck,postbit_posturl,postbit_quote,postbit_multiquote,postbit_report,postbit_ignored,postbit,post_subscription_method";

require_once "./global.php";

$templatelist .= ",smilieinsert,smilieinsert_getmore,codebuttons,post_attachments_new,post_attachments,post_savedraftbutton,newreply_modoptions,newreply_threadreview_more,newreply_disablesmilies,postbit_online,postbit_find,postbit_pm,postbit_www,postbit_email,postbit_reputation,postbit_warninglevel,postbit_author_user,postbit_edit,postbit_quickdelete,postbit_inlinecheck,postbit_posturl,postbit_quote,postbit_multiquote,postbit_report,postbit_ignored,postbit,post_subscription_method";

require_once "./global.php";

Zeile 435Zeile 435
	mark_thread_read($tid, $fid);

// Check captcha image

	mark_thread_read($tid, $fid);

// Check captcha image

	if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])

	if($mybb->settings['captchaimage'] && !$mybb->user['uid'])

	{

	{

		$imagehash = $db->escape_string($mybb->input['imagehash']);
$imagestring = $db->escape_string($mybb->input['imagestring']);
$query = $db->simple_select("captcha", "*", "imagehash='$imagehash'");
$imgcheck = $db->fetch_array($query);
if(my_strtolower($imgcheck['imagestring']) != my_strtolower($imagestring) || !$imgcheck['imagehash'])

		require_once MYBB_ROOT.'inc/class_captcha.php';
$post_captcha = new captcha(false, "post_captcha");

if($post_captcha->validate_captcha() == false)


		{

		{

			$post_errors[] = $lang->invalid_captcha;
}
else
{
$db->delete_query("captcha", "imagehash='$imagehash'");
$hide_captcha = true;
}

// if we're using AJAX, and we have a captcha, regenerate a new one
if($mybb->input['ajax'])
{
$randomstr = random_str(5);
$imagehash = md5(random_str(12));
$imagearray = array(
"imagehash" => $imagehash,
"imagestring" => $randomstr,
"dateline" => TIME_NOW
);
$db->insert_query("captcha", $imagearray);
header("Content-type: text/html; charset={$lang->settings['charset']}");
echo "<captcha>$imagehash";
if($hide_captcha)

			// CAPTCHA validation failed
foreach($post_captcha->get_errors() as $error)





















			{

			{

				echo "|$randomstr";





































				$post_errors[] = $error;
}
}
else
{
$hide_captcha = true;
}

if($mybb->input['ajax'])
{
if($post_captcha->type == 1)
{
$randomstr = random_str(5);
$imagehash = md5(random_str(12));

$imagearray = array(
"imagehash" => $imagehash,
"imagestring" => $randomstr,
"dateline" => TIME_NOW
);

$db->insert_query("captcha", $imagearray);

header("Content-type: text/html; charset={$lang->settings['charset']}");
echo "<captcha>$imagehash";

if($hide_captcha)
{
echo "|$randomstr";
}

echo "</captcha>";
}
else if($post_captcha->type == 2)
{
header("Content-type: text/html; charset={$lang->settings['charset']}");
echo "<captcha>reload</captcha>";

			}

			}

			echo "</captcha>";

 
		}
}


		}
}


Zeile 502Zeile 516
			// Moderated post
$lang->redirect_newreply .= '<br />'.$lang->redirect_newreply_moderation;
$url = get_thread_link($tid);

			// Moderated post
$lang->redirect_newreply .= '<br />'.$lang->redirect_newreply_moderation;
$url = get_thread_link($tid);

		}


		}


		// Mark any quoted posts so they're no longer selected - attempts to maintain those which weren't selected
if($mybb->input['quoted_ids'] && $mybb->cookies['multiquote'] && $mybb->settings['multiquote'] != 0)
{

		// Mark any quoted posts so they're no longer selected - attempts to maintain those which weren't selected
if($mybb->input['quoted_ids'] && $mybb->cookies['multiquote'] && $mybb->settings['multiquote'] != 0)
{

Zeile 526Zeile 540
						{
unset($multiquote[$key]);
}

						{
unset($multiquote[$key]);
}

					}

					}

					// Still have an array - set the new cookie
if(is_array($multiquote))
{

					// Still have an array - set the new cookie
if(is_array($multiquote))
{

Zeile 549Zeile 563
		{
// Visible post
if($visible == 1)

		{
// Visible post
if($visible == 1)

			{

			{

				// Set post counter
if($ismod == true)
{

				// Set post counter
if($ismod == true)
{

Zeile 646Zeile 660
		}
else
{

		}
else
{

			$lang->redirect_newreply .= $lang->sprintf($lang->redirect_return_forum, get_forum_link($fid)); 

			$lang->redirect_newreply .= $lang->sprintf($lang->redirect_return_thread, get_forum_link($fid)); 

			redirect($url, $lang->redirect_newreply); 
exit;
}

			redirect($url, $lang->redirect_newreply); 
exit;
}

Zeile 826Zeile 840
		else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";

		else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";

		}
}

		}
}


if($forum['allowpicons'] != 0)


if($forum['allowpicons'] != 0)

	{

	{

		$posticons = get_post_icons();

		$posticons = get_post_icons();

	}

	}


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


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





	// Preview a post that was written.
if($mybb->input['previewpost'])
{

	// Preview a post that was written.
if($mybb->input['previewpost'])
{

Zeile 862Zeile 876
		);

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

		);

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

		{

		{

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


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


Zeile 919Zeile 933
			$post['dateline'] = TIME_NOW;
$post['includesig'] = $mybb->input['postoptions']['signature'];
if($post['includesig'] != 1)

			$post['dateline'] = TIME_NOW;
$post['includesig'] = $mybb->input['postoptions']['signature'];
if($post['includesig'] != 1)

			{

			{

				$post['includesig'] = 0;

				$post['includesig'] = 0;

			}

			}

	
// Fetch attachments assigned to this post.
if($mybb->input['pid'])

	
// Fetch attachments assigned to this post.
if($mybb->input['pid'])

			{

			{

				$attachwhere = "pid='".intval($mybb->input['pid'])."'";
}
else
{
$attachwhere = "posthash='".$db->escape_string($mybb->input['posthash'])."'";

				$attachwhere = "pid='".intval($mybb->input['pid'])."'";
}
else
{
$attachwhere = "posthash='".$db->escape_string($mybb->input['posthash'])."'";

			}

			}

	
$query = $db->simple_select("attachments", "*", $attachwhere);
while($attachment = $db->fetch_array($query))

	
$query = $db->simple_select("attachments", "*", $attachwhere);
while($attachment = $db->fetch_array($query))

Zeile 954Zeile 968
	if(!$mybb->input['posthash'] && $mybb->input['action'] != "editdraft")
{
$posthash = md5($mybb->user['uid'].random_str());

	if(!$mybb->input['posthash'] && $mybb->input['action'] != "editdraft")
{
$posthash = md5($mybb->user['uid'].random_str());

	}

	}

	elseif($mybb->input['action'] == "editdraft")
{
// Drafts have posthashes, too...

	elseif($mybb->input['action'] == "editdraft")
{
// Drafts have posthashes, too...

Zeile 978Zeile 992
		if($mybb->input['action'] == "editdraft" && $mybb->input['pid'])
{
$attachwhere = "pid='$pid'";

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

		}

		}

		else
{
$attachwhere = "posthash='".$db->escape_string($posthash)."'";

		else
{
$attachwhere = "posthash='".$db->escape_string($posthash)."'";

Zeile 989Zeile 1003
		{
$attachment['size'] = get_friendly_size($attachment['filesize']);
$attachment['icon'] = get_attachment_icon(get_extension($attachment['filename']));

		{
$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))
{

			
if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && (!$mybb->user['uid'] || $mybb->user['showcodebuttons'] != 0))
{

Zeile 1012Zeile 1027
			$noshowattach = 1;
}
if($mybb->usergroup['attachquota'] == 0)

			$noshowattach = 1;
}
if($mybb->usergroup['attachquota'] == 0)

		{

		{

			$friendlyquota = $lang->unlimited;

			$friendlyquota = $lang->unlimited;

		}

		}

		else
{
$friendlyquota = get_friendly_size($mybb->usergroup['attachquota']*1024);

		else
{
$friendlyquota = get_friendly_size($mybb->usergroup['attachquota']*1024);

Zeile 1024Zeile 1039
		if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach)
{
eval("\$newattach = \"".$templates->get("post_attachments_new")."\";");

		if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach)
{
eval("\$newattach = \"".$templates->get("post_attachments_new")."\";");

		}

		}

		eval("\$attachbox = \"".$templates->get("post_attachments")."\";");

		eval("\$attachbox = \"".$templates->get("post_attachments")."\";");

	}


	}


	// If the user is logged in, provide a save draft button.
if($mybb->user['uid'])
{

	// If the user is logged in, provide a save draft button.
if($mybb->user['uid'])
{

Zeile 1035Zeile 1050
	}

// Show captcha image for guests if enabled

	}

// Show captcha image for guests if enabled

	if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])
{

	if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
{

		$correct = false;

		$correct = false;

		// If previewing a post - check their current captcha input - if correct, hide the captcha input area


		require_once MYBB_ROOT.'inc/class_captcha.php';


		if($mybb->input['previewpost'] || $hide_captcha == true)

		if($mybb->input['previewpost'] || $hide_captcha == true)

		{
$imagehash = $db->escape_string($mybb->input['imagehash']);
$imagestring = $db->escape_string($mybb->input['imagestring']);
$query = $db->simple_select("captcha", "*", "imagehash='$imagehash' AND imagestring='$imagestring'");
$imgcheck = $db->fetch_array($query);
if($imgcheck['dateline'] > 0)
{
eval("\$captcha = \"".$templates->get("post_captcha_hidden")."\";");
$correct = true;
}
else
{
$db->delete_query("captcha", "imagehash='$imagehash'");

		{
// If previewing a post - check their current captcha input - if correct, hide the captcha input area
$post_captcha = new captcha;

if($post_captcha->validate_captcha() == true)
{
$correct = true;

// Generate a hidden list of items for our captcha
$captcha = $post_captcha->build_hidden_captcha();




			}
}

			}
}

 


		if(!$correct)
{

		if(!$correct)
{

			$randomstr = random_str(5);
$imagehash = md5(random_str(12));
$imagearray = array(
"imagehash" => $imagehash,
"imagestring" => $randomstr,
"dateline" => TIME_NOW
);
$db->insert_query("captcha", $imagearray);
eval("\$captcha = \"".$templates->get("post_captcha")."\";");

			$post_captcha = new captcha(true, "post_captcha");

if($post_captcha->html)
{
$captcha = $post_captcha->html;
}




		}
}


		}
}


Zeile 1098Zeile 1109
		while($post = $db->fetch_array($query))
{
$pidin[] = $post['pid'];

		while($post = $db->fetch_array($query))
{
$pidin[] = $post['pid'];

		}

		}


$pidin = implode(",", $pidin);



$pidin = implode(",", $pidin);


Zeile 1121Zeile 1132
		while($post = $db->fetch_array($query))
{
if($post['userusername'])

		while($post = $db->fetch_array($query))
{
if($post['userusername'])

			{

			{

				$post['username'] = $post['userusername'];
}
$reviewpostdate = my_date($mybb->settings['dateformat'], $post['dateline']);

				$post['username'] = $post['userusername'];
}
$reviewpostdate = my_date($mybb->settings['dateformat'], $post['dateline']);

Zeile 1143Zeile 1154
			if($post['visible'] != 1)
{
$altbg = "trow_shaded";

			if($post['visible'] != 1)
{
$altbg = "trow_shaded";

			}


			}


			$post['message'] = $parser->parse_message($post['message'], $parser_options);
get_post_attachments($post['pid'], $post);
$reviewmessage = $post['message'];

			$post['message'] = $parser->parse_message($post['message'], $parser_options);
get_post_attachments($post['pid'], $post);
$reviewmessage = $post['message'];

Zeile 1190Zeile 1201
		else
{
$closecheck = '';

		else
{
$closecheck = '';

		}

		}


if($stuck)
{


if($stuck)
{

Zeile 1214Zeile 1225
	
$lang->post_reply_to = $lang->sprintf($lang->post_reply_to, $thread['subject']);
$lang->reply_to = $lang->sprintf($lang->reply_to, $thread['subject']);

	
$lang->post_reply_to = $lang->sprintf($lang->post_reply_to, $thread['subject']);
$lang->reply_to = $lang->sprintf($lang->reply_to, $thread['subject']);

 

// Do we have any forum rules to show for this forum?
$forumrules = '';
if($forum['rulestype'] >= 2 && $forum['rules'])
{
if(!$forum['rulestitle'])
{
$forum['rulestitle'] = $lang->sprintf($lang->forum_rules, $forum['name']);
}

if(!$parser)
{
require_once MYBB_ROOT.'inc/class_parser.php';
$parser = new postParser;
}

$rules_parser = array(
"allow_html" => 1,
"allow_mycode" => 1,
"allow_smilies" => 1,
"allow_imgcode" => 1
);

$forum['rules'] = $parser->parse_message($forum['rules'], $rules_parser);
$foruminfo = $forum;

if($forum['rulestype'] == 3)
{
eval("\$forumrules = \"".$templates->get("forumdisplay_rules")."\";");
}
else if($forum['rulestype'] == 2)
{
eval("\$forumrules = \"".$templates->get("forumdisplay_rules_link")."\";");
}
}


$plugins->run_hooks("newreply_end");



$plugins->run_hooks("newreply_end");