From 31fd9b4663a6575af1219d2550ad3cf51182c0a5 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Fri, 1 Oct 2010 14:06:10 +0200 Subject: [PATCH] Smarty's {profile} function now prints the category instead of the promo. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit For users with a promotion this does not change anything, for others this adds useful information. Example: DUCHMOL Thierry (Secrétariat de l'AX) BRUNEAU Florent (X2003) DURET Brigitte (Personnel de l'X) Signed-off-by: Florent Bruneau --- plugins/function.profile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/function.profile.php b/plugins/function.profile.php index 77909bd..f3a7fb1 100644 --- a/plugins/function.profile.php +++ b/plugins/function.profile.php @@ -22,7 +22,7 @@ function smarty_function_profile($params, &$smarty) { $params = new PlDict($params); - $with_promo = $params->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_groupperms = $params->b('groupperms', true); @@ -36,7 +36,7 @@ function smarty_function_profile($params, &$smarty) $name = '•' . $name; } if ($with_promo) { - $promo = $user->promo(); + $promo = $user->category(); if ($promo) { $name .= ' (' . pl_entities($promo) . ')'; } -- 2.1.4