Helpful Information
 
 
Category: Modification Requests/Questions (Unpaid)
show weekly and monthly new member totals

How would I show the weekly and monthly new member totals on my stats page? I have already figured out how to show them daily but not weekly or monthly.

I would appreciate any help!!

Thanks,

Odil

Someone has to know...

Odil

$weekly = mktime (date("H"), date("i"), date("s"), date("m"), date("d")-7, date("Y"));
$monthly = mktime (date("H"), date("i"), date("s"), date("m")-1, date("d"), date("Y"));
$new_userW=$DB_site->query_first("SELECT count(*) as count FROM user WHERE joindate>$weekly");
$weeklyuser=$new_userW['count'];
$new_userM=$DB_site->query_first("SELECT count(*) as count FROM user WHERE joindate>$monthly");
$monthlyuser=$new_userM['count'];

Now use variables $monthlyuser and $weeklyuser in the relevant template or your code..

Originally posted by Logician
$weekly = mktime (date("H"), date("i"), date("s"), date("m"), date("d")-7, date("Y"));
$monthly = mktime (date("H"), date("i"), date("s"), date("m")-1, date("d"), date("Y"));
$new_userW=$DB_site->query_first("SELECT count(*) as count FROM user WHERE joindate>$weekly");
$weeklyuser=$new_userW['count'];
$new_userM=$DB_site->query_first("SELECT count(*) as count FROM user WHERE joindate>$monthly");
$monthlyuser=$new_userM['count'];

Now use variables $monthlyuser and $weeklyuser in the relevant template or your code..

Excellent thank you! I was looking at the stats.php in the admin directory to see if I could figure the code out but I'm not that good at it yet. Thanks again!

Odil

Where exactley do you put this in ?

Wich file ?

Where exactley do you put this in ?
depends..

He was trying to integrate it to his existing stats file, so he put it there.

If you want to make it displayed in say main forum page, then you would put in index.php... For forums page it's forumdisplay.php..

Buttom line: it depends..

Or, if you don't know where to put it, go to your admin CP, stats, and then......
Start --> Programs --> Accessories --> Calculator

:D

Thx il try this out.










privacy (GDPR)