Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-09-2009, 04:43 PM
cory_booth cory_booth is offline
 
Join Date: Jul 2006
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 12-09-2009, 05:52 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #3  
Old 12-09-2009, 06:40 PM
cory_booth cory_booth is offline
 
Join Date: Jul 2006
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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]>
Reply With Quote
  #4  
Old 12-10-2009, 06:40 AM
Almotmaiz.Net Almotmaiz.Net is offline
 
Join Date: Jan 2005
Location: U.A.E, Sharjah
Posts: 180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>'
;

Reply With Quote
  #5  
Old 12-10-2009, 06:29 PM
cory_booth cory_booth is offline
 
Join Date: Jul 2006
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:46 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07776 seconds
  • Memory Usage 2,210KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete