vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   View User's Current Style/ThemeID.. (https://vborg.vbsupport.ru/showthread.php?t=197176)

Ad1tya 11-25-2008 02:29 AM

View User's Current Style/ThemeID..
 
Hi.

Is there any way to check a users current style selection?

We want to make a button on our forums, which will alternate between Fixed Width and Fluid Width.

We have a Dark and a Light Theme.

Regards,
Ad1tya.

KiD0M4N 11-25-2008 04:23 AM

What he wants to know is is there some way to get the currently active style id.

ReCom 11-25-2008 04:46 AM

Each style/theme has its own "StyleVars" page in AdminCP > Style Manager. Within that page there is a section titled "Image Paths" where paths for various types of images can be modified for that particular style:
  • Button Images Folder
  • Item Status Icon Folder
  • Attachment Icons Folder
  • Miscellaneous Images Folder
  • Text Editor Controls Folder
  • Poll Images Folder
  • Ratings Images Folder
  • Reputation Images Folder
You can put the buttons for dark theme in, say /images/dark/buttons and point "Button Images Folder" to that folder. Users who browse in that dark theme will see button images from that folder while those browsing in default style will see the default buttons.

But if you still want to access the style id from plugins or templates, it's
Code:

$vbulletin->userinfo['styleid']

KiD0M4N 11-25-2008 05:03 AM

Quote:

Originally Posted by ReCom (Post 1672490)
Each style/theme has its own "StyleVars" page in AdminCP > Style Manager. Within that page there is a section titled "Image Paths" where paths for various types of images can be modified for that particular style:
  • Button Images Folder
  • Item Status Icon Folder
  • Attachment Icons Folder
  • Miscellaneous Images Folder
  • Text Editor Controls Folder
  • Poll Images Folder
  • Ratings Images Folder
  • Reputation Images Folder
You can put the buttons for dark theme in, say /images/dark/buttons and point "Button Images Folder" to that folder. Users who browse in that dark theme will see button images from that folder while those browsing in default style will see the default buttons.

But if you still want to access the style id from plugins or templates, it's
Code:

$vbulletin->userinfo['styleid']

Thanks a LOT bro :)

--------------- Added [DATE]1227596983[/DATE] at [TIME]1227596983[/TIME] ---------------

Quote:

Originally Posted by ReCom (Post 1672490)
Each style/theme has its own "StyleVars" page in AdminCP > Style Manager. Within that page there is a section titled "Image Paths" where paths for various types of images can be modified for that particular style:
  • Button Images Folder
  • Item Status Icon Folder
  • Attachment Icons Folder
  • Miscellaneous Images Folder
  • Text Editor Controls Folder
  • Poll Images Folder
  • Ratings Images Folder
  • Reputation Images Folder
You can put the buttons for dark theme in, say /images/dark/buttons and point "Button Images Folder" to that folder. Users who browse in that dark theme will see button images from that folder while those browsing in default style will see the default buttons.

But if you still want to access the style id from plugins or templates, it's
Code:

$vbulletin->userinfo['styleid']

Hi... unfortunately the code is not working. I am unable to get the styleid.

Lynne 11-25-2008 03:07 PM

Quote:

Originally Posted by KiD0M4N (Post 1672500)
Hi... unfortunately the code is not working. I am unable to get the styleid.

If something doesn't work and you need help with it, you need to post the code (including the code location).

ReCom 11-25-2008 10:14 PM

Yup, $vbulletin is the core vbulletin registry object; you can't miss it except for one possible reason:

You tried to access it from withn a function but forgot to do "global $vbulletin;" first

PHP Code:

function blah()
{
  global 
$vbulletin;
  
doSomething->to($vbulletin->userinfo['styledid'];


Or if your code is in the form of a plugin, and the hook location happens to fall inside a class function, try using this instead:
PHP Code:

$this->registry->userinfo['styleid'



All times are GMT. The time now is 09:55 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.03715 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
  • (3)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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