[SOLVED] Member List - Connected

2 months 1 week ago - 2 months 1 week ago #307207 by bins
How can I show whether a logged in member is connected to someone in a member list?

I can see how to add the number of connections they have, but an indicator like 'online/offline' would be good.
2 months 1 week ago #307211 by krileon

How can I show whether a logged in member is connected to someone in a member list?

There's no specific field for that so you'd need to use CB Code Field and the necessary PHP to check if the displayed users is connected to the viewing users or use CB Query Field and query for that information. For CB Code Field the below should work (did not test).

$cbConnection	=	new cbConnection( '[user_id]' );

return ( $cbConnection->isConnected( '[cb:userdata field="user_id" user="#me" /]' ) ? 'CONNECTED' : 'NOT CONNECTED'  );

but an indicator like 'online/offline' would be good.

You should already be able to see if someone is online/offline using the "Online Status" (onlinestatus) field.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
2 months 1 week ago #307222 by bins
Hi Kyle,

thanks for the pointer.

I have created a field and added the code under the Parameters/Code tab, but I get the message:
CB Code Field is not published.

Not sure what to do next!
2 months 1 week ago #307226 by krileon
Publish CB Code Field plugin within CB > Plugin Management.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
2 months 1 week ago #307228 by bins
I bet people like me get right up your nose sometimes!!!!

It works!

Thanks.
The following user(s) said Thank You: nant, krileon
2 months 1 week ago #307230 by nant

bins wrote: I bet people like me get right up your nose sometimes!!!!

It works!

Thanks.


LOL

THANK YOU for supporting us as a Developer subscriber
Moderators: beatnantkrileon
Time to create page: 0.387 seconds
Facebook Twitter Google LinkedIn