From c463c13f01712a7ec7d4575ac6adb99db73cb419 Mon Sep 17 00:00:00 2001 From: dave Date: Thu, 21 Jan 2010 20:32:54 +0000 Subject: [PATCH] - Tell the user if there are no stats --- fair_stats.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/fair_stats.php b/fair_stats.php index 7eb64b2..eb0578f 100644 --- a/fair_stats.php +++ b/fair_stats.php @@ -102,7 +102,7 @@ $server_config['info'] = false; $server_config['next_chair'] = false; $server_config['scholarships'] = false; $server_config['delegates'] = false; - +$server_any_stats = false; $year = intval($_POST['year']); if($year < 1900) $year = $config['FAIRYEAR']; @@ -113,7 +113,11 @@ echo mysql_error(); $fair = mysql_fetch_assoc($q); $s = split(',', $fair['gather_stats']); -foreach($s as $k) $server_config[$k] = true; +foreach($s as $k) { + if(trim($k) == '') continue; + $server_config[$k] = true; + $server_any_stats = true; +} /* @@ -323,7 +327,13 @@ $stats = mysql_fetch_assoc($q); echo '
'; } - echo ""; +if($server_any_stats == false) { + /* Every condition below will fail, tell the user something */ + echo i18n("No stats to gather. Contact the admins if you believe this is an error."); +} else { + echo ""; +} + echo ''; echo "
"; echo "
";