From 1972197078da28c109730a59ea1215eaa545a366 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Fri, 16 Jul 2010 01:39:20 +0200 Subject: [PATCH] Removes boggus getAliveUsersCount() function, fixes alive user count in marketing email. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- include/marketing.inc.php | 9 +-------- modules/marketing.php | 3 ++- templates/marketing/marketing.mail.tpl | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/marketing.inc.php b/include/marketing.inc.php index 18f02a6..af1ef1f 100644 --- a/include/marketing.inc.php +++ b/include/marketing.inc.php @@ -186,18 +186,12 @@ class Marketing } } - static public function getAliveUsersCount() - { - $uf = new UserFilter(new PFC_Not(new UFC_Dead())); - return $uf->getTotalCount(); - } - static public function relance(PlUser &$user, $nbx = -1) { global $globals; if ($nbx < 0) { - $nbx = self::getAliveUsersCount(); + $nbx = $globals->core->NbIns; } $res = XDB::fetchOneCell('SELECT r.date, r.email, r.bestalias @@ -291,7 +285,6 @@ class AnnuaireMarketing implements MarketingEngine $page->assign('intro', $this->getIntro()); $page->assign('u', $user); $page->assign('sign', $this->getSignature()); - $page->assign('num_users', Marketing::getAliveUsersCount()); $page->assign('personal_notes', $this->getPersonalNotes()); } diff --git a/modules/marketing.php b/modules/marketing.php index d5f9ed8..5b35bb8 100644 --- a/modules/marketing.php +++ b/modules/marketing.php @@ -317,7 +317,8 @@ class MarketingModule extends PLModule $page->changeTpl('marketing/relance.tpl'); if (Post::has('relancer')) { - $nbdix = Marketing::getAliveUsersCount(); + global $globals; + $nbdix = $globals->core->NbIns; $sent = Array(); $users = User::getBulkUsersWithUIDs($_POST['relance']); diff --git a/templates/marketing/marketing.mail.tpl b/templates/marketing/marketing.mail.tpl index 6b786c9..dbaff61 100644 --- a/templates/marketing/marketing.mail.tpl +++ b/templates/marketing/marketing.mail.tpl @@ -27,7 +27,7 @@ {#globals.baseurl#}/register/%%hash%% ========================================================== -Il ne te faut que 5 minutes sur https://www.polytechnique.org/ pour rejoindre la communauté polytechnicienne sur le web grâce aux services de Polytechnique.org dont profitent déjà {$num_users} camarades. Cela te permettra, entre autres, de contacter un X en connaissant seulement son nom et son prénom et de bénéficier à vie d'une adresse prestigieuse {$u.forlife_email} et de son alias discret {$u.forlife_email2} (m4x = mail for X). +Il ne te faut que 5 minutes sur https://www.polytechnique.org/ pour rejoindre la communauté polytechnicienne sur le web grâce aux services de Polytechnique.org dont profitent déjà {$globals->core->NbIns|number_format} camarades. Cela te permettra, entre autres, de contacter un X en connaissant seulement son nom et son prénom et de bénéficier à vie d'une adresse prestigieuse {$u.forlife_email} et de son alias discret {$u.forlife_email2} (m4x = mail for X). Pas de nouvelle boîte aux lettres à relever, il suffit de la rediriger vers ton adresse personnelle et/ou professionnelle que tu indiques et que tu peux changer à ta guise, sans que tes correspondants n'aient à actualiser leur carnet d'adresses. -- 2.1.4