×

Error

Please login first

I need to access to the "viewed" Profile User Info data

7 years 8 months ago #285807 by octaviobh
Hi!. I am using the Breezing Forms Component and I need to access to the "viewed" Profile User Info data in order to populate the form fields.

I can do something like that using the Joomla user data as:

<?php $user = JFactory::getUser(); return "$user->name"; ?>

If the "user" is not logged then it is blank.

But I do not need the "user logged data" !.

What I need is the "viewed" Profile user data, even if no user is logged.

Can you help me to do that?

What PHP piece of code I need?

Thanks in advance,

Octavio.

Please Log in to join the conversation.

7 years 8 months ago #285808 by krileon
If it supports Joomla content prepare plugins simply use CB Content Bot and substitutions. Otherwise you need to load CB API, load a CB user object, then call getFields API if you want processed field values. See the below regarding this.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18361-obtaining-field-values-through-getfields-api


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 to join the conversation.

7 years 8 months ago #285906 by octaviobh
Could you write here some examples of what you said "CB Content Bot and substitutions" ?.
Help with that?

Please Log in to join the conversation.

7 years 7 months ago #285941 by krileon
If Breezing Forms processes Joomla content plugins then you can install CB Content Bot and use substitutions as documented below to output CB fields.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb


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 to join the conversation.

7 years 7 months ago #286092 by octaviobh
Finally I manage to set a Breezing Forms field with:

<?php Global $_CB_framework; $myId = $_CB_framework->myId(); $cbUser =& CBuser::getInstance( $myId ); if ( ! $cbUser ) { $cbUser =& CBuser::getInstance( null ); } $user =& $cbUser->getUserData(); return "$user->cb_dealername"; ?>

But as you can see in the attached images, the CB logged user appears in field ( OctavioDealer ) but the dealername I want to appear is the "viewed" ( Acura North Scottsdale ). Note the "d" in "viewed".

How could I do that?

Thanks for your support.

Octavio.
Attachments:

Please Log in to join the conversation.

7 years 7 months ago #286112 by krileon
You're using myId so you're grabbing the viewing users user object and not the displayed users user object. For the displayed user id you need to use the below (note this only works on profile view and may not work in your custom usage).

$displayedUserId = $_CB_framework->displayedUser();

You'd basically just replace your myId usage with displayedUser.

Are you sure this is even necessary? Surely Breezing Forms supports Joomla content plugins. If it does you'd just supply the below after installing and publishing CB Content Bot.

[cb:userdata field="cb_dealername" user="#displayed" /]


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.188 seconds

Facebook Twitter LinkedIn