XF 1.2 User Location

Floyd R Turbo

Well-known member
Just converted from vB and I had done something that:

1) forced the user to specify their location (city, state, country, etc) upon registration

and

2) displayed this below their username on each post

Is it possible to make this happen in XF and if so, how?
 
You could edit the template(s) to remove the default field.
Then create a custom field and use the style property option to display it below the avatar.
 
Newbie warning here. My programming experience started with BASICA in the mid 80s and ended with FORTRAN in high school in the 90s. I can follow directions well but figuring it out on my own is dangerous at best.:eek:

So a little more detail or a point to a helpful similar thread would be awesome

Thanks!!
 
Well first you need to tell me where you want to remove the default field from and I can tell you which templates to edit.

Then you just set up a custom field and show it under the avatar by checking Style Properties: Message Elements -> Show custom user fields
 
Cool, thanks. I'll try that in a bit. Another question: most users have this field filled in already. So can I create the custom field and the transfer the information en mass before disabling the default field? Does that have to be done by editing the table in the DB? Only 190 users so if it has to be manual, it's not a big deal. Just looking for a shortcut
 
I was able to create the custom field, no problem. I am able to comment out the default field, no problem.

I can find the default field in the SQL database under xf_user_profile -> location, no problem

I can find the new custom field xf_user_field_value -> field_id = userlocation (my name for it), no problem

Where I get stuck is how to copy the information. I'm thinking that I could get this done manually quicker.

Another possible issue though, I have noticed that quite a few people do not have anything in the default location field. This is because on the old vB forum, it was not flagged as a required field. So will this cause any issue for existing users?
 
Cool

I think I figured out the way to edit the DB. I'm an excel whiz so I exported a few tables so I can match up uesrnames/IDs with the fields, then add the new rows with field_id -> userlocation information and arrange it properly so it matches the current structure, then import it. Of course a backup prior....
 
Top Bottom