2010-06-17 20:03:45 +00:00
|
|
|
<?
|
|
|
|
function db_update_188_pre()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
function db_update_188_post()
|
|
|
|
{
|
|
|
|
global $config;
|
|
|
|
$q=mysql_query("SELECT * FROM config WHERE var='fairname' AND year>0 ORDER BY year");
|
|
|
|
while($r=mysql_fetch_object($q)) {
|
|
|
|
echo " Creating conference: $r->val $r->year\n";
|
|
|
|
mysql_query("INSERT INTO conferences (`name`,`type`,`status`,`year`) VALUES ('".mysql_real_escape_string($r->val." ".$r->year)."',
|
|
|
|
'sciencefair',
|
|
|
|
'ended',
|
|
|
|
'$r->year')");
|
|
|
|
}
|
|
|
|
//but wait, the current fairyear is still running
|
|
|
|
echo " Setting science fair conference for {$config['FAIRYEAR']} to running\n";
|
|
|
|
mysql_query("UPDATE conferences SET status='running' WHERE year='{$config['FAIRYEAR']}'");
|
|
|
|
|
2010-06-17 20:56:03 +00:00
|
|
|
//now update a couple config options for now, until we cna do soemthing better, without theme and theme_icons
|
|
|
|
//being fairyear independent, they wont get set at all so the page wont even load
|
|
|
|
mysql_query("UPDATE config SET year=0, category='Special' WHERE year='{$config['FAIRYEAR']}' AND var='theme'");
|
|
|
|
mysql_query("UPDATE config SET year=0, category='Special' WHERE year='{$config['FAIRYEAR']}' AND var='theme_icons'");
|
|
|
|
mysql_query("DELETE FROM config WHERE year!=0 AND var='theme'");
|
|
|
|
mysql_query("DELETE FROM config WHERE year!=0 AND var='theme_icons'");
|
|
|
|
|
2010-06-17 20:03:45 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|