vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Countries/States fields as options(over 30 fields) (https://vborg.vbsupport.ru/showthread.php?t=61332)

mtha 02-07-2004 10:00 PM

Countries/States fields as options(over 30 fields)
 
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 (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 and YaME
- 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

Quote:

Originally Posted by Boofo
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

Quote:

Originally Posted by Boofo
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 ...


All times are GMT. The time now is 07:17 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01065 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete