The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How do I add an option in a plugin?
Hello,
I created a product, I created a plugin, in that plugin I have some php-code... PHP Code:
PHP Code:
Is having a button for my product on the left side, and in there a button called "options" or something similar. when you click on that, on the right side: News Thread Forum ID: (Enter the forum id where the News thread will be made) & News Discussions Thread Forum ID: (Enter the forum id where the News Discussions thread will be made) So what do I need to do to change that "69" so whatever number is filled in the "News Thread Forum ID" is used there... And what do I need to change that "70" so whatever number is filled in the "News Discussions Thread Forum ID" is used there... (You can call me lazy for not reading enough of documentations, I'm just a little bit to impatient for reading) Friendly greetings, and thanks in advance Valcav |
#2
|
|||
|
|||
To put a menu on the left in the adminCP, look at the files in the includes/xml directory. If you create an xml file starting with "cpnav_" and put it in that directory, you can create your own menu. For the right side, you will need to create your own script. Probably the easiest thing to do would be to look at the existing scripts in the admincp directory and see how they work.
An easier way is to add your options to the existing options page by putting the site in debug mode. When you do that, extra controls will appear that will allow you to add sections and options (Add Option link at the top of each section). When you do that you choose a Varname, and then in your plugin code you can use $vbulleton->options['varname'] to get your value. |
#3
|
|||
|
|||
Quote:
Setting Group: Valcavs Auto Copy Threads To Discussion Forum (id: valcav_news_discussion) Added 2 settings: Setting: News Thread Forum ID: (id: valcav_news_discussion_news_id) Default: 69 Positive Integer & Setting: News Discussions Thread Forum ID: (id: valcav_news_discussion_discussion_id) Default: 70 Positive Integer So now I have to change: PHP Code:
PHP Code:
PHP Code:
PHP Code:
Friendly greetings, Valcav (& thanks for your help) |
#4
|
|||
|
|||
That's looks right to me. You may also need to add
Code:
global $vbulletin; before you use $vbulletin, depending on the hook location. |
#5
|
|||
|
|||
Can/could it hurt if that code is standing twice in that "Plugin PHP Code"?
|
#6
|
|||
|
|||
No, you can have that twice, so it's OK if you want to put it in just to make sure.
|
#7
|
|||
|
|||
Thank you very much for the help!
|
#8
|
|||
|
|||
What was the end result...code?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|