diff --git a/account.php b/account.php
index e05772c0f05..af220522014 100644
--- a/account.php
+++ b/account.php
@@ -201,17 +201,52 @@ function account_user($uname) {
$theme->footer();
}
elseif ($uname && $account = account_get_user($uname)) {
+ $theme->header();
+
+ // Display account information:
$output .= "
\n";
$output .= " ". t("Username") .": | ". check_output($account->userid) ." |
\n";
- $output .= " ". t("Real name") .": | ". check_output($user->name) ." |
\n";
+ $output .= " ". t("Real name") .": | ". check_output($account->name) ." |
\n";
$output .= " ". t("E-mail") .": | ". format_email($account->fake_email) ." |
\n";
$output .= " ". t("Homepage") .": | ". format_url($account->url) ." |
\n";
$output .= " ". t("Bio") .": | ". check_output($account->bio) ." |
\n";
$output .= "
\n";
- // Display account information:
- $theme->header();
$theme->box(strtr(t("%a's user information"), array("%a" => $uname)), $output);
+
+ // Display contributions:
+ if (user_access("access contents")) {
+ $result = db_query("SELECT n.nid, n.type, n.title, n.timestamp, COUNT(c.cid) AS count FROM node n LEFT JOIN comments c ON c.lid = n.nid WHERE n.status = '". node_status("posted") ."' AND n.author = '$account->id' GROUP BY n.nid DESC ORDER BY n.nid DESC LIMIT 25");
+
+ while ($node = db_fetch_object($result)) {
+ $nodes .= "\n";
+ $nodes .= " ". t("Subject") .": | nid\">". check_output($node->title) ." (". format_plural($node->count, "comment", "comments") .") |
\n";
+ $nodes .= " ". t("Type") .": | ". check_output($node->type) ." |
\n";
+ $nodes .= " ". t("Date") .": | ". format_date($node->timestamp) ." |
\n";
+ $nodes .= "
\n";
+ $nodes .= "\n";
+ }
+
+ $theme->box(strtr(t("%a's contributions"), array("%a" => $uname)), ($nodes ? $nodes : t("Not posted any nodes.")));
+ }
+
+ if (user_access("access comments")) {
+ $sresult = db_query("SELECT n.nid, n.title, COUNT(n.nid) AS count FROM comments c LEFT JOIN node n ON c.lid = n.nid WHERE c.author = '$account->id' GROUP BY n.nid DESC ORDER BY n.nid DESC LIMIT 5");
+
+ while ($node = db_fetch_object($sresult)) {
+ $comments .= "
". format_plural($node->count, "comment", "comments") ." ". t("attached to node") ." `nid\">". check_output($node->title) ."`:\n";
+ $comments .= " \n";
+ }
+
+ $theme->box(strtr(t("%a's comments"), array("%a" => $uname)), ($comments ? $comments : t("Not posted any comments.")));
+ }
+
$theme->footer();
}
else {
diff --git a/includes/comment.inc b/includes/comment.inc
index b88ceadfc5e..870d5feb81d 100644
--- a/includes/comment.inc
+++ b/includes/comment.inc
@@ -163,20 +163,6 @@ function comment_moderation($comment) {
return $output;
}
-function comment_controls($threshold = 1, $mode = 3, $order = 1) {
- global $REQUEST_URI, $user;
- $output .= "\n";
- $output .= "\n";
- $output .= "
\n";
- return $output;
-}
-
function comment_threshold($threshold) {
for ($i = -1; $i < 6; $i++) $options .= " ";
return "\n";
@@ -273,7 +259,7 @@ function comment_render($lid, $cid) {
if ($user->id) {
// Comment control:
- $theme->box(t("Comment control"), comment_controls($threshold, $mode, $order));
+ $theme->box(t("Comment control"), $theme->comment_controls($threshold, $mode, $order));
// Print moderation form:
print "