![]() |
Tickbox vB Option Code
Trying to setup a vb option setting with tick boxes in it. I took some code from a setting that already had them and implemented it into my own, but now I'm getting this wacky error:
Code:
Fatal error: Unsupported operand types in \includes\adminfunctions_options.php on line 229 PHP Code:
|
Set the datatype to free.
|
Yeah I tried that, but then it won't save the status of the tickboxes. Same with Boolean.
|
Does anyone else have an idea?
|
You need to convert the data to an integer first, then upon retrieving the data, check to see the individual values. Bitfields make it easy....
admin_options_processing hook: PHP Code:
option eval code Code:
<fieldset> |
Thanks SirAdrian, I'll try that later.
Is there a reason that you've got the setting increments doubling? |
Here's a visual explanation...
http://www.litfuel.net/tutorials/images/800binary.gif |
Ha ha -- thanks SirAdrian, that makes sense.
One final question before the thread can be put to bed: how do I call the option? The typical $vbulletin->options[varname] returns an array, go figure, but I'm not sure what values to use for each bit. |
I have this in my PHP file where I use it
PHP Code:
PHP Code:
PHP Code:
For the values, go up by multiples of two (binary!), then make sure the values you use matchup with an array (in my case, $blog->parsingLookup). |
Thanks again for all your help and the laugh :p, I've got everything working perfectly.
|
All times are GMT. The time now is 12:02 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|