Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

GeoIP function doesn't detect cities that are list MaxMind DB

GeoIP function doesn't detect cities that are list MaxMind DB

Hi Stephen, it's been a few months since I worked on my banner project modules. I did banners for all major cities I had data on my GA.

It doesn't seem to work, I have asked friends in different city to check it here's the code:

Code:


if ( $template == "electric_standard_jan2011" ) {
  if ( $fromCountryId == "CA" )  {
    if ( $city == "Charlesbourg" ) return "450";
    if ( $city == "Quebec" ) return "458";
    if ( $city == "Beauport" ) return "459";
    if ( $city == "Lévis" ) return "460";
    if ( $city == "Montreal" ) return "461";
    if ( $city == "Neufchatel" ) return "462";
    if ( $city == "Sainte-foy" ) return "463";
    if ( $city == "Sillery" ) return "464";
    if ( $city == "Vanier" ) return "465";

    /* list of teacher search banners conditions */
    if ( $city == "Ancton Vallé" ) return "475";
    if ( $city == "Alma" ) return "477";       
    if ( $city == "Sainte-adèle" ) return "476";
    if ( $city == "Ancienne Lorette" ) return "478";
    if ( $city == "Anjou" ) return "479";
    if ( $city == "Baie-comeau" ) return "480";
    if ( $city == "Baie-saint-paul" ) return "481";
    if ( $city == "Bathurst" ) return "482";
    if ( $city == "Bécancour" ) return "483";
    if ( $city == "Blainville" ) return "484";
    if ( $city == "Boucherville" ) return "485";
    if ( $city == "Brossard" ) return "487";
    if ( $city == "Chambly" ) return "488";
    if ( $city == "Charny" ) return "489";
    if ( $city == "Chicoutimi" ) return "490";
    if ( $city == "Côte-saint-luc" ) return "491";
    if ( $city == "Dollard-des-ormeaux" ) return "492";
    if ( $city == "Dorval" ) return "493";
    if ( $city == "Duvernay" ) return "494";
    if ( $city == "Gaspé" ) return "495";
    if ( $city == "Gatineau" ) return "496";
    if ( $city == "Granby" ) return "497";
    if ( $city == "Greenfield Park" ) return "498";
    if ( $city == "Hull" ) return "499";
    if ( $city == "Joliette" ) return "500";
    if ( $city == "Jonquière" ) return "501";
    if ( $city == "Lac Etchemin" ) return "502";
    if ( $city == "Lasalle" ) return "503";
    if ( $city == "Laval" ) return "504";
    if ( $city == "Longueuil" ) return "505";
    if ( $city == "Matane" ) return "507";
    if ( $city == "Moncton" ) return "508";
    if ( $city == "Mont-laurier" ) return "509";
    if ( $city == "Mont-royal" ) return "510";
    if ( $city == "Montmagny" ) return "511";
    if ( $city == "Outremont" ) return "512";
    if ( $city == "Repentigny" ) return "514";
    if ( $city == "Richelieu" ) return "515";
    if ( $city == "Rimouski" ) return "516";
    if ( $city == "Roberval" ) return "517";
    if ( $city == "Rockcliffe Park" ) return "518";
    if ( $city == "Rosemère" ) return "519";
    if ( $city == "Rouyn" ) return "520";
    if ( $city == "Saint-laurent" ) return "521";
    if ( $city == "Saint-léonard" ) return "522";
    if ( $city == "Sept-Îles" ) return "523";
    if ( $city == "Shawinigan" ) return "524";
    if ( $city == "Saint-eustache" ) return "525";
    if ( $city == "Saint-georges" ) return "526";
    if ( $city == "Saint-hubert" ) return "527";
    if ( $city == "Saint-hyacinthe" ) return "528";
    if ( $city == "Saint-chrysostome" ) return "529";
    if ( $city == "Richelieu" ) return "530";
    if ( $city == "Saint-lambert" ) return "532";
    if ( $city == "Beloeil" ) return "533";
    if ( $city == "Saint-pascal" ) return "534";
    if ( $city == "Sainte-anne-de-bellevue" ) return "536";
    if ( $city == "Sainte-julienne" ) return "537";
    if ( $city == "Sainte-marie" ) return "538";
    if ( $city == "Sainte-thérèse" ) return "539";
    if ( $city == "Terrebonne" ) return "540";
    if ( $city == "Thetford Mines" ) return "541";
    if ( $city == "Trois-rivières" ) return "542";
    if ( $city == "Val-d'or" ) return "543";
    if ( $city == "Vallée-jonction" ) return "544";
    if ( $city == "Verdun" ) return "545";
    if ( $city == "Victoriaville" ) return "546";
    if ( $city == "Westmount" ) return "547";
    if ( $city == "Weston" ) return "549";
    if ( $city == "Yamachiche" ) return "534";
    return 447;
    }

  /*return 447; // backstop for countries other than Canada, in same template */
}

