You're placing $navbits
after processing them. Secondly your titles are pretending to be constants, instead of a string:
Code:
$navbits[''] = Donate;
Should be:
Code:
$navbits[''] = 'Donate';
This should work for you, and will make adding pages to the script easier:
Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'others'); // change this depending on your filename
// ################### 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(
'rules',
'donate',
'livescore',
);
// pre-cache templates used by specific actions
$actiontemplates = array(
);
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
// ############################### Process Page ###############################
$valid_pages = array(
'rules' => 'Rules',
'donate' => 'Donate',
'livescore' => 'Live Score',
);
if ($page = $valid_pages[$_REQUEST['do']])
{
$navbits[''] = $page;
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template($_REQUEST['do']) . '");');
}
// #############################################################################
// #############################################################################
// #############################################################################
?>
Simply edit this to add a new page:
Code:
$valid_pages = array(
'rules' => 'Rules',
'donate' => 'Donate',
'livescore' => 'Live Score',
);
The first bit is the name of the template, the second bit is the page title, so if you had to add the page "Information" that used the template 'information', it would look like this:
Code:
$valid_pages = array(
'rules' => 'Rules',
'donate' => 'Donate',
'livescore' => 'Live Score',
'information' => 'Information',
);
Hope that helps