From bd5916789cbc2c6218d3e336730cb347288e0f5a Mon Sep 17 00:00:00 2001 From: ozhozh Date: Thu, 1 Jul 2010 20:48:59 +0000 Subject: [PATCH] Core sample plugin: administration page git-svn-id: http://yourls.googlecode.com/svn/trunk@451 12232710-3e20-11de-b438-597f59cd7555 --- user/plugins/sample-page/plugin.php | 50 +++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 user/plugins/sample-page/plugin.php diff --git a/user/plugins/sample-page/plugin.php b/user/plugins/sample-page/plugin.php new file mode 100644 index 0000000..1001a89 --- /dev/null +++ b/user/plugins/sample-page/plugin.php @@ -0,0 +1,50 @@ +Sample Plugin Administration Page +

This plugin stores an integer in the option database

+
+

+

+
+HTML; +} + +// Update option in database +function ozh_yourls_samplepage_update_option() { + $in = $_POST['test_option']; + + if( $in ) { + // Validate test_option. ALWAYS validate and sanitize user input. + // Here, we want an integer + $in = intval( $in); + + // Update value in database + yourls_update_option( 'test_option', $in ); + } +} \ No newline at end of file -- 2.45.0