The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Adding Settings to the AdminCP
Hello,
I am working for an update to a product of mine, and I cannot figure out for the life of me how to add a setting to the AdminCP that is in the form of a dropdown menu. If anyone could please explain to me how this works, it'd be much appreciated. For example, here is how to do it for a boolean setting: PHP Code:
|
#2
|
|||
|
|||
The easiest way is just to find a dropdown in the regular vBulletin options, click on "Edit" link next to it and copy the code
For example, the "Enable Forum Leaders" dropdown option in vB->Options has an option code of: Code:
<select name=\"setting[$setting[varname]]\" tabindex=\"1\" class=\"bginput\"> <option value=\"0\" " . iif($setting['value']==0,'selected="selected"') . ">$vbphrase[no]</option> <option value=\"1\" " . iif($setting['value']==1,'selected="selected"') . ">$vbphrase[yes]</option> <option value=\"2\" " . iif($setting['value']==2,'selected="selected"') . ">$vbphrase[yes_but_disable_moderators]</option> </select> Thanks, Alan. |
#3
|
||||
|
||||
Thanks! I got that part to work, but now I have another problem.
I have added this setting to my product: PHP Code:
PHP Code:
|
#4
|
|||
|
|||
That code should work fine. Are you using it within a function or class? If so, you might need to global $vbulletin.
Thanks, Alan. |
#5
|
||||
|
||||
Yes, it is within a function. That would explain why a similar conditional I used works elsewhere in the code. How do you global $vbulletin?
|
#6
|
|||
|
|||
At the top of the function, put:
PHP Code:
Thanks, Alan. |
#7
|
||||
|
||||
A million thanks to you! It worked, and you are now my hero.
Thanks, A fellow Alan. |
#8
|
||||
|
||||
Hi!
I am trying to enable debug mode to be able to add settings via a vBulletin system. I added $debug=1; on top of the config.php file but I don't see any option to add settings. Please help! |
#9
|
||||
|
||||
Enabling debug mode changed from $debug=1. Use the following in your config.php file:
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|