vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Profile Enhancements - Gender Bit: Show gender symbol next to username in postbits and many other places (https://vborg.vbsupport.ru/showthread.php?t=196749)

ReCom 11-19-2008 10:00 PM

Gender Bit: Show gender symbol next to username in postbits and many other places
 
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):
http://www.recom.org/threadnav.gif
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/

ReCom 11-20-2008 01:19 AM

First post reserved!

My first public mod (although I've created a number of mods used only on my site).

Please be kind to me :)

DarkGizmo 11-20-2008 02:17 AM

Cool mod! installed! :D

ReCom 11-20-2008 05:08 AM

I just realized that in the normal postbit template (non-legacy), both options in the "Gender bit location in postbit" setting give the same result but if the forum uses postbit_legacy, the result will be different. I only tested it on postbit_legacy so I was not aware that that particular setting doesn't do much difference in normal postbit. All is good though.

sensimilla 11-20-2008 05:27 AM

Ive just installed previous version by peterska yesterday, but i might look into your code aswell, thanks.

Ash Ketchum 11-20-2008 12:31 PM

I can't seem to install it....

ReCom 11-20-2008 09:38 PM

Quote:

Originally Posted by Ash Ketchum (Post 1669313)
I can't seem to install it....

Did you import the included product-genderbit.xml file in AdminCP > Plugins & Products > Manage Products ?

Did you create a custom user profile page for members' gender using AdminCP > User Profile Fields > Add New User Profile Field ?

Did you configure Gender Bit to use that custom user profile field in Admin CP > vBulletin Options > vBulletin Options > Gender Bit ?

neoxi 11-20-2008 10:43 PM

thank you.. installed :D

P.Jackson 11-20-2008 11:01 PM

anyone got images for a dark based forum? :(

ReCom 11-21-2008 05:27 AM

Quote:

Originally Posted by P.Jackson (Post 1669678)
anyone got images for a dark based forum? :(

Version 1.0.1 comes with a few image sets to choose from. Re-download the package above and install+upload. "Pixel Precision", "Japanese Kanji", "Bee & Flower" and "Toilet Sign" sets should look okay in dark-styled forum. Test for me please?

PAKIDIL 11-21-2008 11:49 AM

i want to know formats like .swf or flv will work using this hack ?

ReCom 11-21-2008 01:13 PM

Quote:

Originally Posted by PAKIDIL (Post 1669978)
i want to know formats like .swf or flv will work using this hack ?

What are you going to do with the .swf or .flv?

LisaJH 11-22-2008 06:19 AM

I dont understand what i have to write in the Profile Field bit....

ReCom 11-22-2008 07:10 AM

Quote:

Originally Posted by LisaJH (Post 1670489)
I dont understand what i have to write in the Profile Field bit....

Please refer to the second screenshot and see if it helps you, otherwise read on.

First, do you already have a User Profile Field for gender (look in AdminCP > User Profile Fields > User Profile Field Manager).

If you don't, create one by going to AdminCP > User Profile Fields > Add New User Profile Field. Select Profile Field Type = Single-selection Menu and click 'Continue'. On the next page put title, descriptions etc, but for the Options box, enter 'male' and 'female' text in your forum language. Save the new user profile field.

Back in User Profile Field Manager, find the user profile field for gender that you created. Look at its 'Name' column, there should be 'fieldX' written there (where X is a number). In my forum it is 'field5' but it might be different in yours.

Now go to AdminCP > vBulletin Options > vBulletin Options > Gender Bit and enter the 'fieldX' in the "User profile field name". Also configure the 'male' and 'female' values to match the texts you entered in the 'Options' box when creating the user profile field.

That said, this addon will only give useful outputs if your members update the gender profile field.

ReCom 11-22-2008 12:31 PM

Version 1.0.2 is up with many changes (see change logs)

A special note to other coders, version 1.0.2 exposes a globally-scoped function (refer changelogs) that your mod/plugin can call to get the user gender so that it is possible to build upon this mod. One nice idea for mod is the gender-aware phrase system that many have requested in this forum.

Maybe I should stop looking at the code or else I won't stop adding features ... :rolleyes:

shlomot 11-22-2008 03:00 PM

Thank you so much for this long awaited conditional default picture display for male/female and anything in between (on my site we have also bi-directional transgenders).

Works great on vb3.8 beta 3


As they say - appetite comes with eating, and now we ask you to implement the same conditional default for avatars.

I believe that you'd like to mention that the male and female pictures that are provided with the package can be replaced to fit different site themes. These images are unknown_male.gif and unknown_female.gif respectively.

Bless you. INSTALLED, VOTED & NOMINATED.

Hannan 11-22-2008 08:45 PM

Nice Mod, Thanks

ReCom 11-23-2008 06:09 AM

Quote:

Originally Posted by shlomot (Post 1670648)
As they say - appetite comes with eating, and now we ask you to implement the same conditional default for avatars.

Version 1.1.0 is coming soon. The male/female default avatar/profilepic will be a part of main feature together with gender symbols, and there will be separate configuration options for the two features. All this warranted the sudden jump in version number from 1.0.2 to 1.1.0

Quote:

Originally Posted by shlomot (Post 1670648)
Bless you. INSTALLED, VOTED & NOMINATED.

THANKS!

p/s: attached is screenshot of configuration options for symbols and avatars to drool over :p

shlomot 11-23-2008 06:40 AM

Thanks a lot. Drooling has warrented drooling indeed.

Since there's a lot of terminology interchange in these posts, I just hope that the new version takes care of both member picture and member avatar.

Would we be able to show one image for avatar and one for the picture?

Thanks again for a MOD well done.

Quote:

Originally Posted by ReCom (Post 1671065)
Version 1.1.0 is coming soon. The male/female default avatar/profilepic will be a part of main feature together with gender symbols, and there will be separate configuration options for the two features. All this warranted the sudden jump in version number from 1.0.2 to 1.1.0


THANKS!

p/s: attached is screenshot of configuration options for symbols and avatars to drool over :p


ziggylol 11-23-2008 07:53 AM

Thanks, Great Mod :)

FiMeTi 11-23-2008 10:33 AM

Nicely done!
Will install this babe. :=)

