* */ function yourls_install() { register_hook('plugin_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings'); register_hook('plugin_settings_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post'); } function yourls_uninstall() { unregister_hook('plugin_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings'); unregister_hook('plugin_settings_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post'); set_config('yourls','url1',trim($_POST[''])); set_config('yourls','username1',trim($_POST[''])); set_config('yourls','password1',trim($_POST[''])); set_config('yourls','ssl1',trim($_POST[''])); } function yourls_addon_settings(&$a,&$s) { if(! is_site_admin()) return; /* Add our stylesheet to the page so we can make our settings look nice */ $a->page['htmlhead'] .= '' . "\r\n"; $yourls_url = get_config('yourls','url1'); $yourls_username = get_config('yourls','username1'); $yourls_password = get_config('yourls', 'password1'); $ssl_enabled = get_config('yourls','ssl1'); $ssl_checked = (($ssl_enabled) ? ' checked="checked" ' : ''); $yourls_ssl = get_config('yourls', 'ssl1'); $s .= '