X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.profile.php;h=abfb165f2565eb6a078dfce4b4b4f7634eda8d2a;hb=009f4a24bd8743b2cf180b59cb2a2d90ff3f8640;hp=53f2a5db9001214643818e4434bbbff288a1d5e2;hpb=fb813fb52d5ab65ca9a5b92b5cb9089523380d79;p=platal.git
diff --git a/plugins/function.profile.php b/plugins/function.profile.php
index 53f2a5d..abfb165 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);
+ $raw = $params->b('raw', false);
$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_sex && $user->isFemale()) {
- $name = '•' . $name;
+ if ($with_dir) {
+ $name = pl_entities($user->directoryName());
+ } else {
+ $name = pl_entities($user->fullName());
}
if ($with_promo) {
- $promo = $user->promo();
+ $promo = $user->category();
if ($promo) {
$name .= ' (' . pl_entities($promo) . ')';
}
}
+ if ($raw) {
+ return $name;
+ }
+
+ if ($with_sex && $user->isFemale()) {
+ $name = '•' . $name;
+ }
if ($with_link) {
$profile = ($user instanceof Profile) ? $user : $user->profile();
if ($profile) {
$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;