Skip to Content Skip to Menu

Gravatar Setup

9 years 6 months ago #263057 by shibumidesign
Replied by shibumidesign on topic Gravatar Setup
Thanks Kyle... BUT, here's the thing... since we have the auto actions pushing the registered users email address to the cb_gravatar plugin, I need the option for the users to be able to select whether or not they want to use a Gravatar, hence the radio button to select yes or no for the Gravatar.

Will your code logic take that into consideration?

Jeff

ShibumiDesignStudios.com - Ottawa.ScionOwners.ca
Joomla v3.4.1 - Kunena v3.0.8 - K2 v2.6.9 - CB v2.0.8

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
9 years 6 months ago #263063 by krileon
Replied by krileon on topic Gravatar Setup
No, it doesn't take that into consideration. You'd need to extend the if substitution or change it to just check for your radio. When checking your radio field values you need to do an exact match (e.g. if the value is Yes you must match Yes exactly). If it's a checkmark field then yes/no is 1/0. See the bottom of the substitutions tutorial for substitution if usage examples or just modify the example provided in my previous reply.


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.

9 years 6 months ago #263067 by shibumidesign
Replied by shibumidesign on topic Gravatar Setup
Okay, so I'm using a select dropdown with values set to 0/1 (no/yes) for cb_use_gravatar...

stupid question... is [value] to be replaced with the field I want to show? like [avatar]?

Can you, or how do you do, nested if statements? For example:

first check to see if cb_use_gravatar is set to off (0/no), if it is, then allow/use the upload profile image field and hide the cb_gravatar field,

if it's set to on (1/yes) then hide the upload profile image field, (but still show avatar image) and show the cb_gravatar field with the pre-populated email address from the auto actions.

Sorry, not too familiar with the input substitution logic yet...

Jeff

ShibumiDesignStudios.com - Ottawa.ScionOwners.ca
Joomla v3.4.1 - Kunena v3.0.8 - K2 v2.6.9 - CB v2.0.8

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

9 years 6 months ago #263070 by shibumidesign
Replied by shibumidesign on topic Gravatar Setup
Alright, so here's what I'm using that seems to be working:
For Profile Value Layout, Profile Edit Value Layout, and Registration Value Layout
Code:
[cb:if cb_use_gravatar="0"][value][/cb:if] [cb:if cb_use_gravatar="1"][cb:userfield field="cb_gravatar" /][/cb:if]
and for Userlist Value Layout:
Code:
[cb:if cb_use_gravatar="0"][value][/cb:if] [cb:if cb_use_gravatar="1"][cb:userfield field="cb_gravatar" reason="list" /][/cb:if]

Now, just need to find a way to push the users email to the cb_gravatar field when changing the cb_use_gravatar select dropdown from No to Yes... I love a good challenge B)

Jeff

ShibumiDesignStudios.com - Ottawa.ScionOwners.ca
Joomla v3.4.1 - Kunena v3.0.8 - K2 v2.6.9 - CB v2.0.8

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
9 years 6 months ago - 9 years 6 months ago #263073 by krileon
Replied by krileon on topic Gravatar Setup

is [value] to be replaced with the field I want to show? like [avatar]?

[value] is a special substitution for the layouts that'll replace with the value the field normally would've output without layout. It's a good way to ensure the layout can output the original value it was supposed to.

Can you, or how do you do, nested if statements?

Nested substitution if statements won't work as the first if statement will pick up the closing tag of the second if statement.

first check to see if cb_use_gravatar is set to off (0/no), if it is, then allow/use the upload profile image field and hide the cb_gravatar field,

if it's set to on (1/yes) then hide the upload profile image field, (but still show avatar image) and show the cb_gravatar field with the pre-populated email address from the auto actions.

The layout usage is basically just for display. It's not really conditioning it like that, but you could have that conditioning using CB Conditional in if you wanted.

Now, just need to find a way to push the users email to the cb_gravatar field when changing the cb_use_gravatar select dropdown from No to Yes... I love a good challenge

CB Auto Actions and its Field action acting on the after frontend registration and after frontend profile update triggers (should be in the dropdown, begin typing to filter it) then under Conditions just condition your field (e.g. [cb_use_gravatar] Equal To 1) and set your gravatar field with the email field substitution.


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.
Last edit: 9 years 6 months ago by krileon.

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

9 years 6 months ago #263085 by shibumidesign
Replied by shibumidesign on topic Gravatar Setup
I seem to still be having issues with this. If I want to use a gravatar, my gravatar will show only on the profile page, it wont show in the CB Login Module, or in Kunena. If I turn select a gallery image or upload an image, and no gravatar, the image will show in all 3 places: CB Login Module, Profile page, and Kunena. It seems that I cant have both options working here... Looking like I might have to trash Gravatar and just use uploaded or gallery avatars, which I think might be the best solution until you guys come up with a gravatar plugin similar to how kunena's works.

Jeff

ShibumiDesignStudios.com - Ottawa.ScionOwners.ca
Joomla v3.4.1 - Kunena v3.0.8 - K2 v2.6.9 - CB v2.0.8

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

Moderators: beatnantkrileon
Powered by Kunena Forum