MyBB Community Forums

Full Version: Use php codes in templates...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Author: My-BB.Ir
1. Open inc/class_templates.php in an editor like Notepad++.
2. Find:
		$template = $this->cache[$title];
3.Replace with:
		$template = $this->cache[$title];
		while(preg_match("#<\?my-bb.ir(.*?)\?>#si", $template, $matches))
		{
			$x = $matches[0];
			$y = $matches[1];
			$z = eval($y);
			$template = str_replace($x, $z, $template);
		}
Now you can use php code in template:
<?my-bb.ir
	PHP Codeā€¦.
?>
Preview:
[attachment=27836]
[attachment=27837]
This looks very suspicious to me. Why have you encrypted the source multiple times?

Secondly, this is a very insecure thing to do. PHP is disabled in templates for a reason. In fact, you're opening security holes which weren't even there to start with.