Exemplo n.º 1
0
if (empty($_GET["id"])) {
    include_once $relPath . 'theme.inc';
    output_header(_("Error!"));
    echo "<br><center>";
    echo sprintf(_("A team id must specified in the following format: %s"), "{$code_url}/stats/teams/teams_xml.php?id=*****");
    echo "</center>";
    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>";
}
Exemplo n.º 2
0
$tstart = get_integer_param($_GET, 'tstart', 0, 0, null);
if ($tname) {
    if ($texact) {
        $where_body = "teamname='{$tname}'";
    } else {
        $where_body = "teamname LIKE '%{$tname}%'";
    }
    $tResult = select_from_teams($where_body, "ORDER BY {$order} {$direction} LIMIT {$tstart},20");
    $tRows = mysql_num_rows($tResult);
    if ($tRows == 1) {
        metarefresh(0, "tdetail.php?tid=" . mysql_result($tResult, 0, "id") . "", '', '');
        exit;
    }
    $tname = "tname=" . urlencode($tname) . "&";
} else {
    $tResult = select_from_teams("", "ORDER BY {$order} {$direction} LIMIT {$tstart},20");
    $tRows = mysql_num_rows($tResult);
    $tname = "";
}
$name = _("Team List");
output_header($name);
echo "<center><br>";
//Display of user teams
echo "<table border='1' cellspacing='0' cellpadding='4' style='border: 1px solid #111; border-collapse: collapse' width='95%'>\n";
echo "<tr bgcolor='" . $theme['color_headerbar_bg'] . "'><td colspan='6' align='center'><b><font color='" . $theme['color_headerbar_font'] . "'>";
echo _("User Teams");
echo "</font></b></td></tr>\n";
echo "<tr bgcolor='" . $theme['color_navbar_bg'] . "'>";
echo "<td align='center'><b>" . _("Icon") . "</b></td>";
if ($order == "id" && $direction == "asc") {
    $newdirection = "desc";
Exemplo n.º 3
0
$relPath = "./../../pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'theme.inc';
include_once $relPath . 'js_newpophelp.inc';
include_once $relPath . 'metarefresh.inc';
include_once '../includes/team.inc';
require_login();
$theme_extra_args = array("js_data" => get_newHelpWin_javascript("{$code_url}/pophelp.php?category=teams&name=edit_"));
// Either the parameter is $_POST['tsid'] when coming from the edit form,
// or it is $_GET['tid'] when using the link on top of the team summary.
$tid = get_integer_param($_POST, 'tsid', null, 1, null, true);
if (!isset($tid)) {
    $tid = get_integer_param($_GET, 'tid', null, 1, null);
}
$result = select_from_teams("id = {$tid}");
$curTeam = mysql_fetch_assoc($result);
// Allow team owner and site administrators to edit the team
if ($userP['u_id'] != $curTeam['owner'] && !user_is_a_sitemanager()) {
    $title = _("Authorization Failed");
    $desc = _("You are not authorized to edit this team....");
    metarefresh(4, "tdetail.php?tid={$tid}", $title, $desc);
    exit;
}
if (isset($_GET['tid'])) {
    $edit = _("Edit");
    output_header($edit . " " . $curTeam['teamname'], SHOW_STATSBAR, $theme_extra_args);
    echo "<center><br>";
    showEdit(unstripAllString($curTeam['teamname'], 0), unstripAllString($curTeam['team_info'], 1), unstripAllString($curTeam['webpage'], 1), 0, $tid);
    echo "</center>";
} elseif (isset($_POST['edQuit'])) {
Exemplo n.º 4
0
echo "<?xml version=\"1.0\" encoding=\"{$charset}\" ?>\n";
echo "<memberstats xmlns:xsi=\"http://www.w3.org/2000/10/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"memberstats.xsd\">\n";
$now = time();
$daysInExistence = floor(($now - $user->date_created) / 86400);
//User info
if ($user->u_privacy == PRIVACY_PUBLIC) {
    echo "\n        <userinfo id='{$user->u_id}'>\n            <username>" . xmlencode($user->username) . "</username>\n            <datejoined>" . date("m/d/Y", $user->date_created) . "</datejoined>\n            <lastlogin>" . date("m/d/Y", $user->last_login) . "</lastlogin>\n            <location>" . xmlencode($forum_profile['from']) . "</location>\n            <occupation>" . xmlencode($forum_profile['occ']) . "</occupation>\n            <interests>" . xmlencode($forum_profile['interests']) . "</interests>\n            <website>" . xmlencode($forum_profile['website']) . "</website>";
    foreach ($page_tally_names as $tally_name => $tally_title) {
        $tallyboard = new TallyBoard($tally_name, 'U');
        $current_page_tally = $tallyboard->get_current_tally($user->u_id);
        $currentRank = $tallyboard->get_rank($user->u_id);
        list($bestDayCount, $bestDayTimestamp) = $tallyboard->get_info_re_largest_delta($user->u_id);
        $bestDayTime = date("M. jS, Y", $bestDayTimestamp - 1);
        if ($daysInExistence > 0) {
            $daily_Average = $current_page_tally / $daysInExistence;
        } else {
            $daily_Average = 0;
        }
        echo "\n            <roundinfo id='{$tally_name}'>\n                <pagescompleted>{$current_page_tally}</pagescompleted>\n                <overallrank>{$currentRank}</overallrank>\n                <bestdayever>\n                    <pages>{$bestDayCount}</pages>\n                    <date>{$bestDayTime}</date>\n                </bestdayever>\n                <dailyaverage>" . number_format($daily_Average) . "</dailyaverage>\n            </roundinfo>";
    }
    echo "\n        </userinfo>";
    //Team info
    $result = select_from_teams("id IN ({$user->team_1}, {$user->team_2}, {$user->team_3})");
    echo "\n        <teaminfo>";
    while ($row = mysql_fetch_assoc($result)) {
        echo "\n            <team>\n            <name>" . xmlencode($row['teamname']) . "</name>\n            <activemembers>" . $row['active_members'] . "</activemembers>\n            </team>";
    }
    echo "\n        </teaminfo>";
}
echo "\n</memberstats>";
// vim: sw=4 ts=4 expandtab