-Subproject commit e25ddad9784ef9e8e4de1847b50207f88622a165
+Subproject commit f4e68a785c9cd69abf70db02944eb9422fef6414
Env::i('unread'), S::i('uid'));
pl_redirect("#art" . Env::i('unread'));
}
- $arts = XDB::iterator("SELECT a.*, u.nom, u.prenom, u.promo, u.hruid,
- FIND_IN_SET('photo', a.flags) AS photo
+ // XXX: Fix promo_min; promo_max
+ $arts = XDB::iterator("SELECT a.*, FIND_IN_SET('photo', a.flags) AS photo
FROM groupex.announces AS a
- INNER JOIN auth_user_md5 AS u USING(user_id)
LEFT JOIN groupex.announces_read AS r ON (r.user_id = {?} AND r.announce_id = a.id)
WHERE asso_id = {?} AND peremption >= CURRENT_DATE()
AND (promo_min = 0 OR promo_min <= {?})
S::i('uid'), $globals->asso('id'), S::i('promo'), S::i('promo'));
$page->assign('article_index', $index);
} else {
- $arts = XDB::iterator("SELECT a.*, u.nom, u.prenom, u.promo, FIND_IN_SET('photo', a.flags) AS photo
+ $arts = XDB::iterator("SELECT a.*, FIND_IN_SET('photo', a.flags) AS photo
FROM groupex.announces AS a
- INNER JOIN auth_user_md5 AS u USING(user_id)
WHERE asso_id = {?} AND peremption >= CURRENT_DATE()
- AND FIND_IN_SET('public', u.flags)",
+ AND FIND_IN_SET('public', a.flags)",
$globals->asso('id'));
}
if (may_update()) {
function smarty_function_profile($params, &$smarty)
{
- $with_promo = isset($params['with_promo']) ? $params['with_promo'] : false;
- $with_sex = isset($params['with_sex']) ? $params['with_sex'] : true;
- $with_link = isset($params['with_link']) ? $params['with_link'] : true;
- $with_groupperms = isset($params['with_groupperms']) ? $params['with_groupperms'] : true;
- $user = $params['user'];
+ $params = new PlDict($params);
+ $with_promo = $params->b('promo', false);
+ $with_sex = $params->b('sex', true);
+ $with_link = $params->b('link', true);
+ $with_groupperms = $params->b('groupperms', true);
+ $user = $params->v('user');
+ if (ctype_digit($user)) {
+ $user = User::getWithUID($user);
+ }
$name = pl_entities($user->fullName());
if ($with_sex && $user->isFemale()) {
<!-- Don't copy this list of emails!!!
+{if !t($login)}
+ {if t($smarty.session.auth)}
+ {assign var="login" value="true"}
+ {/if}
+{/if}
+
{poison seed=$login}
-->
-{if !$login && $smarty.session.auth}
- {assign var="login" value="true"}
-{/if}
<div id="bandeau-X">
<img src="bandeau/icone.png" alt=""/>
<a href="http://www.polytechniciens.com/">AX</a>
˜˜
<a href="https://www.polytechnique.org">Polytechnique.org</a> ·
- <a href="http://www.polytechnique.net{if $login}/login{/if}">Associations polytechniciennes</a> ·
+ <a href="http://www.polytechnique.net{if t($login)}/login{/if}">Associations polytechniciennes</a> ·
<a href="http://www.polytechnique.fr/eleves/">Élèves</a> ·
- <a href="http://www.manageurs.com/{if $login}anciens_accueil.php?asso=X.org{/if}">Manageurs</a>
+ <a href="http://www.manageurs.com/{if t($login)}anciens_accueil.php?asso=X.org{/if}">Manageurs</a>
</div>
{* vim:set et sw=2 sts=2 sws=2 enc=utf8: *}
</head>
<body>
{include core=plpage.devel.tpl}
- {if !$simple}
+ {if !t($simple)}
{include file=skin/common.bandeau.tpl}
{/if}
<table id="layout" cellspacing="0" cellpadding="0">
- {if !$simple}
+ {if !t($simple)}
<tr>
<td colspan="2">
<table cellspacing="0" cellpadding="0" id="top">
</td>
{if $xnet_type}
<td style="width: 280px">
- <a href="{if $xnet_type eq plan}plan{else}groups/{$xnet_type}{/if}"><img src="images/texte_{$xnet_type}.jpg" alt="{$xnet_type}" width="280" height="96" /></a>
+ <a href="{if $xnet_type eq 'plan'}plan{else}groups/{$xnet_type}{/if}"><img src="images/texte_{$xnet_type}.jpg" alt="{$xnet_type}" width="280" height="96" /></a>
</td>
{if $asso}
<td class="logo">
</tr>
{/if}{* fin simple *}
- {if $menu && !$simple}
+ {if $menu && !t($simple)}
<tr>
<td id="menu">
{foreach from=$menu key=title item=submenu}
{include core=plpage.content.tpl}
</td>
</tr>
- {if !$simple}
+ {if !t($simple)}
<tr class="hideable"><td colspan="2"><img src="images/barre.png" alt="----------" width="100%" /></td></tr>
<tr class="hideable">
</tr>
{/if}
{/if}
- {if !$simple}
+ {if !t($simple)}
<tr class="hideable"><td colspan="2"><img src="images/barre.png" alt="----------" width="100%" /></td></tr>
<tr class="hideable">
<td {if $art.photo}colspan="2"{/if}>
<div style="float: right">
<small>
- Annonce proposée par
- <a class="popup2" href="https://www.polytechnique.org/profile/{$art.hruid}">
- {$art.prenom} {$art.nom} (X{$art.promo})
- </a>
+ Annonce proposée par {profile user=$art.user_id sex=false promo=true groupperms=false}
</small>
</div>
<small>
</tr>
{foreach from=$not_in_list item=u}
<tr>
- <td class='checkboxToggle'>{profile user=$u with_promo=false}</td>
+ <td class='checkboxToggle'>{profile user=$u promo=false}</td>
<td class='checkboxToggle'>{$u->promo()}</td>
<td class='checkboxToggle'><input type="checkbox" class="moderate_email" name="add[{$u->forlifeEmail()}]" id="add{$u->forlifeEmail()}"/></td>
</tr>