vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Disabling options in settings (https://vborg.vbsupport.ru/showthread.php?t=312492)

burtonmiller 06-27-2014 09:51 PM

Disabling options in settings
 
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

Quote:

Originally Posted by burtonmiller (Post 2504140)
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:
Code:

$myoption = $vbulletin->options['your option'];
https://www.vbulletin.com/docs/html?...rsion=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

[quote=burtonmiller;2504180]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. :)


All times are GMT. The time now is 10:43 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
  • Page Generation 0.00950 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete