PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

GEO filtering

s2Member Plugin. A Membership plugin for WordPress®.

GEO filtering

Postby jb1360 » March 23rd, 2011, 12:43 pm

I'd like to TURN OFF S2Member (making the site completely free) in certain zip codes. Getting the GEO info is being handled by maxmind.com.

Whats the best way to effectively turn off S2member dynamically?
User avatar
jb1360
Registered User
Registered User
 
Posts: 1
Joined: March 23, 2011

Re: GEO filtering

Postby Cristián Lávaque » March 23rd, 2011, 8:26 pm

Well, s2Member doesn't do that off the box, but you could create something to make it work the way you need it.

What comes to mind is to use conditions where you'd protect content, instead of protecting the whole page. If you have a function that checks the user's location, you can then determine if s2Member should have anything to do with him or not.

Code: Select all
<?php
if 
(dont_use_s2member_with_this_user() || current_user_is('s2member_level1')) {
    echo 'The content goes here.';
}
 else {
    echo 'A message asking him to purchase access.';
}
?>


You could probably also have anything that s2Member would moderate access to, go through the function automatically using a hook, and decide there if s2Member has to mess with that person or not.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 1 guest

cron