- set proper SFIABDIRECTORY on all menu links (so they work from inside subdirs)

- add config directory, update config.inc.php
This commit is contained in:
james 2004-11-30 19:06:35 +00:00
parent efdf49d000
commit 86bad4961b
3 changed files with 21 additions and 14 deletions

View File

@ -5,14 +5,15 @@ mysql_select_db($DBNAME);
session_start(); session_start();
//find out the fiar year //find out the fair year and any other 'year=0' configuration parameters (things that dont change as the years go on)
$q=mysql_query("SELECT * FROM config WHERE var='FAIRYEAR' AND year='0'"); $q=mysql_query("SELECT * FROM config WHERE year='0'");
$r=mysql_fetch_object($q); while($r=mysql_fetch_object($q))
$FAIRYEAR=$r->val; {
$config['FAIRYEAR']=$FAIRYEAR; $config[$r->var]=$r->val;
}
//now pull the rest of the configuration //now pull the rest of the configuration
$q=mysql_query("SELECT * FROM config WHERE year='$FAIRYEAR'"); $q=mysql_query("SELECT * FROM config WHERE year='".$config['FAIRYEAR']."'");
while($r=mysql_fetch_object($q)) while($r=mysql_fetch_object($q))
{ {
$config[$r->var]=$r->val; $config[$r->var]=$r->val;
@ -105,26 +106,26 @@ function send_header($title="")
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head><title><?=$title?></title> <head><title><?=$title?></title>
<link rel="stylesheet" href="sfiab.css" type="text/css" /> <link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/sfiab.css" type="text/css" />
</head> </head>
<body> <body>
<div id="header"> <div id="header">
<? <?
echo "<h1>".i18n($config['FAIRNAME'])."</h1>"; echo "<h1>".i18n($config['fairname'])."</h1>";
?> ?>
<hr /> <hr />
</div> </div>
<div id="left"> <div id="left">
<ul class="mainnav"> <ul class="mainnav">
<li><a href="register_participants.php"><?=i18n("Participant Registration")?></a></li> <li><a href="<?=$config['SFIABDIRECTORY']?>/register_participants.php"><?=i18n("Participant Registration")?></a></li>
<li><a href="register_judges.php"><?=i18n("Judges Registration")?></a></li> <li><a href="<?=$config['SFIABDIRECTORY']?>/register_judges.php"><?=i18n("Judges Registration")?></a></li>
</ul> </ul>
<br /> <br />
<ul class="mainnav"> <ul class="mainnav">
<li><a href="admin/"><?=i18n("Fair Administration")?></a></li> <li><a href="<?=$config['SFIABDIRECTORY']?>/admin/"><?=i18n("Fair Administration")?></a></li>
<li><a href="config/"><?=i18n("SFIAB Configuration")?></a></li> <li><a href="<?=$config['SFIABDIRECTORY']?>/config/"><?=i18n("SFIAB Configuration")?></a></li>
</ul> </ul>
<div class="aligncenter"> <div class="aligncenter">

View File

@ -1,8 +1,6 @@
<? <?
$SFIABDIRECTORY= "sfiab/";
$DBHOST= "localhost"; $DBHOST= "localhost";
$DBNAME= "sfiab"; $DBNAME= "sfiab";
$DBUSER= "sfiab"; $DBUSER= "sfiab";
$DBPASS= "sfiab"; $DBPASS= "sfiab";
?> ?>

8
config/index.php Normal file
View File

@ -0,0 +1,8 @@
<?
require("../common.inc.php");
send_header("Configuration");
send_footer();
?>