7
$member_handler =& xoops_gethandler('member');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('level', 1, '>='));
$total_users = $member_handler->getUserCount($criteria);
echo "Total registered users: $total_users";
echo '
';
$criteria->add(new Criteria('user_from', 'RI', '='));
$ri_users = $member_handler->getUserCount($criteria);
echo "Users whose location == 'RI': $ri_users";
echo '
';
$outofstate_users = $total_users - $ri_users;
echo "Out of state users: $outofstate_users";
The user_from condition above does an exact check for "RI". If you want to make it looser, you could use:
$criteria->add(new Criteria('user_from', '%RI%', 'LIKE'));