/** * Decorates theme_username() to strip the " (not verified)" string from the * commenter's name. * * @param object $account * An instance of a user object. * * @return string * The altered HTML output from theme_username(). */ function __nitobe_username($account) { $output = theme_username($account); if ((bool) theme_get_setting("nitobe_remove_not_verified")) { $to_strip = " (" . t("not verified") . ")"; $output = str_replace($to_strip, "", $output); } return $output; }
/** * Override a formatted list of recent comments to be displayed in the comment block. */ function phptemplate_comment_block() { $items = array(); foreach (phptemplate_comment_get_recent() as $comment) { $link = l($comment->subject, 'node/' . $comment->nid, array('fragment' => 'comment-' . $comment->cid)); $date = t('@time ago', array('@time' => format_interval(time() - $comment->timestamp))); if ($author = _member_get_node($comment->uid)) { $capacity = ($author->jobtitle === '' ? '' : $author->jobtitle . ', ') . ($author->affiliation === '' ? '' : $author->affiliation); $author = theme('member_link', $author); } else { $author = theme_username(user_load(array('uid' => $comment->uid))); $capacity = ''; } $content = '<div class="title clear-block">' . $link . ' <span class="date">' . $date . '</span></div>'; $content .= '<div class="comment clear-block">' . scf_au_truncate_by_word_count($comment->comment, 30) . '</div>'; $content .= '<div class="byline vcard clear-block">By <span class="fn">' . $author . '</span>'; $content .= ($capacity === '' ? '' : ', <span class="title">' . $capacity . '</span>') . '</div>'; $items[] = $content; } if ($items) { return theme('item_list', $items); } }
/** * Username override * Hides or shows username '(not verified)' text */ function fusion_core_username($object) { if (!$object->uid && $object->name) { $output = !empty($object->homepage) ? l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow'))) : check_plain($object->name); $output .= theme_get_setting('user_notverified_display') == 1 ? t(' (not verified)') : ''; } else { $output = theme_username($object); } return $output; }
* - $submitted: By line with date and time. * - $title: Linked title. * * These two variables are provided for context. * - $comment: Full comment object. * - $node: Node object the comments are attached to. * * @see template_preprocess_comment() * @see theme_comment() */ $date = t('@time ago', array('@time' => format_interval(time() - $comment->timestamp))); if ($author = _member_get_node($comment->uid)) { $capacity = ($author->jobtitle === '' ? '' : $author->jobtitle . ', ') . ($author->affiliation === '' ? '' : $author->affiliation); $author = theme('member_link', $author); } else { $author = theme_username(user_load(array('uid' => $comment->uid))); $capacity = ''; } ?> <div class="comment<?php print $comment->new ? ' comment-new' : ''; print ' ' . $status; ?> clear-block"> <h3 class="clear-block"> <?php print $title; ?> <span class="date"> Added <?php print $date; ?>