I have the following PHP code:
Code:
<?
require_once('./api/class.api.php');
require_once('./api/class.charselect.php');
$api = new Api();
$api->debug(false);
$api->cache(false);
$api->setCredentials($apiuser,$apipass);
$uchars = $api->getCharacters();
$chars = CharSelect::getCharacters($uchars);
$apichar = $chars[0]['charname'];
$api->setCredentials($apiuser,$apipass,$apichar);
?>
I need to use this, and several more $api->getSomeInfo calls, in a new template I've created. I've got the template and php file and a link to it in the footer bar all working, I just need to know where to put this code, so that it will run when the page is accessed and so I can call the $api functions as needed from the template. Or should I run this in the php file itself and grab everything it might need, then just have the template display the requested parts? Also, if will need <if condition=$bbuserinfo[fieldX]> stuff, and I've read that doesn't work well outside of the template. Does that mean that I _can't_ put the code into the php file?