Quote:
does anyone know what code i would need to put exactly on the home page? and then again what code would i need to put in the global.php file?
|
Nothing should be inserted into your global.php file unless told to do so by a member of staff at
www.vbulletin.com as part of a support issue.
Quote:
i think i'm not understanding exactly where to put that code you gave me....and then on top of that....what i would need to do to 'set the PHP environment'
|
When you're creating a vBulletin-powered page, it requires a PHP file to get it up and running if you want to include user accounts, etc. There are many articles available to do this, including this one
here. I firmly suggest reading over that particular article to get a feel for using vBulletin PHP.
Here is how a standard vBulletin-powered page should look (this one is called test.php, taken from the article posted above):
PHP Code:
<?php
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
// change the line below to the actual filename without ".php" extention.
// the reason for using actual filename without extention as a value of this constant is to ensure uniqueness of the value throughout every PHP file of any given vBulletin installation.
define('THIS_SCRIPT', 'test');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array(
// change the lines below to the list of actual templates used in the script
'test_mytesttemplate1',
'test_mytesttemplate22',
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once('./global.php');
// #################### HARD CODE JAVASCRIPT PATHS ########################
$headinclude = str_replace('clientscript', $vbulletin->options['bburl'] . '/clientscript', $headinclude);
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
$navbits = array();
// change the line below to contain whatever you want to show in the navbar (title of your custom page)
$navbits[$parent] = 'Test Page';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
// change the line below to contain the name of the actual main output template used in your script
eval('print_output("' . fetch_template('test_mytesttemplate1') . '");');
?>
Do you see how he's inserted his global.php file? That's what you need to do. Then you can use variables such as: $username, $bbuserinfo[userid], etc.