X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.profile.php;h=516f019f2b48fe4f750fe517b552c26c76428988;hb=b588133fbb0ef97fc65320f38897362b74bb6a82;hp=dfc4bf306e768501f93eff88681c31fe96a559a0;hpb=a1534b3f60d76881cd8a7b468617dccf657f4926;p=platal.git diff --git a/plugins/function.profile.php b/plugins/function.profile.php index dfc4bf3..516f019 100644 --- a/plugins/function.profile.php +++ b/plugins/function.profile.php @@ -1,6 +1,6 @@ b('promo', false); + $with_promo = $params->b('promo', false) || $params->b('cat', false); $with_sex = $params->b('sex', true); $with_link = $params->b('link', true); + $with_dir = $params->b('directory', 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_dir) { + $name = pl_entities($user->directoryName()); + } else { + $name = pl_entities($user->fullName()); + } if ($with_sex && $user->isFemale()) { $name = '•' . $name; } if ($with_promo) { - $promo = $user->promo(); + $promo = $user->category(); if ($promo) { $name .= ' (' . pl_entities($promo) . ')'; } @@ -47,6 +52,9 @@ function smarty_function_profile($params, &$smarty) $name = '' . $name . ''; } } + if ($user->lost) { + $name .= ' Patte cassée'; + } if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin' && !empty($name)) { $name = '' . $name . ''; }