- 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

@ -5,14 +5,15 @@ mysql_select_db($DBNAME);
session_start();
//find out the fiar year
$q=mysql_query("SELECT * FROM config WHERE var='FAIRYEAR' AND year='0'");
$r=mysql_fetch_object($q);
$FAIRYEAR=$r->val;
$config['FAIRYEAR']=$FAIRYEAR;
//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 year='0'");
while($r=mysql_fetch_object($q))
{
$config[$r->var]=$r->val;
}
//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))
{
$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">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<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>
<body>
<div id="header">
<?
echo "<h1>".i18n($config['FAIRNAME'])."</h1>";
echo "<h1>".i18n($config['fairname'])."</h1>";
?>
<hr />
</div>
<div id="left">
<ul class="mainnav">
<li><a href="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_participants.php"><?=i18n("Participant Registration")?></a></li>
<li><a href="<?=$config['SFIABDIRECTORY']?>/register_judges.php"><?=i18n("Judges Registration")?></a></li>
</ul>
<br />
<ul class="mainnav">
<li><a href="admin/"><?=i18n("Fair Administration")?></a></li>
<li><a href="config/"><?=i18n("SFIAB Configuration")?></a></li>
<li><a href="<?=$config['SFIABDIRECTORY']?>/admin/"><?=i18n("Fair Administration")?></a></li>
<li><a href="<?=$config['SFIABDIRECTORY']?>/config/"><?=i18n("SFIAB Configuration")?></a></li>
</ul>
<div class="aligncenter">

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

8
config/index.php Normal file

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