vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Browser Version Check (https://vborg.vbsupport.ru/showthread.php?t=229854)

cory_booth 12-09-2009 04:43 PM

Browser Version Check
 
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

PHP Code:

$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 [DATE]1260400137[/DATE] at [TIME]1260400137[/TIME] ---------------

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 :-
PHP Code:

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 [DATE]1260447299[/DATE] at [TIME]1260447299[/TIME] ---------------

umm i think this will help two.

PHP Code:

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:

PHP Code:

$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...


All times are GMT. The time now is 06:52 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01080 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete