Back to vBulletin 4.x Template Modifications

Member Location - Chosen from a Drop Down Menu List. UK Counties and Countries*
Mod Version: 1.00, by Welshy2008

vB Version: 4.0.4 Rating: (2 votes - 5.00 average) Installs: 10
Released: 14 Jul 2010 Last Update: 14 Jul 2010 Downloads: 83
Not Supported Template Edits Code Changes Re-usable Code Translations  

What is it?

I made this small Mod which adds a User Profile Field to to a Member's Posbit (or Posbit_Legacy, should you choose to place it there) called 'Location'.

I have searched the net and compiled a list of UK and Ireland's Counties, and Manually typed them into a "text Document". There are also some of the most popular Countries (worldwide) too. *Should you wish to use the FULL worldwide Country List, please use the text file from my "Country Flags" Mod.

I have set this up as a Non-Compulsory field. The reason that I have done this Mod is that I am stopping Members from manually entering silly names of places/countries, where they aren't even in or from.

By doing it this way, should a member 'Want' to display their loctation, all they have to do is to select theie location from the options that you have added, for them to choose from (drop down menu). If they do not wish to display their location, then all they have to do is to select the first option (blank) and nothing with show - Not even the word 'Location'.


How do I do this?

This really is a simple installation and I have included plenty of Screenshots for you too. As always, before making any template change, I would recommend that you do a 'Back Up' of your forum, and test on a Test Forum, before going Live.

I have made and tested this for the vB4.0.4.


Instructions:


Admin Control Panel (ACP) -> User Profile Field -> Add new user profile field -> Profile Field Type -> Single-Selection Menu (from the drop down menu) -> Press ‘Continue’.

Please see image "1 Single-Selection_Menu.JPG", below - for a screenshot of this.


User Profile Field
  • Title: Location
  • Description: Please enter the County that you Currently live in.
  • Profile Field Category: Uncatagorized
  • Options: Please Copy & Past ALL of the contents of the attached "County and Country OPTIONS.txt" file
  • Set Default: Yes, Including a First Blank Option
  • Display Order: (Chosen By You)
  • Field Required: No (I have made this Not Compulsory, to my Members)
  • Field Editable By User: Yes
  • Private Field: No
  • Field Searchable On Members List: Yes
  • Show On Members List: Yes
Optional Output:
  • Allow User to input their own value for this option: No
  • Max length of allowed user input: 100
  • Field Length: 25
  • Regular Expression: Leave this EMPTY
Display Page:
  • Which page displays this option? Edit Profile
SAVE & Note the ‘field’ number as you need to replace the ‘X’ with it in the two positions (2) containing ‘fieldX’

Please see image "2 USER_PROFILE_FIELD_SCREENSHOT.JPG", Below - for a screenshot of this.


Next, we need to Make a Template change. I use Postbit, and because of which, this is how I have done this Mod. If you use Posbit_Legacy, it will work in there too.


Admin Control Panel (ACP) -> Styles and Templates -> Style Manager -> (style that you use – Mine is ‘Default Style’) -> << >> -> Postbit
Templates -> Postbit (or Postbit _legacy, depending on which one YOU use)

Find:

Code:
                        <vb:if condition="$post['joindate']"><dt>{vb:rawphrase join_date}:</dt> <dd>{vb:raw post.joindate}</dd></vb:if>

Add Below:

Code:
<!-- Wy Selectable Location in postbit Start -->
<vb:if condition="$post['fieldX']"> <dt>Location:</dt> <dd>{vb:raw post.fieldX}</dd></vb:if>
<!-- Wy Selectable Location in postbit End -->
  • Click "Save".
Please see image "4 Postbit_Screenshot1.JPG", Below - for a screenshot of this.



Please remember to replace the TWO red X's in the code, Above - with the field number from earlier. Please see image "3 Field-Number-Screenshot.JPG", below.


THAT’S IT !

This can be done when a Member Registers and When a Member Edits His or Her Profile.



To view it in your profile: Edit your Profile and choose your “Location”.

Please Click Installed and Rate the Mod – Many Thanks.


Support will only be offered to those who have clicked 'Installed'.

Download

File Type: %1$s County and Country OPTIONS.txt (2.1 KB, 79 downloads)

Screenshots

Click image for larger version
Name:	1 Single-Selection_Menu.jpg
Views:	173
Size:	34.4 KB
ID:	119628   Click image for larger version
Name:	2 USER_PROFILE_FIELD_SCREENSHOT.jpg
Views:	171
Size:	95.7 KB
ID:	119629   Click image for larger version
Name:	3 Field-Number-Screenshot.JPG
Views:	163
Size:	65.9 KB
ID:	119630   Click image for larger version
Name:	4 Postbit_Screenshot1.jpg
Views:	248
Size:	72.2 KB
ID:	119631  

Click image for larger version
Name:	5.1 Edit_Profile_Screenshot1.jpg
Views:	204
Size:	35.4 KB
ID:	119632   Click image for larger version
Name:	5.2 Edit_Profile_Screenshot2.jpg
Views:	292
Size:	46.6 KB
ID:	119633   Click image for larger version
Name:	6 Postbit_Screensot.JPG
Views:	271
Size:	4.3 KB
ID:	119638  


vblts.ru supports vBulletin®, 2022-2024