MyBB Community Forums

Full Version: php in templates?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How come php written in templates does not display? I need to include a page in my profile pages. Help me!
You cannot use php in templates, only variables, you need to check it in an php file then use the variable in the template.
What do you mean?
Put the code into the "member.php" (somewhere near the top is best) but make sure it is below the include and require statements and not in between any conditionals.

The simply go to the member_profile template and put in the variables you have set in the actual file.
So I have to make the code into a variable? How?
try:
ob_start();
include('yourfile.php');
$myfile_output = ob_get_clean();

And use $myfile_output in the template.
This just messed the members.php file up:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/gamers00/public_html/forums/member.php(1435) : eval()'d code on line 33
Sad
Now I need to fix this error and the variable thing
SOmeone help me!
Can you please post your code or attach your member.php?
Here is the members.php file
Post your template too.
Pages: 1 2