PDA

View Full Version : How put PHP into templates or work around?


Rireal
02-13-2005, 10:58 PM
After playing with this all day I've decided to ask for help.
I've used this (https://vborg.vbsupport.ru/showthread.php?t=62164) hack to create the page I'm working with. The following code is in the PHP file and I want it to execute every time the page is accessed.

if ($bbuserinfo['userid']!=0)
{
$username=$bbuserinfo['username'];

if ($bbuserinfo['usergroupid']==10 || $bbuserinfo['usergroupid']==5 || $bbuserinfo['usergroupid']==7 || $bbuserinfo['usergroupid']==6 || $bbuserinfo['usergroupid']==9)
{
include("up.php");
}
else
{
include("noup.php");
}
}
else
{
include("loginrequired.php");
}
I know that this executes before the template gets called and HTML written but it's the best way I can visualize. I basically just need help integrating the PHP file with the vB template. The script that's called when the conditions are met is an upload script that calls itself during operation and I'm just not sure how to get the seemingly two different files (php and template) to work as one with it. If there is a way to put the PHP in the template that would be ideal, but I haven't figured out how to yet.
I do realize that this is kind of vague so please ask if you're not sure what I'm asking for.
Thanks in advance
Rireal

edit: Easily put, how do I put the above code in an actual vB template.

Dean C
02-14-2005, 07:32 AM
You can't, but take a look in the modifications hints & tips forum on how to do it in a different way :) You should be looking for a phpinclude tutorial. phpinclude_start and phpinclude_end are the only templates where you can place raw PHP into. So do so with care ;)