Override

CB Core-Canvas & Connection

Thomas Engelken

Hello Martin,

After thinking about it a bit more, I believe it would be best to continue focusing on Community Builder core functionality that is useful for all CB users.

The avatar upload rule is already working very well. The next core actions I would find most useful are:

  1. Profile cover (canvas/background) uploaded

    • Triggered when a user uploads or changes their profile cover image.

  2. Connection request sent

    • Triggered when a user sends a new connection request.

  3. Connection request accepted

    • Triggered when a connection request is accepted and the connection becomes active.

I see these as three independent rules. UserPoints already provides all the flexibility needed for administrators to decide who should receive points, how many points should be awarded, and whether the rule should only run once or every time.

I think these are generic Community Builder core actions that would be useful for many different types of communities, not just dating websites.

Once the core functionality is well covered, it would always be possible to look at integrations with optional CB add-ons in the future.

Best regards,

Thomas

0

4 Replies

#1

Hi Thomas

I'm working on item 2.

Item 3 seems to relate to the "onBeforeAcceptConnectionRequest" which passes a user ID. I'd assume the user ID refers to the user who has accepted the connection. Do you think that is correct? I imagine you want to award points to the person accepting the connection, not the person who requested it?

For item 1, I don't see a relevant trigger. Can you find one?

Best regards, Martin

0
#2

Hello 

I did some more testing regarding both topics.

1. Profile cover (canvas/background) uploaded

I don't think there is a dedicated "canvas uploaded" trigger in Community Builder. However, I have a working CB Auto Action that handles this use case. It is based on the general onAfterUserProfileSaved event.

The available user object (var1) contains the canvas property, which can be accessed like this:

$variables['var1']->canvas

If the user has uploaded a profile cover/background image, this property contains the corresponding value. This allows me to detect whether a canvas exists after the profile has been saved.

So perhaps the best approach would be to use the general profile save event and check whether the canvas property has been added or changed, rather than relying on a dedicated canvas upload trigger.

2. Connection request sent / Connection accepted

I also looked into the available Community Builder Auto Action triggers.

Community Builder already provides two separate triggers:

  • onAfterAddConnection
  • onAfterAcceptConnection

These seem to map perfectly to two independent UserPoints rules:

  1. Connection request sent (onAfterAddConnection)
  2. Connection request accepted (onAfterAcceptConnection)

I believe both actions deserve their own UserPoints rules.

Connections are one of the core features of Community Builder. They are much more than simply adding someone as a contact. Many communities use connection types and connection-based privacy to control which content, profiles, groups, or other information members can access.

Because of this, creating and accepting connections represent meaningful user engagement. This is true not only for dating communities, but also for professional networks, clubs, hobby communities, educational platforms, and many other types of Community Builder websites.

Having two separate UserPoints rules would give administrators the flexibility to reward either action independently, depending on how they want to encourage member interaction.

Thank you again for taking the time to work on these Community Builder integrations. I believe these core actions would be valuable additions for many CB users.

0
#3

Thanks for the information.

  1. When onAfterUserProfileSaved is triggered, the parameters are $userComplete and either 1 or 2. What do 1 or 2 signify? I assume $userComplete is a user object. Where does $variables come from? It is easy to trigger award of points the first time a canvas exists. To know if it has changed is a lot harder - it requires storing the value somewhere so that a comparison can be made.
  2. Is onAfterAddConnection equivalent to a connection request? I had assumed that the onBeforeAddConnectionRequest would have to be used.
  3. If this is based on onAfterAcceptConnection the first parameter appears to be a user object. Is it correct to award points to that user?

Best regards, Martin

0
#4

Hi,

thanks for checking this.

Regarding onAfterUserProfileSaved:
Yes, my understanding is that $userComplete is the CB user object. The second parameter seems to indicate the save mode/status, but I am not fully sure whether 1 and 2 mean "new user / existing user" or something else. I mentioned it because this trigger worked in my CB Auto Actions tests.

You are right regarding the canvas/background image:
Awarding points the first time a canvas exists would already solve the most important use case for me. Detecting later changes is not essential. I agree that checking whether the image has changed would require storing the previous value somewhere and comparing it later.

So for the canvas use case, "award points once when a canvas exists for the first time" would be enough.

Regarding connections:
I checked the available CB Auto Actions triggers again. For my use case I would like to reward two different actions:

1. A user sends a connection request.
2. A connection request is accepted / a real connection is created.

You are probably right that onBeforeAddConnectionRequest is the better trigger for rewarding the user who sends a request.

For accepting a connection:
My intention is to reward the user who accepts the connection request. If onAfterAcceptConnection passes the accepting user as the first parameter, then yes, points should be awarded to that user.

The reason why I consider connections important is that they are not just a small social feature. In Community Builder, connections can also act as a visibility/filter mechanism, because users can show certain profile content depending on connection types. That makes connections valuable for community interaction in general, not only for my own website.

Best regards

Thomas

0