[SOLVED] Member List - Connected

5 years 7 months ago - 5 years 7 months ago #307207 by bins
[SOLVED] Member List - Connected was created 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.

Please Log in to join the conversation.

5 years 7 months ago #307211 by krileon
Replied by krileon on topic Member List - Connected

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 - 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.

5 years 7 months ago #307222 by bins
Replied by bins on topic Member List - Connected
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!

Please Log in to join the conversation.

5 years 7 months ago #307226 by krileon
Replied by krileon on topic Member List - Connected
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 - 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.

5 years 7 months ago #307228 by bins
Replied by bins on topic Member List - Connected
I bet people like me get right up your nose sometimes!!!!

It works!

Thanks.
The following user(s) said Thank You: nant, krileon

Please Log in to join the conversation.

5 years 7 months ago #307230 by nant
Replied by nant on topic Member List - Connected

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

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.184 seconds

Facebook Twitter LinkedIn