create_time));
row2("Total credit", $user->total_credit);
row2("Recent average credit", $user->expavg_credit);
if ($user->teamid) {
$result = mysql_query("select * from team where id = $user->teamid");
$team = mysql_fetch_object($result);
row2("Team", "id>$team->name");
} else {
row2("Team", "None");
}
row2("Computers", "View");
}
// show static user info (private)
//
function show_user_profile_private($user) {
if (is_valid_email_addr($user->email_addr)) {
$email_text = $user->email_addr;
} else {
$email_text = "Verification pending";
}
row1("Your account information");
row2("Email address
Edit",
$email_text
);
row2("Name", $user->name);
row2("URL", "http://$user->url");
row2("Country", $user->country);
row2("Postal code", $user->postal_code);
row2("", "Edit account info");
row1("Your profile");
$sql = "SELECT * FROM profile WHERE userid = ".$user->id;
$result = mysql_query($sql);
if (mysql_num_rows($result) != 0) {
row2("", "id>View / Edit");
row2("", "Delete");
} else {
row2("", "Create");
}
row1("Your preferences");
row2("General", "View / Edit");
row2(PROJECT, "View / Edit");
}
// show summary of dynamic and static info (public)
function show_user_summary_public($user) {
$result = mysql_query("SELECT * FROM profile WHERE userid = $user->id");
row1("Account data for $user->name");
row2(PROJECT." member since", time_str($user->create_time));
row2("Country", $user->country);
if (strlen($user->url)) {
row2("URL", "url>http://$user->url");
}
row2("Total credit", $user->total_credit);
row2("Recent average credit", $user->expavg_credit);
if (mysql_num_rows($result) != 0) {
row2("Profile", "id>View");
}
if ($user->teamid) {
$result = mysql_query("select * from team where id = $user->teamid");
$team = mysql_fetch_object($result);
row2("Team", "id>$team->name");
} else {
row2("Team", "None");
}
if ($user->show_hosts) {
row2("Computers", "id>View");
} else {
row2("Computers", "hidden");
}
}
// show a summary of the user.
// NOTE: This is intended to be shown only to that user.
// it has info that other users aren't supposed to see
function show_user_page_private($user) {
start_table();
show_user_profile_private($user); // NOTE: Will include the actual user profile.
show_user_stats_private($user);
end_table();
}
function user_table_start() {
start_table();
echo "