Allow only certain countries to post

ClassiBase classifieds script Forums General help Allow only certain countries to post

Tagged: , ,

This topic contains 0 replies, has 1 voice, and was last updated by  infoactivo 1 year, 4 months ago.

Viewing 1 post (of 1 total)
  • Author
  • #2421 Reply


    You cant disallow certain IP from your site, via the admin area.
    But maybe you want only certain countries to post.
    I think you can get this with a little change to your theme/layouts/frontend.php file
    Find in your theme/layouts/frontend.php file
    <div class="content<?php
    and change it to

    $geotarget = '';
      $geoPlugin_array = unserialize( file_get_contents('' . $_SERVER['REMOTE_ADDR']) );
    	$country = strtolower($geoPlugin_array['geoplugin_countryCode']);
    	switch ($country) {
    		// NOTE: Lower cases ISO 3166 Country Codes from here
        case 'gb': // United Kingdom
    		case 'us': // United States
    			// Allow visitors from above countries to post ads
    			$geotarget = '';
    			// The rest of the world CAN'T post ads
    			$geotarget = 'style="visibility: hidden;"'; 
    			<div <?php echo $geotarget ?> class="content<?php

    Upload file.
    I wish this can help.
    This uses geoPlugin from

Viewing 1 post (of 1 total)
Reply To: Allow only certain countries to post
Your information: