The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
# of posts for the day on non-vb page?
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 |
#2
|
|||
|
|||
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. |
#3
|
|||
|
|||
Quote:
|
#4
|
|||
|
|||
the code you can use is this
Code:
// 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']); Code:
// 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']); Have Fun |
#5
|
|||
|
|||
Does that not pull posts for the past 24 hours, and not actually the current day from midnight?
|
#6
|
|||
|
|||
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.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|