summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-11-02 15:10:56 -0700
committerBrion Vibber <brion@pobox.com>2010-11-02 15:10:56 -0700
commit905d621b6f4fed60deb772df691c15e4a57a1902 (patch)
treeb6dd72dad5c497b8df98cf191e6137ebaa231584 /classes
parent23f69c80b5c6a8730fc6ff3b9f3cec71840de03b (diff)
parent81e06530800bce5eb60eca362d4c21453632183a (diff)
Merge branch '0.9.x' into twitstream
Diffstat (limited to 'classes')
-rw-r--r--classes/Profile.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/classes/Profile.php b/classes/Profile.php
index 37d2c571f..064ba551c 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -141,12 +141,33 @@ class Profile extends Memcached_DataObject
return true;
}
+ /**
+ * Gets either the full name (if filled) or the nickname.
+ *
+ * @return string
+ */
function getBestName()
{
return ($this->fullname) ? $this->fullname : $this->nickname;
}
/**
+ * Gets the full name (if filled) with nickname as a parenthetical, or the nickname alone
+ * if no fullname is provided.
+ *
+ * @return string
+ */
+ function getFancyName()
+ {
+ if ($this->fullname) {
+ // TRANS: Full name of a profile or group followed by nickname in parens
+ return sprintf(_('%1$s (%2$s)'), $this->fullname, $this->nickname);
+ } else {
+ return $this->nickname;
+ }
+ }
+
+ /**
* Get the most recent notice posted by this user, if any.
*
* @return mixed Notice or null