MarlonFungai wrote: So far its working but the client wants it to apply only to groups in a specific category how do I add this condition to the auto action?
You would need to change in your CB Auto-action the "$query = ..."
part in the "user" tab to something like (where you change 1234567 with the groupjive category id:
Code:
$category = 1234567;
$query = 'SELECT ' . $_CB_database->NameQuote( 'user_id' )
. "\n FROM " . $_CB_database->NameQuote( '#__groupjive_users' ) . ' AS u'
. "\n INNER JOIN " . $_CB_database->NameQuote( '#__groupjive_groups' ) . ' AS g'
. " ON g." . $_CB_database->NameQuote( 'id' ) . ' = u.' . $_CB_database->NameQuote( 'group' )
. " AND g." . $_CB_database->NameQuote( 'category' ) . ' = ' . (int) $category
. "\n WHERE u." . $_CB_database->NameQuote( 'group' ) . " = " . (int) $matches[1]
. "\n AND u." . $_CB_database->NameQuote( 'status' ) . " >= 1"
. "\n AND u." . $_CB_database->NameQuote( 'user_id' ) . " != " . (int) \CBLib\Application\Application::MyUser()->getUserId();
Please note that as providing code is quite outside the scope of our forum support, I didn't have time to setup and test this query, so please try it on a site clone first.