All you have to do is to enter the right id of the post/s and the thread/s of the deleted user/s and a username under which you want to bring those posts and threads. You can get their ids at the db or even at the forum (by checking the url at the posts/threads in question).
Username of deleted user still shows in thread starters
Collapse
X
-
All you have to do is to enter the right id of the post/s and the thread/s of the deleted user/s and a username under which you want to bring those posts and threads. You can get their ids at the db or even at the forum (by checking the url at the posts/threads in question).
I'm playing around with phpMyAdmin, and I've managed to get all the threads where she is the thread starter:
Code:SELECT `threadid` , `title` , `postuserid` FROM `vb_thread` WHERE `postuserid` =99 LIMIT 0 , 100
That means that
Code:UPDATE vb_thread SET postusername = '"Deleted user"' WHERE postuserid= 99;
Incidentally, there are no results in the vb_post table when I run a search for userid 99; I'm guessing thread starters are different from posts? That makes it easier - it's just one table to update.Comment
-
I think I'm getting somewhere
I'm playing around with phpMyAdmin, and I've managed to get all the threads where she is the thread starter:
Code:SELECT `threadid` , `title` , `postuserid` FROM `vb_thread` WHERE `postuserid` =99 LIMIT 0 , 100
That means that
Code:UPDATE vb_thread SET postusername = '"Deleted user"' WHERE postuserid= 99;
Incidentally, there are no results in the vb_post table when I run a search for userid 99; I'm guessing thread starters are different from posts? That makes it easier - it's just one table to update.
That can be done with the queries that were posted by Andreas.
Now, that username that you want to replace the posts of the deleted users, is that from another user at your forum? Or it is just a username that doesn''t belong to anyone.
I am asking you because you got me all confused again with your last post. If the username belongs to another user at your forum and you want to bring all the posts and threads of the deleted user under him/her, then run these queries instead:
For the posts:
Code:UPDATE vb_post SET userid = 99 WHERE username = 'deletedusername';
Code:UPDATE vb_thread SET postuserid = 99 WHERE postusername = 'deletedusername';
Now, which from the 2 ways is it
Another thing, it would be best to make a duplicate of your main forum to a test one and experiment at the db of your test forum until you get things right.
P.s. From your last post I think it is the second method, which I mentioned before as well. But I am not really sure. That is why I needed you to be as detailed and exact as possible,Comment
-
I do want to use Andreas' solution, I'm just trying to figure out what to put in there.
The first query I ran was
Code:SELECT `title` , `postusername` , `postuserid` FROM `vb_thread` WHERE `postusername` LIKE CONVERT( _utf8 'USERNAME' USING latin1 ) COLLATE latin1_swedish_ci LIMIT 0 , 30
But since there are multiple threads (88), I use the postuserid in my WHERE-clause instead of the threadid:
Code:UPDATE thread SET postusername = 'X' WHERE postuserid = Y;
Comment
-
When a user is deleted from your forum, then his/her id goes to 0, like guests. That is why you need to enter their old username at the query.
Just run Andrea''s suggestions exactly as he posted them. Only thing is to edit accordingly the deleted user username and the posts/threads id''s and you should be all setComment
-
Thank you for help.Comment
-
Anyway, this is getting a bit confusing for me. In order to help you properly I must check things out visually for myself.
Sorry that I couldn''t be of no more help. Hopefully someone else that won''t get confused by all these contradictory statements will come along and help you out furtherComment
-
I'm sorry that vBulletin is not behaving the way you expect, but I haven't made contradictory statements. I have told what I have done, and what is in my database.Comment
-
Also Andreas posted the examples on the assumptions that the user was deleted totally from the db, the same thing I assumed as well... .Comment
-
I have been in contact with vBulletin staff (via a support-ticket) and they say it's expected behaviour that the postid stays in the thread-table, but is set to 0 in the post-table.
If the postuserid/userid is still in the tables then the account wasn't fully deleted (otherweise it would be zero).
Anyway:
Code:UPDATE post SET userid = 0, username = 'W' WHERE postid IN (X, Y, Z); UPDATE thread SET postuserid = 0, postusername = 'W' WHERE threadid IN (X, Y, Z);
W = The usernamne you want to set (eg. Deleted User)
X, Y, Z being the affected postids/threadids.Comment
-
Code:vb_thread threadid title [B]firstpostid[/B] <-- lastpost forumid pollid open replycount hiddencount postusername [B]postuserid[/B] <-- lastposter dateline views iconid notes visible sticky votenum votetotal attach similar deletedcount [B]lastpostid[/B] <-- prefixid taglist
Once a user is deleted, all the posts (in the post table) retain the username, but get the userid "0" (yes, borbole was correct). In the thread table, the old userid actually stays in the database. This is why when Andreas wrote the queries, he did it based on the username, not a userid.Comment
-
Code:vb_thread threadid title [B]firstpostid[/B] <-- lastpost forumid pollid open replycount hiddencount postusername [B]postuserid[/B] <-- lastposter dateline views iconid notes visible sticky votenum votetotal attach similar deletedcount [B]lastpostid[/B] <-- prefixid taglist
In the thread table, the old userid actually stays in the database. This is why when Andreas wrote the queries, he did it based on the username, not a userid.Last edited by Andreas; Mon 10 May '10, 12:20am.Comment
-
If at first you don't succeed, report it as a bug
Anywho, I'll get to deleting tonight - I figure it's best to do when the forum is shut down.Comment
-
Like I told you chran, it is not like how I want it but how it is, as confirmed to you by the vb staff as well
Anyway, it would be best, in my opinion, if you made first a duplicate of your forum at your test one and run the query at your test database first. Or if you want to run them directly at your live db then make a full backup of those tables. Good luck with itComment
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Comment