Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons

Reply
 
Thread Tools
Gender Bit: Show gender symbol next to username in postbits and many other places Details »»
Gender Bit: Show gender symbol next to username in postbits and many other places
Version: 1.1.0, by ReCom ReCom is offline
Developer Last Online: Jul 2014 Show Printable Version Email this Page

Category: Profile Enhancements - Version: 3.7.x Rating:
Released: 11-19-2008 Last Update: 11-26-2008 Installs: 160
Uses Plugins
Re-useable Code Additional Files  
No support by the author.

My first public mod. Please be kind to me

Description:
Gender Bit shows gender symbol next to username in postbits. See "prerequisite" and "Installation guide" below.

Features:
  • Fully uses plugins so there is no need to customize any templates
  • Makes use of the built-in User Profile Field system
  • Configurable through vBulletin Options
  • Includes a number of male-or-female symbol sets to choose from
  • Easily enable/disable the gender symbols in various places
    • Postbits, private messages, announcements etc
    • Memberlist
    • Profile pages
  • No database changes, no extra queries (instead it utilizes existing queries to fetch the gender info), no template edits, in short, no mess.
  • Version 1.0.2 and above: Now also takes care of default profile pictures and friends' avatars by showing default male/female avatar accordingly
  • Version 1.0.2 and above: Exposes a globally-scoped function genderbit_getgender for other mods and plugins to make use (refer change logs below for details)
  • New in 1.1.0: Support for the third gender type ...

Prerequisite:
A custom user profile field designated for members' gender must be manually created in user profile field manager. If your forum does not already have one and you have no idea how to create it, please read included README.txt for instructions.

Download guide:
  • Download and install the latest version only. The older versions are there for record purpose only.
  • The main product package file is Gender Bit x.x.x.zip. You would only need to install this to get the gender symbols in your postbits.
  • Gender Bit Ext x.x.x (requires Gender Bit x.x.x).zip is an extension product that displays gender-aware default avatars for your users. Only install this if you want to have the default avatars showing sillhoutte of a man or a woman depending on your users' genders.

Installation guide:
  1. Upload the includes and images folders (inside the zipped upload folder) to your vbulletin directory (usually /forum). The folders should merge with existing /forum/includes and /forum/images.
  2. Import the product XML in AdminCP product manager. Then, head straight to the option page for Gender Bit under vBulletin Options.
  3. Configure the "User profile field name" to be the name of the user profile field. Usually it is in the form of 'fieldX' where X is a number.
  4. Also configure the "Field value: Male" and "Field value: Female" to be the value(s) of the profile field when a member selects "Male" or "Female" respectively. If there are multiple values that refer to male (or female), separate them using pipe characters, example: Boy|Gentleman
  5. Lastly configure the other options to your likings.
  6. Save and the gender symbol will appear in postbits for members who have set their gender profile field.
Upgrading guide:
Same as installation, with the only difference is to tick the "Overwrite" checkbox when importing the product xml). Also, you would need to check the options page (Admin CP > vBulletin Options > Gender Bit) for any new settings.

Uninstallation guide:
To uninstall simply uninstall the product from AdminCP product manager. Optionally delete the images and xml files:
/images/misc/gender_*.gif
/images/misc/unknown_*.gif
/includes/xml/bitfield_genderbit*.xml

Changelogs:

Version 1.0
- Initial version

Version 1.0.1
- Replaced align="absmiddle" with CSS to pass XHTML validation
- Extra image sets for male/female with a new option in vB Options to choose which set to use

Version 1.0.2
- Fixed php errors in private messages and a few other places
- New: Option to show gender symbol in memberlist
- New: Gender Bit can now take care of default profile pictures and friends' avatar to show default male/female avatar
- New: Exposes a globally-scoped function genderbit_getgender($registry, $userinfo, $unknown='') that returns 'male', 'female' or $unknown. The three parameters are:
  • $registry: the vbulletin core object, usually $vbulletin but may be $this->registry in some vb classes
  • $userinfo: the userinfo array, which usually holds 'userid' and 'username'
  • $unknown: string to return if $userinfo does not contain gender information. default to empty string
Version 1.1.0
- Major revamps.
- Added: a lots more places where the gender symbols will appear, with options to turn each one of them on/off in vBulletin Options
- Added: the third gender for those who think two genders are not enough.
- Changed: Gender Bit will only look for the images in forumdir/images/misc by default unless overridden in vBulletin Options.
- Starting from this version, the handling of gender-aware default avatars and profile pictures have been separated into an extension product named "Gender Bit Extension". Gender Bit does NOT require Gender Bit Extension to operate but Gender Bit Extension REQUIRES Gender Bit.

Note: Should also work in vB 3.6.x, but I haven't done any testing in that vB version.

Troubleshooting (aka why aren't the symbols/images showing?)

Step 1:
In { AdminCP > vBulletin Options > Gendet Bit } check if you have configured "Field value: Male" and "Field value: Female" to match what your members would choose if they are male or female. If in your forum/language "Shalabadaba" means "male" and "Shubidubidu" means "female", enter Field value: Male = "Shalabadaba" and Field value: Female = "Shubidubidu". Just overwrite the default "Male" and "Female" in the textboxes.

Step 2 (version 1.1.0 and above):
Still in { AdminCP > vBulletin Options > Gendet Bit }. Try setting Gender symbols image set = "Text/Font" to see if the symbols appear. If it does then you forgot to upload the images into ALL /images/misc folders for ALL STYLES installed in your forum.

Step 3:
From your showthread pages, find the following part (page navigation):

Right-click on the down-pointing arrow and select "Properties" from the popup menu. Check the path to the file, usually in the form of "http://www.yoursite.net/forum/images/misc/menu_open.gif". The bolded part is the path of the misc images folder for your current style. If it says "http://www.yoursite.net/forum/images/yuppie/v4/misc/menu_open.gif" then upload the gender images into forum/images/yuppie/v4/misc/

Show Your Support

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

Comments
  #42  
Old 11-27-2008, 07:37 AM
shlomot's Avatar
shlomot shlomot is offline
 
Join Date: Apr 2007
Location: Haifa, Israel
Posts: 246
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks a lot for keeping your promise

Will you be kind and add UPGRADE instructions to your MOD?

Also, version 1.0.2 worked flawlessly in vb3.8 beta 3. Would you like me to test the new version on beta 4 and post the results here?

Quote:
Originally Posted by ReCom View Post
Version 1.1.0 is up.

Starting from this version Gender Bit has been broken up into two products: Gender Bit and Gender Bit Extension.

Gender Bit handles the core functions and gender symbols (original purpose).

Gender Bit Extension adds the support to display gender-aware default avatars and profile pictures. You do not have to install this product if you just want the gender symbols. Requires Gender Bit to be installed first.
Reply With Quote
  #43  
Old 11-27-2008, 08:40 AM
ReCom ReCom is offline
 
Join Date: Mar 2008
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by shlomot View Post
Will you be kind and add UPGRADE instructions to your MOD?
The upgrade procedure is the same as most other mods you found here: upload the files, import the product xml (make sure the "override" checkbox is ticked) and check the new settings. Shouldn't be too hard.
Quote:
Originally Posted by shlomot View Post
Also, version 1.0.2 worked flawlessly in vb3.8 beta 3. Would you like me to test the new version on beta 4 and post the results here?
Sure, thanks. I have not installed vB 3.8.x beta on my forum so I only tested it on vb 3.7.4. The new version has a lot more plugins than before maybe one or two plugins do not work in vb 3.8.x if the hook locations changed. Thanks again for your support.

p/s: hope the separation between gender symbols portion and default avatars/pics portion does not bother you much. as you would notice if you install both Gender Bit and the Extension products, the number of plugins doubles with both products are installed compared to Gender Bit only. By separating them, those who are not interested with the default avatars will not have to have the unutilized plugins, which do affect performance in the long run.
Reply With Quote
  #44  
Old 11-27-2008, 09:49 PM
Tauhid Tauhid is offline
 
Join Date: Apr 2006
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is such a worthy mod, after switching from IPB to VB, the genders were all gone, so I had to install this mod. thank you OP.
Reply With Quote
  #45  
Old 11-28-2008, 03:35 AM
shlomot's Avatar
shlomot shlomot is offline
 
Join Date: Apr 2007
Location: Haifa, Israel
Posts: 246
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The new version 1.1 and the avatar/profile picture extension also work flawlessly in vb3.8 beta 3 & 4.

Also, this is one of the better planned and wisely implemented mods I have ever used. I'm thrilled to have ReCom decided to share is professional experties with the rest of us.
Reply With Quote
  #46  
Old 11-28-2008, 04:33 AM
shlomot's Avatar
shlomot shlomot is offline
 
Join Date: Apr 2007
Location: Haifa, Israel
Posts: 246
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have found a few glitches in vb3.8 (never installed on vb3.7.x):
  1. In the "Friends" block on member profile - it shows members pictures instead of avatars, with the image width set to avatar max width.
  2. When viewing a member profile when the visitor belongs to a user group that has no permission to view member profile pictures, it displays default picture, instead of not displaying anything at all.
Reply With Quote
  #47  
Old 11-28-2008, 04:52 AM
ReCom ReCom is offline
 
Join Date: Mar 2008
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by shlomot View Post
In the "Friends" block on member profile - it shows members pictures instead of avatars.
Weird because the plugin code outputs the "unknown_male.gif" or "unknown_female.gif':
PHP Code:
if (!empty($gender) AND $user['avatarurl'] == "$stylevar[imgdir_misc]/unknown.gif" AND ($this->registry->options['genderbit_loc_avatars'] & $this->registry->options['genderbit_loc']['profile']) != 0)
{
  
$user['avatarurl'] = $this->registry->options['genderbit_imgdir']."/unknown_$gender.gif";

Since gender-aware default profile pictures are "unknown_pic_male.gif" or "unknown_pic_female.gif' it's hard to imagine how the plugin picks the default profile pictures over the default avatars in vb 3.8.
Quote:
Originally Posted by shlomot View Post
When viewing a member profile while NOT logged in, it shows default picture even when member has their own. Avatar display, on the other hand is OK.
It's because usergroup "Unregistered / Not Logged In" does not have permission to view profile pictures so vBulletin original code does not output the profile pictures (AdminCP > Usergroups > Usergroup Manager > Unregistered / Not Logged In > Edit > General Permissions > Can View Others' Profile Pictures). Gender Bit plugin detects it as "the user profile does not have a profile picture" and inject a default one. Seeking opinion here: will it make more sense if Gender Bit does not show the default profile picture to usergroups that do not have permission to view profile pictures (like before Gender Bit is installed)?

Thanks for testing Gender Bit on vBulletin 3.8 .. I don't think I will be installing 3.8 until at least RC version is out ..
Reply With Quote
  #48  
Old 11-28-2008, 05:54 AM
shlomot's Avatar
shlomot shlomot is offline
 
Join Date: Apr 2007
Location: Haifa, Israel
Posts: 246
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Another option for glitch #1 is that it does use the avatar picture but assigns wrong dimentions (even though wrong dimensions would distort the image and not cut it into half). Here is a sample URL in my ADULT site.

As to #2 - logic prevails Logically, the default picture should abide by the same rules of the game as a user-assigned one. I can dream, of course, about a third option where you give us the opportunity to display another picture variation when not allowed to view profile pictures. In my case I will put my site's logo with a diagonal message that encourages the visitor to register.

Quote:
Originally Posted by ReCom View Post
Weird because the plugin code outputs the "unknown_male.gif" or "unknown_female.gif':
PHP Code:
if (!empty($gender) AND $user['avatarurl'] == "$stylevar[imgdir_misc]/unknown.gif" AND ($this->registry->options['genderbit_loc_avatars'] & $this->registry->options['genderbit_loc']['profile']) != 0)
{
  
$user['avatarurl'] = $this->registry->options['genderbit_imgdir']."/unknown_$gender.gif";

Since gender-aware default profile pictures are "unknown_pic_male.gif" or "unknown_pic_female.gif' it's hard to imagine how the plugin picks the default profile pictures over the default avatars in vb 3.8.

It's because usergroup "Unregistered / Not Logged In" does not have permission to view profile pictures so vBulletin original code does not output the profile pictures (AdminCP > Usergroups > Usergroup Manager > Unregistered / Not Logged In > Edit > General Permissions > Can View Others' Profile Pictures). Gender Bit plugin detects it as "the user profile does not have a profile picture" and inject a default one. Seeking opinion here: will it make more sense if Gender Bit does not show the default profile picture to usergroups that do not have permission to view profile pictures (like before Gender Bit is installed)?

Thanks for testing Gender Bit on vBulletin 3.8 .. I don't think I will be installing 3.8 until at least RC version is out ..
Reply With Quote
  #49  
Old 11-28-2008, 06:28 AM
ReCom ReCom is offline
 
Join Date: Mar 2008
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by shlomot View Post
Another option for glitch #1 is that it does use the avatar picture but assigns wrong dimentions (even though wrong dimensions would distort the image and not cut it into half). Here is a sample URL in my ADULT site.
Well, because your default avatars are bigger than vbulletin buit-in dimension for each friend's avatar in the Friends box. Gender Bit don't and won't modify the built-in limit to avoid messing up the Friends box. I suggest you resize your default avatars to smaller dimension (vBulletin's default unknown.gif is 60x60 so better stick to that). p/s: you are bad for making me click that link
Quote:
Originally Posted by shlomot View Post
As to #2 - logic prevails Logically, the default picture should abide by the same rules of the game as a user-assigned one.
Will add another setting in vBulletin Options in next version.
Quote:
Originally Posted by shlomot View Post
I can dream, of course, about a third option where you give us the opportunity to display another picture variation when not allowed to view profile pictures. In my case I will put my site's logo with a diagonal message that encourages the visitor to register.
Maybe in next version Gender Bit will display unknown_pic_nopermission.gif to them ... or do you want unknown_pic_nopermission_male.gif and unknown_pic_nopermission_female.gif variations as well?
Reply With Quote
  #50  
Old 11-29-2008, 02:41 AM
shlomot's Avatar
shlomot shlomot is offline
 
Join Date: Apr 2007
Location: Haifa, Israel
Posts: 246
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ReCom View Post
Well, because your default avatars are bigger than vbulletin buit-in dimension for each friend's avatar in the Friends box. Gender Bit don't and won't modify the built-in limit to avoid messing up the Friends box. I suggest you resize your default avatars to smaller dimension (vBulletin's default unknown.gif is 60x60 so better stick to that).
I see your point, but nonetheless, the friends block is displaying non-standard-size avatars just fine when they (the avatars) have been assigned manually.

Quote:
Originally Posted by ReCom View Post
p/s: you are bad for making me click that link
So sorry. I would never try to trick you into that. This is why I stated that it is an adult site in bold and red text. Unfortunately, this is the only site yet where I have implemented your mod. But soon enough it will be implemented on the other PG forums.

Quote:
Originally Posted by ReCom View Post
Will add another setting in vBulletin Options in next version. Maybe in next version Gender Bit will display unknown_pic_nopermission.gif to them ... or do you want unknown_pic_nopermission_male.gif and unknown_pic_nopermission_female.gif variations as well?
Thanks for your exceptional accommodation. It seems that a single unisex picture would be
enough yet gender-specific images will better follow your script's business logic; the user can always duplicate the same image across the genders.
Reply With Quote
  #51  
Old 11-29-2008, 08:09 AM
cykelmyggen's Avatar
cykelmyggen cykelmyggen is offline
 
Join Date: Oct 2006
Location: Europe
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a suspicion this doesn't work with the vBExperience mod. Havent been able to make it show anywhere in postbit or elsewhere... Checked all the image paths and settings with no luck so far.
Reply With Quote
Reply

Thread Tools

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 02:57 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09477 seconds
  • Memory Usage 2,346KB
  • Queries Executed 25 (?)
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_php
  • (12)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete