PDA

View Full Version : Countries/States fields as options(over 30 fields)


mtha
02-07-2004, 10:00 PM
NOTE: You can do this by adding custom user field/drop down option, as of vB3 allows you to add as many options as you want

Old version of vB custom field only allow you to add 30 fields to their options (for some reason), I re-write this hack, to use with vB3-beta7, then update for vB3.0.1. (dont want to remove it and use vB default dropdown option)

advantage over the default field: you dont have to store the whole country name in database (save some space), use US instead of United States, it is also easier if you want to use this for flag ...


Author: HacNho (mtha)
Version: 2.0
Description:
- Use FIELD2 as Country field
- Add selections for countries in registration (call register_customfields_country template)
- Add selections for countries in edit profile (call register_customfields_country template)
- Add selections for countries in memberlist search (call register_customfields_country template)

File to edit: 3 (register.php, includes/functions_user.php, memberlist.php)
Template to edit: 0
Template to add: 2 (userfield_country and memberlist_search_country)

Version support: vB 3.0.1

UPGRADE: there's too many changes from vB3.0 beta to the final release, so you'd better uninstall the old mod before reinstall this one.
- remove template register_customfields_country
- remove the changes added in register.php, includes/functions_profile.php


OLD Version: 1.0
Description:
- Use FIELD2 in userfield as Country field (this one used to be "Location")
- Add seletions for countries in registration (call register_customfields_country template)
- Add seletions for countries in edit profile (call register_customfields_country template)
- Add seletions for countries in memberlist - Search (call register_customfields_country template)
File to edit: 2
Template to edit: 0
Template to add: 1 (register_customfields_country)
Version support: vB 3.0 b4 - b7

Screen shot: https://vborg.vbsupport.ru/external/2007/12/41.gif customfields_country.gif (https://vborg.vbsupport.ru/attachment.php?attachmentid=16624&stc=1) (8.9 KB)

Important:
BACKUP modified files and template before making changes.
USE at your own risk!
You may want to check the country lists, as of I got several different lists from internet, and use one of them

Suggestion: you should download and use YaME, to read this file. It will be much easier to understand what you should do.

Credit:
- those who wrote this tools BoardMod (http://www.boardmod.org/) and YaME (http://www.boardmod.org/downloads.php#bc01)
- those who make the countries list, so I just need to re-edit them

Additional mod: customfield_state
NOTE:
- you can only use one of the two mod. If you want to use both of them, you have to change field# in one of them (as of I am using the same field# (field2) in both two mods.

Gio Takahashi
02-08-2004, 08:45 PM
Nice Job, will install once gold is out.

Boofo
02-08-2004, 08:50 PM
They must have changed something then because I have the whole countries list in a profile field and it accepts them all. It doesn't limit it to 30 anywhere that I can see. I am running 3.0 RC 3, by the way.

mtha
02-08-2004, 09:04 PM
They must have changed something then because I have the whole countries list in a profile field and it accepts them all. It doesn't limit it to 30 anywhere that I can see. I am running 3.0 RC 3, by the way.
hehe, yeah, nevermind about my hack then.


but I dont really like the way they store arrays in database very much, and my hack give me flexibility to store different data into database, says if I want to store United States, I just need to keep US in the profile. It might be easier for me to use in adding flags, or mapping members in a worldmap

Boofo
02-08-2004, 09:13 PM
I think your hack is great! ;)

I just changed Location to City and State/Province and made a new field for Country and put all the countries from the list in the drop-down in the field editor. It is in the profile options. I don't have it in the new registration area but I have other fields that don't show up there either, so the user will have to go into their profile and edit them when they get regsitered.

NTLDR
02-08-2004, 09:30 PM
They must have changed something then because I have the whole countries list in a profile field and it accepts them all. It doesn't limit it to 30 anywhere that I can see. I am running 3.0 RC 3, by the way.

The limit of 30 was removed in one of the RC's.

Boofo
02-08-2004, 09:31 PM
Thank you for verifying that. I thought they must have changed something. ;)

Dean C
02-09-2004, 07:54 AM
Fixed the typo in your thread title :)

sabret00the
02-09-2004, 11:14 AM
looks great i need to investigate properly as i was looking for one that would drop down on location, you'd select your country then it would open another drop down to select state/region/province then it would do another for city and then a final input box for you to type a more specific location, if this does this yay, if not i'll have to hope i inspired you ;)

gmarik
02-09-2004, 03:57 PM
A good add-on would be language selection on FORUMHOME per language flags ...

Charlie Argueta
02-13-2004, 08:30 AM
Is it possible to make this field as a required field?, I would like that my users select their real countries insted of "At my home", "Asumed to be earth", etc.

See Ya

Boofo
02-13-2004, 08:32 AM
Fixed the typo in your thread title :)
I liked Mist better. ;)

