New sites registered today, this week, this month

Discission about the future of Aardvark Topsites PHP.

New sites registered today, this week, this month

Postby Xerion » 2007-11-11 10:32 am

I would like to add stats on the front page.

I've seen other sites do this.

How can I in an easy way get this kind of stat? New sites today and total would be enough I guess, and I think there already is a way to get the total nr, but 1 day old registered sites?
Xerion
Advanced Member
 
Posts: 57
Joined: 2007-04-06 11:23 am

Re: New sites registered today, this week, this month

Postby Xerion » 2008-01-22 04:39 pm

Any help with this one? :)
Xerion
Advanced Member
 
Posts: 57
Joined: 2007-04-06 11:23 am

Re: New sites registered today, this week, this month

Postby Jeremy » 2008-01-22 08:00 pm

basically you'd want to create a variable called $TMPL['num_new_today'] towards the bottom of sources/misc/skin.php containing this info, then you could use {$num_new_today} in wrapper.html. to get the stats, you could use an sql query. if u know a little php and mysql it shouldn't be too hard.
Jeremy
Supreme Diety
 
Posts: 8922
Joined: 2003-05-05 04:41 pm
Location: NJ, USA

Re: New sites registered today, this week, this month

Postby Xerion » 2008-01-24 02:05 pm

I tried this and it did not work (infact the entire site stopped working hehe)

Code: Select all
// Number of Sites registered last day
list($TMPL['num_sites_today']) = $DB->fetch('SELECT COUNT(*) FROM '.$CONF['sql_prefix'].'_sites WHERE join_date = '. $date("Y-m-d"), __FILE__, __LINE__);
Xerion
Advanced Member
 
Posts: 57
Joined: 2007-04-06 11:23 am

Re: New sites registered today, this week, this month

Postby Xerion » 2008-01-27 04:17 pm

what am I doing wrong?
Xerion
Advanced Member
 
Posts: 57
Joined: 2007-04-06 11:23 am

Re: New sites registered today, this week, this month

Postby Jeremy » 2008-01-28 10:49 am

you probably need single quotes around the date in that query, or else the dashes would be interpreted as minus signs.
Jeremy
Supreme Diety
 
Posts: 8922
Joined: 2003-05-05 04:41 pm
Location: NJ, USA

Re: New sites registered today, this week, this month

Postby Xerion » 2008-01-31 09:32 am

Didn't work. Thnx for the help though. It's not important so I'll just forget about it. I thought it would be an easy fix to explain so I asked :)
Xerion
Advanced Member
 
Posts: 57
Joined: 2007-04-06 11:23 am


Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron