Save the following code to /modifications/registration-begin.php (if you don't have a /modifications/ subdirectory, create it first):
<?php
if ($thismember->isguest())
{
$whitelistcountries = "United States,Canada,United Kingdom";
$ourcountry = $thismember->ipcountry();
if (strstr(",$whitelistcountries,", ",$ourcountry,")) $settings->registration = 'direct';
}
?>
if ($thismember->isguest())
{
$whitelistcountries = "United States,Canada,United Kingdom";
$ourcountry = $thismember->ipcountry();
if (strstr(",$whitelistcountries,", ",$ourcountry,")) $settings->registration = 'direct';
}
?>
Make sure you don't leave any spaces or newlines before <?php or after ?>.
The example above allows direct registration (no email verification) for anyone from the United States, Canada or United Kingdom. The rest of the world follows the registration setting you've selected at Admin Panel -> Members -> Member Settings. Possible values are:
direct - fully trusted
email - must click link in email to verify
validate - must be manually reviewed by admins
emailandmanual - must click link in email to verify, and then wait for admin to approve
invite - registration is by invitation-only
adminonly - only an admin can manually register people
disable - nobody can register
If you want to use a blacklist instead of a whitelist, just list bad countries and change 'direct' to the desired higher level of verification.