Do this:
Create a file titled "vbglobal.php" with the following contents and upload it to your public_html directory. Make sure to edit the value of
$forumpath to the absolute forum path.
PHP Code:
<?php
/* ################################################################ *\
Created By: Ken Iovino
Email: KenIovino@gmail.com
--
Copyright ?2007 iVino, Inc. All Rights Reserved.
This file may not be redistributed in whole or significant part.
\* ################################################################ */
// enter the absolute forum path. (Use ending slash!)
$forumpath = "/home/name/public_html/forum/";
// move to vBulletin directory
chdir($forumpath);
// require vBulletin's core file
require_once($forumpath . 'global.php');
// bass CSS infomation
$basecss = "<base href=\"" . $vbulletin->options['bburl'] . "/\">";
?>
Then anytime you create a new file in the public_html directory, you could use this:
PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'scriptname');
// ################### 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();
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once('./vbglobal.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('template_name_here') . '");');
?>
Make sure to edit the "template_name_here" to the template you want to use. Hope this helps.
Here is a quick default template:
HTML Code:
$stylevar['htmldoctype']
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<!-- end no cache headers -->
$basecss
$headinclude
<title>Your Title</title>
</head>
<body>
$header
$navbar
my code here
$footer
</body>
</html>
Having the $basecss in place insures that all your links "should" point to the correct path.
- Ken Iovino