Log in

View Full Version : Mini Mods - Member Location - Chosen from a Drop Down Menu List. UK Counties and Countries*


Welshy2008
07-13-2010, 10:00 PM
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: YesOptional 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 EMPTYDisplay Page:


Which page displays this option? Edit ProfileSAVE & 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:

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


Add Below:

<!-- 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'.

COL NIL SATIS
07-16-2010, 03:55 PM
Awesome !!! Thanks Welshy ,will add this now:up:

Welshy2008
07-16-2010, 03:59 PM
You're Welcome Col.

Alfa1
07-16-2010, 09:13 PM
I would love to have this, but with world countries & states, instead of countries. Is anyone able to provide the text for countries and states?

Welshy2008
07-17-2010, 08:33 AM
I would love to have this, but with world countries & states, instead of countries. Is anyone able to provide the text for countries and states?

I will be unavailable from 18th - 25th July, I will have a look for you after that date. What Countries are you looking for? (It took me long enough to put this one together :()

COL NIL SATIS
07-18-2010, 05:58 PM
Just installed and it works brilliantly ...top work Welshy thanks for this man:)

Alfa1
07-18-2010, 06:25 PM
I will be unavailable from 18th - 25th July, I will have a look for you after that date. What Countries are you looking for? (It took me long enough to put this one together :()
I run an international forum and would like my members to select from the drop down, the country they live in. My members come from all over the world, so I am looking for all countries.

There must be a list on the net somewhere, but I have not found it.

COL NIL SATIS
07-18-2010, 10:14 PM
I run an international forum and would like my members to select from the drop down, the country they live in. My members come from all over the world, so I am looking for all countries.

There must be a list on the net somewhere, but I have not found it.

Will check this out tomorrow man and add a full list if i have time :up:

jgt58
07-19-2010, 02:53 AM
Yea I have something very similar except with states on www.elitestangs.com/forum

Alfa1
07-23-2010, 05:49 PM
This would be great to have.

COL NIL SATIS
07-24-2010, 06:06 PM
I run an international forum and would like my members to select from the drop down, the country they live in. My members come from all over the world, so I am looking for all countries.

There must be a list on the net somewhere, but I have not found it.

http://www.listofcountriesoftheworld.com/

hope that helps bud :)

Welshy2008
07-25-2010, 04:14 PM
http://www.listofcountriesoftheworld.com/

hope that helps bud :)

You are very Welcome Col, Thanks for using it. :)

Alfa1
08-05-2010, 11:49 PM
Here is the edited country list. (without numbers and spaces)

COL NIL SATIS
09-23-2010, 05:41 PM
Updated to 4.0.6 Welshy mate ...re added this and it works fab still !!! great stuff:)

Welshy2008
09-23-2010, 07:37 PM
Indeed it does Col, Mate.

I have only just added it to a fresh upgrade to 4.0.6 (test forum).

Thanks for the update, Mate. :)