X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.profile.php;h=dfc4bf306e768501f93eff88681c31fe96a559a0;hb=28c20b86be8b40cecba0d83080879f81c49e07ad;hp=d686b1ce1b2b972c6d014b322130e60b18ae176b;hpb=6d1747b3dbcf944c995dc2d87e8561c7a66f3aa6;p=platal.git diff --git a/plugins/function.profile.php b/plugins/function.profile.php index d686b1c..dfc4bf3 100644 --- a/plugins/function.profile.php +++ b/plugins/function.profile.php @@ -1,6 +1,6 @@ b('promo', false); + $with_sex = $params->b('sex', true); + $with_link = $params->b('link', true); + $with_groupperms = $params->b('groupperms', true); + $user = $params->v('user'); + if (is_int($user) || ctype_digit($user)) { + $user = User::getWithUID($user); + } $name = pl_entities($user->fullName()); if ($with_sex && $user->isFemale()) { @@ -43,7 +47,7 @@ function smarty_function_profile($params, &$smarty) $name = '' . $name . ''; } } - if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin') { + if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin' && !empty($name)) { $name = '' . $name . ''; } return $name;