View Full Version : Help with a mysql query - replacing field
Can anyone help me? I want to give everyone using my forum a new username, based on their real name. Their real name is stored in the database as two custom fields. So I want to replace all existing usernames with [customfield1]_[customfield2].
That's their firstname_lastname. (e.g. Jane_Doe).
Does that make sense? Anyone know how to do it? :)
You could change the user table with a query, but there are a bunch of other tables that have a username. I think the best thing to do would be to write a script that uses the data manager to change the username. It would basically be
for each user
fetch userdata
create User data manager
set existing
set new username
save
How would I do that?
I'm not familiar with writing scripts like that
Simon Lloyd
02-12-2012, 02:58 PM
Can't you use the replcement variable manager? so say find text "[musername]" and replace with "[customfield1]_[customfield2]"
I've never used it but it's just a thought :)
That would be really great but I don't think all the vbulletin pages get the customfield data. It's pulled into showthread but I don't think it's pulled into all pages.
I would be even happier to do it that way if I could make the pages get the data.
Anyone know how?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.