Cheers mate!

lostguy 11-24-2008 05:12 AM

Quote:

Originally Posted by ReCom (Post 1669624)
Did you import the included product-genderbit.xml file in AdminCP > Plugins & Products > Manage Products ?

Did you create a custom user profile page for members' gender using AdminCP > User Profile Fields > Add New User Profile Field ?

Did you configure Gender Bit to use that custom user profile field in Admin CP > vBulletin Options > vBulletin Options > Gender Bit ?

This is confusing specially CREATE A CUSTOM USER ? U have to know we not a coder and no idea where to start and WHAT TO ADD and FILL ...U not helping in process Create New Custom user field ?

This Script / addon no Intructions / Read Me txt !

Lg

lostguy 11-24-2008 05:16 AM

All i see under ADD NEW CUSTOM FIELD :

Title

Description


Increase Size Decrease Size

Profile Field Category (Uncategorized)


Default Value
You may specify a default value that is entered into this field at the time of registration.

Max length of allowed user input

Field Length

Display Order

Field Required Yes, at registration and profile updating Yes, Always No No, but display at registration

Field Editable by User Yes No Only at registration

Private Field Yes No

Field Searchable on Members List Yes No

Show on Members List Yes No

Regular Expression
You may require the input field to match a regular expression (PCRE).

Seriouslly i have no idea WHAT TO FILL IN THERE ? U NOT HELPING AT ALL .

lostguy 11-24-2008 06:11 AM

Quote:

