Welcome to #VIPR 2.1


Country Flags for Xenforo 2

GO TO ADMIN PANEL > ADD-ONS AND INSTALL VERTIFORO SIDEBAR TO SEE FORUMS AND SIDEBAR

VIPR

Founder
Administrator
Messages
276
Reaction score
138
Points
93
Best answers
0
PSN
VIP-Racing
Country
Australia
This tutorial will help you add a "Country" field to your forum so your users can easily select their country of origin and have a flag show in their profile and messages.

** BACK UP YOUR SQL DATABASE NOW **

Step 1: Download resource and upload the files to the root of your forum installation.
Step 2: Login to your Admin CP and find the "extra.less" template. Add the following code to the bottom of this template:
Code:
.flag {
background:url(/styles/default/xenforo/flags/{$choice}.gif) no-repeat;
height:16px;
width:25px;
margin-top: 4px;
}
Step 3: While still logged into the Admin CP, head to "Users" > "User Custom Fields" and "Create a New Field" with the following settings:

  • Field ID: country
  • Title: Country
  • Description: Show other users where you're from.
  • Field Type: Drop down selection
  • Option for Possible choices: Add "test" and text of "Test".
  • General Options: Set the "Value Display HTML" to:
Code:
<img src="/styles/default/xenforo/flags/{$choice}.gif" class="flag flag-{$choice}" alt="{$value}" />
Step 4:Login to your Control Panel and access phpMyAdmin. Find your XenForo database and locate the table called "xf_user_field". Click edit, go down to field_choices, click browse and upload the file "xf_user_field-field_choices" and hit Go.
 
Last edited:

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Thread starter Similar threads Forum Replies Date
VIPR VIPR Multimedia 0

Similar threads

About Us

Online Sim Car Racing at VIPR. All series Sponsored by VIPR, Super Cheap and AutObarn. Win Prizes. Project CARS 2, iRacing, GT Sport and more!

Video

Coming Series!

GT Sport
PS4 - GT Sports Track Stars Series 2019 - Prizes!

GTSport Sign Up Now!

Project Cars
PC - Project CARS V8 Supercars Series 1 - 2019 - Prizes!

pCARS Sign Up Now!
Top