MyBB Community Forums

Full Version: Plugin Options
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
When creating settings for a plugin is it possible to have a "Read Only" textbox ?

In this option:
"optionscode"	=> "text",
Kind of defeats the purpose of having a "setting" if you can't change it Smile
What is it you're trying to do?
I was just creating a simple plugin that adds a facebook share button to the postbit and for some reason the only way i could add the code was in the settings value and call it from there , so i didnt want the user to be able to edit that particular textbox.

But ive sorted it out now anyway , ive added it to the template correctly Big Grin
OK Smile
Can u take a look at this dylan when you get a chance , cheers Big Grin

>> http://community.mybb.com/thread-78496-p...#pid574438
the ability to create a setting that the plugin should be the only thing to change it would be nice. for MyBBPublisher, one setting is used to create another one. Its the way Facebook works and make sit less work for the user to setup the Facebook application and permissions.

My plugin takes one value from the user that Facebook creates for the user, then the plugin uses that code to generate another code and insert it into the settings. Because this Facebook code is a one time use, this reduces the chance for the user making an error. the resulting code should not be edited via ACP but needs to be stored for the plugin to access.

A read-only option for settings would be nice
(2010-09-17, 04:18 PM)pavemen Wrote: [ -> ]the ability to create a setting that the plugin should be the only thing to change it would be nice. for MyBBPublisher, one setting is used to create another one. Its the way Facebook works and make sit less work for the user to setup the Facebook application and permissions.

My plugin takes one value from the user that Facebook creates for the user, then the plugin uses that code to generate another code and insert it into the settings. Because this Facebook code is a one time use, this reduces the chance for the user making an error. the resulting code should not be edited via ACP but needs to be stored for the plugin to access.

A read-only option for settings would be nice

You can already do this by using php code inside the option itself.
can you give me an example?
For an example of a stock setting using PHP for more functionality look at the database optioncode entries for timezoneoffset and searchtype; both of which use php code for their optioncode Smile
sweet, i don't think I ever realized a "php" entry was supported. This could be fun!
Pages: 1 2