Override

Userpoints & Community Builder

Thomas Engelken

Hello Martin,

first of all, thank you for the work you are putting into UserPoints. I am currently using UserPoints together with Community Builder and I am exploring ways to build a stronger engagement and gamification system for my community.

I would like to ask about the current and future relationship between UserPoints and Community Builder.

At the moment, most point rules seem to focus on Joomla content, logins, competitions and other general activities. However, for many community-driven websites, Community Builder itself is where the most important user engagement happens.

I am curious if there are any plans to expand the native Community Builder integration in the future.

Some examples that could be very useful:

  • Completing profile fields
  • Reaching profile completion milestones
  • Uploading or changing an avatar
  • Uploading or changing a profile cover image
  • Profile visits
  • Receiving profile visits
  • Creating new connections
  • Accepting connection requests
  • Appearing in user searches
  • Updating profile information
  • Completing specific profile sections
  • Daily activity within Community Builder

These are only examples, but in general I am interested in whether Community Builder is considered an important future integration target for UserPoints.

Is there currently any development roadmap or discussion regarding deeper Community Builder support?

I would love to hear your thoughts.

Kind regards
Thomas

0

16 Replies

#1

In principle, I would be glad to achieve integrations with Community Builder. Is there available documentation to describe how to connect to CB?

1
Thanked by: Thomas Engelken
#2

Hello Martin,

Thank you for your reply.

Following your question about Community Builder documentation, I contacted the Community Builder team and received a response from Krileon, one of the lead developers.

He pointed me to the CB trigger documentation and mentioned that most of the functionality I described should be achievable through Community Builder triggers and a dedicated CB plugin listening to those triggers.

CB Trigger Documentation:
https://www.joomlapolis.com/documentation/127-community-builder/279-tutorials/18358-using-cb-triggers

He also recommended the current Community Builder tutorials section, which has recently been reviewed and reduced to only the tutorials that are still relevant:

https://www.joomlapolis.com/documentation/127-community-builder/279-tutorials

According to Krileon, existing CB core plugins can also be used as examples, since they are distributed as normal installable plugins.

One comment from his reply that may be relevant:

A CB plugin that has params to toggle on/off points and just acts on those triggers should be sufficient if a hardcoded solution is needed.

From my perspective as a Community Builder site owner, this sounds very encouraging, as many community engagement actions happen directly inside Community Builder, GroupJive and CB Gallery rather than in Joomla core content.

Thank you again for your willingness to look into Community Builder integration. I thought this information might be useful and wanted to share it with you.

Kind regards,

Thomas

0
#3

Hello Thomas

Thanks for the documentation. Do you have thoughts on a specific trigger that could do something useful for you? There are a great many, and it isn't clear to me how they could be used. If I had a specification for a particular action based on a given trigger, I could implement something.

Best regards, Martin

0
#4

Hello Martin,

Thank you for your reply.

If I had to choose a starting point, I would focus entirely on the core Community Builder user profile first, before looking at the optional CB plugins such as GroupJive or CB Gallery.

I think there is already a lot of value in the profile itself.

Some examples could be:

  • Avatar uploaded or changed

  • Cover/Canvas image uploaded or changed

  • Profile completed (or profile completion reaches a certain percentage)

  • Profile updated

  • Specific profile field completed (for example location, interests or biography)

  • First profile completion milestone

  • Profile visited (or profile visit received)

  • Connection request sent

  • Connection request accepted

  • New connection established

  • Private message sent (if supported through Community Builder)

From a UserPoints perspective I imagine these as normal rules, just like the existing Joomla rules. The administrator could simply enable or disable them and assign the number of points.

For example:

  • Avatar uploaded → +10 points

  • Cover image uploaded → +5 points

  • Profile completed → +25 points

  • New connection accepted → +20 points

  • Profile visit received (once per visitor per day) → +2 points

Personally, I would leave the separate Community Builder plugins such as GroupJive, CB Gallery, etc. for a later stage. I think the core profile functionality would already provide a very solid foundation and would be useful for many Community Builder websites.

Kind regards,

Thomas

0
#5

Thanks for that, Thomas. The documentation is helpful, but appears to have limitations. Let's start with avatar uploaded. There is a trigger for onAfterUserAvatarUpdate which looks to provide the information needed. I could write something based on that. But the same trigger can be called from two different places, with the parameters apparently having different meanings. I'm not clear whether there is a way to know where the call is coming from. Also, the definitions of the parameters for the trigger seem to be truncated in the documentation. I'd be more comfortable if the information was complete! Sorry I am not more familiar with CB.

Best regards, Martin

0
#6

I contacted Krileon again with your questions about the onAfterUserAvatarUpdate trigger and received some clarification.

According to him:

  • The trigger is called from two places: Community Builder's ImageField and CB Gallery's ItemController.

  • Although the variable names differ ($user and $viewer), they both refer to the same UserTable object and are functionally identical.

  • The trigger is fired only after a successful avatar upload, so it should be safe to simply react to the event and award points.

  • For a UserPoints integration, only the user ID should really be needed ($user->id).

