SmartCJ Incoming Traffic GEO Block

zweiporn
Posts: 11
Joined: Tue Oct 25, 2016 12:15 am

Re: SmartCJ Incoming Traffic GEO Block

Post by zweiporn »

i think i have do something wrong in it. sry im not a php pro.

here is the file how it looks now:


<?php
if (!defined('BASE_DIR')) define('BASE_DIR', '/home/ftplogin/hornybitches.org/smartcj/');
if ($_SERVER['GEOIP_COUNTRY_CODE'] == 'IN');
if ($_SERVER['GEOIP_COUNTRY_CODE'] == 'ID');
if ($_SERVER['GEOIP_COUNTRY_CODE'] == 'PK');
if ($_SERVER['GEOIP_COUNTRY_CODE'] == 'CN');
if ($_SERVER['GEOIP_COUNTRY_CODE'] == 'RU'); {
$_GET['dont_count'] = true;
}
?>
admin
Site Admin
Posts: 37197
Joined: Wed Sep 10, 2008 11:43 am

Re: SmartCJ Incoming Traffic GEO Block

Post by admin »

no...

if ($_SERVER['GEOIP_COUNTRY_CODE'] == 'CN' or $_SERVER['GEOIP_COUNTRY_CODE'] == 'CN' or $_SERVER['GEOIP_COUNTRY_CODE'] == 'CN' and so on) {
$_GET['dont_count_in_trade'] = true;
}
Don't forget to run script update
zweiporn
Posts: 11
Joined: Tue Oct 25, 2016 12:15 am

Re: SmartCJ Incoming Traffic GEO Block

Post by zweiporn »

i'm not a super php pro like you. i dont know where to put this code or what to do. you put here a 5 seconds answer inside and i try now 5 hours to solve a problem.
i have no backup from the original one from the start and now i can wait for a 5 seconds answer or can delete the script because i loose money when my site is offline or only the header will showed because of errors.
pisses me inside real off because it makes me angry when i can't solve a problem myself and need informations. but this is no help.
sorry.
admin
Site Admin
Posts: 37197
Joined: Wed Sep 10, 2008 11:43 am

Re: SmartCJ Incoming Traffic GEO Block

Post by admin »

You dont have to be a pro


if ($_SERVER['GEOIP_COUNTRY_CODE'] == 'CN') {
$_GET['dont_count_in_trade'] = true;
}

in common.php
that's it

and there's an easy way to find an error.
You take take my code, see that it works, then start to modify it in the way you need it. If it doesn't work at some stage - you just roll back your changes.
Don't forget to run script update
zweiporn
Posts: 11
Joined: Tue Oct 25, 2016 12:15 am

Re: SmartCJ Incoming Traffic GEO Block

Post by zweiporn »

Ok but this is only for 1 Country.
It is working real nice! thanks...
But can you Post the Code how i have put it in when i want to block 5,10 or 20 countries.
Because this is what i need.
I have test the code above and it was not working with the ,,or'' between it.

thanks
zweiporn
Posts: 11
Joined: Tue Oct 25, 2016 12:15 am

Re: SmartCJ Incoming Traffic GEO Block

Post by zweiporn »

This is how the code looks now:
http://justpic.info/images4/6397/Screen ... 185518.png

but i need it for more then 1 country.
admin
Site Admin
Posts: 37197
Joined: Wed Sep 10, 2008 11:43 am

Re: SmartCJ Incoming Traffic GEO Block

Post by admin »

the easiest way for you would be just copy and paste the same code as many times as you need it

or you can try

if ($_SERVER['GEOIP_COUNTRY_CODE'] == 'CN' or $_SERVER['GEOIP_COUNTRY_CODE'] == '...') {
Don't forget to run script update
zweiporn
Posts: 11
Joined: Tue Oct 25, 2016 12:15 am

Re: SmartCJ Incoming Traffic GEO Block

Post by zweiporn »

ok... same thing still incoming hits from the selected countries.
to erease errors in our conversation i hope we can make it shorter.
i will put now all informations that can be wrong.
Please tell me complete code or better write it down.

see screenshots:
http://justpic.info/images4/6fa5/1.png
http://justpic.info/images4/6ac3/2.png

the common.php file is in folder: /scj/cgi
admin
Site Admin
Posts: 37197
Joined: Wed Sep 10, 2008 11:43 am

Re: SmartCJ Incoming Traffic GEO Block

Post by admin »

I think you also have common.php at the root of your domain and you didn't change it
Don't forget to run script update
zweiporn
Posts: 11
Joined: Tue Oct 25, 2016 12:15 am

Re: SmartCJ Incoming Traffic GEO Block

Post by zweiporn »

Its working now! Yes the File was in the root...
that was the error! Thanks so much!!!!
i was searching for this option for so long time! THANKS!!!
Post Reply