vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   What am I doing wrong? (https://vborg.vbsupport.ru/showthread.php?t=129811)

fkatzenb 10-23-2006 11:21 PM

What am I doing wrong?
 
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 != AND $final_drive2 !="")
        {
         
$final_drive $final_drive2;
          }

     
$wheel_rate =  $tire_size 3.1416 63360 60;

     if (
$first_gear != 0)
         { 
         
$first_mph =  ($tc_slip/100) * $redline $final_drive $wheel_rate $first_gear
         
$page_content .=  '<tr><td>1st</td><td>' round($first_gear2) . '</td><td>' round($first_mph0) . '</td></tr>';
        }
     if (
$second_gear != 0)
         { 
         
$second_mph =  ($tc_slip/100) * $redline $final_drive $wheel_rate $second_gear;
         
$page_content .=  '<tr><td>2nd </td><td>' round($second_gear2) . '</td><td>' round($second_mph0) . '</td></tr>';
        }
     if (
$third_gear != 0)
         { 
         
$third_mph =  ($tc_slip/100) * $redline $final_drive $wheel_rate $third_gear;
         
$page_content .=  '<tr><td>3rd</td><td>' round($third_gear2) . '</td><td>' round($third_mph0) . '</td></tr>';
        }
     if (
$fourth_gear != 0)
         {
         
$fourth_mph = ($tc_slip/100) * $redline $final_drive $wheel_rate $fourth_gear;
         
$page_content .=  '<tr><td>4th</td><td>' round($fourth_gear2) . '</td><td>' round($fourth_mph0) . '</td></tr>';
        }
     if (
$fifth_gear != 0)
         { 
         
$fifth_mph =  ($tc_slip/100) * $redline $final_drive $wheel_rate $fifth_gear;
         
$page_content .=  '<tr><td>5th</td><td>' round($fifth_gear2) . '</td><td>' round($fifth_mph0) . '</td></tr>';
        }
     if (
$sixth_gear != 0)
         { 
         
$sixth_mph =  ($tc_slip/100) * $redline $final_drive $wheel_rate $sixth_gear;
         
$page_content .=  '<tr><td>6th gear</td><td>' round($sixth_gear2) . '</td><td>' round($sixth_mph0) . '</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') . '");');

?>


sebbe 10-24-2006 01:49 AM

Shouldn't this
PHP Code:

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''test.php'); // change this depending on your filename 

be

PHP Code:

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''index.php'); // change this depending on your filename 

instead? Maybe will not solve your problem but.. :bored:

fkatzenb 10-24-2006 09:10 AM

Thanks for catching that, but it didnt fix it.

ZacUSNYR 10-24-2006 10:10 AM

All your links in the navbar are relative to forum root - you're putting this file in a subdirectory.

fkatzenb 10-24-2006 11:07 AM

I figured that much out. How do I fix it? It is implied in the tutorials that this can be done, and links will be ok.

ZacUSNYR 10-24-2006 11:12 AM

Unless you put it in a sub directory heh.

It sounds like you're rather new to all this - why can't you name the file gearingcalc.php and place it in forum root?

sebbe 10-24-2006 12:08 PM

Here's what you're looking for
https://vborg.vbsupport.ru/showpost....&postcount=125

fkatzenb 10-24-2006 03:24 PM

Quote:

Originally Posted by ZacUSNYR
Unless you put it in a sub directory heh.

It sounds like you're rather new to all this - why can't you name the file gearingcalc.php and place it in forum root?

I wanted too, however these tools are spread/linked all over the internet, and I didnt want to break the links, etc. Not new per say, but stubborn.


Frank

Quote:

Originally Posted by sebbe

Giving it a try now. Thanks for the link.

Ended up using this...

PHP Code:

$vboptions[bburl]/ 



All times are GMT. The time now is 04:12 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02272 seconds
  • Memory Usage 1,845KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete