IE8 - redirect to another page if user is using IE

Is there anyway to redirect a user automatically to another page if they are using IE? I am having nothing but problems with IE, and want to let me users know to use safari or firefox or anything else, and warn them if the still want to use internet explorer, there will be problems.

Hoping to get the issues with IE resolved, but until then, I want more than a link at the bottom saying"Best used with Firefox" since all my issues are formatting problems, and likely that link wont even show up on IE.

Any ideas??

Thanks,

Cory

Quote · 21 Mar 2010

Any ideas on the IE format issues??? I just upgraded to 7.01 hoping it might fix it and nothing. Any ideas on how I could do this??

 

Thanks.

Quote · 2 May 2010

This functionality is already included in Dolphin 7, go to _sub_header.html in your templates folder.

Search for the following

<!--[if lt IE 7]>
<div style='border: 1px solid #F7941D; background: #FEEFDA; text-align: center; clear: both; height: 75px; position: relative; margin-bottom: 10px;'>
<div style='position: absolute; right: 3px; top: 3px; font-family: courier new; font-weight: bold;'><a href='#' alt='javascript:this.parentNode.parentNode.style.display="none"; return false;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-cornerx.jpg' style='border: none;' alt='Close this notice'/></a></div>
<div style='width: 640px; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: black;'>
<div style='width: 75px; float: left;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-warning.jpg' alt='Warning!'/></div>
<div style='width: 275px; float: left; font-family: Arial, sans-serif;'>
<div style='font-size: 14px; font-weight: bold; margin-top: 12px;'><bx_text:_sys_outdated_browser /></div>
<div style='font-size: 12px; margin-top: 6px; line-height: 12px;'><bx_text:_sys_outdated_browser_explain /></div>
</div>
<div style='width: 75px; float: left;'><a href='http://www.firefox.com' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-firefox.jpg' style='border: none;' alt='Get Firefox 3.5'/></a></div>
<div style='width: 75px; float: left;'><a href='http://www.browserforthebetter.com/download.html' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-ie8.jpg' style='border: none;' alt='Get Internet Explorer 8'/></a></div>
<div style='width: 73px; float: left;'><a href='http://www.apple.com/safari/download/' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-safari.jpg' style='border: none;' alt='Get Safari 4'/></a></div>
<div style='float: left;'><a href='http://www.google.com/chrome' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-chrome.jpg' style='border: none;' alt='Get Google Chrome'/></a></div>
</div>
</div>
<![endif]-->

This is what is known as a conditional comment - it is only recognised by internet explorer - in this case any version less than IE7. It runs the code in between the if / endif. In this case it displays a popup that warns Internet Explorer 6 users to upgrade.

You can change the condition and content to suit your needs-

<!--[if lt IE 8]>

This will make the popup appear for all users of IE or earlier

<!--[if IE]>

This will make it appear for all IE users

There are other combinations - a google will turn up more info iif needs be.

HTH

/DM

Dolphin - Ajax Masturbation
Quote · 2 May 2010

Perfect, that does work better. I couldnt get it to work before for some reason even when changing it to 8, but when I just did

<!--[if IE]>

it worked!

Only problem is that in Internet Explorer, I get the <!--[if IE] text showing up on the page?

Thanks.

Quote · 2 May 2010

You can also use htaccess to do a redirect to anpther file.

RewriteCond %{HTTP_USER_AGENT} *MSIE*
RewriteRule (.*) http://www.someotherurl.com

or you can detect it in php and send a redirect header to the browser

$useragent = $_SERVER['HTTP_USER_AGENT'];
if ($useragent == "MSIE"){
header( 'Location: http://www.yoursite.com/new_page.html' ) ;
}

Or even javascript.

HTH

/DM

Dolphin - Ajax Masturbation
Quote · 2 May 2010

This is probably a lot more complicated, but is there a way, using a conditional statement or whatever, to make certain content appear only to certain users or groups?

Or better yet, based on a custom profile field option. For instance, if I had a custom field that let users select option 1, option 2, or option 3. Can I apply the condition statement idea to let Option 1, Option 2, and Option 3 users each see different things, like a header notification, or image, or whatever?

Cory

Quote · 2 May 2010

Perfect, that does work better. I couldnt get it to work before for some reason even when changing it to 8, but when I just did

<!--[if IE]>

it worked!

Only problem is that in Internet Explorer, I get the <!--[if IE] text showing up on the page?

Thanks.

It shouldn't display in the browser as it is a comment. Maybe there is an error with the syntax (possibly mine - lol).

You can find out a bit more info on this method here - http://www.quirksmode.org/css/condcom.html

/DM

Dolphin - Ajax Masturbation
Quote · 2 May 2010

This is probably a lot more complicated, but is there a way, using a conditional statement or whatever, to make certain content appear only to certain users or groups?

Or better yet, based on a custom profile field option. For instance, if I had a custom field that let users select option 1, option 2, or option 3. Can I apply the condition statement idea to let Option 1, Option 2, and Option 3 users each see different things, like a header notification, or image, or whatever?

Cory

There is - but it would involve integrating the PHP redirect method into the Dolphin core.

Best place for this would be where the user is validated and the users usergroup is determined. This way when a certain usergroup is validated by the code AND they are using an MSIE user agent (explorer) they will be redirected.

Alternatively, if you simply want to hide different content from different user groups then you only need to create the relevant groups and assign their permissions via the 'membership levels' section in the admin panel. This is however quite limited as to what you can control - whilst you can control what modules can be seen / edited / etc, it does not extend to things like notifications and header / footer, which would require extra modification.

I presume that the issues are template related - why not either fix the css issues for IE and use the conditional comment to import the css file (the most wide use of conditional comments), or simply provide the option for users to switch to a standard template?

/DM

Dolphin - Ajax Masturbation
Quote · 2 May 2010

I assumed it was just template problems, but even when I just replaced my template files with the default ones and upgraded to the 7.01 files, it still showed up funky.

I am in no way a programmer, so pardon my ignorance, but how would I set up the conditional statement to say if a user was using IE, then use template B?

Oh, I did fix the issue of part of the if statement showing up on the site, I forgot to remove the lt part of the <!--[if IE]>

Thanks again.

Cory

Quote · 2 May 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.