diff --git a/projects.inc.php b/projects.inc.php index 74a54a5..b3f4a6b 100644 --- a/projects.inc.php +++ b/projects.inc.php @@ -169,31 +169,42 @@ function getProjectsNominatedForSpecialAward($award_id) { global $config; - $prjq=mysql_query("SELECT - projects.projectnumber, - projects.title, - projects.id AS projects_id - FROM - project_specialawards_link, - projects - WHERE - project_specialawards_link.award_awards_id='$award_id' - AND project_specialawards_link.projects_id=projects.id - AND projects.projectnumber is not null - AND projects.year='".$config['FAIRYEAR']."' - ORDER BY - projectnumber - "); - $projects=array(); - while($prjr=mysql_fetch_object($prjq)) + //if they dont use special award nominations, then we will instead get all of the projects that + //are eligible for the award, instead of nominated for it. + if($config['specialawardnomination']!="none") { - $projects[$prjr->projectnumber]=array( - "id"=>$prjr->projects_id, - "projectnumber"=>$prjr->projectnumber, - "title"=>$prjr->title - ); + $prjq=mysql_query("SELECT + projects.projectnumber, + projects.title, + projects.id AS projects_id + FROM + project_specialawards_link, + projects + WHERE + project_specialawards_link.award_awards_id='$award_id' + AND project_specialawards_link.projects_id=projects.id + AND projects.projectnumber is not null + AND projects.year='".$config['FAIRYEAR']."' + ORDER BY + projectnumber + "); + $projects=array(); + while($prjr=mysql_fetch_object($prjq)) + { + $projects[$prjr->projectnumber]=array( + "id"=>$prjr->projects_id, + "projectnumber"=>$prjr->projectnumber, + "title"=>$prjr->title + ); + } + //return the projects that have self-nominated themselves for the award + return $projects; + } + else + { + //return the projects that are eligible for the award instead + return getProjectsEligibleForAward($award_id); } - return $projects; } function getSpecialAwardsNominatedByRegistrationID($id)