Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount! Get 20% off now with code SPOOKY-2024!

[SOLVED] Profile variables

  • iandjr
  • iandjr
  • OFFLINE
  • Posts: 6
  • Thanks: 0
  • Karma: 0
11 years 9 months ago - 11 years 9 months ago #217969 by iandjr
[SOLVED] Profile variables was created by iandjr
I am trying to list items connected to users on their profile page.
Is there a list of profile variables example $current->id so i can get the id of the profile I'm viewing as opposed to $my->id which gets the current user's id?
Last edit: 11 years 9 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
11 years 9 months ago #217972 by krileon
Replied by krileon on topic Re: Profile variables
Where are you trying to access this information? In a new plugin? In a delimiter field through substitutions? There is API to grab the viewing user, yes, example as follows.
Code:
global $_CB_framework; $user =& CBuser::getUserDataInstance( $_CB_framework->myId() );


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.

  • iandjr
  • iandjr
  • OFFLINE
  • Posts: 6
  • Thanks: 0
  • Karma: 0
11 years 9 months ago #217980 by iandjr
Replied by iandjr on topic Re: Profile variables

krileon wrote: Where are you trying to access this information? In a new plugin? In a delimiter field through substitutions? There is API to grab the viewing user, yes, example as follows.

Code:
global $_CB_framework; $user =& CBuser::getUserDataInstance( $_CB_framework->myId() );


That pulls the current user info, not the profile info.
eg. if john doe is on jim public's profile, i want john to see jim's info, not his own

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
11 years 9 months ago - 11 years 9 months ago #217981 by krileon
Replied by krileon on topic Re: Profile variables
Ah, ok I understand what you're wanting now, sorry. It depends on how you're using the code. For example if you're using tab class then the $user object passed to its functions is always of the displayed user. At any rate the below will always grab displayed user if there is one.
Code:
global $_CB_framework; $user =& CBuser::getUserDataInstance( $_CB_framework->displayedUser() );

Note if you execute your code too early this won't be set yet, but as you didn't provide your usage there's not much more I can suggest.


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: 11 years 9 months ago by krileon.
The following user(s) said Thank You: iandjr

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

  • iandjr
  • iandjr
  • OFFLINE
  • Posts: 6
  • Thanks: 0
  • Karma: 0
11 years 9 months ago #217991 by iandjr
Replied by iandjr on topic Re: Profile variables
Thanks!
That did it

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

Moderators: beatnantkrileon
Powered by Kunena Forum