Make sure $config['dates']['postparticipants'] is valid before relying on it.

This commit is contained in:
james 2007-03-08 21:35:52 +00:00
parent 59aade5f0c
commit ea55978aa9

View File

@ -415,13 +415,18 @@ echo "<h1>".i18n($config['fairname'])."</h1>";
//then we will show the registration confirmation page as a link in the menu,
$registrationconfirmationlink="";
$q=mysql_query("SELECT (NOW()>'".$config['dates']['postparticipants']."') AS test");
$r=mysql_fetch_object($q);
if($r->test==1)
//only display it if a date is set to begin with.
if($config['dates']['postparticipants'] && $config['dates']['postparticipants']!="0000-00-00 00:00:00")
{
$registrationconfirmationlink="<li><a href=\"".$config['SFIABDIRECTORY']."/confirmed_participants.php\">".i18n("Confirmed Participants")."</a></li>";
$q=mysql_query("SELECT (NOW()>'".$config['dates']['postparticipants']."') AS test");
$r=mysql_fetch_object($q);
if($r->test==1)
{
$registrationconfirmationlink="<li><a href=\"".$config['SFIABDIRECTORY']."/confirmed_participants.php\">".i18n("Confirmed Participants")."</a></li>";
}
}
?>
<div id="left">
<ul class="mainnav">
<li><a href="<?=$config['SFIABDIRECTORY']?>/index.php"><?=i18n("Home Page")?></a></li><li><a href="<?=$config['SFIABDIRECTORY']?>/important_dates.php"><?=i18n("Important Dates")?></a></li><li><a href="<?=$config['SFIABDIRECTORY']?>/register_participants.php"><?=i18n("Participant Registration")?></a></li><?=$registrationconfirmationlink?><li><a href="<?=$config['SFIABDIRECTORY']?>/register_judges.php"><?=i18n("Judges Registration")?></a></li><li><a href="<?=$config['SFIABDIRECTORY']?>/committees.php"><?=i18n("Committee")?></a></li><li><a href="<?=$config['SFIABDIRECTORY']?>/winners.php"><?=i18n("Winners")?></a></li></ul>