id == $team->ping_user) { $get_from_db = true; } // Cache the team record, its forum record, its new members, // its admins, and its member counts $cache_args = "teamid=$teamid"; if (!$get_from_db) { $cached_data = get_cached_data(TEAM_PAGE_TTL, $cache_args); if ($cached_data) { // We found some old but non-stale data, let's use it $team = unserialize($cached_data); } else { $get_from_db = true; } } if ($get_from_db) { $team->nusers = BoincUser::count("teamid=$teamid"); $team->nusers_worked = BoincUser::count("teamid=$teamid and total_credit>0"); $team->nusers_active = BoincUser::count("teamid=$teamid and expavg_credit>0.1"); $team->forum = BoincForum::lookup("parent_type=1 and category=$team->id"); $team->new_members = new_member_list($teamid); $team->admins = admin_list($teamid); $team->founder = BoincUser::lookup_id($team->userid); set_cache_data(serialize($team), $cache_args); } if (!$team) { error_page("No such team"); } display_team_page($team, $user); page_tail(true); ?>