View Full Version : Browser Version Check
cory_booth
12-09-2009, 04:43 PM
Is there a builtin feature to validate a user's browser?
I am having some difficulty with a mod (cometchat) and IE6.
Interestingly, if I hit my site and load a blank page (which activates cometchet) everything work s well for IE6...
If I try and load it through VB4, it crashes the user's browser if it is IE6.
I have spent days playing with different ideas and css/js to no avail.
The developers aren't all the helpful either.
Right now I have a profile "bit" field to have users choose if they want to use the chat or not.
I would rather just have VB4 validate the browser version and shut off the chat if it is IE6
Lynne
12-09-2009, 05:52 PM
Have you googled it? I wrote a mod and didn't want it to 'work' if the user was using IE, so I put a condition around it. I found the condition by using google (and then testing, of course).
cory_booth
12-09-2009, 06:40 PM
I am trying the following as a plugin...
So far doesn't look like it is working - but I need to run and will play with later tonight
$ua = $_SERVER['HTTP_USER_AGENT'];
if (strpos($ua,'MSIE') != false && strpos($ua,'Opera') === false)
{
if (strpos($ua,'Windows NT 5.2') != false)
{ if(strpos($ua,'.NET CLR') === false) return; }
if (substr($ua,strpos($ua,'MSIE')+5,1) < 7)
{
$template_hook['footer_links'] .='';
}
}
else
{
$template_hook['footer_links'] .='
<link type="text/css" rel="stylesheet" media="all" href="http://xxx.com/cometchat/cometchatcss.php" charset="utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script>jqcc=jQuery.noConflict(true);</script>
<script type="text/javascript" src="http://xxx.com/cometchat/cometchatjs.php" charset="utf-8"></script>
';
}
--------------- Added 1260400137 at 1260400137 ---------------
Hmmm...
What about:
<![if !IE 6]>
Almotmaiz.Net
12-10-2009, 06:40 AM
use is_browser function .. will help you much :)
in php like this :-
if(is_browser('ie'))
{
// Ie
} elseif (is_browser('ie') == 6) {
// if ie is 6
} elseif (is_browser('ie', 7)) {
// true if is ie 7 or grator.
} elseif (is_browser('firefox')) {
// its Frefox
}
/// .......... etc
more explanation found on "includes/functions.php" line ~ 5528
best regards
--------------- Added 1260447299 at 1260447299 ---------------
umm i think this will help two.
if(!(is_browser('ie') == 6)) {
$template_hook['footer_links'] .='
<link type="text/css" rel="stylesheet" media="all" href="http://xxx.com/cometchat/cometchatcss.php" charset="utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script>jqcc=jQuery.noConflict(true);</script>
<script type="text/javascript" src="http://xxx.com/cometchat/cometchatjs.php" charset="utf-8"></script>';
}
cory_booth
12-10-2009, 06:29 PM
thanks everyone...
Actually I used the following:
$template_hook['footer_links'] .='
<![if !IE 6]>
<link type="text/css" rel="stylesheet" media="all" href="http://aquiacreek.com/cometchat/cometchatcss.php" charset="utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script>jqcc=jQuery.noConflict(true);</script>
<script type="text/javascript" src="http://aquiacreek.com/cometchat/cometchatjs.php" charset="utf-8"></script>
<![endif]>
';
Almotmaiz - thanks though, with your version I can easily evaluate for <= IE6...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.