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
Gender in Postbit or Postbit Legacy - vB 4.0.x Inc GOLD Details »»
Gender in Postbit or Postbit Legacy - vB 4.0.x Inc GOLD
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.0 Rating:
Released: 12-25-2009 Last Update: 12-26-2009 Installs: 280
Template Edits
Re-useable Code Code Changes Translations  
No support by the author.

What is this?

This is a little Mod & Template edit that adds a 'Gender' for you Members to choose and displays their 'Gender and a nice little icon' in their Postbit.

Instructions in the "READ ME" file (pdf) , pictures and SCREENSHOTS are all included in the Attached file ' Gender in Postbit'.

Complete this in 4 Steps:-


STEP ONE; Create a New Profile Field:

AdminCP -> User Profile Fields -> Add New User Profile Field ->
And do the following:
  • Profile Field Type: Single-Selection Menu
Click Continue


Add New User Profile field: Single-Selection Menu

  • Title: Gender:
  • Description: Please Select your Gender
  • Profile Field Category: Uncatagorized
  • Options: Male , Female
  • Set Default: None
  • Display Order: (Chosen By You)
  • Field Required: Yes, at registration & profile updating (You don?t have to make it compulsory)
  • 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?



STEP 2; Add a Phrase:

AdminCP -> Languages & Phrases -> Phrase Manager -> Add New Phrase (Center button on the bottom):
  • Phrase Type: GLOBAL
  • Product: vBulletin
  • Varname: gender
  • Text: Gender
SAVE


STEP 3; Postbit or Postbit_Legacy Template (whichever one you use):


AdminCP -> 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><br />
ADD BELOW:

Code:
<!-- Wy Gender in postbit Start -->
<vb:if condition="$post['fieldX']"> <dt>Gender:</dt> <dd><img src="http://WWW.YOUR FORUM
ADDRESS.COM/images/misc/{vb:raw post.fieldX}.gif" alt="" /></dd></vb:if>
<!-- Wy Gender in postbit End -->

