Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Utility to update pmtotal and pmunread in user table Details »»
Utility to update pmtotal and pmunread in user table
Version: 3.00, by Quarterbore Quarterbore is offline
Developer Last Online: Aug 2020 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.6.4 Rating:
Released: 02-07-2007 Last Update: 02-09-2007 Installs: 12
Additional Files  
No support by the author.

About this Script:

This script will update the PM Count and Undead PM counts in the user table.

Why Did I write this:

Well, I wrote it as I could not find a built in function in vBulletin to rebuild these values! I had my PM table become corrupted during an install process and while it was easy to restore the PM tables (there are three of them) I had issues as the USER table did not accurately represent the values in the PM table.

I tried searching for a solution and I learned that others have had this issue with board imports, pruning old PMs, or as in my case when it was necessary to recover data from a backup.

What does the script do:

This script updates the USER table to show the correct count of TOTAL PMs and UNREAD PMs for all users.

Why is this so "unrefined"?

This is intended as a utility. I included a permissions check to verify the person running the script is an Admin. I would suggest that this is not a script that you would want sitting on your server all the time but instead is being shared as a tool for cases where someone needs it!

Credits and Revisions

9-Feb-2007 Version 2

thincom2000 did a major rewrite of the script to go from three SQL queries down to one. The script is much faster now and he is listed as Co-author! THANKS!

9-Feb-2007 Version 3

Fixed this bug: https://vborg.vbsupport.ru/showpost....4&postcount=11

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 02-09-2007, 09:24 PM
kenji4861's Avatar
kenji4861 kenji4861 is offline
 
Join Date: Jun 2003
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Got it... $lastuser is being overwritten with a boolean when it should have the lastuser's id.

Line 31 should have this
$lastuser = $pms['userid'];
Reply With Quote
  #13  
Old 02-10-2007, 01:28 AM
Quarterbore Quarterbore is offline
 
Join Date: Mar 2005
Location: Valley Forge PA
Posts: 538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kenji4861 View Post
Got it... $lastuser is being overwritten with a boolean when it should have the lastuser's id.

Line 31 should have this
$lastuser = $pms['userid'];

You are correct... Zip is updated and I checked it on a live board this time with real PM users My Dev board has me, myself , and I and while there are three accounts we don't tend to PM each other much
Reply With Quote
  #14  
Old 02-10-2007, 02:05 AM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kenji4861 View Post
Got it... $lastuser is being overwritten with a boolean when it should have the lastuser's id.
Haha, sorry I threw that code together in a bit of a rush (just copy and pasted most of your old code which is how it still had query_first and not query_read), and forgot to add the other line setting $lastuser to $pms['userid']. Glad you all figured it out.
Reply With Quote
  #15  
Old 02-16-2007, 01:36 AM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What's the whole problem we are talking about? What PM counter do u mean exactly, and how could it have a negative effect on your forums?
Reply With Quote
  #16  
Old 02-17-2007, 10:38 PM
Quarterbore Quarterbore is offline
 
Join Date: Mar 2005
Location: Valley Forge PA
Posts: 538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It is the PM count that shows in the header or in your profile... It could say you have 10 PMs when you have 3000 (or the opposite) and your PM limit will be based on that count! You can also have issues with the system sayingyou ALWAYS have 2-unread PMs... but they will NEVER CLEAR as you need to reed those unread PMs before the count will reset. The problem is, you don't have any unread PMs...

If you ever have the problem, you will know it as your members will complain!
Reply With Quote
  #17  
Old 02-19-2007, 04:46 AM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have never experienced problems with that to be honest..
Reply With Quote
  #18  
Old 02-19-2007, 05:07 AM
Tralala's Avatar
Tralala Tralala is offline
 
Join Date: Jan 2006
Posts: 1,207
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I could have used this awhile back, some users had something like "62781287 unread messages." Only way to fix this (wrong) number was to empty their PM mailbox.

Thanks for sharing, Quarterbore!
Reply With Quote
  #19  
Old 02-19-2007, 05:09 AM
Tralala's Avatar
Tralala Tralala is offline
 
Join Date: Jan 2006
Posts: 1,207
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Perhaps to quell concerns, this utility would be better served as a menu item available in the AdminCP, available under "Maintenance."
Reply With Quote
  #20  
Old 02-19-2007, 01:36 PM
Quarterbore Quarterbore is offline
 
Join Date: Mar 2005
Location: Valley Forge PA
Posts: 538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

True... I actually have been trying to get this considered for an addition in vBulletin itself (they can recode as they would like) and I have posted this over at vBulletin.com as a suggestion for inclusion. We will see...
Reply With Quote
  #21  
Old 02-19-2007, 01:59 PM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Quarterbore View Post
True... I actually have been trying to get this considered for an addition in vBulletin itself (they can recode as they would like) and I have posted this over at vBulletin.com as a suggestion for inclusion. We will see...
Did u make a bugreport of it?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06: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.05293 seconds
  • Memory Usage 2,306KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete