Hi guys,
I've been writing a Quarter-Mile table for my forum. I know this has already been done but the existing one i found on here was aimed mainly at pro's by the looks of things i just wanted something really basic so i wrote my own.
Everything works except for some reason I dont have a forum nav bar at the top of the page (the php and template code looks identical to my 2nd page which has the navbar). I was wondering if someone could look over my code to see if they could see anywhere i've gone wrong as this is driving me totally nuts now.
Template
HTML Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header
$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat"><div align="center">Performance Xtreme Quarter-mile times</div></td>
</tr>
<tr>
<td class="alt1">Welcome to the new Quarter-Mile section of PerformanceXtreme, this is where you can see quarter-mile times for our members cars.<if condition="$bbuserinfo[username] =='Unregistered'"> Only registered members of PerformanceXtreme can add their car's time to the table, if you would like to add yours please login or register, registering only takes a few minutes and is totally free.</if></td>
</tr>
</table>
<br />
<br />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="1" width="90%" align="center">
<td class="thead" align="center"> Username </td><td class="thead" align="center"> Car </td><td class="thead" align="center"> Reaction Time </td><td class="thead" align="center"> Quarter-Mile Time </td><td class="thead" align="center"> Terminal Speed </td>
$mydatabits
</table>
<br />
<br />
<if condition="$bbuserinfo[username] !='Unregistered'">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="1" width="70%" align="center">
<tr>
<td class="tcat"><div align="center">Submit your time <if condition="is_member_of($bbuserinfo, 6)"> - Administrator functions</if>
</div></td>
</tr><tr><td>
<table>
<form action="submittime.php" method="get">
<tr><td><div align="right">Reaction Time </div></td><td><input type="text" class="bginput" name="reactiontime" /></td><td> To 3 decimal places, Example: 1.123 </td></tr>
<tr><td><div align="right">Quarter Mile Time </div></td><td><input type="text" class="bginput" name="quarter" /></td><td> To 2 decimal places, Example 12.34 </td></tr>
<tr><td><div align="right">Terminal Speed (MPH) </div></td><td><input type="text" class="bginput" name="maxspeed" /></td><td> To 2 decimal places, Example 120.21</td></tr>
<if condition="is_member_of($bbuserinfo, 6)">
<tr><td><div align="right">Delete User from table </div></td><td><input type="text" class="bginput" name="deluser" /></td></tr>
</if>
<tr><td></td><td>
<input type="submit" class="button" value="Submit" /></td></tr>
</form>
</table></td></tr>
<tr><td><strong>Please remember if your terminal speed is less than 100MPH you will need to add a leading zero <i> i.e. 090.12 </i></strong></td></tr></table></if>
<if condition="$bbuserinfo[username] =='Unregistered'">
<div align="center">If you want to submit your car in the Quarter Mile table then please either log-in or <strong><a href="http://www.performancextreme.com/forums/register.php">Register</a><strong></div>
</if>
$footer
</body>
</html>
PHP file
PHP Code:
<?php
error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'quartermile');
// get special phrase groups
$phrasegroups = array(
);
$specialtemplates = array(
);
$globaltemplates = array(
'Quartermile_table',
);
$actiontemplates = array(
);
require_once('./global.php');
$mydatabits = '';
$result = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "quartermile");
while ($myrow =$db->fetch_array($result))
{
eval('$mydatabits .= "' . fetch_template('mydatabit') . '";');
}
eval('print_output("' . fetch_template('Quartermile') . '");');
//Above the values read from the database
$navbits = array();
$navbits[$parent] = 'Submit Quarter Mile time';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('Quartermile_table') . '");');
?>
If anyone can spot anything obviously wrong with this then i'd be greatly appreciative as it's the only thing holding me back from adding it to my site.
Like i mentioned before as far as i can tell the code is identical to that of the other page (navbar and template wise) and that page displays the navbar :ermm:
Thanks