Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Intro Black Friday Offer for a lifetime*

CB Connections - Cross Connection (Friend) / Non Cross Connection (Favourite)

5 years 3 weeks ago #315156 by mikegrimwade
Hi

I have CB Connections configured for cross connections so members must approve connections which works great for my first connection type (Friends).

However I would like members to also be able to add connections to other members without approval for a second connection type (Favourite).

Is this achievable? I see some potential in the CB Auto Action "Connection" Type but I don't know how I would apply the type within the action and I don't see how I could trigger the action. If I handle the onBeforeConnectionRequest trigger it would surely run the action for friend requests also.

Kind Regards

Mike Grimwade

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48551
  • Thanks: 8291
  • Karma: 1445
5 years 3 weeks ago #315161 by krileon
There's no connection type approval. It's something that's planned for when CB Connections plugin and connections behavior in general has been rewritten. Connections approval is for the connection it self and not the type. Doubt you'd be able to implement something like this using CB Auto Actions without a lot of work and likely a database table to keep track of type approval.


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: mikegrimwade

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

5 years 1 week ago #315358 by mikegrimwade
I found a workaround for this with a couple of hints from krileon on another topic thread. Thought I would share it for anyone else who was looking to do something similar.

Basically I ditched the idea of using CB connections for users to flag other profiles as favourites. Instead I created a profile field where favourite profile ID's are being stored as a comma delimited list.

To add to the list I have a Add_to_Favourites field which displays as a link to a autoaction on profiles by setting the "Profile Value Layout" parameter like below...

<a href=" mycbsite.com/dev/index.php?option=com_comprofiler&view=pluginclass&plugin=cbautoactions&action=action&actions=97&Itemid=181&fav= [username]"><img src="images/site/icons/fav-plus.png" alt="Add to Favourites" title="Add to Favourites" height="32" width="32" /></a>

Display of the field is controlled by CBConditional which checks [cb:userdata field="cb_profile_favourites" user="#me" /] to see if it contains [username]

Notice I added the fav=[username] query string to the url calling the action which sends the target profile (to be favourited) id to the action.

The action is a Field type action with no other triggers. I set the conditions to check that the target profile id passed in the query string [get_fav] is not already contained in my cb_profile_favourite_members. Assuming it's not then the action suffixes the id to the end of the comma delimited list.

To remove favourites I follow the same method in reverse.

Chuck in a list filtered to only show users in the comma delimited list and I have my favourite profiles feature.
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum