X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.profile.php;h=d3a93d246c4f6a80f8f4164bb3ae8569529ab0a4;hb=2482fe415f23dad9abc95f0fd5ff0fdf939de8b8;hp=516f019f2b48fe4f750fe517b552c26c76428988;hpb=45ea6160465aeba0aa780e49c12272819dedffd1;p=platal.git diff --git a/plugins/function.profile.php b/plugins/function.profile.php index 516f019..d3a93d2 100644 --- a/plugins/function.profile.php +++ b/plugins/function.profile.php @@ -1,6 +1,6 @@ b('link', true); $with_dir = $params->b('directory', true); $with_groupperms = $params->b('groupperms', true); + $raw = $params->b('raw', false); $user = $params->v('user'); + $profile = $params->v('profile'); + if (is_int($user) || ctype_digit($user)) { $user = User::getWithUID($user); } @@ -37,22 +40,31 @@ function smarty_function_profile($params, $smarty) } else { $name = pl_entities($user->fullName()); } - if ($with_sex && $user->isFemale()) { - $name = '•' . $name; - } if ($with_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 (is_null($profile)) { + $profile = $user->profile(); + } + if ($profile) { $name = '' . $name . ''; } } - if ($user->lost) { + if ($profile && $profile->isDead()) { + $name .= ' †'; + } else if ($user->lost) { $name .= ' Patte cassée'; } if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin' && !empty($name)) {