From 7625a4e91ab81b52f5cd74cabe5b0e0324ef8bb4 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 1 Aug 2005 05:14:05 +0000 Subject: - Patch #27737 by Gerhard: format_name($object) -> theme('username', $object). Usernames can now be themed; eg. an icon/avatar could be added. TODO: update contributed modules + update the migration docs. --- modules/comment/comment.module | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/comment/comment.module') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 568471b97..0f66a630a 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1020,7 +1020,7 @@ function comment_admin_overview($type = 'new') { $comment->name = $comment->uid ? $comment->registered_name : $comment->name; $rows[] = array( l($comment->subject, "node/$comment->nid", array('title' => truncate_utf8($comment->comment, 128)), NULL, "comment-$comment->cid") ." ". theme('mark', node_mark($comment->nid, $comment->timestamp)), - format_name($comment), + theme('username', $comment), ($comment->status == COMMENT_PUBLISHED ? t('Published') : t('Not published')), format_date($comment->timestamp, 'small'), l(t('edit'), "comment/edit/$comment->cid", array(), $destination), @@ -1400,7 +1400,7 @@ function theme_comment_form($edit, $title = NULL) { $form .= "\n"; } else { - $form .= form_item(t('Your name'), format_name($user)); + $form .= form_item(t('Your name'), theme('username', $user)); } } else if (variable_get('comment_anonymous', 0) == 1) { @@ -1554,7 +1554,7 @@ function theme_comment($comment, $links = 0) { $output = "
\n"; $output .= '
'. l($comment->subject, $_GET['q'], NULL, NULL, "comment-$comment->cid") . ' ' . theme('mark', $comment->new) ."
\n"; $output .= '
'. $comment->moderation ."
\n"; - $output .= '
'. t('by %a on %b', array('%a' => format_name($comment), '%b' => format_date($comment->timestamp))) ."
\n"; + $output .= '
'. t('by %a on %b', array('%a' => theme('username', $comment), '%b' => format_date($comment->timestamp))) ."
\n"; $output .= "
$comment->comment
\n"; $output .= "
$links
\n"; $output .= "
\n"; @@ -1564,7 +1564,7 @@ function theme_comment($comment, $links = 0) { function theme_comment_folded($comment) { $output = "
\n"; $output .= ' '. l($comment->subject, comment_node_url() .'/'. $comment->cid, NULL, NULL, "comment-$comment->cid") . ' '. theme('mark', $comment->new) .' '; - $output .= ''. t('by') .' '. format_name($comment) ."\n"; + $output .= ''. t('by') .' '. theme('username', $comment) ."\n"; $output .= "
\n"; return $output; } -- cgit v1.2.3