exit; } $req_team_id = get_integer_param($_GET, 'id', null, 0, null); //Try our best to make sure no browser caches the page header("Content-Type: text/xml"); header("Expires: Sat, 1 Jan 2000 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); $result = select_from_teams("id = {$req_team_id}"); $curTeam = mysql_fetch_assoc($result); $team_id = $curTeam['id']; //Team info portion of $data $result = mysql_query("SELECT COUNT(id) AS totalTeams FROM user_teams"); $totalTeams = mysql_result($result, 0, "totalTeams"); $data = "<teaminfo id='{$team_id}'>\n <teamname>" . xmlencode($curTeam['teamname']) . "</teamname>\n <datecreated>" . date("m/d/Y", $curTeam['created']) . "</datecreated>\n <createdby>" . xmlencode($curTeam['createdby']) . "</createdby>\n <leader>" . xmlencode(get_username_for_uid($curTeam['owner'])) . "</leader>\n <description>" . xmlencode($curTeam['team_info']) . "</description>\n <website>" . xmlencode($curTeam['webpage']) . "</website>\n <forums>" . xmlencode(get_url_to_view_topic($curTeam['topic_id'])) . "</forums>\n <totalmembers>" . $curTeam['member_count'] . "</totalmembers>\n <currentmembers>" . $curTeam['active_members'] . "</currentmembers>\n <retiredmembers>" . ($curTeam['member_count'] - $curTeam['active_members']) . "</retiredmembers>"; foreach ($page_tally_names as $tally_name => $tally_title) { $teams_tallyboard = new TallyBoard($tally_name, 'T'); $pageCount = $teams_tallyboard->get_current_tally($team_id); $pageCountRank = $teams_tallyboard->get_rank($team_id); $avg_pages_per_day = get_daily_average($curTeam['created'], $pageCount); list($bestDayCount, $bestDayTimestamp) = $teams_tallyboard->get_info_re_largest_delta($team_id); $bestDayTime = date("M. jS, Y", $bestDayTimestamp - 1); $data .= "\n <roundinfo id='{$tally_name}'>\n <totalpages>{$pageCount}</totalpages>\n <rank>" . $pageCountRank . "/" . $totalTeams . "</rank>\n <avgpagesday>" . number_format($avg_pages_per_day, 1) . "</avgpagesday>\n <mostpagesday>" . $bestDayCount . " (" . $bestDayTime . ")</mostpagesday>\n </roundinfo>"; } $data .= "\n </teaminfo>\n"; //Team members portion of $data $data .= "<teammembers>"; $mbrQuery = mysql_query("\n SELECT username, date_created, u_id, u_privacy\n FROM users\n WHERE {$team_id} IN (team_1, team_2, team_3)\n ORDER BY username ASC\n"); while ($curMbr = mysql_fetch_assoc($mbrQuery)) { if ($curMbr['u_privacy'] == PRIVACY_PUBLIC) {
function private_message_link_for_uid($u_id) { $username = get_username_for_uid($u_id); $link = private_message_link($username, NULL); return $link; }