Created
September 3, 2013 19:12
-
-
Save benoitjpnet/6428258 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Geolocalization part. */ | |
$bannedCountry = array(); | |
$bannedCountry['Love Lab'] = array('FR', 'BE'); // BE pour tester ;) | |
$visitorCountry = geoip_country_code_by_name($_SERVER['REMOTE_ADDR']); | |
$post = get_post(); | |
$postTitle = $post->post_title; | |
foreach($bannedCountry as $animeTitle => $bannedCountryCode) { | |
if($animeTitle == $postTitle) { | |
if (in_array($visitorCountry, $bannedCountryCode) === TRUE) { | |
//header('Location: http://mo-f.fr/contenu-licencie/'); | |
echo '<h1> Pays bloqué ! (test beta ;)) </h1>'; | |
die(1); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment