2002-08-07 18:56:55 +00:00
|
|
|
<?php
|
2004-06-16 19:10:24 +00:00
|
|
|
require_once("../inc/cache.inc");
|
2005-02-16 19:08:07 +00:00
|
|
|
require_once("../inc/util.inc");
|
2006-11-02 19:34:02 +00:00
|
|
|
require_once("../inc/db.inc");
|
|
|
|
require_once("../inc/team.inc");
|
2002-08-07 18:56:55 +00:00
|
|
|
|
2005-05-11 09:57:46 +00:00
|
|
|
if (isset($_GET["sort_by"])) {
|
|
|
|
$sort_by = $_GET["sort_by"];
|
|
|
|
} else {
|
|
|
|
$sort_by = "expavg_credit";
|
|
|
|
}
|
|
|
|
|
2005-02-15 22:29:32 +00:00
|
|
|
$offset = get_int("offset", true);
|
2004-06-07 03:34:07 +00:00
|
|
|
if (!$offset) $offset=0;
|
2005-02-15 22:29:32 +00:00
|
|
|
$teamid = get_int("teamid");
|
2004-06-07 03:34:07 +00:00
|
|
|
|
2004-06-24 16:51:22 +00:00
|
|
|
if ($offset > 1000) {
|
2006-11-03 18:41:34 +00:00
|
|
|
error_page("Limit exceeded: Only displaying the first 1000 members.");
|
2004-06-24 16:51:22 +00:00
|
|
|
}
|
|
|
|
|
2002-08-07 18:56:55 +00:00
|
|
|
db_init();
|
2006-11-02 19:34:02 +00:00
|
|
|
|
2003-03-21 04:38:55 +00:00
|
|
|
$user = get_logged_in_user(false);
|
2006-11-03 18:41:34 +00:00
|
|
|
// We can only cache team object, as the page is customised to the current user
|
2006-11-02 19:34:02 +00:00
|
|
|
$cache_args = "teamid=$teamid&sort_by=$sort_by&offset=$offset";
|
|
|
|
$cached_data = get_cached_data(TEAM_PAGE_TTL, $cache_args);
|
|
|
|
if ($cached_data) {
|
2006-11-03 18:41:34 +00:00
|
|
|
// We found some old but non-stale data, let's use it
|
2006-11-02 19:34:02 +00:00
|
|
|
$team = unserialize($cached_data);
|
|
|
|
} else {
|
2006-11-03 18:41:34 +00:00
|
|
|
// No data was found, generate new data for the cache and store it
|
2006-11-02 19:34:02 +00:00
|
|
|
$team = lookup_team($teamid);
|
2006-11-03 18:41:34 +00:00
|
|
|
$team->nusers = team_count_nusers($team->id);
|
2006-11-02 19:34:02 +00:00
|
|
|
set_cache_data(serialize($team), $cache_args);
|
|
|
|
}
|
|
|
|
|
2002-08-07 18:56:55 +00:00
|
|
|
if (!$team) {
|
2005-02-15 22:29:32 +00:00
|
|
|
error_page("No such team");
|
2002-08-07 18:56:55 +00:00
|
|
|
}
|
|
|
|
|
2004-06-07 03:34:07 +00:00
|
|
|
display_team_page($team, $offset, $sort_by);
|
2003-03-21 04:38:55 +00:00
|
|
|
|
2004-11-18 20:01:12 +00:00
|
|
|
page_tail(true);
|
2004-06-16 19:10:24 +00:00
|
|
|
|
2002-08-07 18:56:55 +00:00
|
|
|
?>
|