vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Adding options to the User CP (https://vborg.vbsupport.ru/showthread.php?t=214340)

gdguide 05-23-2009 12:16 AM

Adding options to the User CP
 
On our forum we have a set of rotating header images, but the PHP that is used to rotate them doesn't perform well on old versions of IE. I'd like to add a single checkbox in the UserCP that enables a "optimize for IE" setting, and wrap the IE-specific header code in an <if>...<else> tag that would check for the status of that option for each individual user and display the header accordingly. How would I do this?

Biker_GA 05-23-2009 12:19 AM

Why don't you just add the browser check in your coding for everyone?

gdguide 05-23-2009 12:22 AM

Quote:

Originally Posted by Biker_GA (Post 1815513)
Why don't you just add the browser check in your coding for everyone?

Because in some instances it performs fine on IE 7, while in others it performs horribly. It is isolated to IE, but I don't want to force IE users to use a simple, static header if they feel no need for it.

Biker_GA 05-23-2009 12:24 AM

You can look for specific IE versions within the script.. Something like:

PHP Code:

<?php
echo ( browser_detection'number' ) .'<br>'.
browser_detection'browser' ) .'<br>'.
browser_detection'os' ) .'<br>'.
browser_detection'os_number' ) );
?>

Outputs (browser version, browser, os, os number):
1.5
moz
nt
5.1

<?php
if ( ( browser_detection'browser' ) == 'ie' )
&&
browser_detection'number' ) >= ) )
{
echo 
'it is Internet Explorer ' .
browser_detection'number' );
// or anything else you want to happen of course
}
?>

Obviously, you don't need to check for OS version, but this should give you an idea on where to start with checking for the type of browser and browser version.

gdguide 05-23-2009 01:39 AM

Quote:

Originally Posted by Biker_GA (Post 1815517)
You can look for specific IE versions within the script.. Something like:

PHP Code:

<?php
echo ( browser_detection'number' ) .'<br>'.
browser_detection'browser' ) .'<br>'.
browser_detection'os' ) .'<br>'.
browser_detection'os_number' ) );
?>

Outputs (browser version, browser, os, os number):
1.5
moz
nt
5.1

<?php
if ( ( browser_detection'browser' ) == 'ie' )
&&
browser_detection'number' ) >= ) )
{
echo 
'it is Internet Explorer ' .
browser_detection'number' );
// or anything else you want to happen of course
}
?>

Obviously, you don't need to check for OS version, but this should give you an idea on where to start with checking for the type of browser and browser version.

Like I said, I don't want to force it upon anyone - I'd rather give them the option.

Unofficial mods and addons manage to add options to the User CP. Is it not possible to do this manually?


All times are GMT. The time now is 12:15 AM.

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.01006 seconds
  • Memory Usage 1,736KB
  • 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
  • (2)bbcode_php_printable
  • (2)bbcode_quote_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