Could something not fairly easily be done using the following bit of code, obviously a change would need to be made to the “get user id” part so that it cycles through every user in the user database and then setup the if, else part at the start to do certain actions…
Surely it could then be added as a cron job?
// Array of paying levels.
$paid_levels= array(1323183238,1323183239,1323183240);
// Main call..
if (is_paid_member($paid_levels)){
// user is paid continue running your php script
}else{
// User is not paid, redirect to not paid URL
}
// Main function
function is_paid_member($paid_levels){
if(function_exists(‘WishListMemberAPIRequest’)){
// Get user ID
global $current_user;
get_currentuserinfo();
$rm_curr_usr = $current_user->ID;
// Set default
$is_paid_member=FALSE;
// Setup api request to retreive user’s levels
$request=’/members/’.$rm_curr_usr;
$method=’GET’;
$data=””;
$rm_mem_details = WishListMemberAPIRequest( $request, $method , $data );
//$rm_mem_details = unserialize($rm_mem_details);
$WLM_levels = $rm_mem_details[‘member’][0][‘Levels’];
// Compare users levels to the array of paying levels.
foreach($WLM_levels AS $i => $rm_array_obj) {
$rm_level_array = (array)$rm_array_obj;
if(in_array($rm_level_array[‘Level_ID’],$paid_levels) ) {
$is_paid_member = TRUE;
break;
}
}
return $is_paid_member;
}else{
// WLM is not active
return FALSE;
}
}