X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.profile.php;h=f97016017b7b77b4d5a4a1dec16ef086cb9e052b;hb=e557b0dbd21096d0fdd5c18f62dab460d20c90c3;hp=abfb165f2565eb6a078dfce4b4b4f7634eda8d2a;hpb=5289c142e04219cb8e846c86ccd9f5005d7d49e1;p=platal.git diff --git a/plugins/function.profile.php b/plugins/function.profile.php index abfb165..f970160 100644 --- a/plugins/function.profile.php +++ b/plugins/function.profile.php @@ -29,6 +29,8 @@ function smarty_function_profile($params, $smarty) $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); } @@ -52,12 +54,17 @@ function smarty_function_profile($params, $smarty) $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)) {