diff --git a/checkin_notes b/checkin_notes
index 88c0868746..b887e37907 100755
--- a/checkin_notes
+++ b/checkin_notes
@@ -6228,4 +6228,7 @@ Karl 2003/09/07
- changed all user-visible cobblestone numbers to use a new
format_credit() function which does sprintf %.3f
+ - allow sorting top_{team,user,host}s.php by either expavg_credit or
+ total_credit (default expavg_credit)
+
html_user/*.php, *.inc
diff --git a/html/user/host.inc b/html/user/host.inc
index 7ca3d57c23..0d490210c9 100644
--- a/html/user/host.inc
+++ b/html/user/host.inc
@@ -115,8 +115,8 @@ function host_table_start($title, $private) {
echo "
Owner | \n";
}
echo "
- Recent average credit |
- Total credit |
+ Recent average credit |
+ Total credit |
CPU type |
Operating system |
Results Click for list |
diff --git a/html/user/team.inc b/html/user/team.inc
index de43305176..6d29b477c1 100644
--- a/html/user/team.inc
+++ b/html/user/team.inc
@@ -123,8 +123,8 @@ function team_table_start() {
echo "
Name |
Members |
- Average credit |
- Total credit |
+ Average credit |
+ Total credit |
Country |
";
diff --git a/html/user/top_hosts.php b/html/user/top_hosts.php
index 6b3d662015..1e9300746b 100644
--- a/html/user/top_hosts.php
+++ b/html/user/top_hosts.php
@@ -6,7 +6,13 @@
$max_hosts_display = 100;
db_init();
page_head("Top computers");
- $result = mysql_query("select * from host order by expavg_credit desc limit $max_hosts_display");
+ $sort_by = $_GET["sort_by"];
+ if ($sort_by == "total_credit") {
+ $sort_by = "total_credit desc, total_credit desc";
+ } else {
+ $sort_by = "expavg_credit desc, total_credit desc";
+ }
+ $result = mysql_query("select * from host order by $sort_by limit $max_hosts_display");
host_table_start("Top computers", false);
$i = 1;
while (($host = mysql_fetch_object($result)) && $max_hosts_display > 0) {
diff --git a/html/user/top_users.php b/html/user/top_users.php
index 7db0f651cb..f1896d9162 100644
--- a/html/user/top_users.php
+++ b/html/user/top_users.php
@@ -7,7 +7,13 @@
db_init();
$numusers = 100;
page_head("Top $numusers users");
- $result = mysql_query("select * from user order by expavg_credit desc,total_credit desc limit $numusers");
+ $sort_by = $_GET["sort_by"];
+ if ($sort_by == "total_credit") {
+ $sort_by = "total_credit desc, total_credit desc";
+ } else {
+ $sort_by = "expavg_credit desc, total_credit desc";
+ }
+ $result = mysql_query("select * from user order by $sort_by limit $numusers");
user_table_start();
while ($user = mysql_fetch_object($result)) {
show_user_row($user);
diff --git a/html/user/user.inc b/html/user/user.inc
index 581e2df623..1ebf0d0a1c 100644
--- a/html/user/user.inc
+++ b/html/user/user.inc
@@ -102,8 +102,8 @@ function user_table_start() {
echo "
Name |
- Recent average credit |
- Total credit |
+ Recent average credit |
+ Total credit |
Country |
Participant since |