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.

 

Metamod Pro Geo Location - 2 cities + else

Metamod Pro Geo Location - 2 cities + else

Hi Stephen, I saw your biking performances on facebook. I am glad that you are getting in shape. I hope I could do the same.

Here is a migration of my old site: http://www.quebecguitare.ca/

I will use metamodpro only to return the frontpage header using the geo location function..

I got a first problem. Here is the code, used the strings you gave me for 1.5, not sure if the structure is still the same though:

Code:


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

if ( $fromCountryId == "CA" )  {

    // Villes PQ
    if ( $city == "Montréal" ) return "698";
    if ( $city == "Québec" ) return "811";

    return 813;
}

Advanced debug returns this:

Code:


if (
$option == 'com_content'
and $view == 'featured'
and $Itemid == '640'
) return XXX; /* remplacer XXX par l'ID du module ou par sa position pour le faire apparaître */
MetaMod debug info:
Module ID: 814
$option: com_content
$view: featured
$id:
$Itemid: 640
$timezone: UTC
$language: en-us
$language_code: en
$language_region: us
Pays: ID
Nom du pays: Indonesia
Country Code 3: IDN
Region:
City:
Postal Code:
Latitude: -6.175
Longitude: 106.8286
Area Code:
Metro Code:
Continent Code: AS
Modules inclus: Aucun

I've uploaded both Geo files from maxmind to the root/geoip folder. GeoIP tabs says OK it sees it.
Module 698, 811, 813 were unpublished during the test. Metamod Pro was set in the right position, published

The content of these custom HTML module is pretty complex and they are responsive:

Code:


<h1 class="gkAnimate">Apprenez <br />La <em class="gk-icon-heart"></em><br /> Guitare</h1>
<p class="gkAnimate">Nous offrons des <strong>cours de guitare privés avec suivi en ligne</strong>. Visitez notre site pour

plus d'informations. Vous pouvez aussi nous contacter soit via le <strong>formulaire d'admission</strong> au bas de cette page

ou par <strong>téléphone</strong> à Montréal et Québec.</p>
<a href="#mes-profs" class="gkScrollDown gkAnimate reverse">Nos professeurs</a>
<img src="images/demo/header/header1.jpg" alt="Cours de Guitare Montréal." class="gkHeaderBg" />

I will give you backend access if that's alright.

Thank you Stephen,
Best Regards!

Alexandre

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

Re: Metamod Pro Geo Location - 2 cities + else

The metamod on the backen is named Metamod - Header I

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

Re: Metamod Pro Geo Location - 2 cities + else

Hi - just looking at this  - it's detecting my IP address and location perfectly. How up to date is your GeoIP database? Perhaps you migrated an old one from your old site? What's your reported IP address at present?

I also modified the PHP slightly to be this, which may reduce PHP warnings:

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

if ( $fromCountryId == "CA" )  {

    // Villes PQ
    if ( $city == "Montréal" ) return "698";
    if ( $city == "Québec" ) return "811";

    return 813;
}

I've disabled the module again but it's all looking ok when enabled as far as I can see.

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: Metamod Pro Geo Location - 2 cities + else

Whoa! I never saw your reply I was about to write to you... I think your forum doesn't have the default subscribe ticked on. Yikes! smile

I confirm that the GeoIP database is updated to the latest.

I confirm the cities are detected and works well for the detection using override.
The main problem is that the metamod seems to alter the CSS formatting of my module. I get a different appearance for my different headers.

I wanted to make sure with you also that this code was OK before hand:

If Montreal  > Return 811
If Québec  > Return 698
If anything else (even other countries > Return 813

Code:


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

if ( $fromCountryId == "CA" )  {

    // Villes PQ
    if ( $city == "Montréal" ) return "698";
    if ( $city == "Québec" ) return "811";

}
else
return 813;
}

Please have a look at the CSS problems with the design once the rules goes through Metamod processing. I've named the different image file so you can understand which was on, and with or without metamod published

Link: Images

Regards

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

Re: Metamod Pro Geo Location - 2 cities + else

Hi,

fixed!

There were 2 problems:
1 - there was a syntax error with missing "{" near the end of the PHP. This caused an error message to be displayed (faintly at the top of the window), and the desired modules were not loaded by the MetaMod.

2 - in the MetaMod, you had "style for included modules" set to "rounded". This should have been "inherited" so as to use the same module styling that Joomla normally would have done. That was the reason for the strange CSS effects.

So I have now published the MetaMod and unpublished the other 3 modules so they don't show up until the MetaMod includes them. I tested with the "not Montréal and not Québec" included module and it appears to work perfectly for me. Can you please test from Montréal and the rest of Québec to ensure they work too?

Thanks,
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:
10783
Newest User:
weatti4qx
Members Online:
0
Guests Online:
242

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