X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.profile.php;h=516f019f2b48fe4f750fe517b552c26c76428988;hb=1745c7c830c7ac1aa89ee732dbfbe6939a1b32ff;hp=be02e7b88c21e529f17987a1630ce0f58b302155;hpb=d2100923749766ffcf61745b0145cf82a3886716;p=platal.git
diff --git a/plugins/function.profile.php b/plugins/function.profile.php
index be02e7b..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 (ctype_digit($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,7 +52,10 @@ function smarty_function_profile($params, &$smarty)
$name = '';
}
}
- if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin') {
+ if ($user->lost) {
+ $name .= '
';
+ }
+ if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin' && !empty($name)) {
$name = '' . $name . '';
}
return $name;