Please or Register to create posts and topics.

Integration with the Ultimate Membership Pro

Hello, there I want to integrate it with the Ultimate Membership Pro and I know how the workflow will be used to make ut work.

Like

  1. Use action to add a user to the user group of Asgaros after successful subscription.
  2. User Asgaros filter/action of check that a user is having access to it or not. But it will require me to add Ultimate membership configuration checkboxes to each forum. And setting there to make it work.
  3. Maybe some other way but i don’t know 🙂

I think the first one is simplest of them like checking the level of the membership and adding the user to the corresponding user group after successful subscription

Please help

 

Thanks in Advance

You can find some integration-examples in this forum:

https://asgaros.com/support/?view=forum&id=5

Maybe other users can help you out with the other stuff. I never used Ultimate Membership Pro so I cant give you support for it. 🙂

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Sorry, But there is nothing related to what I need. Can you tell me action/hook which can be used to prevent the each Forum listed to be first checked before getting listed.

 

Thanks

For forums there is no such filter available because all access-settings are defined for categories. You can use the asgarosforum_filter_get_categories-filter to implement your custom filter-rules for your categories.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

I using the User Groups for integration like

 

<?php
/*
Plugin Name: Ultimate Membershipship Pro Integration with Asgaros Forum
Plugin URI: https://www.google.com
Description: Custom Plugin to Add user according to its Level into its corrosponding User Groups of the Asgaros Forum 
Version: 1.0
Author: someauthor
Author URI: https://www.google.com
*/

function return_val($lid){
//declare variable to store conditional groupid
$var_groupid = 1171;

//free
if( $lid == 6 ){
$var_groupid = 1171;
}

//basic
elseif( $lid == 2 ){
$var_groupid = 1172; 
}

//standard
elseif( $lid == 3 ){
$var_groupid = 1174;
}

//premium
elseif( $lid == 4 ){
$var_groupid = 1175;
}

//mastermind
elseif( $lid == 5 ){
$var_groupid = 1176;
}

return $var_groupid;
}


function add_user_to_asgaros_user_group( $user_id , $lid ){
//check eligibility of current user
//set the usergroupid variable
//run the fun 
//set the group id using lid

AsgarosForumUserGroups::insertUserGroupsOfUsers( $user_id , return_val( $lid ) );

}
add_action( "ihc_new_subscription_action" , "add_user_to_asgaros_user_group" );

//ihc_action_after_subscription_activated


function remove_user_from_asgaros_user_group( $user_id , $lid ){

AsgarosForumUserGroups::deleteUserGroupsOfUser( $user_id );

}
add_action( "ihc_action_after_subscription_delete" , "remove_user_from_asgaros_user_group" );
add_action( "ihc_action_after_cancel_subscription" , "remove_user_from_asgaros_user_group");
add_action( "ihc_action_level_has_expired" , "remove_user_from_asgaros_user_group");


function remove_user_from_asgaros_user_group_afterdelete( $user_id ){
AsgarosForumUserGroups::deleteUserGroupsOfUser( $user_id );
}
add_action( "ihc_delete_user_action" , "remove_user_from_asgaros_user_group_afterdelete");


//ump_paypal_user_do_refund this hook is not having too much information so this case has to be dealt manually

I have created this code but its not working, but when i set the groupid manually then it works. But it’s not working with function which is used to set the groupid according the $lid

AsgarosForumUserGroups::insertUserGroupsOfUsers( $user_id , return_val( $lid ) );

This is the action with which I am hooking the code

do_action('ihc_action_after_subscription_activated', $this->user_id, $lid);

 

The second parameter of that function expects an array, because a user can be added to multiple groups. So you can try something like:

AsgarosForumUserGroups::insertUserGroupsOfUsers($user_id , array(13, 37));

 

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Sorry, But its not working. Can you please help me in debugging?

 

I am attaching the plugin for your reference.

https://drive.google.com/open?id=1oibc0XI7u7SIVyXHMPQc7I9Pr_O9NLJl

Thanks