Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jun 2002
Posts: 47
User
User
Offline
Joined: Jun 2002
Posts: 47
On my message board I just did a major deletion of theads since I was moving my board to a new server. I completely cleaned out one forum so there were no posts. After I imported the database on to the new server it shows that I have 4 threads and 18 posts in that forum when I actually have NONE. After noticeing this I checked a bunch of my other forums and they also are showing the wrong Thread and Post count when you veiw all the forums on ubbthreads.php

Does anyone know how to correct this and have the message board fix itself? Any help would be apprecaited. I am at version 6.4.1

Sponsored Links
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
Does the count get updated when you post a new topic?


UBB.classic: Love it or hate it, it was mine.
Joined: Jun 2002
Posts: 47
User
User
Offline
Joined: Jun 2002
Posts: 47
It does get updated, it goes up one. If I delete the post it goes down one (back to the original wrong number).

It is really weird. I just wanted to see if anyone had a script or something that will force a re-count of the threads and post numbers in the database to correct these errors and make sure everything is displayed as it should be.

I mean can anyone else truly confirm that their thread count is correct or are we just "assuming" that it is correct? There should be some way to confirm it and correct it if it is wrong.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
How did you delete them?

You might see if this utility helps.

https://www.ubbdev.com/forum/showflat.php?Cat=0&Board=beta&Number=65289

Joined: Jun 2002
Posts: 47
User
User
Offline
Joined: Jun 2002
Posts: 47
I deleted them via the normal "delete threads" option in the admin section. I started with a date (like 6/1/03) and check marked every post from that date and previous and then deleted them. I did it for every forum.

I ran that script you pointed to and it worked great!!! you are a god! It found that all but 5 of my forums were off their count. Its really weird. But it works now, Thanks!!!

Sponsored Links
Joined: Jun 2002
Posts: 47
User
User
Offline
Joined: Jun 2002
Posts: 47
Actually I need to take that back, it fixed some of them but some of them are still wrong. Some still show having 5 threads when they actually have none... even that script shows the forum as having 5 threads but when you click into the forum it is empty... its really weird.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I wonder if you have users missing from the users table. If the threads were there, but the user who posted them was missing, they wouldn't appear, but they would still be there.

Have you had any database corruption lately?

Joined: Jun 2002
Posts: 47
User
User
Offline
Joined: Jun 2002
Posts: 47
Not that I am aware of, how could I check to make sure it is an ok database?... the missing user thing is possible though. Thanks for your help in this.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
OK - download the attached. Rename it .php instead of .txt

Put it in your threads directory and run it in your browser.

It doesn't fix anything, but it's something I use to see if there are any missing users for posts.

If so, we can go from there.
Attachments
106554-checkusers.txt (0 Bytes, 31 downloads)

Joined: Jun 2002
Posts: 47
User
User
Offline
Joined: Jun 2002
Posts: 47
Josh,

Here is the output of the Script. It seems the #1 user is missing..

============================
User # 1 is missing from the User Database

Done! 668 Users Checked - you had 1 Missing Users.
============================

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
OK - #1 is the placeholder user for anonymous posts and users who have been deleted.

Run this query to put it back.

INSERT INTO w3t_Users
(U_Username,U_Groups)
VALUES
('**DONOTDELETE**','-4-')


Then run this Query

UPDATE w3t_Users
SET U_Number = 1
WHERE U_Username = '**DONOTDELETE**'


<fingers crossed that it helps the other problem).

Joined: Feb 2001
Posts: 104
Journeyman
Journeyman
Offline
Joined: Feb 2001
Posts: 104
Well now you stuck you foot in it Josh.

COURSE others (Like ME ) ran that utility....

Got the same response, but mine was user 359 was missing.

I checked the backend using phpmyadmin and 358 and 359 are no longer in the database itself. I'm guessing your utility is pointing out 359 has a post somewhere?

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609

[]User # 12 is missing from the User Database
User # 13 is missing from the User Database
User # 15 is missing from the User Database
User # 24 is missing from the User Database
User # 30 is missing from the User Database
User # 39 is missing from the User Database
User # 41 is missing from the User Database
User # 42 is missing from the User Database
User # 43 is missing from the User Database
User # 53 is missing from the User Database
User # 56 is missing from the User Database
User # 58 is missing from the User Database
User # 62 is missing from the User Database
User # 63 is missing from the User Database
User # 68 is missing from the User Database
User # 69 is missing from the User Database
User # 70 is missing from the User Database
User # 71 is missing from the User Database
User # 73 is missing from the User Database
User # 76 is missing from the User Database
User # 79 is missing from the User Database
User # 81 is missing from the User Database
User # 83 is missing from the User Database
User # 84 is missing from the User Database
User # 85 is missing from the User Database
User # 88 is missing from the User Database
User # 89 is missing from the User Database
User # 92 is missing from the User Database
User # 93 is missing from the User Database
User # 95 is missing from the User Database
User # 97 is missing from the User Database
User # 100 is missing from the User Database
User # 101 is missing from the User Database
User # 102 is missing from the User Database
User # 103 is missing from the User Database
User # 106 is missing from the User Database
User # 107 is missing from the User Database
User # 108 is missing from the User Database
User # 110 is missing from the User Database
User # 113 is missing from the User Database
User # 130 is missing from the User Database
User # 134 is missing from the User Database
User # 136 is missing from the User Database
User # 137 is missing from the User Database
User # 138 is missing from the User Database
User # 142 is missing from the User Database
User # 144 is missing from the User Database
User # 148 is missing from the User Database
User # 151 is missing from the User Database
User # 152 is missing from the User Database
User # 154 is missing from the User Database
User # 155 is missing from the User Database
User # 156 is missing from the User Database
User # 158 is missing from the User Database
User # 160 is missing from the User Database
User # 161 is missing from the User Database
User # 162 is missing from the User Database
User # 166 is missing from the User Database
User # 170 is missing from the User Database
User # 171 is missing from the User Database
User # 176 is missing from the User Database
User # 177 is missing from the User Database
User # 179 is missing from the User Database
User # 180 is missing from the User Database
User # 186 is missing from the User Database
User # 187 is missing from the User Database
User # 188 is missing from the User Database
User # 198 is missing from the User Database
User # 200 is missing from the User Database
User # 205 is missing from the User Database
User # 207 is missing from the User Database
User # 211 is missing from the User Database
User # 214 is missing from the User Database
User # 215 is missing from the User Database
User # 220 is missing from the User Database
User # 221 is missing from the User Database
User # 236 is missing from the User Database
User # 239 is missing from the User Database
User # 243 is missing from the User Database
User # 249 is missing from the User Database
User # 265 is missing from the User Database
User # 267 is missing from the User Database
User # 270 is missing from the User Database
User # 276 is missing from the User Database
User # 285 is missing from the User Database
User # 286 is missing from the User Database
User # 295 is missing from the User Database
User # 298 is missing from the User Database
User # 299 is missing from the User Database
User # 300 is missing from the User Database
User # 303 is missing from the User Database
User # 313 is missing from the User Database
User # 327 is missing from the User Database

Done! 1104 Users Checked - you had 93 Missing Users.
[/]

Okay Josh, what SQL query do I use to fix this one?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yes, it points out user #s which have posts.
So you'd most likely want to recreate a user with that number. Or find the posts with the B_PosterId of that number, set the B_PosterId to 1 and B_Reged = n for that post.

Otherwise posts for any missing users won't appear, as when it tires to join the usernumber in the pOsts table to the users table, it fails, thus typically the whole thread won't appear, even though it exists in the database.

Joined: Feb 2001
Posts: 104
Journeyman
Journeyman
Offline
Joined: Feb 2001
Posts: 104
That took care of it Josh. Cool Dude!

Joined: Jun 2002
Posts: 47
User
User
Offline
Joined: Jun 2002
Posts: 47
Wow, I am impressed. That worked I see the missing posts now.. they are owned by user **DONOTDELETE** ...... but here is the question, Can I delete these posts now?

Thanks for all your help, I apprecaite it!

Lex

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You can -

Or as per the "**DONOTDELETE**" that'll appear if they are from user#1 yet not tagged as being anonymous deleted.

UPDATE w3t_Users
SET B_Reged = 'n'
WHERE B_PosterId = 1

Should do the trick.

Or you can delete them like normal posts, from within threads.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)