show how many new member join last time

leonor

Active Member
License Active
I want to know how i can show how many member joined in the last Werk month in wrapper.HTML

Greetz
Leonor
 

Basti

Administrator
Staff member
Make yourself a plugin, use the file skin_global.php and in there place
Code:
// New Member today, week, month
list($TMPL['member_today'], $TMPL['member_week'], $TMPL['member_month']) = $DB->fetch("SELECT
SUM(CASE WHEN DAY(join_date) = DAY(CURDATE()) AND MONTH(join_date) = MONTH(CURDATE()) AND YEAR(join_date) = YEAR(CURDATE()) THEN 1 ELSE 0 END),
SUM(CASE WHEN WEEK(join_date) = WEEK(CURDATE()) AND YEAR(join_date) = YEAR(CURDATE()) THEN 1 ELSE 0 END),
SUM(CASE WHEN MONTH(join_date) = MONTH(CURDATE()) AND YEAR(join_date) = YEAR(CURDATE()) THEN 1 ELSE 0 END)
FROM {$CONF['sql_prefix']}_sites WHERE active = 1", __FILE__, __LINE__);
template tags:
{$member_today}
{$member_week}
{$member_month}

Might be useful to more people, not sure if i make it a standalone plugin or integrate into our core. Properbly the later, since we already have the total count and that way we also not make a additional query.

But for now you can use it as a plugin
 
Top