Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

Gender field + auto gender specific Avatar

  • nicophp
  • nicophp
  • OFFLINE
  • Posts: 68
  • Thanks: 8
  • Karma: 7
13 years 9 months ago #153023 by nicophp
How to create a Gender field - with auto gender specific Avatar, language and search compliant in CB 1.3.1

chrissy6930 posted on 2010/03/27 an interesting post for a gender field adjusting the gender image displayed
In my topic #137953 (+/- 7months ago), I had adapted chrissy6930 codes and proposed it for CB 1.2.3

Here is the update for CB 1.3.1

As I'm using gender support, that display the default gender image and integrates in a multilanguages website.

1 - Create new field:
type Dropdown(single select) or Radio Buttons
Name: cb_gender
Title: _UE_GENDER
with 2 values : _UE_MALE and _UE_FEMALE
Searchable in users-lists: Yes (works fine)

2 - As _UE_MALE and _UE_FEMALE already exist in all CB language files, just add a line for _UE_GENDER translation. Example for english: DEFINE ('_UE_GENDER','Gender');
Language files are located in root\components\com_comprofiler\plugin\language\language name\language name.php

3 - Make the gender specific nophoto images display on component stuff by replacing "cb.core.php" with attached "cb.core.php".
Adaptations have been made in "function _avatarLivePath" (new code from 2597 to 2646 in CB 1.3.1)
File is located in root\components\com_comprofiler\plugin\user\plug_cbcore\
Note : don't forget to keep a copy of the original file (Eg. by renamig it "cb.core_ORIG.php").

4 - Make the gender specific nophoto images display in plugins by replacing "plugin.foundation.php" with attached "plugin.foundation.php".
Adaptations have been made in "function avatarFilePath" (new code from 1054 to 1099 in CB 1.3.1)
File is located in root\administrator\components\com_comprofiler\
Note : don't forget to keep a copy of the original file (Eg. by renamig it "plugin.foundation_ORIG.php")

Now once a user has update is gender profile, the standard nophoto image will be replaced with the gender specific nophoto image and also in member lists and in plugins

Hope will help up to next release of CB, that will probably integrate such field.

File Attachment:

File Name: gender_sup...b131.zip
File Size:55 KB
Attachments:
The following user(s) said Thank You: bergmannn, heyai

Please Log in or Create an account to join the conversation.

  • spock9458
  • spock9458
  • OFFLINE
  • Posts: 24
  • Thanks: 1
  • Karma: 3
13 years 9 months ago #154616 by spock9458
Replied by spock9458 on topic Re: Gender field + auto gender specific Avatar
This does not appear to have been adopted in CB 1.4. I created the new field as described in your post, and nothing happens to change the image to either the male or female version. Would it be as simple as copying the proper code lines from your 1.3.1 version to the new?

Maybe someone could advise...

Thanks,
Rob

Rob Grinage
Smart Websites & Networking, LLC
Webmaster at www.nmlta.org

Please Log in or Create an account to join the conversation.

  • nicophp
  • nicophp
  • OFFLINE
  • Posts: 68
  • Thanks: 8
  • Karma: 7
13 years 8 months ago #157088 by nicophp

Please Log in or Create an account to join the conversation.

  • spock9458
  • spock9458
  • OFFLINE
  • Posts: 24
  • Thanks: 1
  • Karma: 3
13 years 8 months ago #157390 by spock9458
Replied by spock9458 on topic Re: Gender field + auto gender specific Avatar
The solution you provided works flawlessly - THANK YOU!

Rob

Rob Grinage
Smart Websites & Networking, LLC
Webmaster at www.nmlta.org

Please Log in or Create an account to join the conversation.

  • webqc
  • webqc
  • OFFLINE
  • Posts: 19
  • Thanks: 0
  • Karma: 0
12 years 2 months ago #209864 by webqc
Did it work for new CB version

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum