MyBB Community Forums

Full Version: Check box in settings
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I give up!

I was trying to generate check boxes in settings area for some of my plugins and until now I had no success.
Can anyone point me on how I can add one check box in the settings section. I looked in MyBB code and I found that should work with:
'optionscode' => 'checkbox',
but this is not working.
I can do it with onoff option, but it is huge and it looks very ugly.
So, please, can anyone point me to the right direction?
Try specifying "onoff" instead of "checkbox" Toungue
(2009-01-27, 04:00 AM)Yumi Wrote: [ -> ]Try specifying "onoff" instead of "checkbox" Toungue

But if I am using the onoff I get that ugly thing with yes and no. It is OK when you have a few settings, but when you want to change 200 settings (I want to use this for my video link plugin - for admins to be able to chose the sites that they want embedded), it is very very ugly and huge.
I saw something in: class_form.php. I will give a try starting from there. I hope it will work. If not may be in the next release of MyBB Smile
Oh, in that case, don't use the settings system, as you've probably decided to do anyway Toungue
(2009-01-27, 04:16 AM)thor2705 Wrote: [ -> ]
(2009-01-27, 04:00 AM)Yumi Wrote: [ -> ]Try specifying "onoff" instead of "checkbox" Toungue

But if I am using the onoff I get that ugly thing with yes and no. It is OK when you have a few settings, but when you want to change 200 settings (I want to use this for my video link plugin - for admins to be able to chose the sites that they want embedded), it is very very ugly and huge.
I saw something in: class_form.php. I will give a try starting from there. I hope it will work. If not may be in the next release of MyBB Smile

I'm agree, it should be an option to use the default input fields

Anyway, you can still choose 'php' as the optioncode and control the output, though if you have any other method it's preferred that you won't use 'php'
(2009-01-27, 09:34 AM)Yumi Wrote: [ -> ]Oh, in that case, don't use the settings system, as you've probably decided to do anyway Toungue

No, I haven't decided that. I am open to anything else that make the life of the user/forum admin easier. In my view, after the user is choosing the sites I will modify a different file than the settings one (this will help not increasing the size of that file, and also with the load), the only issue is: with the input method - it has to specify each an every site (200) and it has to be small. All the choices provided by MyBB at this moment are generating huge and ugly pages.
I will dig a little bit more and if I find a solution to this I will post it here. If someone else find one before me, please pot it here. Thanks.
(2009-01-27, 09:51 AM)dvb Wrote: [ -> ]Anyway, you can still choose 'php' as the optioncode and control the output, though if you have any other method it's preferred that you won't use 'php'

What about this? you specify the exact output, look at the timezone selection field of MyBB
(2009-01-27, 09:52 PM)dvb Wrote: [ -> ]What about this? you specify the exact output, look at the timezone selection field of MyBB
Thanks, working right now at it, I will report here how is going.
MyBB's settings editor really wasn't designed to handle such large volumes of settings, which is why I'd suggest a custom page. This also has the advantage of more flexibility and consistency since you can retrieve a list of sites from, say, a text file, rather than insert a heapload of settings on activation, then delete them afterwards.
(2009-01-29, 03:29 AM)Yumi Wrote: [ -> ]MyBB's settings editor really wasn't designed to handle such large volumes of settings, which is why I'd suggest a custom page. This also has the advantage of more flexibility and consistency since you can retrieve a list of sites from, say, a text file, rather than insert a heapload of settings on activation, then delete them afterwards.

Thank you, this was (and still is) my first intention, to save the settings in a total different file. But I still need a page inside AdminCP where the admin can select what he/she wants.
I am working on this, I will keep you posted.
Thank you again.