MyBB Community Forums

Full Version: Condition (<if></if>) in template with var PHP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have simple question. Imagine I have a var "$adminlevel" (in php), how I can create a condition for a template. For exemple :

<if $adminlevel == 1>
<b>blablabla</b>
</if>

I search to correct my code, thanks you.
you can use template conditionals plugin (required usage details available there on the plugin thread)
Is not integrated in MyBB ?
(2016-01-10, 07:06 PM)MrAlexisX2 Wrote: [ -> ]Is not integrated in MyBB ?

No and among other things.

.M. suggested a great plugin that works as you need. Big Grin
Thanks you for answer.

When I activate the plugin, I have a PHP ERROR :

( ! ) Parse error: syntax error, unexpected ')' in C:\wamp\www\forum\global.php(506) : eval()'d code on line 35

Line 35 (global.php) :
if(!defined('THIS_SCRIPT'))
{
	define('THIS_SCRIPT', '');
}

Line 506 (global.php) :
	eval('$welcomeblock = "'.$templates->get('header_welcomeblock_member').'";');
There is an unexpected ) in the template header_welcomeblock_member on line 35 (even the error message says that Smile).