From 288dd58c9c8137535c8ae1483d005f3ba5393789 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 24 Nov 2005 20:12:06 +0000 Subject: [PATCH] Make sure we always have all of our configuration variables defined. If a new one is added as a default with year -1, it needs to be automatically created for the current FAIRYEAR as well. --- config/variables.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/config/variables.php b/config/variables.php index 6dd7697d..46ba8c83 100644 --- a/config/variables.php +++ b/config/variables.php @@ -27,6 +27,17 @@ send_header("Configuration - Variables"); echo "<< ".i18n("Back to Configuration")."
"; + $q=mysql_query("SELECT * FROM config WHERE year='-1'"); + while($r=mysql_fetch_object($q)) + { + mysql_query("INSERT INTO config (var,val,description,year) VALUES ( + '".mysql_escape_string($r->var)."', + '".mysql_escape_string($r->val)."', + '".mysql_escape_string($r->description)."', + '".$config['FAIRYEAR']."')"); + } + + if($_POST['action']=="save") { if($_POST['specialconfig'])