}
}
+class ArraySet extends UserSet
+{
+ public function __construct(array $users)
+ {
+ $where = $this->getUids($users);
+ if ($where) {
+ $where = "a.alias IN ($where)";
+ } else {
+ $where = " 0 ";
+ }
+ parent::__construct('', $where);
+ }
+
+ private function getUids(array $users)
+ {
+ $users = get_users_forlife_list($users, true, '_silent_user_callback');
+ if (is_null($users)) {
+ return '';
+ }
+ return '\'' . implode('\', \'', $users) . '\'';
+ }
+}
+
class MinificheView extends MultipageView
{
public function __construct(PlSet &$set, $data, array $params)
}
$this->addSortKey('name', array('nom', 'prenom'), 'nom');
$this->addSortKey('promo', array('-promo', 'nom', 'prenom'), 'promotion');
- $this->addSortKey('date', array('-watch_last', '-promo', 'nom', 'prenom'), 'dernière modification');
parent::__construct($set, $data, $params);
}
'lists/create' => $this->make_hook('create', AUTH_MDP),
'lists/members' => $this->make_hook('members', AUTH_COOKIE),
- 'lists/trombi' => $this->make_hook('trombi', AUTH_COOKIE),
+ 'lists/annu' => $this->make_hook('annu', AUTH_COOKIE),
'lists/archives' => $this->make_hook('archives', AUTH_COOKIE),
'lists/archives/rss' => $this->make_hook('rss', AUTH_PUBLIC),
}
}
- function compare($a, $b)
- {
- if ($a['promo'] == $b['promo']) {
- if ($a['nom'] == $b['nom']) {
- return strcmp($a['prenom'], $b['prenom']);
- }
- return strcmp($a['nom'], $b['nom']);
- }
- return $a['promo'] - $b['promo'];
- }
-
- function _get_list($offset, $limit)
- {
- global $platal;
- list($total, $members) = $this->client->get_members_limit($platal->argv[1], $offset, $limit);
-
- $membres = Array();
- foreach ($members as $member) {
- list($m) = explode('@',$member[1]);
- $res = XDB::query("SELECT prenom,if (nom_usage='', nom, nom_usage) AS nom,
- promo, a.alias AS forlife
- FROM auth_user_md5 AS u
- INNER JOIN aliases AS a ON u.user_id = a.id
- INNER JOIN photo AS p ON p.uid = u.user_id
- WHERE a.alias = {?}", $m);
- if ($tmp = $res->fetchOneAssoc()) {
- $membres[$tmp['nom']] = $tmp;
- } else {
- $total--;
- }
- }
- uasort($membres, array($this, 'compare'));
- return array($total, $membres);
- }
-
- function handler_trombi(&$page, $liste = null)
+ function handler_annu(&$page, $liste = null, $action = null, $subaction = null)
{
if (is_null($liste)) {
return PL_NOT_FOUND;
$this->prepare_client($page);
- $page->changeTpl('lists/trombi.tpl');
-
if (Get::has('del')) {
$this->client->unsubscribe($liste);
- pl_redirect('lists/trombi/'.$liste);
+ pl_redirect('lists/annu/'.$liste);
}
if (Get::has('add')) {
$this->client->subscribe($liste);
- pl_redirect('lists/trombi/'.$liste);
+ pl_redirect('lists/annu/'.$liste);
}
$owners = $this->client->get_owners($liste);
-
- if (is_array($owners)) {
- $moderos = list_sort_owners($owners[1]);
-
- $page->assign_by_ref('details', $owners[0]);
- $page->assign_by_ref('owners', $moderos);
-
- $trombi = new Trombi(array(&$this, '_get_list'));
- $page->assign('trombi', $trombi);
- } else {
+ if (!is_array($owners)) {
$page->kill("La liste n'existe pas ou tu n'as pas le droit d'en voir les détails");
}
+
+ global $platal;
+ list(,$members) = $this->client->get_members($liste);
+ $users = array();
+ foreach ($members as $m) {
+ $users[] = $m[1];
+ }
+ require_once 'userset.inc.php';
+ $view = new ArraySet($users);
+ $view->addMod('trombi', 'Trombinoscope', true, array('with_promo' => true));
+ if (empty($GLOBALS['IS_XNET_SITE'])) {
+ $view->addMod('minifiche', 'Minifiches', false);
+ }
+ $view->addMod('geoloc', 'Planisphère');
+ $view->apply("lists/annu/$liste", $page, $action, $subaction);
+ if ($action == 'geoloc' && $subaction) {
+ return;
+ }
+
+ $page->changeTpl('lists/annu.tpl');
+ $moderos = list_sort_owners($owners[1]);
+ $page->assign_by_ref('details', $owners[0]);
+ $page->assign_by_ref('owners', $moderos);
}
function handler_archives(&$page, $liste = null, $action = null, $artid = null)
{foreach from=$owners item=xs key=promo}
{foreach from=$xs item=x}
{if $promo}
- {cycle values="1,2,3" assign="loop"}
+ {cycle values="1,2,3,4" assign="loop"}
{if $loop eq "1"}<tr>{/if}
<td class='center'>
- <img src="photo/{$x.l}" width="110" alt=" [ PHOTO ] " />
+ <img src="photo/{$x.l}" width="80" alt=" [ PHOTO ] " />
<br />
<a href="profile/{$x.l}" class="popup2">
{$x.n} ({$promo})
</a>
</td>
- {if $loop eq "3"}</tr>{/if}
+ {if $loop eq "4"}</tr>{/if}
{/if}
{/foreach}
{/foreach}
{if $loop eq "1"}
{cycle values="1,2,3" assign="loop"}
{cycle values="1,2,3" assign="loop"}
- <td></td><td></td></tr>
+ {cycle values="1,2,3" assign="loop"}
+ <td></td><td></td><td></td></tr>
{elseif $loop eq "2"}
{cycle values="1,2,3" assign="loop"}
+ {cycle values="1,2,3" assign="loop"}
+ <td></td><td></td></tr>
+ {elseif $loop eq "3"}
+ {cycle values="1,2,3" assign="loop"}
<td></td></tr>
{/if}
</table>
-<h1>
- membres de la liste
-</h1>
-
-{$trombi->show()|smarty:nodefaults}
-
+{include file="core/plset.tpl"}
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}