pH7Software / pH7-Social-Dating-CMS

😻 pH7Builder (formerly pH7CMS) is a Professional & Open Source Social Dating CMS written in PHP 8 🚀 This Social Dating Script aims to be low resource-intensive, powerful and secure. pH7Builder includes over 40 modules. It is the first Professional, Free & Open Source Social Dating Site Builder Software and the first choice for enterprise level Da
https://pH7Builder.com
MIT License
965 stars 579 forks source link

MAXMIND #786

Closed DBLBASE closed 4 years ago

DBLBASE commented 4 years ago

Hello,

Your link to MAXMIND: http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz

does not work anymore: Message:

"Free GeoLite2 Database Users: Due to upcoming data privacy regulations, we are making significant changes to how you access free GeoLite2 databases starting December 30, 2019"

Currently on another Website I use the following library:

https://ip-api.com

You can see from this link, there is no database to load free for 45 requests / minute or € 13.3/month

Of course, I cannot integrate this script into your pH7CMS

Basic example:

function get_ip() {
    // IP if shared internet
    if (isset($_SERVER['HTTP_CLIENT_IP'])) {
        return $_SERVER['HTTP_CLIENT_IP'];
    }
    // IP behind a proxy
    elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        return $_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    // Otherwise: normal IP
    else {
        return (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '');
    }
}

$real = get_ip();

$query = @unserialize(file_get_contents('http://ip-api.com/php/'.$real)); if($query && $query['status'] == 'success') { //result: echo $real; // or $query; echo "
"; echo $query['country']; echo "
"; echo $query['regionName']; echo "
"; echo $query['city']; echo "
"; echo $query['zip'];
}

polynamaude commented 4 years ago

@DBLBASE Why can't you integrate ?

polynamaude commented 4 years ago

@DBLBASE What prevent you from doing a integration and making a PR ?

DBLBASE commented 4 years ago

I can't get my script to work in the Geo.class.php file

polynamaude commented 4 years ago

@DBLBASE That's really precise as a way we can know what doesn't work. As good as my computer don't work.

pH-7 commented 4 years ago

Hey @DBLBASE

Why don't you stick with the current Lite GeoIP database provided by default with the software?

It is true that MaxMind doesn't distribute their Geo DB freely anymore, since Dec 30th 2019

However, fortunately for pH7Builder, it got the last freely version released by MaxMind in early December 2019. That version works very well, and is still very recent for a geo database (geo database doesn't have to be updated every month. Geo lat/lng don't change very often).