Create checkbox group at your hack's options (usergroup selection for example)
1 Attachment(s)
Hello.
In this article I will show how to create a checkbox group in your hack's options. It's easy. Just do the following: 1. Create an option. Datatype validation type = free. 2. Enter the following code to Option code: Code:
" . eval('$options=""; 4. Now create a admin_options_processing hook with the following code: PHP Code:
5. That's all. Now $vbulletin->settings['my_setting_name'] will be a string like "Test1Code,Test1Code" depending on what user checked at options page. A little moment on option text localization. Instead of PHP Code:
PHP Code:
Code:
<phrasetype name="vBulletin Settings" fieldname="vbsettings"> Code:
" . eval('$options =""; |
Just what i been looking for, shame I havent got a clue..lol..:(
cool tut tho' :) |
Can you provide a screenshot of how this would look?
|
Attached to post
|
/bookmarked
this is handy to have! |
Fractalizer, very nice! I am wondering however why you don't just loop through each usergroup and call vbulletin's print_checkbox_row() function to handle the checkbox creation. It's located within adminfunctions.php :)
|
Quote:
|
Thanks for this tutorial.
in step 4 i.e. PHP Code:
I also wanted to know how to use this option code bitfield:nocache|allowedbbcodesfull This bitfield type code automatically generates a set of check boxes of allowed bbcodes to choose from. Now how to implement onto our page. Thank you |
my_setting_name is the setting name you provided when creating setting. As for bitfield - I am not sure it is supported. Where is this example from?
|
thanks for your reply !
alright so $settings['my_setting_name'] is the field setting name, fine. 1. And in the option code I see "setting[$setting[varname]", does varname needs to be replaced by something ? 2. How do I check for the checked options from the php page ? Like for boolean we do :- PHP Code:
3. umm.. not sure what you mean by bitfield supported. See in admincp->Social Group Options and Album Options and Visitor Message options. They all have a setting of "Allowed BBCODES", their option code is set to bitfield:nocache|allowedbbcodesfull and it automatically outputs a set of checkboxes of bbcodes. I did the same and it works but as in my 2nd ques, how do I check it ? Thank you |
All times are GMT. The time now is 10:25 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 | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|