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 |
Quote:
Quote:
Quote:
|
Thanks for your replies.
Can you please tell me what to do after creating the plugin at admin_options_processing hook. Is this correct ? PHP Code:
See.. I am showing 3 radio buttons via template. Simple ! Now.. I have created 3 checkboxes (corresponding to radio buttons) so that whichever is checked THAT radio button would show. How do I achieve this ? What should I wrap around my radio button code in template so that the corresponding one shows only when it is allowed (checked in admincp). Thank you |
PHP Code:
|
oh i still can't get it to work. See this is all what I had done:-
1. I created a setting $vbulletin->options['vin_mysetting'], Free datatype, with the following option code:- Code:
" . eval('$options=""; PHP Code:
PHP Code:
HTML Code:
<if condition="$show['option1']"> It never shows up now, whether checked or unchecked ! Thank you |
Thanks for the info, Ive been in need of this type of info... now I just need to figure out how to create options in the UserGroup and User settings
|
All times are GMT. The time now is 10:22 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 | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|