From 3c9253dd9d904abef17a3a262f61452adbc7a61c Mon Sep 17 00:00:00 2001 From: dave Date: Sat, 22 Dec 2007 05:11:42 +0000 Subject: [PATCH] - Add a config option to disable printing the cash/scholarship amount on the public winners page. (defaults to ON, which is the current behaviour) - Fix pluralization of "Students" for one student. :) - Change the effort option for judges and tours to a pulldown menu Low=100, Med=1000, High=10000 --- db/db.code.version.txt | 2 +- db/db.update.88.sql | 10 ++++++++++ winners.php | 8 ++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 db/db.update.88.sql diff --git a/db/db.code.version.txt b/db/db.code.version.txt index 84df352..d22307c 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -87 +88 diff --git a/db/db.update.88.sql b/db/db.update.88.sql new file mode 100644 index 0000000..11b6d73 --- /dev/null +++ b/db/db.update.88.sql @@ -0,0 +1,10 @@ +INSERT INTO `config` ( `var` , `val` , `category` , `type` , `type_values` , `ord` , `description` , `year`) VALUES ( +'winners_show_prize_amounts', 'yes', 'Global', 'yesno', '', '700', 'Show the dollar amounts of the cash/scholarship prizes on the publicly viewable winners page.', '-1'); + +UPDATE `config` SET `type` = 'enum', `type_values` = '100=Low|1000=Medium|10000=High', +`description` = 'This controls how long and hard the judge scheduler will look for a scheduling solution. Low effort will finish almost instantly but give a very poor result. High effort can take several tens of minutes to run, but it gives a very good solution.' WHERE `var` = 'effort' ; + +UPDATE `config` SET `type` = 'enum', `type_values` = '100=Low|1000=Medium|10000=High', +`description` = 'This controls how long and hard the tour assigner will look for a quality solution. Low effort will finish almost instantly but give a very poor result. High effort can take several minutes to run, but it gives a very good solution. ' WHERE `var` = 'tours_assigner_effort' ; + + diff --git a/winners.php b/winners.php index 0efb444..9a14817 100644 --- a/winners.php +++ b/winners.php @@ -109,7 +109,7 @@ if($_GET['year'] && $_GET['type']) echo " "; echo ""; echo "$pr->prize"; - if($pr->cash || $pr->scholarship) + if(($pr->cash || $pr->scholarship) && $config['winners_show_prize_amounts'] == 'yes') { echo " ("; if($pr->cash && $pr->scholarship) @@ -171,7 +171,11 @@ if($_GET['year'] && $_GET['type']) echo "
"; echo "    "; echo "    "; - echo "Students: $students"; + if($studnum > 1) + echo "Students: $students"; + else + echo "Student: $students"; + echo "
"; echo "    "; echo "    ";