Skip to Content Skip to Menu

[SOLVED] male/female blank avatar

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago #240811 by krileon
Replied by krileon on topic male/female field
You need to add an "and" between the fields. The below should work.

[cb:if cb_gender="_UE_MALE" and avatar=""]
I'm male and I did not upload an avatar.
[/cb:if]

If not it's possible avatar is returning the default avatar image instead of null. Try substituting [avatar] in to see what value it is outputting.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

10 years 8 months ago #240813 by thewebsurfer
Replied by thewebsurfer on topic male/female field
i need to add AND? last time you said there is no need an AND in conditions!

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

10 years 8 months ago - 10 years 8 months ago #240816 by thewebsurfer
Replied by thewebsurfer on topic male/female field
i tried substitution a blank avatar field has value

"..components/com_comprofiler/plugin/templates/default/images/avatar/nophoto_n.png"

so i can't use avatar=""

EDIT: how can i set an ELSE condition?
Last edit: 10 years 8 months ago by thewebsurfer.

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

10 years 8 months ago - 10 years 8 months ago #240817 by thewebsurfer
Replied by thewebsurfer on topic male/female field
this is the code,pls i need help
Code:
<p>[cb:if avatar="http://www.SITE.com/components/com_comprofiler/plugin/templates/default/images/avatar/nophoto_n.png"] [cb:if cb_gender="_UE_MALE" ]<img src="/components/com_comprofiler/plugin/templates/default/images/avatar/tnnophoto_m.png" alt="" />[/cb:if] [cb:if cb_gender="_UE_FEMALE"]<img src="http://www.SITE.com/components/com_comprofiler/plugin/templates/default/images/avatar/tnnophoto_f.png" alt="" />[/cb:if] [/cb:if] [cb:if avatar!="http://www.SITE.com/components/com_comprofiler/plugin/templates/default/images/avatar/nophoto_n.png"] <img src="http://www.SITE.com/images/comprofiler/[avatar]" alt="" /> [/cb:if]</p>
Last edit: 10 years 8 months ago by thewebsurfer.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago #240843 by krileon
Replied by krileon on topic male/female field

i need to add AND? last time you said there is no need an AND in conditions!

I said there was no "and" in field substitutions, which there isn't. There is "and" in IF statements.

so i can't use avatar=""

Correct, you can use something like the below to REGEX match for blank avatar.

[cb:if cb_gender="_UE_MALE" and avatar=~"nophoto_n.png|tnnophoto_n.png"]MALE[/cb:if]
[cb:if cb_gender="_UE_FEMALE" and avatar=~"nophoto_n.png|tnnophoto_n.png"]FEMALE[/cb:if]
[cb:if avatar!~"nophoto_n.png|tnnophoto_n.png"]NORMAL[/cb:if]

EDIT: how can i set an ELSE condition?

You can't, there is no "else" usage.

Folks, please be sure you're searching before posting. I can't stress this enough. It's exhausting to keep answering the same topics over and over. Please use some forum etiquette and search before making a new topic. Topics like this have already been answered and multiple keywords like "gender avatar" will find all of them. We are propagated by Google quite well so even using Google should turn up good results (append site:joomlapolis.com).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

10 years 8 months ago - 10 years 8 months ago #240885 by thewebsurfer
Replied by thewebsurfer on topic male/female field
you're totally right, but you should understand my reasons too: usually building a community is a HUGE work, i have daily hundreds of big problems, those kind of little problems shouldn't be in a competitive paid component.
anyway i don't know why your code prints me always "normal"
i solved with an hack
www.joomlapolis.com/forum/153-professional-member-support/209937-automatic-gender-avatar-cb-181

(i guess is the only way to subtitute the CB login module blank avatar too)
Last edit: 10 years 8 months ago by thewebsurfer.

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

Moderators: beatnantkrileon
Powered by Kunena Forum