2018 “The winner ain't the one with the fastest car, it's the one who refuses to lose.” 2018
    2018 “#VIPR 2.0.” 2018

Country Flags for Xenforo 2

Thread starter #1

VIPR

Founder
Administrator
Messages
241
Ratings
123
Points
93
Best answers
0
PSN
VIP-Racing
Country
Australia
Online
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.
 

Attachments

Last edited:
Thread starter Similar threads Forum Replies Date
VIPR VIPR Multimedia 0

Similar threads

Top Bottom