So it sounds like the trigger should provide everything necessary for a first native UserPoints rule such as "Avatar uploaded".

Krileon also mentioned that if you have further technical questions about specific Community Builder triggers, he would prefer if you opened a topic in the free Community Builder forums so you can discuss the implementation directly. He said using me as an intermediary is probably not the most efficient way. 😊

Hopefully this helps. It sounds like there are no technical blockers for the avatar trigger anymore.

Kind regards,

Thomas

0
#7

OK, I am hoping that the attached CB plugin will deal with the avatar. You need to install it into CB, run the UserPoints "Auto detect new rules" and configure the rule in UserPoints.

Attachments:
0
#8

Hi,

I have now tested the plugin on my test system.

The plugin installs successfully into Community Builder and I have enabled it. However, Community Builder displays a compatibility warning for the plugin (see attached screenshot).

My Community Builder version is:

2.11.0+build.2026.05.04.17.01.28.8d34d7a6c

I then followed your instructions and ran UserPoints → Auto detect new rules, but unfortunately I received:

"No new rules found in this scan."

So at the moment no new UserPoints rule is being detected.

Out of curiosity I also looked at the contents of the plugin package.

I noticed that the ZIP contains a userpoints_rule.xml file with the rule definition for:

  • CB - Points on avatar upload

  • plugin function: up_cbavatar

The PHP plugin also appears to call the same function:

UserPoints::newpoints('up_cbavatar', $referrerid);

However, in plug_cbuserpoints.xml I only see these files listed for installation:

  • plug_cbuserpoints.php

  • index.html

I don't see userpoints_rule.xml listed there.

I'm not sure if this is related, but I wondered whether that could be the reason why Auto detect new rules does not discover the new rule.

I hope this information helps with troubleshooting. Please let me know if you would like me to test another version.

Best regards,

Thomas

Attachments:
0
#9

Thanks Thomas. You are quite right - the packaging XML was written before the rule XML was added - forgot to change it. The attached should fix that, and also set the method to once only per user. I didn't get a compatibility warning when I installed the plugin. If you continue to get that, please could you send the diagnostic as text - I can't translate text in an image! New version attached.

Attachments:
0
#10

I tested the new version.

Steps performed:

  • Uninstalled the previous CB UserPoints plugin

  • Cleared the Joomla cache

  • Installed the new plugin

  • Enabled the plugin in Community Builder

The installation itself completed without any problems.

However, Community Builder still shows the same compatibility warning for the plugin.

You asked me to provide the diagnostic as text instead of an image. The complete warning is:

This plugin is not compatible with your current CB version. This plugin can still be used, but it may not function correctly.

My Community Builder version is:

2.11.0+build.2026.05.04.17.01.28.8d34d7a6c

When I then run UserPoints → Auto detect new rules, I now receive the following database error:

1136 Column count doesn't match value count at row 1

So it looks like the rule XML is now being detected, but UserPoints fails while importing the rule into the database.

Hopefully this helps narrow down both issues.

Best regards,

Thomas

0
#11

Seems like a general problem with rule importing has crept in. I have released version 5.0.12 of UserPoints to fix it. Attached is a modified CB plugin. It seems that it has to adopt their version numbering. Seems odd to me, but there we are. I've given it a version number that matches the CB version you are running (same as me). I don't know what happens if it is installed in a slightly older CB.

Attachments:
0
#12

Just a quick progress update before I do more thorough testing.

The good news is that everything is looking much better now.

  • The updated CB plugin installs correctly.

  • The Community Builder compatibility warning has disappeared.

  • UserPoints 5.0.12 fixed the rule import problem.

  • "Auto detect new rules" now successfully finds and installs the new rule.

So we have definitely made good progress.

I haven't yet tested the actual avatar upload and points awarding. I'll do a full functional test later today and report back with the results.

Thank you again for the quick fixes and for working through the issues so quickly.

Best regards,

Thomas

0
#13

The avatar rule itself works perfectly and points are awarded correctly. One small observation: in the activity list the entry is displayed as "Cbavatar" instead of using the rule name ("CB - Points on avatar upload"). I wonder if the activity title is currently being generated from the unique rule key rather than the rule name.

Best regards,

Thomas

0
#15

I found the cause of the "Cbavatar" text, and it was entirely on my side.

It wasn't coming from UserPoints at all.

I use a heavily customised frontend points account module with several PHP overrides to present the activity list in a more user-friendly way. Unknown rule keys were being converted automatically into display text, which turned the new rule key up_cbavatar into "Cbavatar".

I have now updated my custom code to use the actual UserPoints rule name instead of trying to generate a title from the rule key, and everything is displayed correctly now.

So this was my mistake, not a problem with UserPoints.

The avatar rule itself is working perfectly:

  • the CB plugin installs correctly,

  • the rule is detected,

  • points are awarded,

  • and the activity is displayed correctly.

Thank you again for all the work you've put into this. I think this is a great first step towards a deeper Community Builder integration.

Best regards,

Thomas

0
#16

You're welcome. As this has got quite long, I suggest you start a new thread with one or two requests for specific integrations that are achievable using the CB plugin triggers - when you're ready.

0