Page in question.... everything works nice except for links to private message, navbar stuff, etc.
http://www.squirrelpf.com/gearingcalc/index.php
Thanks for the help!
My template called TEST
PHP 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">$page_title</td>
</tr>
<tr>
<td class="alt1">$page_content</td>
</tr>
</table>
$footer
</body>
</html>
My PHP file....
PHP Code:
<?php
$page_title = 'Gearing/MPH Calculator';
$page_content = '<div id="content" style="background-image: url(\'gear_bg.jpg\');background-position: 325px 1px;background-repeat: no-repeat;">
<form method="post" action="index.php">';
if ($submit == "Submit Gears")
{
$page_content .= '
<table style="clear:left;padding:3px;text-align:right;border: 1px solid black;margin:10px;">
<tr style="font-weight:bold;"><td></td><td>Gearing</td><td>Max MPH</td><td></tr> ';
if ($final_drive2 != 0 AND $final_drive2 !="")
{
$final_drive = $final_drive2;
}
$wheel_rate = $tire_size * 3.1416 / 63360 * 60;
if ($first_gear != 0)
{
$first_mph = (1 - $tc_slip/100) * $redline / $final_drive * $wheel_rate / $first_gear;
$page_content .= '<tr><td>1st</td><td>' . round($first_gear, 2) . '</td><td>' . round($first_mph, 0) . '</td></tr>';
}
if ($second_gear != 0)
{
$second_mph = (1 - $tc_slip/100) * $redline / $final_drive * $wheel_rate / $second_gear;
$page_content .= '<tr><td>2nd </td><td>' . round($second_gear, 2) . '</td><td>' . round($second_mph, 0) . '</td></tr>';
}
if ($third_gear != 0)
{
$third_mph = (1 - $tc_slip/100) * $redline / $final_drive * $wheel_rate / $third_gear;
$page_content .= '<tr><td>3rd</td><td>' . round($third_gear, 2) . '</td><td>' . round($third_mph, 0) . '</td></tr>';
}
if ($fourth_gear != 0)
{
$fourth_mph = (1 - $tc_slip/100) * $redline / $final_drive * $wheel_rate / $fourth_gear;
$page_content .= '<tr><td>4th</td><td>' . round($fourth_gear, 2) . '</td><td>' . round($fourth_mph, 0) . '</td></tr>';
}
if ($fifth_gear != 0)
{
$fifth_mph = (1 - $tc_slip/100) * $redline / $final_drive * $wheel_rate / $fifth_gear;
$page_content .= '<tr><td>5th</td><td>' . round($fifth_gear, 2) . '</td><td>' . round($fifth_mph, 0) . '</td></tr>';
}
if ($sixth_gear != 0)
{
$sixth_mph = (1 - $tc_slip/100) * $redline / $final_drive * $wheel_rate / $sixth_gear;
$page_content .= '<tr><td>6th gear</td><td>' . round($sixth_gear, 2) . '</td><td>' . round($sixth_mph, 0) . '</td></tr>';
}
$page_content .= '
</table> <input type="submit" id="user-inputs" name="submit" value="Reset" style="margin: 10px;">
<br /><br />
<hr />
<h3>Further Info...</h3>
<p>Thanks for using the Gearing Calculator! This is based on my original work which can be downloaded as an excel spreadsheet <a href="gearing.xls">here</a>. Be advised that it is no longer supported and has some annoying bugs. This new version has many new benifits - no longer requires excel, has less features, and allows for custom inputs.</p>
<p>I have also included a tire size calculator to make life easier and can be found <a href="tirecalc.php" onclick="return popitup(\'tirecalc.php\')">here</a>. You can also e-mail me transmission setups to be included in the drop down list. Just use the contact link below!</p>
<h3>To Do\'s</h3>
<p>I am going to stream line the code sometime in the near future, so that the tranny information is more dynamic. AKA, only show fields which have data, and allow more then 2 final drives per group.</p>
<br /><br />';
}
elseif ($submit == "Submit Gearbox")
{
if ($gearbox == "custom")
{
$page_content .= '
<h3>Enter you gears:</h3>
<span id="gear_spans">1st Gear: <input id="user-inputs" type="text" name="first_gear" size="5"></span>
<span id="gear_spans">2nd Gear: <input id="user-inputs" type="text" name="second_gear" size="5"></span>
<span id="gear_spans">3rd Gear: <input id="user-inputs" type="text" name="third_gear" size="5"></span><br /><br />
<span id="gear_spans">4th Gear: <input id="user-inputs" type="text" name="fourth_gear" size="5"></span>
<span id="gear_spans">5th Gear: <input id="user-inputs" type="text" name="fifth_gear" size="5"></span>
<span id="gear_spans">6th Gear: <input id="user-inputs" type="text" name="six_gear" size="5"></span> <br /><br />
<span id="gear_spans">Final Drive: <input id="user-inputs" type="text" name="final_drive" size="5"></span> <br /><br /><br />
<h3>Enter Conditions</h3>
<span id="gear_spans">Redline: <input id="user-inputs" type="text" name="redline" size="5"></span>
<span id="gear_spans">TC Slip (%): <input id="user-inputs" type="text" name="tc_slip" size="5"></span>
<span id="gear_spans">Tire Size (in): <input id="user-inputs" type="text" name="tire_size" size="5"></span>
<a href="tirecalc.php" onclick="return popitup(\'tirecalc.php\')">Click for Tire Calc...</a> <br /><br />
<input type="submit" id="user-inputs" name="submit" value="Submit Gears">
<input type="submit" id="user-inputs" name="submit" value="Reset">';
}
else
{
require('/var/www/vhosts/squirrelpf.com/httpdocs/gearingcalc/gear_data.php');
$current_gear = $gears[$gearbox];
$current_fd = $fd[$gearbox];
$page_content .= '
<h3>Review your gears:</h3>
<span id="gear_spans">1st Gear: <input id="user-inputs" type="text" name="first_gear" value="' . $current_gear['1st'] . '" size="5"></span>
<span id="gear_spans">2nd Gear: <input id="user-inputs" type="text" name="second_gear" value="' . $current_gear['2nd'] . '" size="5"></span>
<span id="gear_spans">3rd Gear: <input id="user-inputs" type="text" name="third_gear" value="' . $current_gear['3rd'] . '" size="5"></span><br /><br />
<span id="gear_spans">4th Gear: <input id="user-inputs" type="text" name="fourth_gear" value="' . $current_gear['4th'] . '" size="5"></span>
<span id="gear_spans">5th Gear: <input id="user-inputs" type="text" name="fifth_gear" value="' . $current_gear['5th'] . '" size="5"></span>
<span id="gear_spans">6th Gear: <input id="user-inputs" type="text" name="sixth_gear" value="' . $current_gear['6th'] . '" size="5"></span> <br /><br />
<span id="gear_spans">Final Drive: <select id="user-inputs" name="final_drive"><option value="' . $current_fd['Opt1'] . '">' . $current_fd['Opt1'] . '</option><option value="' . $current_fd['Opt2'] . '">' . $current_fd['Opt2'] . '</option></select></span>
<span id="gear_spans">or Custom FD:<input id="user-inputs" type="text" name="final_drive2" size="5"></span> <br /><br /><br />
<h3>Enter Conditions</h3>
<span id="gear_spans">Redline: <input id="user-inputs" type="text" name="redline" size="5"></span>
<span id="gear_spans">TC Slip (%): <input id="user-inputs" type="text" name="tc_slip" size="5"></span>
<span id="gear_spans">Tire Size (in): <input id="user-inputs" type="text" name="tire_size" size="5"></span>
<a href="tirecalc.php" onclick="return popitup(\'tirecalc.php\')">Click for Tire Calc...</a> <br /><br />
<input type="submit" id="user-inputs" name="submit" value="Submit Gears">
<input type="submit" id="user-inputs" name="submit" value="Reset"> ';
}
}
elseif ($submit == "" OR $submit =="Reset")
{
$page_content .= '
<h3>Select your gearbox:</h3>
<select id="user-inputs" name="gearbox">
<option value="custom">Enter your custom gearing, OR</option>
<option value="a413-1">Dodge A-413/670 Group 1 (2.60 & 2.78)</option>
<option value="a413-2">Dodge A-413/670 Group 2 (3.02 & 3.22)</option>
<option value="a413-3">Dodge A-413/670 Group 3 (3.50 & 3.72)</option>
<option value="a460">Dodge A-460</option>
<option value="a465">Dodge A-465</option>
<option value="a520">Dodge A-520</option>
<option value="a523-1">Dodge A-523 (90-91)</option>
<option value="a523-2">Dodge A-523 (92)</option>
<option value="a525">Dodge A-525</option>
<option value="a543-1">Dodge A-543 (90-91)</option>
<option value="a543-2">Dodge A-543 (92)</option>
<option value="a555">Dodge A-555</option>
<option value="a568-1">Dodge A-568 (90-91)</option>
<option value="a568-2">Dodge A-568 (92)</option>
<option value="a604">Dodge A-604 (all)</option>
</select> <br /><br />
<input type="submit" id="user-inputs" name="submit" value="Submit Gearbox">
<br /><br />
<hr />
<h3>Further Info...</h3>
<p>Thanks for using the Gearing Calculator! This is based on my original work which can be downloaded as an excel spreadsheet <a href="gearing.xls">here</a>. Be advised that it is no longer supported and has some annoying bugs. This new version has many new benifits - no longer requires excel, has less features, and allows for custom inputs.</p>
<p>I have also included a tire size calculator to make life easier and can be found <a href="tirecalc.php" onclick="return popitup(\'tirecalc.php\')">here</a>. You can also e-mail me transmission setups to be included in the drop down list. Just use the contact link below!</p>
<h3>To Do\'s</h3>
<p>I am going to stream line the code sometime in the near future, so that the tranny information is more dynamic. AKA, only show fields which have data, and allow more then 2 final drives per group.</p>
<br /><br />';
}
$page_content .= '</div></form>';
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'test.php'); // 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(
'TEST',
);
// pre-cache templates used by specific actions
$actiontemplates = array(
);
chdir('/var/www/vhosts/squirrelpf.com/httpdocs/forums');
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$navbits = array();
$navbits[$parent] = $page_title;
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('TEST') . '");');
?>