vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How Post Count is Calculated (https://vborg.vbsupport.ru/showthread.php?t=313784)

tsptom 08-18-2014 05:22 PM

How Post Count is Calculated
 
I have a question about how post counts are determined. I have one member who has 5042 posts, according to the database using this query:

SELECT count(*)
FROM post
WHERE username = 'xxx'

But that gets 42 more rows than what the post count in the forum is, which says 5000 even.

The "visible" field has 5039 1's and 3 2's, if that means anything.

What would cause the difference?

Thanks.

Lynne 08-18-2014 05:57 PM

Do any of your forums have "Count Posts Made in this Forum Towards User Post Counts" set to No?

tsptom 08-18-2014 06:14 PM

Interesting. Is there a way to check that in the database, as opposed to checking the individual forum settings?

--------------- Added [DATE]1408389824[/DATE] at [TIME]1408389824[/TIME] ---------------

I'm not seeing any of the obvious forums set that way, like private forums and threads.

Could it have anything to do with deleted forums or threads? How about soft deleted posts?

ozzy47 08-18-2014 06:27 PM

Its possible it could be due to soft deleted posts, or posts that are in moderation.

tsptom 08-18-2014 06:33 PM

Thanks. Do you know how to eliminate soft deleted posts from this select statement?

Code:

SELECT count(*)
FROM post
WHERE username = 'xxx'


ozzy47 08-18-2014 06:44 PM

Try this:
Code:

SELECT count(*)
FROM post
WHERE username = 'xxx' AND visible = 1


tsptom 08-18-2014 07:05 PM

Adding visible took it down to the 5039. (there were three 2's in the visible column).

I think I will just have to go with the "posts" column in the user table. It matches the current forum's post count, but not what I count using the select. I was just curious why they didn't match.

Thank you!


All times are GMT. The time now is 09:49 PM.

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.02790 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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