public function profileController_usernameMeta_handler($sender, $args) { // get all fields since that is better for caching! $profileFields = Gdn::userMetaModel()->getUserMeta($sender->User->UserID, 'Profile.%', 'Profile.'); $nickname = $profileFields['Profile.' . c('Nickname.Fieldname')]; if ($nickname) { echo '<span class="Nickname">(a.k.a. ' . $nickname . ')</span>'; } }
public static function get($Key, $Default = null) { $Response = Gdn::userMetaModel()->getUserMeta(0, $Key, $Default); if (sizeof($Response) == 1) { return val($Key, $Response, $Default); } return $Default; }
/** * Instance of UserMetaModel. * * @return UserMetaModel */ public function userMetaModel() { return Gdn::userMetaModel(); }