PDA

View Full Version : Merge User histories hack-Easy!


ladyfyre
02-28-2002, 11:29 AM
I am fairly certain that this would only take a couple of simple queries to set up, and would LOVE to see it happen!!!

We have a number of users who are disgruntled by having to follow the rules, and repeatedly register under new handles to launch new attacks.

It would make my life MUCH easier, and shorten our ban list CONSIDERABLY if we could add all users posts and PMs to the history of an existing user, thereby making only one continuous history for them.

I assume this can be done by setting up a queries to edit the userid of a user from the current value, to one specified in a form box....but would LOVE to see someone put it into effect!

JJR512
02-28-2002, 03:42 PM
I can tell you how to do this by queries, but I haven't written a hack for it.

There are two queries you need to run if you want to merge two useraccounts into one:

UPDATE post SET userid='xxx',username='yyy' WHERE userid='zzz';

(Where xxx is the NEW userid number, username is the NEW username, and zzz is the OLD userid.)

UPDATE thread SET postusername='xxx',postuserid='yyy' WHERE postuserid='zzz';

(Where xxx is the NEW username, yyy is the NEW userid, and zzz is the OLD userid.)

After you do this, you should update the various counters. Then check both profiles; the older one should show no posts, while the newer one should now show all posts from both accounts. Look for the postcount number as the easy way to tell; obviously, it would be oldaccount+newaccount.

BTW, it's important to keep the single quotes around the values, at least for text values (I don't think it's necessary for numbers). Actually, text values might need full quotes, I forget.

Admin
02-28-2002, 04:52 PM
Doesn't matter, you can use either double or single quotes around strings. Don't put quotes around numbers (various ID's).

JJR512
02-28-2002, 07:53 PM
What happens if you do?

ladyfyre
02-28-2002, 11:36 PM
ok....what about PMs????

and the question is....anyone wanna bundle it into a hack??

*grinz*

ok...so i am a first class brat...but you can't blame a girl for wanting it all can you????