projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix organizer display for events created by xnet accounts.
[platal.git]
/
plugins
/
function.profile.php
diff --git
a/plugins/function.profile.php
b/plugins/function.profile.php
index
abfb165
..
fc7087f
100644
(file)
--- a/
plugins/function.profile.php
+++ b/
plugins/function.profile.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-201
1
Polytechnique.org *
+ * Copyright (C) 2003-201
4
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-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');
$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);
}
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) {
$name = '•' . $name;
}
if ($with_link) {
- $profile = ($user instanceof Profile) ? $user : $user->profile();
+ if (is_null($profile)) {
+ $profile = $user->profile();
+ }
+
if ($profile) {
$name = '<a href="profile/' . $profile->hrid() . '" class="popup2">' . $name . '</a>';
}
}
if ($profile) {
$name = '<a href="profile/' . $profile->hrid() . '" class="popup2">' . $name . '</a>';
}
}
- if ($user->lost) {
+ if ($profile && $profile->isDead()) {
+ $name .= ' †';
+ } else if ($user->lost) {
$name .= ' <a href="https://www.polytechnique.org/marketing/broken/' . $user->hruid . '"><img src="images/icons/error.gif" alt="Patte cassée" /></a>';
}
if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin' && !empty($name)) {
$name .= ' <a href="https://www.polytechnique.org/marketing/broken/' . $user->hruid . '"><img src="images/icons/error.gif" alt="Patte cassée" /></a>';
}
if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin' && !empty($name)) {
@@
-66,5
+73,5
@@
function smarty_function_profile($params, $smarty)
return $name;
}
return $name;
}
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker
f
enc=utf-8:
?>
?>