PDA

View Full Version : # of posts for the day on non-vb page?


jthorpe
12-25-2003, 02:50 PM
Hi guys, pretty new here and just installed vb 2.3.3 recently. Works great so far, and added vbhome lite for the front page. I really like it, but I'm wondering if there is a way to show how many posts have accumulated for the current day on there as well? It shows the total number of posts on the front page, but my users are always interested in seeing how many posts per day occur. I searched but maybe not well enough. I couldn't find anything that does this. Any help would be appreciated. Thanks :)

Jack

http://www.dieseltruckresource.com

BlackxRam
12-26-2003, 06:55 AM
Try my hack its called the Ultimate Stats to non VB page hack. you can search it pretty easily. People in that thread have it working for 2.3.3

Just be sure to follow the instructions for member of the day. That might need to be removed.

jthorpe
12-26-2003, 03:09 PM
Try my hack its called the Ultimate Stats to non VB page hack. you can search it pretty easily. People in that thread have it working for 2.3.3

Just be sure to follow the instructions for member of the day. That might need to be removed.

Thanks for the info. I'll check it again, but I messed with that hack yesterday and only saw where it shows total posts on the forum, not the posts on the current day. All I'm looking for is the amount of posts on the current day to stick on the front page of my site.

BlackxRam
12-27-2003, 09:28 AM
the code you can use is this


// Today
$vbs_today=time()-(86400);
$gettodaystats = $DB_site->query_first("SELECT count(postid) AS posts, COUNT(DISTINCT(threadid)) AS threads FROM post WHERE dateline>='$vbs_today'");
$poststoday = number_format($gettodaystats['posts']);
$threadstoday = number_format($gettodaystats['threads']);
$getviewstoday=$DB_site->query_first("SELECT SUM(views) AS threadviews FROM thread WHERE dateline>='$vbs_today'");
$viewstoday=number_format($getviewstoday['threadviews']);


Just plug that under


// get total posts
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=number_format($countposts['posts']);

$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=number_format($countthreads['threads']);


in that boardstats.php file of mine. Then just use the $ statements to call your stats in the boardstat.php file. That entire file is customizable. ANy addon you put in your INDEX.php file of your forums can be put into that boardstat.php file.

Have Fun

jthorpe
12-28-2003, 12:23 PM
Does that not pull posts for the past 24 hours, and not actually the current day from midnight?

jthorpe
12-28-2003, 06:04 PM
Ok, figured it out. Instead of showing the last 24 hrs, I wanted to show the posts of that current day since midnight so instead of using time()-(86400), I used mktime(0,0,0); and that worked fine. Thanks for the info. Everything together made it exactly how I needed it. Thanks again.