mtha
02-13-2004, 09:15 AM
Is it possible to make this field as a required field?, I would like that my users select their real countries insted of "At my home", "Asumed to be earth", etc.

See Ya
You can set the field as required in field property/

Charlie Argueta
02-23-2004, 12:45 PM
You can set the field as required in field property/
Thanks for the info ;)

sabret00the
04-02-2004, 02:51 PM
this is an awesome hack, more people should work on listing different states/provinces from around the world :)

kolorom
06-16-2004, 06:14 AM
I so stupid 8( but what file i have to edit register.php? yes i cannot find 'register_customfields', at that file.
includes/functions_profile.php that file is apsent 8(

and in memberlist.php i cannot find
if ($profilefield['type'] == 'input' OR $profilefield['type'] == 'textarea')
{
$bbuserinfo["$profilefieldname"] = '';
eval('$customfields .= "' . fetch_template('register_customfields') . '";');
}

I use 3.0.1 8( can you help me*?
Thanks for all.

mtha
06-16-2004, 07:31 AM
I so stupid 8( but what file i have to edit register.php? yes i cannot find 'register_customfields', at that file.
includes/functions_profile.php that file is apsent 8(

and in memberlist.php i cannot find
if ($profilefield['type'] == 'input' OR $profilefield['type'] == 'textarea')
{
$bbuserinfo["$profilefieldname"] = '';
eval('$customfields .= "' . fetch_template('register_customfields') . '";');
}

I use 3.0.1 8( can you help me*?
Thanks for all.Sorry, when I did the upgrade, vBulletin.org was down, and I only update over vbulletin.nl :D

http://www.vbulletin.nl/community/showthread.php?p=27480#post27480


anyway, I have upgraded the first post to version 2.0, for both country and state mod.

Check the file out, and tell me if you still have difficulty.




looks great i need to investigate properly as i was looking for one that would drop down on location, you'd select your country then it would open another drop down to select state/region/province then it would do another for city and then a final input box for you to type a more specific location, if this does this yay, if not i'll have to hope i inspired you

then you will have to have a list of "states/regions/provinces" for many countries ... which is ... not very important to me.

there're many ways to do this, but the easiest way (i think) is to add a javascript, with a redirect function.

check example at http://webreference.com/dev/menus/intro2.html

I dont even use state hack, dont have any list of states for any country other than US, so I dont think it's that useful

Erwin
06-16-2004, 10:56 PM
You can do this without a hack by using custom profiles in vB3. :) Just letting members know.

criscokid
06-20-2005, 09:30 AM
looks great i need to investigate properly as i was looking for one that would drop down on location, you'd select your country then it would open another drop down to select state/region/province then it would do another for city and then a final input box for you to type a more specific location, if this does this yay, if not i'll have to hope i inspired you ;)

This is exactly what I'm looking for.

But I'd like to take it a step further... so you've got 3 fields - Country, State & City - take the content of those three fields and string them together to populate vbulletin's Location field. Why do I want to do this? That field gets displayed in vBulletings postbit in the forums and in other applications that user vBulletins user database - like PhotoPost and ReviewPost does.

Borimikan
07-02-2005, 07:26 PM
could u please make add an add-on that show flags countries in user profile

NOTE: WHY quick Reply quote can NOT be used?

Marco van Herwaarden
07-02-2005, 07:37 PM
could u please make add an add-on that show flags countries in user profile

NOTE: WHY quick Reply quote can NOT be used?
This can only be used if you first click the quick reply icon (the small down arrow, next to the quote button).

Otherwise the quick reply don't know which post you are replying to.

PS This was written and quoted using the quick reply.

jluerken
09-03-2005, 09:18 PM
Will this be available for vb 3.5 also?

mtha
09-03-2005, 10:41 PM
Will this be available for vb 3.5 also?

as Edwin said, this can be done by using custom profiles in vB3. so you dont have to use this hack anymore.

however, if you are interested, i may make something out of it

jluerken
09-04-2005, 07:41 AM
as Edwin said, this can be done by using custom profiles in vB3. so you dont have to use this hack anymore.

however, if you are interested, i may make something out of it

That would be really great. I am interested :D

witolds
11-16-2006, 06:14 PM
looks great i need to investigate properly as i was looking for one that would drop down on location, you'd select your country then it would open another drop down to select state/region/province then it would do another for city and then a final input box for you to type a more specific location, if this does this yay, if not i'll have to hope i inspired you ;)

hey sabret00the,

I am looking for something similar... did you find a solution for this problem?

thanks,
witold

RZ500
01-19-2007, 03:41 PM
Any idea of something like this but to be able to modify trhe list, I want to use it in ma videogames forum for the brands.

DDX
02-17-2007, 10:49 PM
could someone port this to 3.6?

appsfinder
03-11-2009, 10:10 AM
does this mod work with vb 3.7x :(