In the same module, here is all the coding, the previous paste was only a section of it from which if there's a syntax problem, could solve everything else I hope:

Code:


$mainframe =& JFactory::getApplication();
$template =& $mainframe->getTemplate();
$city = $geoip->city;

/* Banner correspondance string (check cookie) */
if ( $_COOKIE["adwords"] == "corresp-qc" )
   return;

/* Banner correspondance string (google search referrer) - QUEBEC */
if ( $fromCountryId == "CA" )  {
  if ( $core_genius->check("referrer contains en ligne")) return 707;
  if ( $core_genius->check("referrer contains correspondance")) return 707;
  if ( $core_genius->check("referrer contains internet")) return 707;
}

/* Banner adwords string (set permanent cookie) */
if ( $core_genius->check("uri contains ?landing=99")) {
   setcookie("adwords", "corresp-qc", time()+60*60*24*6004);  /* permanent cookie */
   return 707;
}


if ( $template == "electric_standard_jan2011" ) {
  if ( $fromCountryId == "CA" )  {
    if ( $city == "Charlesbourg" ) return "450";
    if ( $city == "Quebec" ) return "458";
    if ( $city == "Beauport" ) return "459";
    if ( $city == "Lévis" ) return "460";
    if ( $city == "Montreal" ) return "461";
    if ( $city == "Neufchatel" ) return "462";
    if ( $city == "Sainte-foy" ) return "463";
    if ( $city == "Sillery" ) return "464";
    if ( $city == "Vanier" ) return "465";

    /* list of teacher search banners conditions */
    if ( $city == "Ancton Vallé" ) return "475";
    if ( $city == "Alma" ) return "477";       
    if ( $city == "Sainte-adèle" ) return "476";
    if ( $city == "Ancienne Lorette" ) return "478";
    if ( $city == "Anjou" ) return "479";
    if ( $city == "Baie-comeau" ) return "480";
    if ( $city == "Baie-saint-paul" ) return "481";
    if ( $city == "Bathurst" ) return "482";
    if ( $city == "Bécancour" ) return "483";
    if ( $city == "Blainville" ) return "484";
    if ( $city == "Boucherville" ) return "485";
    if ( $city == "Brossard" ) return "487";
    if ( $city == "Chambly" ) return "488";
    if ( $city == "Charny" ) return "489";
    if ( $city == "Chicoutimi" ) return "490";
    if ( $city == "Côte-saint-luc" ) return "491";
    if ( $city == "Dollard-des-ormeaux" ) return "492";
    if ( $city == "Dorval" ) return "493";
    if ( $city == "Duvernay" ) return "494";
    if ( $city == "Gaspé" ) return "495";
    if ( $city == "Gatineau" ) return "496";
    if ( $city == "Granby" ) return "497";
    if ( $city == "Greenfield Park" ) return "498";
    if ( $city == "Hull" ) return "499";
    if ( $city == "Joliette" ) return "500";
    if ( $city == "Jonquière" ) return "501";
    if ( $city == "Lac Etchemin" ) return "502";
    if ( $city == "Lasalle" ) return "503";
    if ( $city == "Laval" ) return "504";
    if ( $city == "Longueuil" ) return "505";
    if ( $city == "Matane" ) return "507";
    if ( $city == "Moncton" ) return "508";
    if ( $city == "Mont-laurier" ) return "509";
    if ( $city == "Mont-royal" ) return "510";
    if ( $city == "Montmagny" ) return "511";
    if ( $city == "Outremont" ) return "512";
    if ( $city == "Repentigny" ) return "514";
    if ( $city == "Richelieu" ) return "515";
    if ( $city == "Rimouski" ) return "516";
    if ( $city == "Roberval" ) return "517";
    if ( $city == "Rockcliffe Park" ) return "518";
    if ( $city == "Rosemère" ) return "519";
    if ( $city == "Rouyn" ) return "520";
    if ( $city == "Saint-laurent" ) return "521";
    if ( $city == "Saint-léonard" ) return "522";
    if ( $city == "Sept-Îles" ) return "523";
    if ( $city == "Shawinigan" ) return "524";
    if ( $city == "Saint-eustache" ) return "525";
    if ( $city == "Saint-georges" ) return "526";
    if ( $city == "Saint-hubert" ) return "527";
    if ( $city == "Saint-hyacinthe" ) return "528";
    if ( $city == "Saint-chrysostome" ) return "529";
    if ( $city == "Richelieu" ) return "530";
    if ( $city == "Saint-lambert" ) return "532";
    if ( $city == "Beloeil" ) return "533";
    if ( $city == "Saint-pascal" ) return "534";
    if ( $city == "Sainte-anne-de-bellevue" ) return "536";
    if ( $city == "Sainte-julienne" ) return "537";
    if ( $city == "Sainte-marie" ) return "538";
    if ( $city == "Sainte-thérèse" ) return "539";
    if ( $city == "Terrebonne" ) return "540";
    if ( $city == "Thetford Mines" ) return "541";
    if ( $city == "Trois-rivières" ) return "542";
    if ( $city == "Val-d'or" ) return "543";
    if ( $city == "Vallée-jonction" ) return "544";
    if ( $city == "Verdun" ) return "545";
    if ( $city == "Victoriaville" ) return "546";
    if ( $city == "Westmount" ) return "547";
    if ( $city == "Weston" ) return "549";
    if ( $city == "Yamachiche" ) return "534";
    return 447;
    }

  /*return 447; // backstop for countries other than Canada, in same template */
}

