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("#<\?*?)\?>#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:
	PHP Code….
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.