The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How do I load custome addon settings
Hi everyone,
This is again in regard to the World of Warcraft Lottery addon I'm working on. I have a custom settings page similar to other addon settings pages that gives the admin the ability to enable or disable the addon for maintenance purposes, as well as set other global addon settings. I've done some research on how to load setting values from the database by looking at other addon code and searched the forums here. I've seen it done several ways to sunday, but now I'm totally confused and frustrated. Would anyone has some simple suggestions/example on how to do this? Thank you in advance! Jim |
#2
|
||||
|
||||
All settings are automatically loaded into the array $vbulletin->options by the vb core. Just use $vbulletin->options['your_setting_name'] to get the value.
|
#3
|
||||
|
||||
And in templates, you can use $vboptions.
|
#4
|
||||
|
||||
I haven't put my settings in the vboptions though. I've created the following custom tables:
vb_lotteries vb_lotterynumbers vb_lotterysettings vb_lotteryuserjoin vb_lotterysettings fields ------------------------ name value this is so I can add more settings without altering the table structure. Current settings include but are not limited to: Name Value HomeURL http://localhost/ lotteryactive 0 onoffreason "Lottery System is unavailable right now - please come back later" Title "Test World of Warcraft Lottery System" vb_lotteries fields --------------------------- lotteryid drawdate ticketcost jackpot vb_lotterynumbers fields --------------------------------- userid ball1 ball2 ball3 ball4 ball5 ball6 vb_lotteryuserjoin fields --------------------------------- userid drawdate confirm Does this seem like the right way to go? Isn't there a more simple way of loading settings instead of using vboptions? This method seems a bit complex at my current stage of developing mods. Thank you again for your input, Jim |
#5
|
||||
|
||||
All those setting could go in vB's settings table and you'd save yourself a lot of trouble, and your pages won't have so many queries. For stuff like home url, don't create a new setting, use vB's 'bburl' setting.
|
#6
|
||||
|
||||
Ok, I think I have the default settings worked out. Thank you all for your help!
In case you're interested in seeing what I have so far, I've included a screen shot: Jim |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|