Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

In this Discussion

Vanilla 2.6.1 is here with critical security patches. One of them has been publicly disclosed.

Geo Cities - how to

This discussion is related to the GeoIPFlags addon.
edited May 2012 in Localization

1 . download two files:

php classes:

and cities database (17 Mb unpacked):

2 . Put to the the /forum/plugins/geoipusers/extras/

  • GeoLiteCity.dat
  • geoipregionvars.php

(and you may remove GeoIP.dat and geoip.php ).

3 . replace UserController_UserCell_Handler($Sender) function in \forum\plugins\ geoipusers \default.php

` public function UserController_UserCell_Handler($Sender)

    if (empty($Sender->EventArgs['User']->LastIPAddress))
        echo '<th>GeoIP Country</th>';


          $gi = geoip_open($plpath."GeoLiteCity.dat",GEOIP_STANDARD);
          $record = geoip_record_by_addr($gi,$ip);

          $countrycode = $record->country_code;
          $Title  = $record->country_name . ", ";
          $Title .= $record->city;

        echo '<td><img title="'.$Title.'" src="/forum/plugins/geoipusers/flags/' .  
        strtolower($countrycode) . '.png" alt="' . $countrycode . '" /></td>';


In result You can see the city name and name of country by mouse over the flag



Sign In or Register to comment.