diff --git a/checkin_notes b/checkin_notes
index 7b9a51a745..fd12b088c5 100755
--- a/checkin_notes
+++ b/checkin_notes
@@ -20905,3 +20905,15 @@ David 8 Dec 2004
Makefile.am
lib/
Makefile.am
+
+David 8 Dec 2004
+ - web site: added Team leaderboards broken down by type (see team.php)
+
+ html/
+ inc/
+ team.inc
+ util.inc
+ user/
+ sample_index.php
+ team.php
+ top_teams.php
diff --git a/html/inc/team.inc b/html/inc/team.inc
index ac1f54e2de..4bf2ef4dc6 100644
--- a/html/inc/team.inc
+++ b/html/inc/team.inc
@@ -11,6 +11,19 @@ function show_team_create_account_url($team) {
row2("Create team account URL
Accounts created via this URL will belong to this team and will have the project preferences of its founder", "$url");
}
+function team_type_name($type) {
+ switch ($type) {
+ case 1: return "Unclassified";
+ case 2: return "Company";
+ case 3: return "Primary school";
+ case 4: return "Secondary school";
+ case 5: return "Junior college";
+ case 6: return "University or department";
+ case 7: return "Government agency";
+ }
+ return "Unknown";
+}
+
function display_team_page($team, $offset, $sort_by) {
$n = 20;
@@ -37,7 +50,12 @@ function display_team_page($team, $offset, $sort_by) {
row2("Description", sanitize_html($team->description));
}
if (strlen($team->url)) {;
- row2("Web site", "url>http://$team->url");
+ if (strstr($team->url, "http://")) {
+ $x = $team->url;
+ } else {
+ $x = "http://$team->url";
+ }
+ row2("Web site", "$x");
}
row2("Members", $team->nusers);
@@ -46,6 +64,7 @@ function display_team_page($team, $offset, $sort_by) {
$user = lookup_user_id($team->userid);
row2("Founder", user_links($user));
row2("Country", $team->country);
+ row2("Type", team_type_name($team->type));
row2("Join this team", "id>Join");
show_team_create_account_url($team);
echo "";
diff --git a/html/inc/util.inc b/html/inc/util.inc
index d95674c762..4c10e85c63 100644
--- a/html/inc/util.inc
+++ b/html/inc/util.inc
@@ -433,7 +433,7 @@ function sub_sentence($sentence, $delimiter, $max_chars, $ellipsis=false) {
}
function format_credit($cobblestones) {
- return sprintf("%.2f", $cobblestones);
+ return number_format($cobblestones, 2);
}
function project_is_stopped() {
diff --git a/html/user/sample_index.php b/html/user/sample_index.php
index 3c49409de8..40b6702b4c 100644
--- a/html/user/sample_index.php
+++ b/html/user/sample_index.php
@@ -38,7 +38,7 @@ function show_nav() {
".PROJECT." participants may form teams. -
\n"; - if ($offset > 0) { - $new_offset = $offset - $n; - echo "Last $n | "; +} +mysql_free_result($result); +echo "\n
\n"; +if ($offset > 0) { + $new_offset = $offset - $n; + echo "Last $n | "; - } - $new_offset = $offset + $n; - echo "Next $n"; +} +$new_offset = $offset + $n; +echo "Next $n"; - if ($offset < 1000) { - page_tail(true); - end_cache(TOP_PAGES_TTL, $cache_args); - } else { - page_tail(); - } +if ($offset < 1000) { + page_tail(true); + end_cache(TOP_PAGES_TTL, $cache_args); +} else { + page_tail(); +} -} ?> +?>