vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   General Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=189)
-   -   Display number of posts in last 24 hours by forum (https://vborg.vbsupport.ru/showthread.php?t=69248)

Spinball 09-08-2004 10:00 PM

Display number of posts in last 24 hours by forum
 
Don't know where to post these or even if they are welcome but hopefully someone will find them useful or tell me where to re-post them.

Got a couple of MySQL scripts to report the number of posts in the last 24 hours:

Total number of posts in the last 24 hours

Code:

SELECT COUNT(postid) from post WHERE  post.dateline >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL 24 HOUR));
Total number of posts for each active, visible forum. Doesn't include password protected forums unless you edit to specify passwords.

Code:

SELECT forum.title,COUNT(postid) from post,thread,forum WHERE post.threadid = thread.threadid AND thread.forumid = forum.forumid AND forum.displayorder > 0 AND forum.parentid > -1 AND (forum.password='' or forum.password in ('password1','password2')) AND post.dateline >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL 24 HOUR)) GROUP BY forum.forumid ORDER BY forum.title LIMIT 1000;

Dean C 09-09-2004 08:59 AM

Thanks for sharing. Feel free to place [sql] tags around your queries :)

Spinball 09-09-2004 09:05 AM

I have put CODE tags in because the 'greater than or equal to'
Code:

'>='
characters don't come out right in the SQL tags. Thanks for your guidance, chaps

DrussRob 01-13-2008 09:25 PM

How exactly do you input these into a php page?

Brandon Sheley 01-28-2008 11:47 AM

Quote:

Originally Posted by DrussRob (Post 1420872)
How exactly do you input these into a php page?

ya, it would be nice if a bit more was posted here :(

matrex722 03-24-2013 06:05 PM

its not a php code i think
its order to mysql
i think you may use it in phpmyadmin


All times are GMT. The time now is 02:46 PM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01212 seconds
  • Memory Usage 1,717KB
  • 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
  • (3)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