From f33be120013dc68cd5dff474220c7985d60267b6 Mon Sep 17 00:00:00 2001 From: james Date: Mon, 20 Dec 2004 16:00:43 +0000 Subject: [PATCH] Separate configuration into Variables and Category/Divison --- config/catdiv.php | 10 +++++++++ config/index.php | 44 ++------------------------------------ config/variables.php | 50 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 42 deletions(-) create mode 100644 config/catdiv.php create mode 100644 config/variables.php diff --git a/config/catdiv.php b/config/catdiv.php new file mode 100644 index 00000000..0e188e5c --- /dev/null +++ b/config/catdiv.php @@ -0,0 +1,10 @@ + diff --git a/config/index.php b/config/index.php index 4ca49e89..03561f49 100644 --- a/config/index.php +++ b/config/index.php @@ -3,48 +3,8 @@ send_header("Configuration"); echo error(i18n("Note: this section will normally be password protected. It is left open for now for debugging and testing purposes")); - if($_POST['action']=="save") - { - if($_POST['specialconfig']) - { - foreach($_POST['specialconfig'] as $key=>$val) - { - mysql_query("UPDATE config SET val='".mysql_escape_string(stripslashes($val))."' WHERE year='0' AND var='$key'"); - } - } - if($_POST['saveconfig']) - { - foreach($_POST['saveconfig'] as $key=>$val) - { - mysql_query("UPDATE config SET val='".mysql_escape_string(stripslashes($val))."' WHERE year='".$config['FAIRYEAR']."' AND var='$key'"); - } - } - echo happy(i18n("Configuration successfully saved")); - - - } - $q=mysql_query("SELECT * FROM config WHERE year=0 ORDER BY var"); - echo "
"; - echo "\n"; - echo ""; - echo ""; - while($r=mysql_fetch_object($q)) - { - echo ""; - } - - echo ""; - - $q=mysql_query("SELECT * FROM config WHERE year='".$config['FAIRYEAR']."' ORDER BY var"); - while($r=mysql_fetch_object($q)) - { - echo ""; - - - } - echo "

".i18n("Global configuration settings")."

$r->var".i18n($r->description)."var]\" value=\"$r->val\" />


".i18n("Configuration settings for fair year %1",array($config['FAIRYEAR']))."

$r->var".i18n($r->description)."var]\" value=\"$r->val\" />
"; - echo "\n"; - echo "
"; + echo "Configuration Variables
"; + echo "Categories and Divisions
"; send_footer(); ?> diff --git a/config/variables.php b/config/variables.php new file mode 100644 index 00000000..c5fb62c1 --- /dev/null +++ b/config/variables.php @@ -0,0 +1,50 @@ +$val) + { + mysql_query("UPDATE config SET val='".mysql_escape_string(stripslashes($val))."' WHERE year='0' AND var='$key'"); + } + } + if($_POST['saveconfig']) + { + foreach($_POST['saveconfig'] as $key=>$val) + { + mysql_query("UPDATE config SET val='".mysql_escape_string(stripslashes($val))."' WHERE year='".$config['FAIRYEAR']."' AND var='$key'"); + } + } + echo happy(i18n("Configuration successfully saved")); + + + } + $q=mysql_query("SELECT * FROM config WHERE year=0 ORDER BY var"); + echo "
"; + echo "\n"; + echo ""; + echo ""; + while($r=mysql_fetch_object($q)) + { + echo ""; + } + + echo ""; + + $q=mysql_query("SELECT * FROM config WHERE year='".$config['FAIRYEAR']."' ORDER BY var"); + while($r=mysql_fetch_object($q)) + { + echo ""; + + + } + echo "

".i18n("Global configuration settings")."

$r->var".i18n($r->description)."var]\" value=\"$r->val\" />


".i18n("Configuration settings for fair year %1",array($config['FAIRYEAR']))."

$r->var".i18n($r->description)."var]\" value=\"$r->val\" />
"; + echo "\n"; + echo "
"; + + send_footer(); +?>