diff --git a/nsfw.tgz b/nsfw.tgz index 294f9ec8..e7c959e8 100644 Binary files a/nsfw.tgz and b/nsfw.tgz differ diff --git a/nsfw/nsfw.css b/nsfw/nsfw.css new file mode 100644 index 00000000..548b63ae --- /dev/null +++ b/nsfw/nsfw.css @@ -0,0 +1,16 @@ + +#nsfw-label { + float: left; + width: 300px; + margin-top: 10px; +} + +#nsfw-words { + float: left; + margin-top: 10px; +} + +#nsfw-submit { + margin-top: 15px; +} + diff --git a/nsfw/nsfw.php b/nsfw/nsfw.php index 776df194..dba9f1e8 100644 --- a/nsfw/nsfw.php +++ b/nsfw/nsfw.php @@ -11,16 +11,90 @@ function nsfw_install() { register_hook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body'); + register_hook('plugin_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings'); + register_hook('plugin_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post'); + } function nsfw_uninstall() { unregister_hook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body'); + unregister_hook('plugin_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings'); + unregister_hook('plugin_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post'); + +} + + + + + +function nsfw_addon_settings(&$a,&$s) { + + + if(! local_user()) + return; + + /* Add our stylesheet to the page so we can make our settings look nice */ + + $a->page['htmlhead'] .= '' . "\r\n"; + + + $words = get_pconfig(local_user(),'nsfw','words'); + if(! $words) + $words = 'nsfw,'; + + $s .= '