Just a simple little modification for those of us who want our users to be able to select what country they are from. This tutorial will save you a fair bit of time when setting it up.
*Note: The country list WILL NOT be maintained and this IS NOT SUPPORTED in any way, shape or form. This is simply a tutorial to make adding countries easier.
The Setup Process
The setup process is pretty straight forward, but make sure you have access to FTP and phpMyAdmin before you get started.
- Step 1: Setting Up the Flag Sprites
- Download the attached file "flag-sprites.zip" and upload the "styles" directory into your root XenForo directory.
- Login to the Admin CP and within the admin search find "Extra.css". Paste the contents of flags.css into that template and save.
- Step 2: Setting Up the Custom Field
- Login to the Admin CP and head to "Custom Fields" under the "User" tab.
- Click on "Create New Field" and enter the following information in.
- Under "Basic Information" add the following:
Field ID: country
Description: *Anything you want*
Display Location: Personal Details
Display Order: 100
Field Type: Drop Down Selection
- Under "Options for Choice Fields" add the following:
- Under "General Options" do the following:
Check off any options you want to set for this field.
In Value Display, add the following:
You don't have permission to view the code content. Please Log in or register now.
- Save this field.
- Step 3: Import the Countries via phpMyAdmin
- Login to phpMyAdmin and find your XenForo database.
- Insert the SQL code attached in "countries.txt" and run.
- Check your Country Field to see if the countries have been successfully added.
- Remove the "Test" option if it is still there.
- Step 4: Enjoy! Let me know of your success.