Do I need to use any globals to call up loadTemplate or not? The little voice in the back of my head says no, but who is to say the voice is right?
// Function Wizard: Loads the wizard template file
function wizard_popup ()
{
// Globals
global $smcFunc;
// this command loads the template file (wizard_popup.template.php)
loadTemplate('wizard_popup');
} // End of Function wizard bracket
Wiz
The file that holds loadTemplate() func its loaded on every instance of SMF, meaning you don't need to require any file to use it.
As per globals, that only affects variables, not functions, if you need to use some var like $context then you must globalize this var before you can use it.
So I don't need to use any globals and code should look like this -
// place this file in the Sources file
if (!defined('SMF'))
die('Hacking attempt...');
// Function Wizard: Loads the wizard template file
function wizard_popup ()
{
// this command loads the template file (wizard_popup.template.php)
loadTemplate('wizard_popup');
} // End of Function wizard bracket
yep, providing your file is been running inside SMF atmosphere, if you're gonna use your file as an external standalone one then requiring SSI.php before anything else should be enough.