Skip to Content Skip to Menu

🐰 Happy Easter! Great Savings on Professional and Developer Memberships! Get 20% off now with code EASTER-2026!

Search Results (Searched for: Triggers:)

  • krileon
24 Jun 2025 14:38
Ok, the solution is a bit silly, but gets the job done. There's no trigger for directly handling the array of tabs. Instead we need to remove the tabs HTML from the return response which would be the display of the group. The below will do this. It will remove every tab except the About tab if the viewing user is not a member of the group and is not a CB Moderator.

Global
Triggers: gj_onAfterDisplayGroup
Type: Code
User: Self
Access: All Non-Moderators
Action
Method: PHP
Code:
Code:
if ( ! in_array( $variables['var2']->getInt( 'type', 0 ), [ 2, 5 ], true ) ) { // the group isn't an invite or approval group so skip removing tabs return; } if ( $user->getInt( 'id', 0 ) === $variables['var2']->getInt( 'user_id', 0 ) ) { // viewing user is the owner of the group so skip removing tabs return; } if ( \CB\Plugin\GroupJive\CBGroupJive::getGroupStatus( $user, $variables['var2'] ) >= 1 ) { // viewing user is an active member of the group so skip removing tabs return; } // run some regexp to remove the tabs original html before it has been processed by javascript from the output buffer $variables['var1'] = preg_replace( '%<div class="cbTabPane tab-pane cbTabPaneMenu" id="cbtabpanegrouptab(?:activity|wall|photo|video|file|events|users)"><h2 class="cbTabNav cbNavBarItem nav-item" id="cbtabnavgrouptab(?:activity|wall|photo|video|file|events|users)"><a href="#cbtabpanegrouptab(?:activity|wall|photo|video|file|events|users)" class="cbTabNavLink cbNavBarLink nav-link">.+</a></h2><div class="cb_tab_content cb_tab_menu" id="cb_tabid_grouptab(?:activity|wall|photo|video|file|events|users)">.+</div></div>%is', '', $variables['var1'] );
Parameters
Reference Variables: Variable 1

I've tested the above and confirmed it works. This will also only apply to Approval and Invite group types. All other types are left alone. I've added comments for reach step so its a little understood what's going on in the code. Note this can result in groups basically having an empty tab bar if the group didn't supply any About content.
  • krileon
16 May 2025 15:01
Replied by krileon on topic Display of moderation rights
The below should work for filtering that list to specific users.

Global
Triggers: onBeforePendingApprovalUsersFormDisplay
Type: Code
User: Self
Access: Everybody
Action
Method: PHP
Code:
Code:
foreach ( $variables['var1] as $i => $pendingUser ) { $denied = cbCheckIfUserCanPerformUserTask( $pendingUser->getInt( 'id', 0 ), 'allowModeratorsUserEdit' ); if ( $denied === null ) { $denied = checkCBpermissions( [ $pendingUser->getInt( 'id', 0 ) ] ), 'edit', true ); } if ( $denied ) { unset( $variables['var1][$i] ); } }
Parameters
Reference Variables: Variable 1

It should apply the same permissions checking as profile edit to handle who to filter out. Note the above was not tested and is just an example, but should work.
  • krileon
14 Apr 2025 16:14
So you need to send that file as an attachment to the email? Believe that should be doable. Below should send an email after a user registers.

Global
Triggers: onAfterUserRegistration
Type: Email
Conditions
Field: SELECT_FILE_FIELD_HERE
Operator: Not Empty
Action
To: YOUR_EMAIL_ADDRESS_HERE
Subject: Registration Verification
Body: [username] is attempting to register and requires verification.
Attachment: images/comprofiler/plug_cbfilefield/[user_id]/[var1_FILE_FIELD_NAME_HERE]

Replace FILE_FIELD_NAME_HERE with the name of your field. Once you've this confirmed working for you we can move on to trying to delete it after the email is sent.
Displaying 31 - 33 out of 33 results.
Powered by Kunena Forum