diff options
author | natrak <> | 2001-07-25 12:21:48 +0000 |
---|---|---|
committer | natrak <> | 2001-07-25 12:21:48 +0000 |
commit | d016fb14f43976ba184d3e0597065b15f5eca1f0 (patch) | |
tree | d3303a5c55095cdbbc94926274a1512b1b85387c /includes | |
parent | e0dc03dccd90fb6dc0130233719f74429a547cd4 (diff) | |
download | brdo-d016fb14f43976ba184d3e0597065b15f5eca1f0.tar.gz brdo-d016fb14f43976ba184d3e0597065b15f5eca1f0.tar.bz2 |
common.inc
- format_username() now takes a second optional parameter which gives the
real name of the user.
Rest
- updated the calls to format_username() where appropriate to show the name
of the user instead of the account id. Clicking on a name will still give you
the account info etc. If you find a place where the real name is not shown
let me know.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/comment.inc | 6 | ||||
-rw-r--r-- | includes/node.inc | 2 | ||||
-rw-r--r-- | includes/search.inc | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/includes/comment.inc b/includes/comment.inc index 870d5feb8..757a27c89 100644 --- a/includes/comment.inc +++ b/includes/comment.inc @@ -52,7 +52,7 @@ function comment_form($edit) { global $REQUEST_URI, $user; // name field: - $form .= form_item(t("Your name"), format_username($user->userid)); + $form .= form_item(t("Your name"), format_username($user->userid, $user->name)); // subject field: $form .= form_textfield(t("Subject"), "subject", $edit[subject], 50, 64); @@ -216,7 +216,7 @@ function comment_view($comment, $folded = 0) { // display comment: if ($folded) $theme->comment($comment, $folded); - else print "<A HREF=\"". comment_uri("id=$comment->lid&cid=$comment->cid#$comment->cid") ."\">". check_output($comment->subject) ."</A> by ". format_username($comment->userid) ." <SMALL>($comment->score)</SMALL><P>"; + else print "<A HREF=\"". comment_uri("id=$comment->lid&cid=$comment->cid#$comment->cid") ."\">". check_output($comment->subject) ."</A> by ". format_username($comment->userid, $comment->name) ." <SMALL>($comment->score)</SMALL><P>"; } function comment_thread_min($cid, $threshold) { @@ -278,7 +278,7 @@ function comment_render($lid, $cid) { print " <TR><TH>Subject</TH><TH>Author</TH><TH>Date</TH><TH>Score</TH></TR>\n"; while ($comment = db_fetch_object($result)) { if (comment_visible($comment, $threshold)) { - print " <TR><TD><A HREF=\"". comment_uri("id=$comment->lid&cid=$comment->cid#$comment->cid") ."\">". check_output($comment->subject) ."</A></TD><TD>". format_username($comment->userid) ."</TD><TD>". format_date($comment->timestamp, "small") ."</TD><TD>". comment_score($comment) ."</TD></TR>\n"; + print " <TR><TD><A HREF=\"". comment_uri("id=$comment->lid&cid=$comment->cid#$comment->cid") ."\">". check_output($comment->subject) ."</A></TD><TD>". format_username($comment->userid, $comment->name) ."</TD><TD>". format_date($comment->timestamp, "small") ."</TD><TD>". comment_score($comment) ."</TD></TR>\n"; } } print "</TABLE>\n"; diff --git a/includes/node.inc b/includes/node.inc index 1653415d1..de8b36f19 100644 --- a/includes/node.inc +++ b/includes/node.inc @@ -16,7 +16,7 @@ function _node_get($conditions) { } if ($type) { - return db_query("SELECT n.*, l.*, u.userid FROM node n LEFT JOIN $type l ON n.lid = l.lid AND n.nid = l.nid LEFT JOIN users u ON n.author = u.id WHERE $where ORDER BY n.timestamp DESC"); + return db_query("SELECT n.*, l.*, u.userid, u.name FROM node n LEFT JOIN $type l ON n.lid = l.lid AND n.nid = l.nid LEFT JOIN users u ON n.author = u.id WHERE $where ORDER BY n.timestamp DESC"); } } diff --git a/includes/search.inc b/includes/search.inc index e3cd239c3..5be56fb48 100644 --- a/includes/search.inc +++ b/includes/search.inc @@ -14,7 +14,7 @@ function search_data($keys, $type) { foreach ($result as $entry) { $output .= "<p>\n"; $output .= " <b><u><a href=\"$entry[link]\" />$entry[title]</a></u></b><br />"; - $output .= " <small>$entry[link]". ($entry[user] ? " - ". format_username($entry[user]) : "") ."". ($entry[date] ? " - ". format_date($entry[date], "small") : "") ."</small>"; + $output .= " <small>$entry[link]". ($entry[user] ? " - ". format_username($entry[user], $entry[name]) : "") ."". ($entry[date] ? " - ". format_date($entry[date], "small") : "") ."</small>"; $output .= "</p>\n"; } } |