Quote:
Originally Posted by Jakeman
Code:
<?php
// GO TO FORUM DIR
chdir('/full/path/to/forum/directory');
// STANDARD VBULLETIN STUFF
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'script_name');
require_once('./global.php');
// GENERIC_SHELL VARS
$pagetitle = "Title of Page";
$HTML = ""; // PIECED TOGETHER IN SCRIPT
eval('$HTML = "' . fetch_template('name of template') . '";');
eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');
?>
|
I've stripped my version of this code to:
Code:
<?php
// GO TO FORUM DIR
chdir('./forum');
// STANDARD VBULLETIN STUFF
define('NO_REGISTER_GLOBALS', 1);
//define('THIS_SCRIPT', 'script_name');
require_once('./global.php');
// GENERIC_SHELL VARS
$pagetitle = "Talk History Test";
$HTML = ""; // PIECED TOGETHER IN SCRIPT
eval('$HTML = "' . $bbuserinfo[username] . '";');
eval('print_output("' . $bbuserinfo[username]. '");');
?>
This is because I only want to get the username from the forum to display on an independent web page. However, it keeps on creating a new HTML page with the user's name. So, I'd like to be able to convert it into a function (called get_form_user() ) that I can call at any time to insert the name into text within my webpages.
Any ideas?