Dr.CustUmz
11-29-2020, 04:44 PM
I want to create say an additional html option, and allow template conditionals within this option. The html renders fine, but template conditionals are not being rendered.
Is there a way to use template conditionals within an option?
I know I can just create a template and do this in a template, there's just so much more to this I would like to be able to achieve this desired outcome.
A made up example of what's not related to what I'm actually doing:
Option - Additional header block on forumhome.
Contents of option:
<if condition="$bbuserinfo['userid'] == 1">Admin<else />Member</if>
Then in the template I would use $vboptions[add_header]
--------------- Added 1606676541 at 1606676541 ---------------
UPDATE
This seems to work, OCCASSIONLY Sometimes I get an error
require_once(DIR . '/includes/adminfunctions_template.php');
eval('$result = "' . compile_template($vboptions['add_header']) . '" ;');
error:
PHP Fatal error: Cannot redeclare array_trim() (previously declared in C:\wamp\www\includes\adminfunctions_template.p.... .
still working on it if anyone else can help.
Is there a way to use template conditionals within an option?
I know I can just create a template and do this in a template, there's just so much more to this I would like to be able to achieve this desired outcome.
A made up example of what's not related to what I'm actually doing:
Option - Additional header block on forumhome.
Contents of option:
<if condition="$bbuserinfo['userid'] == 1">Admin<else />Member</if>
Then in the template I would use $vboptions[add_header]
--------------- Added 1606676541 at 1606676541 ---------------
UPDATE
This seems to work, OCCASSIONLY Sometimes I get an error
require_once(DIR . '/includes/adminfunctions_template.php');
eval('$result = "' . compile_template($vboptions['add_header']) . '" ;');
error:
PHP Fatal error: Cannot redeclare array_trim() (previously declared in C:\wamp\www\includes\adminfunctions_template.p.... .
still working on it if anyone else can help.