'Day', 'w'=>'Week', 'm'=>'Month', 'y'=>'Year'); $timespan = 'd'; $timeDesc = 'Day'; if(array_key_exists('t', $_GET)) { if(array_key_exists(strtolower($_GET['t']), $timespans)) { $timespan = strtolower($_GET['t']); $timeDesc = $timespans[$timespan]; } } if(array_key_exists('page', $_GET)) { $page = $_GET['page']; } if(!isset($page)) { $page = 1; } if($page < 1) { $page = 1; } $maxResults = 20; function replaceTimespanVariable($t) { $pathInfo = parse_url($_SERVER['REQUEST_URI']); if(array_key_exists('query', $pathInfo)) { $queryString = $pathInfo['query']; } else { $queryString = ''; } parse_str($queryString, $queryArray); $queryArray['t'] = $t; if($t == 'd') { unset($queryArray['t']); } $queryArray['page'] = 1; unset($queryArray['page']); $queryString = http_build_query($queryArray); $new = $pathInfo['path']; if($queryString != ''){ $new .= '?' . $queryString; } return $new; } ?> Top Scores for <?php echo $timeDesc; ?> · TriviaTime

Top Scores

Player rankings.

Top Scores for

getWeekTopScores($page, $maxResults); $resultCount = $storage->getCountWeekTopScores(); } else if ($timespan == 'm') { $result = $storage->getMonthTopScores($page, $maxResults); $resultCount = $storage->getCountMonthTopScores(); } else if ($timespan == 'y') { $result = $storage->getYearTopScores($page, $maxResults); $resultCount = $storage->getCountYearTopScores(); } else { $result = $storage->getDayTopScores($page, $maxResults); $resultCount = $storage->getCountDayTopScores(); } } catch(StorageSchemaException $e) { echo "
Error: Database schema is not queryable
"; } catch(StorageConnectionException $e) { echo "
Error: Database is not available
"; } $storage->close(); ?> '; echo ''; echo ''; echo ''; echo ''; $currentRank++; } ?>
# Username Score
' . $currentRank . '' . $res['username'] . '' . number_format($res['points'],0) . '
paginate(); ?>