MyBB Community Forums

Full Version: quote_body where?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I can't seem to get the quote_body class, I don't like the default quote_body from mybb and I would like to edit it. I can't seem to find the .css file for it.

Thanks.
Go into inc/functions_post.php and find where this:

function doquotes($message)
{
	global $lang;
	
	// user sanity check
	$pattern = array("#\[quote=(?:"|\"|')?(.*?)[\"']?(?:"|\"|')?\](.*?)\[\/quote\]#si",
					 "#\[quote\](.*?)\[\/quote\]#si");
	
	$replace = array("<div class=\"quote_header\">$1 $lang->wrote</div><div class=\"quote_body\">$2</div>",
					 "<div class=\"quote_header\">$lang->quote</div><div class=\"quote_body\">$1</div>\n");
	
	while (preg_match($pattern[0], $message) or preg_match($pattern[1], $message))
	{
		$message = preg_replace($pattern, $replace, $message);
	}
	$message = str_replace("<div class=\"quote_body\"><br />", "<div class=\"quote_body\">", $message);
	$message = str_replace("<br /></div>", "</div>", $message);
	// Remove [attachment=x] from quoted posts.
    	//$message = preg_replace("#\[attachment=([0-9]+?)\]#i", "", $message);
	return $message;
}


And change it to this:

function doquotes($message)
{
	global $lang;
	
	// user sanity check
	$pattern = array("#\[quote=(?:&quot;|\"|')?(.*?)[\"']?(?:&quot;|\"|')?\](.*?)\[\/quote\]#si",
					 "#\[quote\](.*?)\[\/quote\]#si");
	
	$replace = array("<div class=\"quote2_header\">$1 $lang->wrote</div><div class=\"quote2_body\">$2</div>",
					 "<div class=\"quote2_header\">$lang->quote</div><div class=\"quote2_body\">$1</div>\n");
	
	while (preg_match($pattern[0], $message) or preg_match($pattern[1], $message))
	{
		$message = preg_replace($pattern, $replace, $message);
	}
	$message = str_replace("<div class=\"quote2_body\"><br />", "<div class=\"quote2_body\">", $message);
	$message = str_replace("<br /></div>", "</div>", $message);
	// Remove [attachment=x] from quoted posts.
    	//$message = preg_replace("#\[attachment=([0-9]+?)\]#i", "", $message);
	return $message;
}

Now add "quote2_header" and "quote2_body" to the additional CSS section of your themes and modify the CSS as you wish. Smile


By the way, this is fixed in 1.2. Smile
Thanks.