Wow, properly fix the broken winners.php to show multi-year data!

This commit is contained in:
james 2007-06-01 19:52:58 +00:00
parent 0de2bfeef0
commit e36f452636

View File

@ -36,6 +36,7 @@ if($_POST['action']) $action=$_POST['action'];
if($_GET['year'] && $_GET['type']) if($_GET['year'] && $_GET['type'])
{ {
echo "<h2>".i18n("%1 %2 Award Winners",array($_GET['year'],$_GET['type']))."</h2>"; echo "<h2>".i18n("%1 %2 Award Winners",array($_GET['year'],$_GET['type']))."</h2>";
$year=$_GET['year'];
//first, lets make sure someone isnt tryint to see something that they arent allowed to! //first, lets make sure someone isnt tryint to see something that they arent allowed to!
$q=mysql_query("SELECT (NOW()>'".$config['dates']['postwinners']."') AS test"); $q=mysql_query("SELECT (NOW()>'".$config['dates']['postwinners']."') AS test");
@ -57,10 +58,10 @@ if($_GET['year'] && $_GET['type'])
award_awards, award_awards,
award_types award_types
WHERE WHERE
award_awards.year='".$config['FAIRYEAR']."' award_awards.year='$year'
AND award_awards.award_types_id=award_types.id AND award_awards.award_types_id=award_types.id
AND award_types.type='".$_GET['type']."' AND award_types.type='".$_GET['type']."'
AND award_types.year='".$config['FAIRYEAR']."' AND award_types.year='$year'
ORDER BY ORDER BY
awards_order"); awards_order");
@ -90,7 +91,7 @@ if($_GET['year'] && $_GET['type'])
LEFT JOIN projects ON projects.id=winners.projects_id LEFT JOIN projects ON projects.id=winners.projects_id
WHERE WHERE
award_awards_id='$r->id' award_awards_id='$r->id'
AND award_prizes.year='".$config['FAIRYEAR']."' AND award_prizes.year='$year'
ORDER BY ORDER BY
`order`"); `order`");
echo mysql_error(); echo mysql_error();
@ -236,6 +237,8 @@ else
{ {
echo "&nbsp;&nbsp;<a href=\"winners.php?year=$r->year&type=$tr->type\">".i18n("%1 %2 award winners",array($r->year,$tr->type))."</a><br />"; echo "&nbsp;&nbsp;<a href=\"winners.php?year=$r->year&type=$tr->type\">".i18n("%1 %2 award winners",array($r->year,$tr->type))."</a><br />";
} }
echo "<br />";
$first=false;
} }
} }
else else