");
exit();
}
}
getDatabaseLink($link);
beginRO($link);
function viewuserinfo($link, $userId) {
txcache_invaltag("users", "id", $userId);
$userResult = sql_query("SELECT * FROM users WHERE users.id=$userId", $link) or die("ERROR: Query failed");
if (sql_num_rows($userResult) == 0)
{
die("ERROR: Sorry, but this user does not exist.
\n");
}
printHTMLheader("RUBiS: View user information");
// Get general information about the user
$userRow = sql_fetch_array($userResult);
$firstname = $userRow["firstname"];
$lastname = $userRow["lastname"];
$nickname = $userRow["nickname"];
$email = $userRow["email"];
$creationDate = $userRow["creation_date"];
$rating = $userRow["rating"];
print("Information about ".$nickname."
");
print("Real life name : ".$firstname." ".$lastname."
");
print("Email address : ".$email."
");
print("User since : ".$creationDate."
");
print("Current rating : ".$rating."
");
printCommentTable($link, $userId);
sql_free_result($userResult);
}
wrap(true, 'viewuserinfo', $link, $userId);
commit($link);
sql_close($link);
printHTMLfooter($scriptName, $startTime);
?>