Friend request procedure

10 years 4 months ago #238699 by krileon
Replied by krileon on topic Friend request procedure

Do you know an estimated date or month that a stable version of CB 2.0 will be published for live site usage?

No, we'll be doing as many Beta and RC releases as needed. We're going for 3 Betas and 1 RC, but this is subject to change. All the incubator projects also need to be upgraded to work properly with CB 2.0 as well, which am currently doing now.

Till then, isn't there a way to know if a connection is pending (control the connection between the add connection and acceptance/decline connection)?

API wise, yes absolutely as we've API to manage connections. As for a field, no, you need to use CB Query Field and query for the connection. You can adjust the above query to check pending status as needed.


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.

10 years 4 months ago #238703 by Ntelos
Replied by Ntelos on topic Friend request procedure
Ok thank you for your quick answer. One last question to know if i god it write.

You wrote above that if the query value is greater that 0 there there is a kind of connection. In order not to have a connection, this value must be 0 or negative?

Also, you told me that i need to adjust the query code in order to know if a connection is pending. Is there another table row that this information is stored?Or is it the same row and for example if the query returns 1 then the connection is pending and if i have 2 as a result the connection is established?

Please Log in to join the conversation.

10 years 4 months ago #238706 by krileon
Replied by krileon on topic Friend request procedure

You wrote above that if the query value is greater that 0 there there is a kind of connection. In order not to have a connection, this value must be 0 or negative?

If the value is equal to 0 then there is no connection established.

Also, you told me that i need to adjust the query code in order to know if a connection is pending. Is there another table row that this information is stored?Or is it the same row and for example if the query returns 1 then the connection is pending and if i have 2 as a result the connection is established?

All the information is stored in _comprofiler_members. Review that database table for all the columns available so you can adjust the query as needed. Yes you can return 0, 1, or 2, but you'll need to add an IF statement to the query to output a value based off the state.


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.
The following user(s) said Thank You: Ntelos

Please Log in to join the conversation.

10 years 4 months ago #238720 by Ntelos
Replied by Ntelos on topic Friend request procedure
Ok, i found it thank you very much.

I will use this:
SELECT COUNT(*) FROM `#jos_comprofiler_members` WHERE `referenceid` = '[cb:userdata field="user_id" user="#displayed" /]' AND `memberid` = '[cb:userdata field="user_id" user="#me" /]'

to select the connection row between me and the user profile i am viewing (except mine of course) and then i will use 3 if conditions like this:

//I am not friend with the user neither i have sent friend request
IF accepted=0 & pending=0
THEN
SHOW FRIEND REQUEST FIELD

//I have sent friend request to the user and he hasn't accepted yet
IF accepted=1 & pending =1
THEN
SHOW PENDING REQUEST FIELD

//Me and the user are friends and i need to see a remove friend field
IF accepted=1 & pending=0
THEN
SHOW REMOVE FRIEND FIELD

Correct? (I know the if syntax is incorrect i am just presenting the logic)

Please Log in to join the conversation.

10 years 4 months ago #238723 by krileon
Replied by krileon on topic Friend request procedure
It depends. Connections go both ways. So there should be a row from the viewing user to the displayed user and from the displayed user to the viewing user. The viewing user to the displayed user should be accepted = 1 and pending = 1 and from the displayed to the viewing should be accepted = 0 and pending = 0.

With the above usage it's querying for from displayed to viewing. There's multiple stages of the acceptance and multiple states. For example of the request is set to me and it's pending my acceptance then I need an accept connection request button and not a request connection button.


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

Facebook Twitter LinkedIn