id and validate_state=0");
$foobar = mysql_fetch_object($result);
if (!$foobar) return 0;
mysql_free_result($result);
return $foobar->total;
}
function show_credit($user) {
row2("Total credit", format_credit($user->total_credit));
row2("Recent average credit", format_credit($user->expavg_credit));
if ($user->seti_nresults) {
row2("SETI@home classic workunits", number_format($user->seti_nresults));
}
if ($user->seti_total_cpu) {
$x = number_format($user->seti_total_cpu/3600)." hours";
row2("SETI@home classic CPU time", $x);
}
}
// show dynamic user info (private)
//
function show_user_stats_private($user) {
row1("Account statistics");
row2(PROJECT." member since", time_str($user->create_time));
show_credit($user);
row2("Pending credit", "View");
if ($user->teamid) {
$team = lookup_team($user->teamid);
$x = "id>$team->name
| Quit this team";
if ($team->userid == $user->id) {
$x .= " | management functions";
}
row2("Team", $x);
} else {
row2("Team", "None (find a team)");
}
row2("Computers", "View");
row2("Results", "id>View");
if ($user->posts) {
row2("Message board posts", "id>$user->posts messages");
}
}
// show static user info (private)
//
function show_user_info_private($user) {
if (is_valid_email_addr($user->email_addr)) {
$email_text = $user->email_addr;
} else {
$email_text = "Verification pending";
}
row1("Account information");
row2("Email address
Edit",
$email_text
);
row2("Name", $user->name);
if (strlen($user->url)) {
$x = "http://$user->url";
} else {
$x = "none";
}
row2("URL", $x);
row2("Country", $user->country);
row2("Postal code", $user->postal_code);
if ($user->signature) {
$x = "
".htmlspecialchars($user->signature).""; row2("Forums signature", $x); } row2("", "Edit account info"); row1("Profile"); $sql = "SELECT * FROM profile WHERE userid = ".$user->id; $result = mysql_query($sql); if (mysql_num_rows($result) != 0) { row2("", "id>View or edit"); row2("", "Delete"); } else { row2("", "Create"); } row1("Preferences"); row2( "General