![]() |
How to make check-boxes for style selections in settings/options...
1 Attachment(s)
This wasn't especially difficult and doesn't rise to the level of being an article but I did quite a bit of searching and never saw it posted before.
Below is some code that will let you put a "style chooser" in Admin CP -> Settings -> Options (options for any mod you may create.) Previously I was asking users to manually enter styleids into a box if they wanted to enable or disable a style for a particular mod. Now they can easily select the style via a checkbox just like a usergroup name. In the Option Setup in the "Option Code" field enter this code: Code:
" . eval('$options = ""; The second part is you need to make a plugin on the hook admin_options_processing. In that plugin add the code: PHP Code:
And that is it- it will now give you a functioning option that looks like this: https://vborg.vbsupport.ru/attachmen...1&d=1341418668 Oh in the back end calling the option like $vbulletin->options['varname'] will give you a comma separate string of styleids... so it might look like '1,2,3,5' if styleids 1, 2, 3, and 5 were selected. So if you need an array you will have to explode the data. This will only show non-mobile styles in newer versions of vBulletin and in most cases you don't need to worry about the mobile style anyway. If you did need to include the mobile styles you would have to edit this line in the option code: Code:
foreach($vbulletin->stylecache[-1] AS $sss) |
All times are GMT. The time now is 10:30 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|