Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-24-2005, 10:23 AM
neocorteqz's Avatar
neocorteqz neocorteqz is offline
 
Join Date: May 2002
Location: Barefoot Bay Fl
Posts: 473
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default We have is_browser

Is it possible to also create a new variable called is_os so we can define OS specific conditionals?

And how would one do this exactly?
Reply With Quote
  #2  
Old 02-24-2005, 11:18 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by neocorteqz
Is it possible to also create a new variable called is_os so we can define OS specific conditionals?

And how would one do this exactly?
Er. why would you want to do that?
Reply With Quote
  #3  
Old 02-24-2005, 12:26 PM
neocorteqz's Avatar
neocorteqz neocorteqz is offline
 
Join Date: May 2002
Location: Barefoot Bay Fl
Posts: 473
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mainly

The Q3PX plugin doesn't work for Linux or mac. And i find it's rather annoying to see empty boxes saying you need to install this plugin.

the plugin works fine for mozilla and other browsers, but doesn't work with Linux and no developement is planned for a linux plugin.
Reply With Quote
  #4  
Old 02-24-2005, 12:41 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by neocorteqz
Mainly

The Q3PX plugin doesn't work for Linux or mac. And i find it's rather annoying to see empty boxes saying you need to install this plugin.

the plugin works fine for mozilla and other browsers, but doesn't work with Linux and no developement is planned for a linux plugin.
The only way to determin the users OS would be the browser string IIRC.
Reply With Quote
  #5  
Old 02-24-2005, 12:43 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what's the q3px plug-in?
Reply With Quote
  #6  
Old 02-24-2005, 02:57 PM
neocorteqz's Avatar
neocorteqz neocorteqz is offline
 
Join Date: May 2002
Location: Barefoot Bay Fl
Posts: 473
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sabret00the
what's the q3px plug-in?
http://q3px.khimtech.com/en/forUser.html

It's a browser plugin that allows you to see who's playing is some game servers.

@ Zach

Yes, the only way to know what OS someone is using is the useragent string.

Functions.php:
PHP Code:
// #################### Start is browser ##########################
// browser detection script
function is_browser($browser$version 0)
{
    global 
$_SERVER;
    static 
$is;
    if (!
is_array($is))
    {
        
$useragent strtolower($_SERVER['HTTP_USER_AGENT']);
        
$is = array(
            
'opera' => 0,
            
'ie' => 0,
            
'mozilla' => 0,
            
'firebird' => 0,
            
'firefox' => 0,
            
'camino' => 0,
            
'konqueror' => 0,
            
'safari' => 0,
            
'webkit' => 0,
            
'webtv' => 0,
            
'netscape' => 0,
            
'mac' => 0
        
);

        
// detect opera
            # Opera/7.11 (Windows NT 5.1; U) [en]
            #Mozilla/4.0(compatible;MSIE 6.0; MSIE 5.5; Windows NT 5.0) Opera7.02Bork-edition [en]
            #Mozilla/4.0(compatible;MSIE 6.0; MSIE 5.5; Windows NT 4.0) Opera 7.0[en]
            #Mozilla/4.0(compatible; MSIE 5.0; Windows 2000) Opera 6.0 [en]
            #Mozilla/4.0(compatible; MSIE 5.0; Mac_PowerPC) Opera 5.0 [en]
        
if (strpos($useragent'opera') !== false)
        {
            
preg_match('#opera(/| )([0-9\.]+)#'$useragent$regs);
            
$is['opera'] = $regs[2];
        } 
As you see in the snipet of code, it already uses the User agent string to identify the browser.

So what I'm asking, is it possible to code something in functions.phptolook for OS'es Like it already does with is_browser. And how I'dgoabout doing that. Maybe I posted in the wrong section, Maybe Ishouldhave asked in the Request section?

And I can't wait till vBorg upgrades to 3.0.7. Still having probs with text spacing.
Reply With Quote
  #7  
Old 02-24-2005, 06:12 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by neocorteqz
http://q3px.khimtech.com/en/forUser.html

It's a browser plugin that allows you to see who's playing is some game servers.

@ Zach

Yes, the only way to know what OS someone is using is the useragent string.

Functions.php:
PHP Code:
// #################### Start is browser ##########################
// browser detection script
function is_browser($browser$version 0)
{
    global 
$_SERVER;
    static 
$is;
    if (!
is_array($is))
    {
        
$useragent strtolower($_SERVER['HTTP_USER_AGENT']);
        
$is = array(
            
'opera' => 0,
            
'ie' => 0,
            
'mozilla' => 0,
            
'firebird' => 0,
            
'firefox' => 0,
            
'camino' => 0,
            
'konqueror' => 0,
            
'safari' => 0,
            
'webkit' => 0,
            
'webtv' => 0,
            
'netscape' => 0,
            
'mac' => 0
        
);

        
// detect opera
            # Opera/7.11 (Windows NT 5.1; U) [en]
            #Mozilla/4.0(compatible;MSIE 6.0; MSIE 5.5; Windows NT 5.0) Opera7.02Bork-edition [en]
            #Mozilla/4.0(compatible;MSIE 6.0; MSIE 5.5; Windows NT 4.0) Opera 7.0[en]
            #Mozilla/4.0(compatible; MSIE 5.0; Windows 2000) Opera 6.0 [en]
            #Mozilla/4.0(compatible; MSIE 5.0; Mac_PowerPC) Opera 5.0 [en]
        
if (strpos($useragent'opera') !== false)
        {
            
preg_match('#opera(/| )([0-9\.]+)#'$useragent$regs);
            
$is['opera'] = $regs[2];
        } 
As you see in the snipet of code, it already uses the User agent string to identify the browser.

So what I'm asking, is it possible to code something in functions.phptolook for OS'es Like it already does with is_browser. And how I'dgoabout doing that. Maybe I posted in the wrong section, Maybe Ishouldhave asked in the Request section?

And I can't wait till vBorg upgrades to 3.0.7. Still having probs with text spacing.
You'd have to do a match on the useragent and then define them
Reply With Quote
  #8  
Old 02-26-2005, 05:43 AM
neocorteqz's Avatar
neocorteqz neocorteqz is offline
 
Join Date: May 2002
Location: Barefoot Bay Fl
Posts: 473
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Last bump.

Can this be moved to the vB3 request forum, this should have gone there fist.

I don't know hwere to start on this seeing as i lack php coding. So maybe someone can do a hack on this?
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 11:39 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.04276 seconds
  • Memory Usage 2,274KB
  • Queries Executed 13 (?)
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
  • (2)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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