Skip to Content Skip to Menu

Make connections with every user upon first login.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
3 years 9 months ago #322814 by timstohr
Hi Kyle,
Some functionalities of CB are only accessible if you have the connections switched on (which I understand). As the sites I will have will never have more than say 500 users, I would like to add the connection system BUT so that EVERYONE makes connections with everyone else upon First Login. Is that possible?

Thanks,

Tim

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 9 months ago #322826 by krileon
Yes, that's possible. Safest bet is probably to use a database query in a Query action otherwise looping through the connections API 500 times during every registration would be a bit heavy. The database table for connections is _comprofiler_members. The below is an example of creating a two way connection between a user and all other users.

Code:
INSERT INTO `#__comprofiler_members` ( `referenceid`, `memberid`, `accepted`, `pending`, `membersince` ) SELECT '[user_id]', `id`, 1, 0, NOW() FROM `#__comprofiler` WHERE `id` != '[user_id]'; INSERT INTO `#__comprofiler_members` ( `referenceid`, `memberid`, `accepted`, `pending`, `membersince` ) SELECT `id`, '[user_id]', 1, 0, NOW() FROM `#__comprofiler` WHERE `id` != '[user_id]';


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.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
3 years 5 months ago #325126 by timstohr
The connections to everybody works perfectly.
But...
I do not want new users to make a connection with Super users...

In another site, I want to ONLY make connections with everybody belonging to a certain usergroup but not another one... How do I do that?

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 5 months ago #325143 by krileon

I do not want new users to make a connection with Super users...

The example I provided is 2 way. Remove the second query.

In another site, I want to ONLY make connections with everybody belonging to a certain usergroup but not another one... How do I do that?

Adjust the query and add additional WHERE conditions to it. For usergroups you'll have to join the _user_usergroup_map table.


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