Previous Thread
Next Thread
Print Thread
Hop To
#228269 08/11/2009 8:23 AM
Joined: Jan 2008
Posts: 514
addict
addict
Joined: Jan 2008
Posts: 514
Hello all, been a while since I posted here tongue Sorry been a bit busy of late :/ However, I screwed up and need help (again) tongue

I deleted three names (actually I didn't but I won't go into that) but I need to get them reinstated to their posts. Now I know when you delete a name that it is saved under another name and the posts switched to anon user. If this is the case, is there a way to recover the names? As in can I get into the database change the name back and it will be able to update? If so, can someone explain how it could be done. PLEASE. I mean I can have them start over again but really it would be VERY nice if it was an undelete process available- I am not worried about complexity, if you have a way to do it... I will sit here until I figure it out if necessary. Thanks

Dunny

P.S. UBB8 OMG can't wait to see that one! Good work team!

Dunny #228271 08/11/2009 9:47 AM
Joined: Jan 2008
Posts: 514
addict
addict
Joined: Jan 2008
Posts: 514
Just an addon.. I DO have a db with those names in there as well. So it may be nothing more than a DB merge I would think.

Dunny

Dunny #228273 08/11/2009 11:56 AM
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
You might be able to recover them, but not too sure and it might not be a flawless recovery due to the change to the anon user at deletion. I'd recommend doing a backup before getting into tis.

First thing you're going to want to do is run the following query:

SQL Query
select count(*) 
from ubbt_POSTS 
where POST_POSTER_NAME='username'

Change username to the name in question and hopefully that will come back with the proper number of posts for that user. Make a note of the number that was returned.

If that comes back with what looks correct, then what you'll want to do is create a new user with the username that was deleted and then jot down the userid. At that point, you can run the following queries:

SQL Query
update ubbt_POSTS 
set USER_ID='userid' 
where POST_POSTER_NAME='username'

SQL Query
update ubbt_TOPICS 
set USER_ID='userid' 
where TOPIC_POSTER_NAME='username'

userid = the new userid that was created
username = the username in question.

Then you can run this query:

SQL Query
update ubbt_USER_PROFILE 
set USER_TOTAL_POSTS='postcount'
postcount = the number that was returned from the first query.

That should reattach the posts to the new user that was created and the post count should display properly for that user. Like I said, do a backup first just in case you run into any issues.



Rick #228311 08/12/2009 3:37 PM
Joined: Jan 2008
Posts: 514
addict
addict
Joined: Jan 2008
Posts: 514
Aye thanks Rick it worked. Like you said wasn't a perfect fix but I did recover all the posts back to Jan2008 so that is fine. Thank you!

Dunny


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Version 7.7.5 Images suddenly not displaying
by Stovebolt - 05/04/2024 11:19 AM
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Who's Online Now
0 members (), 740 guests, and 157 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240505)