Hopefully I didn't mess it up. I've tested it on my site and it seems to be working like its perl version. If you find any errors (particularly in the documentation since I'm fairly sure the code is right, but let me know!) please let me know asap!
This hack allows you to change a user's name (and all of the various stuff associated with their username, such as posts and PMs). It's pretty straight-forward.
Just out of curiosity, has anyone modified this to 'Merge' usernames? I'm currently having to do it manually on my site when a user accidentally gets more than one account going... Kind of a pain! []/testimages/icons/wink.gif[/]
wopps sorry I'm looking for the change user name atm it was listed on screamers hack php list but I did not grab it I had no idea the site was going down :-( so anyone have it handy the links to the attached files here don't work
have you checked for it at http://screamers.wwwthreads.com ... That's where sixpack keeps all the hacks... you could also check Eileen's Hack Area but I don't believe she has this one posted there...
the sub domain is down do the the dns being change to infopop lol thats why I'm asking here
this is what I see Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
Premature end of script headers: /home/sixpack69/www/six-cgi/perl/index.pl
Actually, I think I was able to accomplish a merge by simply renaming a user's second account to the same name as the first account; consequently, all their posts now show up under the original name. The script is, fundamentally, a search & replace tool.
1. when that user logs in, which passsword do they need? 2. which account gets updated with totalposts? 3. if they get sent a PM, to which account does it go?
Okay, trusting that this board supports file attachments, I'm attaching my revision of the hack. The problem with escaping quotes (mentioned earlier in this thread) is no longer relevant.
Obviously, it's not a complete merge solution. I haven't tested it thoroughly, but maybe this will help.
I'll use a true-life example: after about 6 months, a user decided he wanted a new handle, so he abandoned the old account (we'll call it 'Bill') and created a new username (let's call this one 'Hoohah'). Now, to answer your questions...
1. I renamed the original account ('Bill') to Hoohah. As soon as I did that, Hoohah "inherited" everything from Bill. Hoohah will now need to log in with Bill's password. At login, Hoohah will now find all of Bill's messages in his inbox, including new, unread messages delivered to either account.
2. Unfortunately, this script is not a true merge, so the post total for the resulting account will not be incremented--in this example, Hoohah's new post total will equal Bill's. My solution was to note Hoohah's total beforehand, then manually increment Hoohah's new total (Bill's old total) by adding Hoohah's total (the one that existed before the change) using a db tool like PHPMyAdmin. More laborious, untidy, but it worked.
Post totals is a relatively minor fix. The real value of the changename script (besides changing the username) is this: every post in the database made using either account will now be attributed to (and linked to) Hoohah.
3. As noted earlier, PMs shouldn't be a problem. According to my test, the only problem is that now any PM's in somebody's inbox from Bill can't be answered (since 'Bill' now a nonexistent account). However, unless there's like 100 PM's from Bill out there, this can be fixed with a tool like PHPMyAdmin without too much fuss.
Bottom line: this hack is not ideal for merges, yet it does most of the job. (But, realistically, how many times will you need to merge?) Moreover, I'm sure a couple more basic SQL commands could be added to take care of the current shortcomings. I just haven't gotten around to it . . .
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.