recalculate it on each page.
$mailer->send();
}
+
+function update_NbIns()
+{
+ global $globals;
+ $res = XDB::query("SELECT COUNT(*) FROM auth_user_md5 WHERE perms IN ('admin','user') AND deces=0");
+ $cnt = $res->fetchOneCell();
+ $globals->change_dynamic_config(array('NbIns' => $cnt));
+}
+
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>
$mailer->assign('old', $old_fields);
$mailer->assign('new', $new_fields);
$mailer->send();
+
+ // update number of subscribers (perms or deceased may have changed)
+ update_NbIns();
$page->trig("updaté correctement.");
}
// DELETE FROM auth_user_md5
case "u_kill":
user_clear_all_subs($mr['user_id']);
+ // update number of subscribers (perms or deceased may have changed)
+ update_NbIns();
$page->trig("'{$mr['user_id']}' a été désinscrit !");
$mailer = new PlMailer("admin/mail_intervention.tpl");
$mailer->assign("user", S::v('forlife'));
* Purpose:
* -------------------------------------------------------------
*/
+
function smarty_insert_getNbIns($params, &$smarty)
{
- $res = XDB::query("SELECT COUNT(*) FROM auth_user_md5 WHERE perms IN ('admin','user') AND deces=0");
- $cnt = $res->fetchOneCell();
+ global $globals;
+ $cnt = $globals->core->NbIns;
+ if ($cnt == 0) {
+ update_NbIns();
+ $cnt = $globals->core->NbIns;
+ }
return number_format($cnt, 0, ",", ".");
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: