MyBB Community Forums

Full Version: can I disable certain mycode?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
Is is possible to disable certain mycode in my forum?
for example, i want to disable the "[code]" in the forum.

Thanks
Something like that would require a core edit to the parser class (or you could use the Patches plugin).

There is no other way that I know of to disable [code] tags.
hi,
thank you for reply.
changes to core file including only this inc/class_parser.php ??
In inc/class_parser.php change this:

		// If MyCode needs to be replaced, first filter out [code] and [php] tags.
		if($this->options['allow_mycode'])
		{
			preg_match_all("#\[(code|php)\](.*?)\[/\\1\](\r\n?|\n?)#si", $message, $code_matches, PREG_SET_ORDER);
			$message = preg_replace("#\[(code|php)\](.*?)\[/\\1\](\r\n?|\n?)#si", "<mybb-code>\n", $message);
		}

To this:

		// If MyCode needs to be replaced, first filter out [code] and [php] tags.
		if($this->options['allow_mycode'])
		{
			preg_match_all("#\[(php)\](.*?)\[/\\1\](\r\n?|\n?)#si", $message, $code_matches, PREG_SET_ORDER);
			$message = preg_replace("#\[(php)\](.*?)\[/\\1\](\r\n?|\n?)#si", "<mybb-code>\n", $message);
		}
thank you very much Wildcard
it works Smile
You're welcome. Glad to help. Smile