Example #1
0
function show_list($list)
{
    start_table();
    echo "\n        <tr>\n        <th>" . tra("Team name") . "</th>\n        <th>" . tra("Description") . "</th>\n        <th>" . tra("Average credit") . "</th>\n        <th>" . tra("Type") . "</th>\n        <th>" . tra("Country") . "</th>\n        </tr>\n    ";
    $i = 0;
    foreach ($list as $team) {
        $type = team_type_name($team->type);
        $j = $i++ % 2;
        echo "<tr class=row{$j}>\n            <td><a href=team_display.php?teamid={$team->id}>{$team->name}</a></td>\n            <td><span class=note>" . sanitize_html($team->description) . "</span></td>\n            <td>" . format_credit($team->expavg_credit) . "</td>\n            <td>{$type}</td>\n            <td>{$team->country}</td>\n            </tr>\n        ";
    }
    echo "</table>";
}
Example #2
0
function show_list($list)
{
    start_table();
    echo "<tr>\n\t\t<th>Team name</th>\n\t\t<th>Description</th>\n\t\t<th>Average credit</th>\n\t\t<th>Type</th>\n\t\t<th>Country</th>\n\t\t</tr>";
    $i = 0;
    foreach ($list as $team) {
        $type = team_type_name($team->type);
        $j = $i++ % 2;
        echo '<tr class="row$j">
			<td><a href="team_display.php?teamid=$team->id">$team->name</a></td>
			<td><span class="note">' . sanitize_html($team->description) . '</span></td>
			<td>' . format_credit($team->expavg_credit) . '</td>
			<td>$type</td>
			<td>$team->country</td>
			</tr>
		';
    }
    echo "</table>";
}
Example #3
0
<?php

// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
include_once "../inc/db.inc";
include_once "../inc/util.inc";
include_once "../inc/team.inc";
check_get_args(array());
page_head(tra("Teams"));
echo "<p>" . tra("%1 participants may form %2teams%3.", PROJECT, "<b>", "</b>") . "\n    <p>\n    " . tra("You may belong to only one team. You can join or quit a team at any time.") . "\n    <p>" . tra("Each team has a %1founder%2 who may:", "<b>", "</b>") . "\n    <ul>\n    <li> " . tra("access team members' email addresses") . "\n    <li> " . tra("edit the team's name and description") . "\n    <li> " . tra("add or remove team admins") . "\n    <li> " . tra("remove members from the team") . "\n    <li> " . tra("disband a team if it has no members") . "\n    </ul>\n    <p>" . tra("To join a team, visit its team page and click %1Join this team%2.", "<b>", "</b>") . "\n    <h3>" . tra("Find a team") . "</h3>\n";
team_search_form(null);
echo "\n\n    <h3>" . tra("Top teams") . "</h3>\n    <ul>\n    <li> <a href=\"top_teams.php\">" . tra("All teams") . "</a>\n";
for ($i = 1; $i < 8; $i++) {
    echo "<li> <a href=\"top_teams.php?type=" . $i . "\">" . tra("%1 teams", team_type_name($i)) . "</a>\n    ";
}
echo "\n    </ul>\n    <h3>" . tra("Create a new team") . "</h3>\n    " . tra("If you cannot find a team that is right for you, you can %1create a team%2.", "<a href=\"team_create_form.php\">", "</a>");
page_tail();
Example #4
0
function show_list($list)
{
    start_table();
    echo "\n        <tr>\n        <th>" . tra("Team name") . "</th>\n    ";
    if (defined("SHOW_NONVALIDATED_TEAMS")) {
        echo "<th>Validated?</th>\n";
    }
    echo "\n        <th>" . tra("Description") . "</th>\n        <th>" . tra("Average credit") . "</th>\n        <th>" . tra("Type") . "</th>\n        <th>" . tra("Country") . "</th>\n        </tr>\n    ";
    $i = 0;
    foreach ($list as $team) {
        $type = team_type_name($team->type);
        $j = $i++ % 2;
        echo "<tr class=row{$j}>\n            <td><a href=team_display.php?teamid={$team->id}>{$team->name}</a></td>\n        ";
        if (defined("SHOW_NONVALIDATED_TEAMS")) {
            $user = BoincUser::lookup_id($team->userid);
            echo "<td>";
            echo $user->email_validated ? "Yes" : "No";
            echo "</td>\n";
        }
        echo "\n            <td><p class=\"text-muted\">" . sanitize_html($team->description) . "</p></td>\n            <td>" . format_credit($team->expavg_credit) . "</td>\n            <td>{$type}</td>\n            <td>{$team->country}</td>\n            </tr>\n        ";
    }
    echo "</table>";
}
Example #5
0
switch ($sort_by) {
    case "total_credit":
    case "expavg_credit":
        break;
    default:
        $sort_by = "expavg_credit";
}
$type = get_int("type", true);
if ($type < 1 || $type > 7) {
    $type = 0;
}
$type_url = "";
$type_name = "";
if ($type) {
    $type_url = "&type={$type}";
    $type_name = team_type_name($type);
}
$offset = get_int("offset", true);
if (!$offset) {
    $offset = 0;
}
if ($offset % $teams_per_page) {
    $offset = 0;
}
if ($offset < ITEM_LIMIT) {
    $cache_args = "sort_by={$sort_by}&offset={$offset}{$type_url}";
    $cacheddata = get_cached_data(TOP_PAGES_TTL, $cache_args);
    //If we have got the data in cache
    if ($cacheddata) {
        $data = store_to_teams($cacheddata);
        // use the cached data