News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Option to merge user accounts

Started by NukeWorker.com, July 11, 2004, 11:04:08 PM

Previous topic - Next topic

NukeWorker.com


Jack.R.Abbit™

Can you elaborate on this a bit more?  Perhaps explaining why you would want to do it.. and how you figure it would work in the end.

NukeWorker.com

Sure.

A user has two accounts, and decides to later "retire" his alias.  Perhaps after being exposed, or forced to by the admin.  This function would EASILY change the old references to the discontinued user, to the continued user. (ie, combine statictics (# of posts, karma, etc) and credit posts/replies to the correct person.)

It's just a suggestion.  I won't die if you don't do it.  I'm only trying to offer you ways to improve the worlds best forum software.

TaGBaN

I've also had someone go and not be able to login for one reason or another, so they make a second account, never say anything til about 2-3 weeks later. Then when they do, they have considerable post count on each name. Would be very useful in that situation. :)

Vinoth

good!  this feature would rock! 

10 cups of beer added to your a/c!

Merging two a/c would be nicer.
Vinoth And Sachin ( SpecHackers Team )
The Best  Way to Help Poor Is not Becoming One Of Them.

Overseer

great idea. :)

it should also allow you to pair up posts with users who may have been banned or had their account deleted accidentlally.

Grudge

Quote from: Overseer on July 13, 2004, 05:04:58 AM
it should also allow you to pair up posts with users who may have been banned or had their account deleted accidentlally.
The next version of SMF has this as a function I wrote - I just haven't worked out how to interface it yet... I thought about having it so that after a member registers it does a check to see if their email address already exists on any posts - and if so offers to "claim" those posts as theirs. Would this work?
I'm only a half geek really...

Vinoth

not like this, it must be an control of the admin ( that he can merge any a/c with any sort of condition) regardless email, ets/

And after the merge, the admin must have an fn such that he can rename the username or use any of the merged a/c name/
Vinoth And Sachin ( SpecHackers Team )
The Best  Way to Help Poor Is not Becoming One Of Them.

Grudge

#8
Ummm... I was talking about reclaiming emails not the admin stuff. I see no real benefit in giving the admin the ability to "merge" accounts... it will just confuse things for most people. The *only* time I think this "type" of thing is justified is if a user accidently deletes their account it would give them back their posts.
I'm only a half geek really...

TaGBaN

If you're going to do that, make it send a confirmation email to the email in question. Because otherwise, people could easily 'steal' other's posts.

Grudge

That's a good point. Would have to work only on boards that require activation...
I'm only a half geek really...

Overseer

Quote from: Grudge on July 13, 2004, 01:40:50 PM
Ummm... I was talking about reclaiming emails not the admin stuff. I see no real benefit in giving the admin the ability to "merge" accounts... it will just confuse things for most people. The *only* time I think this "type" of thing is justified is if a user accidently deletes their account it would give them back their posts.

or if a user is banned, then allowed back later on.. which since i'm forgiving has happened quite a few times..

NoRad

I also have a few people who have made duplicate accounts for one reason or another. I'd like to not have their stats duplicated on both accounts.

Oldiesmann

Here are some useful queries for you. I've seperated each one so you can choose which one(s) you need more easily...

Associate attachments:
UPDATE smf_attachments SET ID_MEMBER = 'newmemberid' WHERE ID_MEMBER = 'oldmemberid';

Associate calendar events:
UPDATE smf_calendar SET ID_MEMBER = 'newmemberid' WHERE ID_MEMBER = 'oldmemberid';

Associate IMs (received and sent):
UPDATE smf_instant_messages SET ID_MEMBER_FROM = 'newmemberid' WHERE ID_MEMBER_FROM = 'oldmemberid';
UPDATE smf_im_recipients SET ID_MEMBER = 'newmemberid' WEHRE ID_MEMBER = 'oldmemberid';


Associate posts (first one associates the posts, second one changes the "modified by" username for every post they modified under the old account):
UPDATE smf_messages SET ID_MEMBER = 'newmemberid', posterName = 'newusername', posterEmail = 'newemailaddress' WHERE ID_MEMBER = 'oldmemberid';
UPDATE smf_messages SET modifiedName = 'newusername' WHERE modifiedName = 'oldusername';


Associate polls:
UPDATE smf_log_polls SET ID_MEMBER = 'newmemberid' WHERE ID_MEMBER = 'oldmemberid';
UPDATE smf_polls SET ID_MEMBER = 'newmemberid' WHERE ID_MEMBER = 'oldmemberid';
UPDATE smf_polls SET posterName = 'newusername' WHERE posterName = 'oldusername';


Associate topics:
UPDATE smf_topics SET ID_MEMBER_STARTED = 'newmemberid' WHERE ID_MEMBER_STARTED = 'oldmemberid';
UPDATE smf_topics SET ID_MEMBER_UPDATED = 'newmemberid' WHERE ID_MEMBER_UPDATED = 'oldmemberid';


You can change their post count, karma info and registration date from the profile. You would be wise to do a "recount statistics and totals" after this as well, just to make sure everything gets updated properly. You may get a "duplicate entry for key 1" when you attempt to update the polls log - this just means that the member has already voted in one or more polls under the new account that they previously voted in under the old account.
Michael Eshom
Christian Metal Fans

NoRad

Excellent. Has anybody tested this yet?

Ben_S

Bear in mind before fiddling with your db, you must make a backup first.
Liverpool FC Forum with 14 million+ posts.

TheDel

I think this is a great Idea! I also have many members who come back after a long period of time and dont have their old email addy and seeing a modified username annoys me.

Nitro

i found this topic, however. i am debating with a deleted acount
1. it shows his old name and inderneath shows 'guest'
2. how am i going to know what memberID is this?

i deleted by accident an account, i can see the queries but how am i going to know their deleted "memberid" can i use the name that shows in the old topic? and what i want to do is to merge the new account with this guys' old topics.

make sence?

any comments? PLEASE?
MPF Rocks!!!

Ben_S

The member id is forever lost, when an account is deleted, all their posts are change to member id 0 (guest).

Do a search for restore user or similar. You basically need to register a new member, then run a query to associate all posts from their old username with their member id.
Liverpool FC Forum with 14 million+ posts.

Nitro

in other words do this:

UPDATE smf_messages SET ID_MEMBER = '2023' WHERE posterName = 'Editor';

(editor) is the account that was deleted and you are right, it shows like 'Editor' (guest)
i tried that one and it didn't work, it came up 0 rows affected.

do you think can i do this?

UPDATE smf_messages SET ID_MEMBER = '2023' WHERE posterName = '0';

would this work?

thank you for your comments.
MPF Rocks!!!

Advertisement: