vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to Update Post Count for a Single User (https://vborg.vbsupport.ru/showthread.php?t=189413)

tim330i 08-28-2008 08:25 PM

How to Update Post Count for a Single User
 
It seems like there would be an easy way to do this. Anyone have any ideas?

Thanks in advance,
Tim

fattony69 08-28-2008 08:33 PM

Edit the member. There is a place for post count.

tim330i 08-28-2008 08:41 PM

Ok, but I need to know what the value should be.

Tim

Lynne 08-28-2008 08:59 PM

If you have phpMyAdmin, a real easy way would be to go into the post table and find all posts by that user. It then tells you in the query how many rows get returned. I think if you just want to make the query, it would be something like:

Code:

SELECT  count(*)
FROM  `post`
WHERE  `userid`  =x

where x is the userid. (That does not take into account table prefixes. It's copied straight from phpMyAdmin - except I put count(*) in the select part of the statement.)

tim330i 08-28-2008 09:05 PM

Yes, but that doesn't take into account forums that posts don't increment the post counter. As far as I can tell that option is stored in an option bitfield, which I can't decypher in mysql.

Tim

Opserty 08-28-2008 09:12 PM

AdminCP > Maintenance > Update Counters > Update Post Counts

READ MESSAGE GIVEN UNDER THE TITLE BEFORE YOU PROCEED

Lynne 08-28-2008 09:14 PM

Quote:

Originally Posted by tim330i (Post 1609356)
Yes, but that doesn't take into account forums that posts don't increment the post counter. As far as I can tell that option is stored in an option bitfield, which I can't decypher in mysql.

Tim

I guess you can modify the query to add something in the where statement: AND 'forumid' !=y

tim330i 08-29-2008 01:23 AM

Quote:

Originally Posted by Opserty (Post 1609365)
AdminCP > Maintenance > Update Counters > Update Post Counts

READ MESSAGE GIVEN UNDER THE TITLE BEFORE YOU PROCEED

Yes, I read that. I don't want to do this for all members, just one. I don't see why this is so complicated.

Quote:

Originally Posted by Lynne (Post 1609368)
I guess you can modify the query to add something in the where statement: AND 'forumid' !=y

I guess I could do that, figure out all the IDs and use an NOT IN statement or something....I was hoping to have the SQL/code do all the work.

It seems like this shouldn't be this hard.

Tim

Dave Hawley 08-29-2008 02:30 AM

Updating all users post counts is the best way. Should only take 1-2 minutes.

tim330i 08-29-2008 03:25 PM

I have a feeling it is going to take a lot longer than a few min. And I have custom post counts for some users that I can't lose.

If I wanted to simply update all the users I would have just done it and not posted looking for a solution to what I thought was a simple request.

Tim


All times are GMT. The time now is 08:16 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.01083 seconds
  • Memory Usage 1,728KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete