raorn
Member
Many scripts require editing to set some internal settings. Therefore it's hard for end user to update such scripts to a new version.
Here's mini-library for using personal script settings. How to use it?
This code will check preferences for "script_MyCoolScript_SomeOption", "script_MyCoolScript_SomeOtherOption" and "script_MyCoolScript_YetAnotherOption" and set appropriate variables. If such property does not exist, it will be set to default value (first and second example) or to null string (third example).
Visit javascript:void(mainpane.location="script_settings.php"); url for more fun ;-)
Property format is subject to discuss.
Update 2008.03.12 17:10 GMT: web-based UI for editing custom settings (OMG!). scriptproperty.ash goes to lib/, script_settings.ash to relay/!
Update 2008.03.15 13:00 GMT: moved to HTML lib.
Update 2008.03.25 18:15 GMT: added frame to account settings page.
Here's mini-library for using personal script settings. How to use it?
Code:
import <scriptproperty.ash>;
string scriptname = "MyCoolScript";
boolean some_option = to_boolean(get_script_property(scriptname, "SomeOption", "false"));
int some_other_option = to_int(get_script_property(scriptname, "SomeOtherOption", "666"));
string yet_another_option = get_script_property(scriptname, "YetAnotherOption");
// My Cool Code
This code will check preferences for "script_MyCoolScript_SomeOption", "script_MyCoolScript_SomeOtherOption" and "script_MyCoolScript_YetAnotherOption" and set appropriate variables. If such property does not exist, it will be set to default value (first and second example) or to null string (third example).
Visit javascript:void(mainpane.location="script_settings.php"); url for more fun ;-)
Property format is subject to discuss.
Update 2008.03.12 17:10 GMT: web-based UI for editing custom settings (OMG!). scriptproperty.ash goes to lib/, script_settings.ash to relay/!
Update 2008.03.15 13:00 GMT: moved to HTML lib.
Update 2008.03.25 18:15 GMT: added frame to account settings page.