vBulletin 4.1.0 (tested by beiamerica. Please note that I have not tested this myself.

Code:
<!-- Wy Gender in postbit Start -->
<vb:if condition="$post['fieldX']"><dt>{vb:rawphrase gender}</dt> <dd><img src="{vb:stylevar imgdir_misc}/{vb:raw post.fieldX}.gif" alt="{vb:raw post.fieldX}" /></dd></vb:if>
<!-- Wy Gender in postbit End -->

  • Replace the TWO Green ?X?s with the field number in Step One (1).
  • Replace the Red Text with YOUR forum address.
STEP 4; Upload the Images:
  • Upload the ?Male.gif? and the ?Female.gif? to the ?images/misc? directory of your forum?s route.
THAT?S IT !

To view it in your profile: Edit your Profile and choose your ?Gender?.

Please Click the Install and Rate the Mod ? Many Thanks.

Edited on Wednesday 7th July 2010. Reason: Two more Screenshots added and made the "Single-Selection Menu" Bold.

Download Now

File Type: zip Gender In Postbit.zip (808.3 KB, 1715 views)

Screenshots

File Type: jpg 1.jpg (92.6 KB, 0 views)
File Type: jpg 2.jpg (82.3 KB, 0 views)
File Type: jpg 3.jpg (85.1 KB, 0 views)
File Type: jpg 4.jpg (37.6 KB, 0 views)
File Type: gif 5.gif (28.1 KB, 0 views)
File Type: jpg Gender-Screen1-on-Registration.JPG (42.4 KB, 0 views)
File Type: jpg Gender-Screen2-on-Registration.JPG (44.0 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
6 благодарности(ей) от:
akz645, elsa23, Gorgasm, Macgiber, mohammadxxx, sodasusu

Comments
  #152  
Old 01-11-2014, 08:13 PM
ndut ndut is offline
 
Join Date: Sep 2007
Location: Indonesia
Posts: 335
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes, not enough hooks like vb4 had.
Reply With Quote
  #153  
Old 03-16-2015, 09:44 AM
SᴩiDᴇЯ SᴩiDᴇЯ is offline
 
Join Date: Sep 2009
Location: Australia
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you it works perfectly with my vB4.2.2 you can see it here
Reply With Quote
  #154  
Old 08-10-2015, 11:19 PM
akz645 akz645 is offline
 
Join Date: Jul 2015
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

These were my settings:
http://i.imgur.com/jI48mDH.png
I tried on vBulletin 4.2.3 and it almost worked- the gender options doesn't show when users are editing their profile.
Like me, if you put: No, but display at registration in the User Profile Field, then you'll need to do what I write below:

So in order to fix that:
AdminCP -> Styles & Templates -> Search Templates -> tb_homepage [Pick your style too] -> modifyprofile (edit)
Find:
PHP Code:
                    <input type="hidden" name="coppauser" value="1" />
                    <
class="description">
                        {
vb:rawphrase if_under_13_provide_parent}
                    </
p>
                </
div
Quote:
Originally Posted by imported_df+++++ View Post
ADD BELOW:

Code:
<div class="blockrow">
				<ul class="group">
					<li>
<label for="gender">{vb:rawphrase gender}:</label>
<select class="primary" name="userfield[fieldXX]" id="cfield_XX" tabindex="1">
<option value="0" selected="selected"></option>
<option value="1">Male</option>
<option value="2">Female</option> 
</select>
<input type="hidden" name="userfield[fieldXX_set]" value="1" />
					</li>
				</ul>
			</div>
change XX for whatever your profile field for gender is.
That seems to do the trick.
If you have problems with it appearing on the registration, then do what the guy above me said to do in the registration template.

It will be located here:
http://i.imgur.com/7RpGMzK.png

The blank option is useful, so users can hide gender from appearing in the postbit altogether.

Edit:
I'd suggest ignoring this post. Do what I did in the post below (much better/easier).
Reply With Quote
  #155  
Old 08-29-2015, 11:35 AM
akz645 akz645 is offline
 
Join Date: Jul 2015
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I noticed many of my users never bothered to check their userCP and therefore the default option was blank (if you follow this Mods settings). Hence the gender never appeared in their postbit, as most users didn't fill it out during registration.

So I decided to figure out a way for users to have 'Male' as the default, if they couldn't be bothered to change when registering. This way, if they're female or don't want to display their Gender, they'll be forced to change from their userCP, if they didn't already during registration.

Tested & Working on vBulletin 4.2.3

How did I do this?
Step 1:
Download the attachment & extract the attachment file and upload the 'images' folder into the root of your public_html folder.

Step 2:
Admin CP -> User Profile Fields -> Add New User Profile Field -> Profile Field Type: Single-Selection Menu
This is what I kept as my User Profile Field: Yes, at registration and profile updating & Yes, but No First Blank Option
Notice that I have set a 'Hide' option too (you can name it to whatever you want). That option will not display Gender in the postbit.
Also you won't see the Field ID Number until you press save and then go back to the User Profile Manger.

Step 3:
AdminCP -> Languages & Phrases -> Phrase Manager -> Add New Phrase:
  • Phrase Type: GLOBAL
  • Product: vBulletin
  • Varname: gender
  • Text: Gender

Step 4:
AdminCP -> Styles & Templates -> Search Templates -> postbit_legacy [Pick your style too] -> postbit_legacy (edit)
Note: If postbit_legacy doesn't work, search "postbit" which is located below Postbit Templates.

Find: (well you can pretty much place it anywhere in your postbit that you'd like)
Code:
<vb:if condition="$post['joindate']"><dt>{vb:rawphrase join_date}</dt>: <dd>{vb:raw post.joindate}</dd></vb:if><br />
Add Below:
Code:
<!-- My Gender in postbit Start -->
<vb:if condition="$post['field5'] === 'Male'"><dt>{vb:rawphrase gender}</dt> <dd><img src="{vb:stylevar imgdir_misc}/{vb:raw post.field5}.gif" /></dd></vb:if>
<vb:if condition="$post['field5'] === 'Female'"><dt>{vb:rawphrase gender}</dt> <dd><img src="{vb:stylevar imgdir_misc}/{vb:raw post.field5}.gif" /></dd></vb:if>
<!-- My Gender in postbit End -->
Make sure to edit Male & Female to whatever you called it in your options.
Also, make sure to edit the four Field ID Numbers (as seen in the code, mine is 5).
If you want to add in more options, then you can do that too (same place you put Male & Female images). Make sure to call it the same as your Options (caps sensitive). Likewise, make sure to add in the extra condition into your postbit_legacy (or postbit) template.

That's it

P.S=
Your display order is not your Field ID Number. Display order is completely irrelevant. It's just to help you organise profile fields.
------------------
Edit:
Thanks to Welshy2008 for this Mod, I figured out how to make my own Mod doing this, but for something separate.
Attached Images
File Type: png Download the attachment.png (17.4 KB, 0 views)
File Type: jpg User Profile Field. Yes, at registration and profile updating.jpg (70.9 KB, 0 views)
File Type: jpg Also you won't see the Field ID Number.jpg (32.3 KB, 0 views)
File Type: jpg Phrase Type.jpg (39.8 KB, 0 views)
File Type: jpg postbit_legacy.jpg (17.3 KB, 0 views)
File Type: jpg postbit_legacy (edit).jpg (18.3 KB, 0 views)
File Type: jpg Postbit.jpg (16.1 KB, 0 views)
File Type: jpg located below Postbit Templates..jpg (20.9 KB, 0 views)
Attached Files
File Type: zip Gender In Postbit - with folders.zip (15.8 KB, 10 views)
Reply With Quote
Благодарность от:
darksidemon2
  #156  
Old 10-16-2015, 01:09 PM
darksidemon2 darksidemon2 is offline
 
Join Date: Apr 2011
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by akz645 View Post
I noticed many of my users never bothered to check their userCP and therefore the default option was blank (if you follow this Mods settings). Hence the gender never appeared in their postbit, as most users didn't fill it out during registration.

So I decided to figure out a way for users to have 'Male' as the default, if they couldn't be bothered to change when registering. This way, if they're female or don't want to display their Gender, they'll be forced to change from their userCP, if they didn't already during registration.

Tested & Working on vBulletin 4.2.3

How did I do this?
Step 1:
Download the attachment & extract the attachment file and upload the 'images' folder into the root of your public_html folder.

Step 2:
Admin CP -> User Profile Fields -> Add New User Profile Field -> Profile Field Type: Single-Selection Menu
This is what I kept as my User Profile Field: Yes, at registration and profile updating & Yes, but No First Blank Option
Notice that I have set a 'Hide' option too (you can name it to whatever you want). That option will not display Gender in the postbit.
Also you won't see the Field ID Number until you press save and then go back to the User Profile Manger.

Step 3:
AdminCP -> Languages & Phrases -> Phrase Manager -> Add New Phrase:
  • Phrase Type: GLOBAL
  • Product: vBulletin
  • Varname: gender
  • Text: Gender

Step 4:
AdminCP -> Styles & Templates -> Search Templates -> postbit_legacy [Pick your style too] -> postbit_legacy (edit)
Note: If postbit_legacy doesn't work, search "postbit" which is located below Postbit Templates.

Find: (well you can pretty much place it anywhere in your postbit that you'd like)
Code:
<vb:if condition="$post['joindate']"><dt>{vb:rawphrase join_date}</dt>: <dd>{vb:raw post.joindate}</dd></vb:if><br />
Add Below:
Code:
<!-- My Gender in postbit Start -->
<vb:if condition="$post['field5'] === 'Male'"><dt>{vb:rawphrase gender}</dt> <dd><img src="{vb:stylevar imgdir_misc}/{vb:raw post.field5}.gif" /></dd></vb:if>
<vb:if condition="$post['field5'] === 'Female'"><dt>{vb:rawphrase gender}</dt> <dd><img src="{vb:stylevar imgdir_misc}/{vb:raw post.field5}.gif" /></dd></vb:if>
<!-- My Gender in postbit End -->
Make sure to edit Male & Female to whatever you called it in your options.
Also, make sure to edit the four Field ID Numbers (as seen in the code, mine is 5).
If you want to add in more options, then you can do that too (same place you put Male & Female images). Make sure to call it the same as your Options (caps sensitive). Likewise, make sure to add in the extra condition into your postbit_legacy (or postbit) template.

That's it

P.S=
Your display order is not your Field ID Number. Display order is completely irrelevant. It's just to help you organise profile fields.
------------------
Edit:
Thanks to Welshy2008 for this Mod, I figured out how to make my own Mod doing this, but for something separate.
Thanks

works this way with Version 4.2.3
Reply With Quote
  #157  
Old 02-18-2016, 02:39 PM
Gn_Snake Gn_Snake is offline
 
Join Date: Feb 2006
Location: Italy
Posts: 358
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks,
works perfect to 4.2.3
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 06:08 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.06599 seconds
  • Memory Usage 2,384KB
  • Queries Executed 24 (?)
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
  • (8)bbcode_code
  • (1)bbcode_php
  • (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
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (7)post_thanks_box
  • (7)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (17)postbit_attachment
  • (7)postbit_onlinestatus
  • (7)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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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