Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Member Location - Chosen from a Drop Down Menu List. UK Counties and Countries* Details »»
Member Location - Chosen from a Drop Down Menu List. UK Counties and Countries*
Version: 1.00, by Welshy2008 Welshy2008 is offline
Developer Last Online: Mar 2013 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.0.4 Rating:
Released: 07-13-2010 Last Update: 07-13-2010 Installs: 10
Template Edits
Re-useable Code Code Changes Translations  
No support by the author.

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 Now

File Type: txt County and Country OPTIONS.txt (2.1 KB, 77 views)

Screenshots

File Type: jpg 1 Single-Selection_Menu.jpg (34.4 KB, 0 views)
File Type: jpg 2 USER_PROFILE_FIELD_SCREENSHOT.jpg (95.7 KB, 0 views)
File Type: jpg 3 Field-Number-Screenshot.JPG (65.9 KB, 0 views)
File Type: jpg 4 Postbit_Screenshot1.jpg (72.2 KB, 0 views)
File Type: jpg 5.1 Edit_Profile_Screenshot1.jpg (35.4 KB, 0 views)
File Type: jpg 5.2 Edit_Profile_Screenshot2.jpg (46.6 KB, 0 views)
File Type: jpg 6 Postbit_Screensot.JPG (4.3 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 07-24-2010, 06:06 PM
COL NIL SATIS COL NIL SATIS is offline
 
Join Date: Aug 2009
Location: Liverpool UK
Posts: 802
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Alfa1 View Post
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
Reply With Quote
  #13  
Old 07-25-2010, 04:14 PM
Welshy2008's Avatar
Welshy2008 Welshy2008 is offline
 
Join Date: Jul 2008
Location: UK
Posts: 904
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by COL NIL SATIS View Post
You are very Welcome Col, Thanks for using it.
Reply With Quote
  #14  
Old 08-05-2010, 11:49 PM
Alfa1's Avatar
Alfa1 Alfa1 is offline
 
Join Date: Dec 2005
Location: Netherlands
Posts: 3,537
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is the edited country list. (without numbers and spaces)
Attached Files
File Type: txt countries.txt (3.1 KB, 12 views)
Reply With Quote
  #15  
Old 09-23-2010, 05:41 PM
COL NIL SATIS COL NIL SATIS is offline
 
Join Date: Aug 2009
Location: Liverpool UK
Posts: 802
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Updated to 4.0.6 Welshy mate ...re added this and it works fab still !!! great stuff
Reply With Quote
  #16  
Old 09-23-2010, 07:37 PM
Welshy2008's Avatar
Welshy2008 Welshy2008 is offline
 
Join Date: Jul 2008
Location: UK
Posts: 904
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:16 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04676 seconds
  • Memory Usage 2,304KB
  • Queries Executed 21 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (9)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete