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 not Working with ie Browser detection

MetaMod not Working with ie Browser detection

I'm trying to show one module for IE and another for all others.  I'm using the following recipe:

Code:

if ( $core_genius->check( "browser_type = ie" ) ) return 206;

else return 174;

However, it is showing 174 and not 206 on both browsers.  MetaMod Pro is working when not using browser detection.

iChuzCHRIST
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: MetaMod not Working with ie Browser detection

Hi iChuzCHRIST (so do I smile )

I've just tested with MetaMod for Joomla 1.5 and 1.7, most recent versions of both, and the code above works for me. I tested with Internet Explorer v8, but I know from previous testing that it works on other versions too.

Could it be that you have the system cache plugin turned on? In that case, the entire page gets cached, so if you hit it with one browser first, then the result would get cached and displayed no matter what browser you use on it the next time.

If you're not using the system cache plugin, then try putting this into the MetaMod and test with different browsers:

echo "Browser type is: " . $core_genius->info("browser_type") . "<br  />";
if ($core_genius->check("browser_type = ie")) echo "It is IE!!!" . "<br  />";
echo "User agent is: " . $_SERVER['HTTP_USER_AGENT'] . "<br  />";
echo "MM_USER_AGENT: " . MM_USER_AGENT . "<br  />";


So, what comes up when you test this with an IE browser? What user agent does it give?

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
3329 Posts
User info in posts
Administrator has disabled public posting

Re: MetaMod not Working with ie Browser detection

metamodguy wrote:

Could it be that you have the system cache plugin turned on? In that case, the entire page gets cached, so if you hit it with one browser first, then the result would get cached and displayed no matter what browser you use on it the next time.

That was it!!!  I disabled the cache plugin, and it's all working like I want it to.  I'm just hoping that none of my extensions need to have cache mode.  I suppose that I will have to really test out my site to be sure.

I have a related question.  How does a IE8 browser in compatibility mode register?  Does it register as IE7?

iChuzCHRIST
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: MetaMod not Working with ie Browser detection

About the IE8/IE7 question: I don't know without trying it out, though I suspect the compatibility mode does NOT change the browser version in the user agent string. You can try this out by using the code I suggested in my last post, then view the page with compat view on and off.

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
3329 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1696
Total Polls:
6
Total Posts:
5941
Posts this week:
7
User Info:
 
Total Users:
5418
Newest User:
outsd2
Members Online:
0
Guests Online:
109

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