Skip to Content Skip to Menu

how can get userid of this user?

  • saman2
  • saman2
  • ONLINE
  • Posts: 404
  • Thanks: 7
  • Karma: -1
5 years 8 months ago #310153 by saman2
how can get userid of this user? was created by saman2
hi.
I want to get the profile of the user that is currently being viewed. for example i am user A and want to see user B profile. how i can get the userid of user B?
i use some extension (Fabrik) that need user id currently viewed then do some process. is there any way to get userid in code? i can't use CB substitution like [userid] because i use php eval code . i must get userid from somthing such as query string or Request header. what is your suggest?

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

  • saman2
  • saman2
  • ONLINE
  • Posts: 404
  • Thanks: 7
  • Karma: -1
5 years 8 months ago - 5 years 8 months ago #310161 by saman2
Replied by saman2 on topic how can get userid of this user?
i find that... for future users:
global $_CB_framework;
$userid=$_CB_framework->displayedUser();
return $userid;
please say me is it heavy for proccess in joomla or is it non-standard to use global $_CB_framework?
Last edit: 5 years 8 months ago by saman2.

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

  • saman2
  • saman2
  • ONLINE
  • Posts: 404
  • Thanks: 7
  • Karma: -1
5 years 8 months ago #310162 by saman2
Replied by saman2 on topic how can get userid of this user?
i have other problem. when i use CB user list, this method not work, what can i do if i want show user id in list column with the php code

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48442
  • Thanks: 8276
  • Karma: 1443
5 years 8 months ago #310187 by krileon
Replied by krileon on topic how can get userid of this user?
displayedUser is only set when viewing a profile. It is not set when viewing a userlist because it makes no sense to set it there since it's a list of users. Yes, it's fine to use the $_CB_framework global.


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.

  • saman2
  • saman2
  • ONLINE
  • Posts: 404
  • Thanks: 7
  • Karma: -1
5 years 8 months ago #310196 by saman2
Replied by saman2 on topic how can get userid of this user?
what can i do if i want show user id in list column with the php code?
is there any php function?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48442
  • Thanks: 8276
  • Karma: 1443
5 years 8 months ago #310210 by krileon
Replied by krileon on topic how can get userid of this user?
Create a Custom HTML field with [user_id] set as the HTML. You can then display it in a column of your userlist.


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.

Moderators: beatnantkrileon
Powered by Kunena Forum