if ( $template == "femmes_jan2011" ) {
  if ( $fromCountryId == "CA" )  {
    if ( $city == "Charlesbourg" ) return "450";
    if ( $city == "Quebec" ) return "458";
    if ( $city == "Beauport" ) return "459";
    if ( $city == "Lévis" ) return "460";
    if ( $city == "Montreal" ) return "461";
    if ( $city == "Neufchatel" ) return "462";
    if ( $city == "Sainte-foy" ) return "463";
    if ( $city == "Sillery" ) return "464";
    if ( $city == "Vanier" ) return "465";

    /* list of teacher search banners conditions */
    if ( $city == "Ancton Vallé" ) return "475";
    if ( $city == "Alma" ) return "477";       
    if ( $city == "Sainte-adèle" ) return "476";
    if ( $city == "Ancienne Lorette" ) return "478";
    if ( $city == "Anjou" ) return "479";
    if ( $city == "Baie-comeau" ) return "480";
    if ( $city == "Baie-saint-paul" ) return "481";
    if ( $city == "Bathurst" ) return "482";
    if ( $city == "Bécancour" ) return "483";
    if ( $city == "Blainville" ) return "484";
    if ( $city == "Boucherville" ) return "485";
    if ( $city == "Brossard" ) return "487";
    if ( $city == "Chambly" ) return "488";
    if ( $city == "Charny" ) return "489";
    if ( $city == "Chicoutimi" ) return "490";
    if ( $city == "Côte-saint-luc" ) return "491";
    if ( $city == "Dollard-des-ormeaux" ) return "492";
    if ( $city == "Dorval" ) return "493";
    if ( $city == "Duvernay" ) return "494";
    if ( $city == "Gaspé" ) return "495";
    if ( $city == "Gatineau" ) return "496";
    if ( $city == "Granby" ) return "497";
    if ( $city == "Greenfield Park" ) return "498";
    if ( $city == "Hull" ) return "499";
    if ( $city == "Joliette" ) return "500";
    if ( $city == "Jonquière" ) return "501";
    if ( $city == "Lac Etchemin" ) return "502";
    if ( $city == "Lasalle" ) return "503";
    if ( $city == "Laval" ) return "504";
    if ( $city == "Longueuil" ) return "505";
    if ( $city == "Matane" ) return "507";
    if ( $city == "Moncton" ) return "508";
    if ( $city == "Mont-laurier" ) return "509";
    if ( $city == "Mont-royal" ) return "510";
    if ( $city == "Montmagny" ) return "511";
    if ( $city == "Outremont" ) return "512";
    if ( $city == "Repentigny" ) return "514";
    if ( $city == "Richelieu" ) return "515";
    if ( $city == "Rimouski" ) return "516";
    if ( $city == "Roberval" ) return "517";
    if ( $city == "Rockcliffe Park" ) return "518";
    if ( $city == "Rosemère" ) return "519";
    if ( $city == "Rouyn" ) return "520";
    if ( $city == "Saint-laurent" ) return "521";
    if ( $city == "Saint-léonard" ) return "522";
    if ( $city == "Sept-Îles" ) return "523";
    if ( $city == "Shawinigan" ) return "524";
    if ( $city == "Saint-eustache" ) return "525";
    if ( $city == "Saint-georges" ) return "526";
    if ( $city == "Saint-hubert" ) return "527";
    if ( $city == "Saint-hyacinthe" ) return "528";
    if ( $city == "Saint-chrysostome" ) return "529";
    if ( $city == "Richelieu" ) return "530";
    if ( $city == "Saint-lambert" ) return "532";
    if ( $city == "Beloeil" ) return "533";
    if ( $city == "Saint-pascal" ) return "534";
    if ( $city == "Sainte-anne-de-bellevue" ) return "536";
    if ( $city == "Sainte-julienne" ) return "537";
    if ( $city == "Sainte-marie" ) return "538";
    if ( $city == "Sainte-thérèse" ) return "539";
    if ( $city == "Terrebonne" ) return "540";
    if ( $city == "Thetford Mines" ) return "541";
    if ( $city == "Trois-rivières" ) return "542";
    if ( $city == "Val-d'or" ) return "543";
    if ( $city == "Vallée-jonction" ) return "544";
    if ( $city == "Verdun" ) return "545";
    if ( $city == "Victoriaville" ) return "546";
    if ( $city == "Westmount" ) return "547";
    if ( $city == "Weston" ) return "549";
    if ( $city == "Yamachiche" ) return "534";
    return 447;
   
  }

  /*return 447; // backstop for countries other than Canada, in same template */

}


if ( $template == "metal_jan2011" ) {
  if ( $fromCountryId == "CA" )  {
    if ( $city == "Charlesbourg" ) return "450";
    if ( $city == "Quebec" ) return "458";
    if ( $city == "Beauport" ) return "459";
    if ( $city == "Lévis" ) return "460";
    if ( $city == "Montreal" ) return "461";
    if ( $city == "Neufchatel" ) return "462";
    if ( $city == "Sainte-foy" ) return "463";
    if ( $city == "Sillery" ) return "464";
    if ( $city == "Vanier" ) return "465";

    /* list of teacher search banners conditions */
    if ( $city == "Ancton Vallé" ) return "475";
    if ( $city == "Alma" ) return "477";       
    if ( $city == "Sainte-adèle" ) return "476";
    if ( $city == "Ancienne Lorette" ) return "478";
    if ( $city == "Anjou" ) return "479";
    if ( $city == "Baie-comeau" ) return "480";
    if ( $city == "Baie-saint-paul" ) return "481";
    if ( $city == "Bathurst" ) return "482";
    if ( $city == "Bécancour" ) return "483";
    if ( $city == "Blainville" ) return "484";
    if ( $city == "Boucherville" ) return "485";
    if ( $city == "Brossard" ) return "487";
    if ( $city == "Chambly" ) return "488";
    if ( $city == "Charny" ) return "489";
    if ( $city == "Chicoutimi" ) return "490";
    if ( $city == "Côte-saint-luc" ) return "491";
    if ( $city == "Dollard-des-ormeaux" ) return "492";
    if ( $city == "Dorval" ) return "493";
    if ( $city == "Duvernay" ) return "494";
    if ( $city == "Gaspé" ) return "495";
    if ( $city == "Gatineau" ) return "496";
    if ( $city == "Granby" ) return "497";
    if ( $city == "Greenfield Park" ) return "498";
    if ( $city == "Hull" ) return "499";
    if ( $city == "Joliette" ) return "500";
    if ( $city == "Jonquière" ) return "501";
    if ( $city == "Lac Etchemin" ) return "502";
    if ( $city == "Lasalle" ) return "503";
    if ( $city == "Laval" ) return "504";
    if ( $city == "Longueuil" ) return "505";
    if ( $city == "Matane" ) return "507";
    if ( $city == "Moncton" ) return "508";
    if ( $city == "Mont-laurier" ) return "509";
    if ( $city == "Mont-royal" ) return "510";
    if ( $city == "Montmagny" ) return "511";
    if ( $city == "Outremont" ) return "512";
    if ( $city == "Repentigny" ) return "514";
    if ( $city == "Richelieu" ) return "515";
    if ( $city == "Rimouski" ) return "516";
    if ( $city == "Roberval" ) return "517";
    if ( $city == "Rockcliffe Park" ) return "518";
    if ( $city == "Rosemère" ) return "519";
    if ( $city == "Rouyn" ) return "520";
    if ( $city == "Saint-laurent" ) return "521";
    if ( $city == "Saint-léonard" ) return "522";
    if ( $city == "Sept-Îles" ) return "523";
    if ( $city == "Shawinigan" ) return "524";
    if ( $city == "Saint-eustache" ) return "525";
    if ( $city == "Saint-georges" ) return "526";
    if ( $city == "Saint-hubert" ) return "527";
    if ( $city == "Saint-hyacinthe" ) return "528";
    if ( $city == "Saint-chrysostome" ) return "529";
    if ( $city == "Richelieu" ) return "530";
    if ( $city == "Saint-lambert" ) return "532";
    if ( $city == "Beloeil" ) return "533";
    if ( $city == "Saint-pascal" ) return "534";
    if ( $city == "Sainte-anne-de-bellevue" ) return "536";
    if ( $city == "Sainte-julienne" ) return "537";
    if ( $city == "Sainte-marie" ) return "538";
    if ( $city == "Sainte-thérèse" ) return "539";
    if ( $city == "Terrebonne" ) return "540";
    if ( $city == "Thetford Mines" ) return "541";
    if ( $city == "Trois-rivières" ) return "542";
    if ( $city == "Val-d'or" ) return "543";
    if ( $city == "Vallée-jonction" ) return "544";
    if ( $city == "Verdun" ) return "545";
    if ( $city == "Victoriaville" ) return "546";
    if ( $city == "Westmount" ) return "547";
    if ( $city == "Weston" ) return "549";
    if ( $city == "Yamachiche" ) return "534";
    return 447;
  }

  /*return 447; // backstop for countries other than Canada, in same template */

}


atherrien
Modder Extraordinaire
ranks
useravatar
Offline
140 Posts
Administrator has disabled public posting

Re: GeoIP function doesn't detect cities that are list MaxMind DB

Hi Alex,

The syntax looks fine. I can think of 2 reasons why it might not work:

1 - his IP address is not being properly converted to an address with GeoLiteCity. If it's possible for him to send you his IP address, then you can manually look that up on maxmind.com and see what information it holds. You may find that it incorrectly resolves the city, or misses it completely.

2 - you have several conditions at the top of the rule, checking for a cookie, referrers and landing page. If any of these are triggered, then because you use "return", PHP will never get to the part where you check for cities. Is there any chance that this happened for your friend?

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: GeoIP function doesn't detect cities that are list MaxMind DB

Hi Stephen,

1. I made test with a friend in Quebec and he won't see the banner from Quebec as he should. His ip is dynamic and I made test with 2 that were assigned to him over time and Maxmind identify correctly as being from Quebec.

2. I don't think there is a return made. If any, it would be for the coding i've used for adwords cookies on top of the coding.

Here's my metamod for all banners in Quebec, France and Belgium if you want to check them out or test something through backend:

1         MetaMod - Villes - 3 Quebec Template         ID 466
2         MetaMod - Villes - Correspondance - Cookied Module     ID 708
3         MetaMod - Villes - Belgique     ID 579
4         MetaMod - Villes - France ID 635

Note: I made a test by removing the last return of every sequence, meaning IF there was no city detected in the list but only the country, and the result was no banner appeared.

Note2: Those banners have high and low caps in the name file, would that be a problem?

http://www.quebecguitare.com/images/sto … Quebec.png

atherrien
Modder Extraordinaire
ranks
useravatar
Offline
140 Posts
Administrator has disabled public posting

Re: GeoIP function doesn't detect cities that are list MaxMind DB

Can you send me the IP addresses so I can test them with the GeoLiteCity database? It's possible that the online demo only worked because it uses the commercial database. I'll look at the other issue after I have sorted that one.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: GeoIP function doesn't detect cities that are list MaxMind DB

Thanks Stephen, here's the info.:

184.145.213.84
184.145.217.235

I hope I don't need to get the paid license from MaxMind because they are quite expensive.

Cheers

atherrien
Modder Extraordinaire
ranks
useravatar
Offline
140 Posts
Administrator has disabled public posting

Re: GeoIP function doesn't detect cities that are list MaxMind DB

With the most up to date version of the GeoLiteCIty database, both of these addresses give:

Country: CA
Country Name: Canada
Country Code 2: CAN
Region: QC
City: Quebec
Postal Code:
Latitude: 46.8
Longitude: -71.25
DMA Code:
Area Code:

So, as long as you have the most up to date version [use MetaTemplate's download function to get it] and you're checking the city and/or region and/or country code, then this should work as expected.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: GeoIP function doesn't detect cities that are list MaxMind DB

Sure, but unfortunately it doesn't, that's why I thought it might have been my coding above. I had the confirmation from another party in Quebec; it's the default module ID 447 that shows up, not ID 458 as it should.

Is there any way I can substitute the coding above? it might work...

Maybe I could test the MaxMind paid license too on a site you manage? testing:
     if ( $city == "Quebec" ) return "XXX";

Cheers.

atherrien
Modder Extraordinaire
ranks
useravatar
Offline
140 Posts
Administrator has disabled public posting

Re: GeoIP function doesn't detect cities that are list MaxMind DB

I took a snap of my MetaTemplate config for you info, but I doubt it's relevant to this issue...

Here it is:
<oups cannot upload an offline picture on your forum>


I will just paste the info manually:
MetaTemplate
"Configuration générale"
Debugging :    Desactived
Fuseau horaire :    Montreal
Suffix for duplicated templates : _new   
Front page POST fix :     Activated

atherrien
Modder Extraordinaire
ranks
useravatar
Offline
140 Posts
Administrator has disabled public posting

Re: GeoIP function doesn't detect cities that are list MaxMind DB

H Stephen, I thought of something: could it be a cache problem related to my CDN. I a using the no!number plugin with MaxCDN. Should I exclude certain files that are cookied or else?

You can see the plugins on my backend, I have already excluded files that were causing certain components to glitch.

Cheers,
Alex

atherrien
Modder Extraordinaire
ranks
useravatar
Offline
140 Posts
Administrator has disabled public posting

Re: GeoIP function doesn't detect cities that are list MaxMind DB

Hi Alex,

I've just looked into this carefully, and as things are set up on your site I can't see any way that Chameleon would detect the IP address of a CDN server rather than the actual client. The reason for that is that only files like JS, CSS and image files are served from the CDN. All the actual pages (which Joomla generates) are served directly from your server. Therefore Chameleon would get the IP address of the client, not of the CDN.

The latest version of Chameleon has some changes in it with respect to GeoCity handling. It fixes the problem that was also in MetaMod. That might not be the issue here, but it would pay to upgrade that too.

I just had a thought - since there's now an override function to allow you to set the IP address that will be used for GeoIP, this should be easier to test...

Ok, so on your site I used one of the Quebec IP addresses as an override on the "MetaMod - Villes - 3 Quebec Template" module. At first it didn't work but then I looked more closely and saw some problems with the PHP code.

Here was the problem:

You can commented-out some blocks of code with /*   and   */
The problem was, that inside those blocks of code there were already some /* and */ characters. This confuses PHP, as these don't "nest". Therefore I changed that comments inside the code blocks to start the line with // instead of using /* */. Now the PHP works correctly and detects Quebec!
- the Belgium PHP code looks ok
- the France PHP code looks ok
- I didn't check any of the others.

Hope that helps!

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10796
Newest User:
mokao3
Members Online:
0
Guests Online:
67

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked