From 7f3a75a1107d5a2317062aa823fc250be8505ad2 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Fri, 15 Oct 2004 07:30:40 +0000 Subject: [PATCH] more readable --- htdocs/listes/admin.php | 3 ++- htdocs/listes/members.php | 11 ++++++----- templates/listes/admin.tpl | 4 ++-- templates/listes/members.tpl | 6 +++++- templates/listes/moderate_mail.tpl | 8 +++++++- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/htdocs/listes/admin.php b/htdocs/listes/admin.php index 86c40ad..21780cd 100644 --- a/htdocs/listes/admin.php +++ b/htdocs/listes/admin.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: admin.php,v 1.4 2004-10-06 13:16:49 x2000habouzit Exp $ + $Id: admin.php,v 1.5 2004-10-15 07:30:40 x2000habouzit Exp $ ***************************************************************************/ if(empty($_REQUEST['liste'])) header('Location: index.php'); @@ -82,6 +82,7 @@ if(list($det,$mem,$own) = $client->get_members('polytechnique.org', $liste)) { $page->assign_by_ref('details', $det); $page->assign_by_ref('members', $membres); $page->assign_by_ref('owners', $moderos); + $page->assign('np_m', count($mem)); } else $page->assign('no_list',true); diff --git a/htdocs/listes/members.php b/htdocs/listes/members.php index 260660d..f1c8499 100644 --- a/htdocs/listes/members.php +++ b/htdocs/listes/members.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: members.php,v 1.3 2004-10-14 19:01:31 x2000habouzit Exp $ + $Id: members.php,v 1.4 2004-10-15 07:30:40 x2000habouzit Exp $ ***************************************************************************/ if(empty($_REQUEST['liste'])) header('Location: index.php'); @@ -37,9 +37,9 @@ $members = $client->get_members('polytechnique.org', $liste); $tri_promo = empty($_REQUEST['alpha']); -if(is_array($members)) { +if(list($det,$mem,$own) = $members) { $membres = Array(); - foreach($members[1] as $member) { + foreach($mem as $member) { if(preg_match('/^([^.]*.([^.]*).(\d\d\d\d))@polytechnique.org$/', $member[1], $matches)) { $key = $tri_promo ? $matches[3] : strtoupper($matches[2]{0}); $membres[$key][$matches[2]] = Array('n' => $member[0], 'l' => $matches[1]); @@ -51,7 +51,7 @@ if(is_array($members)) { foreach($membres as $key=>$val) ksort($membres[$key]); $moderos = Array(); - foreach($members[2] as $owner) { + foreach($own as $owner) { list($m) = split('@',$owner); $res = $globals->db->query("SELECT CONCAT(prenom, ' ', nom), promo FROM auth_user_md5 AS u @@ -66,9 +66,10 @@ if(is_array($members)) { } ksort($moderos); - $page->assign_by_ref('details', $members[0]); + $page->assign_by_ref('details', $det); $page->assign_by_ref('members', $membres); $page->assign_by_ref('owners', $moderos); + $page->assign('nb_m', count($mem)); } else $page->assign('no_list',true); diff --git a/templates/listes/admin.tpl b/templates/listes/admin.tpl index dc5880d..5efedb8 100644 --- a/templates/listes/admin.tpl +++ b/templates/listes/admin.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: admin.tpl,v 1.8 2004-10-09 12:49:38 x2000habouzit Exp $ + $Id: admin.tpl,v 1.9 2004-10-15 07:30:40 x2000habouzit Exp $ ***************************************************************************} {dynamic} @@ -91,7 +91,7 @@ c'est-
- membres de la liste + {$np_m|default:"0"} membre(s) dans la liste
diff --git a/templates/listes/members.tpl b/templates/listes/members.tpl index 0c161f0..a46d31c 100644 --- a/templates/listes/members.tpl +++ b/templates/listes/members.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: members.tpl,v 1.7 2004-10-14 19:01:31 x2000habouzit Exp $ + $Id: members.tpl,v 1.8 2004-10-15 07:30:40 x2000habouzit Exp $ ***************************************************************************} {dynamic} @@ -69,6 +69,10 @@ Inscription {if $details.ins}modérée{else}libre{/if} + + Nb. membres: + {$nb_m|default:"0"} + {if $details.info}
diff --git a/templates/listes/moderate_mail.tpl b/templates/listes/moderate_mail.tpl index cb66fd9..4d4515a 100644 --- a/templates/listes/moderate_mail.tpl +++ b/templates/listes/moderate_mail.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: moderate_mail.tpl,v 1.5 2004-10-10 22:05:25 x2000habouzit Exp $ + $Id: moderate_mail.tpl,v 1.6 2004-10-15 07:30:40 x2000habouzit Exp $ ***************************************************************************} {dynamic} @@ -86,6 +86,12 @@ +