Automatic Gender specific Avatar - CB 1.4

13 years 1 month ago - 13 years 1 month ago #157087 by nicophp
The purpose is:
  1. to have the Default Female or Male Avatar displayed in profile, instead of the impersonal Neutral avatar (this before the user upload his/her own avatar)
  2. to have that working in a multi-languages website
So, How to create a Gender field - with auto gender specific Avatar, language and search compliant in CB 1.4.0 ?

chrissy6930 posted on 2010/03/27 an interesting post for a gender field adjusting the gender image displayed. Since I have already posted for CB 1.2.3 and CB 1.3.1. Here is the tip and file for CB 1.4.0


Update for CB 1.4.0

I want a gender support, that display the gender image and integrates in a multilanguages website. Therefore:

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 2694 to 2744 in CB 1.4.0)
File is located in root\components\com_comprofiler\plugin\user\plug_cbcore\
Note : don't forget, in case of problem, 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 1126 to 1172 in CB 1.4.0)
File is located in root\administrator\components\com_comprofiler\
Note : don't forget, in case of problem, to keep a copy of the original file (Eg. by renamig it "plugin.foundation_ORIG.php")

Now once a user has selected his/her gender profile, the standard nophoto image will be replaced with the gender specific nophoto_f or nophoto_m image and also in member lists and in plugins


gender_support_int_cb140.zip


OK, tried to upload the file but receive an error message

Copy failed
Failed to upload file 'gender_support_int_cb140.zip': Could not move file into /home/joomlapolis824/public_html/media/kunena/attachments/167550/gender_support_int_cb140.zip


So if interested, PM me your email to send you the file
The following user(s) said Thank You: wmbell

Please Log in to join the conversation.

13 years 1 month ago #157391 by spock9458
Replied by spock9458 on topic Re: Automatic Gender specific Avatar - CB 1.4
This solution works perfectly in 1.4 - Thanks very much!

Rob

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

Please Log in to join the conversation.

13 years 3 weeks ago #159654 by PCAnalyzer
Replied by PCAnalyzer on topic Re: Automatic Gender specific Avatar - CB 1.4
Thank you.
It would be good to have this integrated directly in CB. :)

Please Log in to join the conversation.

13 years 3 weeks ago #159668 by p0gz
I'm almost done with this, All I need to know is where to change the "nophoto" Image. Where is is located? Thanks in advanced.

Please Log in to join the conversation.

13 years 2 weeks ago #159768 by nicophp
Replied by nicophp on topic Re: Automatic Gender specific Avatar - CB 1.4
All the avatar images are located in the template you have choosen in CB.
Example: if you have selected the default template, the images are in

yoursite/components/com_comprofiler/plugin/templates/default/images/avatar


Good luck

Please Log in to join the conversation.

12 years 10 months ago #167468 by wmbell
Worked perfectly!
Thanks!

:)

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.220 seconds

Facebook Twitter LinkedIn