Originally Posted by P.Jackson (Post 1669678)
anyone got images for a dark based forum? :(

Im so with u..THE ICONS LOOK SUX WITH BLACK BACKGROUND lol .


Lg

ReCom 11-24-2008 06:57 AM

Quote:

Originally Posted by lostguy (Post 1671794)
All i see under ADD NEW CUSTOM FIELD :


Title

Description


Increase Size Decrease Size

Profile Field Category (Uncategorized)


Default Value
You may specify a default value that is entered into this field at the time of registration.

Max length of allowed user input

Field Length

Display Order

Field Required Yes, at registration and profile updating Yes, Always No No, but display at registration

Field Editable by User Yes No Only at registration

Private Field Yes No

Field Searchable on Members List Yes No

Show on Members List Yes No

Regular Expression
You may require the input field to match a regular expression (PCRE).

Seriouslly i have no idea WHAT TO FILL IN THERE ? U NOT HELPING AT ALL .

Such a hater you are.

Here lemme spoon-feed you, I've added the instruction on how to create the gender field in the mod description above.

The reasons the field is not automatically created by the mod:
  1. Some forum admins may have already created the Gender field themselves so it's better to not create duplicate and make use of the existing one.
  2. Some forums may be in other languages than English so it's better to give the freedom on the label for "Male" and "Female" in whatever languages there are. This freedom can't be achieved if the profile is created by scripting.
  3. Some forums may want more than two labels, say Boy, Gentleman, Girl, Lady etc.
So it all boils down to freedom. Any attempt to automate the creation of the new profile field will be made complicated if the same level of freedom as what manual creation could give is to be provided. Plus, vBulletin has provided the nice interface for manually creating the custom user field.

lostguy 11-24-2008 10:09 AM

Maybe u need add READ ME file into ya next version and more deeper explaination .
Btw only two option for Gender ? LOL can it be more then 2 ?

Lg

Glory to God 11-24-2008 11:22 AM

I am trying to import. I get this error: XML Error: Empty document at Line 1

ReCom 11-24-2008 12:50 PM

Quote:

Originally Posted by Glory to God (Post 1671906)
I am trying to import. I get this error: XML Error: Empty document at Line 1

Try again. Or redownload.
Quote:

Originally Posted by lostguy (Post 1671880)
Maybe u need add READ ME file into ya next version and more deeper explaination .
Btw only two option for Gender ? LOL can it be more then 2 ?

Lg

From now on, I'd follow what other mods enforce:

Mark as Installed if you want support

Thanks and have a good day.

gamerfu 11-24-2008 03:16 PM

VERY COOL! :cool: I wish they would release this for vBulletin as a standard. :cool:

Krazeguy 11-24-2008 07:16 PM

good mod thanks. marked as installed

mgurain 11-26-2008 12:28 AM

good mod

But when the change addres from www.xxxx.com to xxxx.com the pictures do not show

thanks

ReCom 11-26-2008 07:44 AM

Quote:

Originally Posted by mgurain (Post 1673062)
good mod

But when the change addres from www.xxxx.com to xxxx.com the pictures do not show

thanks

Give me the URL so that I can see the problem myself.

Because in my forum both with and without "www" still show the symbols.

http://www.recom.org/forum/showthrea...t=5018&page=38
http://recom.org/forum/showthread.php?t=5018&page=38

Either it's your forum configurations, or your browser.

Greek76 11-26-2008 09:03 AM

Great mod but my images are not showing. I added the field which was field5 chose original gender but no images are showing. I also uploaded the images to my misc folders.

ReCom 11-26-2008 10:29 AM

Quote:

Originally Posted by Greek76 (Post 1673228)
Great mod but my images are not showing. I added the field which was field5 chose original gender but no images are showing. I also uploaded the images to my misc folders.

Did your members set their gender fields?

Do you use other words than "Male" and "Female" for the two genders?

Does your forum style have a different /images/misc folder than the default one because most custom styles especially those that have different button images have different misc folder. Check AdminCP > Style & Templates > Style Manager > (The dropdown for your styles) > StyleVars > Miscellaneous Images Folder. Upload to those folders as well.

Lastly, post a screenshot of your AdminCP > vBulletin Options > Gender Bit

p/s: if nothing works, please wait for version 1.1.0 which shall come in a day or two (all done but I'm doing testing on it).

jerx 11-26-2008 12:11 PM

Is it possible to show gender in who is online (bottom of forum index or online.php)?

ReCom 11-26-2008 02:01 PM

Quote:

Originally Posted by jerx (Post 1673300)
Is it possible to show gender in who is online (bottom of forum index or online.php)?

Will add in upcoming version 1.1.0

jerx 11-26-2008 03:43 PM

That would be great. Thanks!

I am using vbadvanced portal. I have seen that your mod provides a genderbit_getgender function. Would I be able to use that to display genders on the who is online module?

Greek76 11-26-2008 09:45 PM

Quote:

Originally Posted by ReCom (Post 1673258)
Did your members set their gender fields?

Do you use other words than "Male" and "Female" for the two genders?

Does your forum style have a different /images/misc folder than the default one because most custom styles especially those that have different button images have different misc folder. Check AdminCP > Style & Templates > Style Manager > (The dropdown for your styles) > StyleVars > Miscellaneous Images Folder. Upload to those folders as well.

Lastly, post a screenshot of your AdminCP > vBulletin Options > Gender Bit

p/s: if nothing works, please wait for version 1.1.0 which shall come in a day or two (all done but I'm doing testing on it).

I deleted my old and added a gender field the way you posted and it works now. Thanks..

ReCom 11-26-2008 09:53 PM

Quote:

Originally Posted by jerx (Post 1673429)
That would be great. Thanks!

I am using vbadvanced portal. I have seen that your mod provides a genderbit_getgender function. Would I be able to use that to display genders on the who is online module?

Technically yes, if you know where to call the function to get "male" or "female", and how to display the male/female indicators.

However, I do not recommend overdisplaying the gender symbols all over the places wherever usernames are displayed. I think the gender symbols are only suitable to be displayed alongside usernames only if the usernames are displayed in separate rows for each like:
  • user1
  • user2
  • user3
and not suitable if they are displayed like:
user1, user2, user3

ReCom 11-27-2008 06:51 AM

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.


All times are GMT. The time now is 01:05 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.01944 seconds
  • Memory Usage 1,863KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete