vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   # of posts for the day on non-vb page? (https://vborg.vbsupport.ru/showthread.php?t=59380)

jthorpe 12-25-2003 02:50 PM

# 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

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

Quote:

Originally Posted by BlackxRam
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

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']);

Just plug that under

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']);

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.


All times are GMT. The time now is 08:17 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01074 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete