PDA

View Full Version : Disabling options in settings


burtonmiller
06-27-2014, 09:51 PM
I would like to store two text values as settings options, but would like to make them read-only.

I am creating a product (mod), and this is a necessary part of what I am doing, to avoid user error.

I need to know what code to write, and what hook to connect it to.

Thanks in advance!)

tbworld
06-28-2014, 05:27 AM
I would like to store two text values as settings options, but would like to make them read-only.

Create your product using the "Admin Control Panel" in debug mode (Make sure you are in debug mode). The options you create will be automatically stored in the database and written to the data-store. You can then access your options via:

$myoption = $vbulletin->options['your option'];
https://www.vbulletin.com/docs/html?manualversion=40202601

:)

burtonmiller
06-28-2014, 05:34 AM
I believe these options will still be editable by the admin. When I say read-only, I am referring the forum admin.

But I think I solved this one - it looks as though 'custom' formatted options are not directly editable, and I can use this method to prevent accidental modification of delicate settings.

Thanks.

tbworld
06-28-2014, 05:40 AM
I believe these options will still be editable by the admin. When I say read-only, I am referring the forum admin.
{/quote]

Depending on the permissions set, all options can be edited via the admin due to it being a script.

[quote]
But I think I solved this one - it looks as though 'custom' formatted options are not directly editable, and I can use this method to prevent accidental modification of delicate settings.

That is why it was setup that way, correct. I was just leaving you a message to not pursue the path you were going down. Anyway, sounds like you are on the right path now. :)