From ca6e43ef495f360541ca78d3637697c6c87e6646 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 4 Feb 2012 03:56:55 -0800 Subject: [PATCH] provide ability to disable n-s-f-w filter as a personal preference --- nsfw.tgz | Bin 1524 -> 1687 bytes nsfw/nsfw.css | 4 ++-- nsfw/nsfw.php | 12 +++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/nsfw.tgz b/nsfw.tgz index 4e465f683b496c0bc7a08d0cc30f6c0227105cf6..8a1e3a3ca1e55134adbce3d0840ae29d6b182d3d 100755 GIT binary patch literal 1687 zcmV;I259*oiwFP#9W74)1MOH_Z`(E$_N(@;XS6cYcYgM5C#C~bXgd{0IWkLKYORpLKj9xPBAGTk; zdi5MWJ)>}yfAz2F3-LsA==={ppZ{*RXY$`}cL%*L=D*wPb}P_&B7aKqKhMAQy-NN; zL?$$9fO(*tOd@K=;CHJUMlq2?h-fH}tm+L5m!6dt;bs#(d7NS9hKT?`R#HR)`$FgpioB;vbkC;CP z8AF^Nk(r@L|f>-Kv4 z{r_3y_%-I;vMlfAOAB7Y2eP0;(4>G*Z*gx;St41?hj1E45lOJYlUPUrx^EdLNs`7% z%7|RGG+O>fQ=zTe&6aw8lgU|}4&gnUQ+U4&H5|{ROopCU1i$IW3l9-P7Ey13$|uSi z|2)eIGwv%_K$YtlX-1MLa_egIPwA8iNz?Hxj_0nEAk&bPjwf+&=QO|}K@fAVRO)J2 zLHuD>yc`h zV?e_Rm{6upy$-LzabO4z>3XZL!6P<35%*3}`9uA@&w=jt@{4i7q?)M*ILi=tJrJNA_J(bh~1 zS7@$2DH0=1^(57jnz>aKitBeRTOF)Q)4ZR4~OEjsAijP?39k6q!?8_&Hdej0T%E*XwWsl7 zL9l6%eQ;k1z@%99SW1ZmB6J`g6#+BBTJw|^pTEu5u2*j6Y&y1C@H(_!;FnguvjWY{ zwx|*~$=x;XnYZ@J`Q^Zx$IGFIkxNU#fS&776EL-)!qbQHSX`@%eEf>LzDI9yKM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3jdEl@G1B-Kd0txb*ti1bxK6OmXp&{& zj=3I4I%7&xIhhNw2!jGU4Uu#*70FG|hJYlA;L+MqH_KMf8t=~0rmn2So5w^^t+Cgs zht%11)9OS}wYewVgQetaz?A&Igl1FQzXs+a|jwM(jM8>pYuNk_4B~8AEVvh9Az%Z0s)$`2hN+ zpkrUt4?4mpn-6nI)3F~w$Euo9J(=PdE~PmE9SEZPz@d;~4tyNz2_s`44~q}ciCOe7 zr23eYL0=VL<3Q_i8`0yII`OATV%W_ z^@?NGz)F67;Mk7WcdtlR(kk7~W+$-OTUQ-n$S11^#~CFUv)lNROt|M+jTW3#?mG9} zuD^8tZehjayQPn7UJC^QJ+rG0FcVPiY3n0i)^Ec)AAjIris%PyS;`Ea$fN@2$Q4T{ z*3hiXaL6yW>$75Esxets`t9ethHWub>zLZs@j&M=+uM_0-<|z_9;|>9T-q+(QeReM zZM<*i>w4VA<&G)87UQW14I1X`)pdav`zyRN+mK(q`^9kHZU(s8?AIf!%b1s0=Bj)x zP8-2LX&1K+7S}JF79u6;z(i#tp&@d&t8K?lGfeXeBmO5hq0{VG&|UY~7(+^s+xZ*g zk`9ef5>?uzm6iBf6#2xxD#Js2q?ZxF zM?3kh^~uQFzESmu6bG*vpFRj~AC_bDsysE1$MC`x&Z^u69v-lrMB!DI>(my}PYQP7 zbn{sn>^N{?wTG-Zw(gUi-eW&u3ZK6>BjAG5Bk-NUmH299!4ZI~(Qo}aXsDrv8fvJa ah8k+9p@tf2sG)|w2l^WXr3S44C;$K~IR~}? diff --git a/nsfw/nsfw.css b/nsfw/nsfw.css index 57bb570e..a8c1bfe8 100755 --- a/nsfw/nsfw.css +++ b/nsfw/nsfw.css @@ -1,11 +1,11 @@ -#nsfw-label { +#nsfw-label, #nsfw-enable-label { float: left; width: 300px; margin-top: 10px; } -#nsfw-words { +#nsfw-words, #nsfw-enable { float: left; margin-top: 10px; } diff --git a/nsfw/nsfw.php b/nsfw/nsfw.php index fdfd5a27..a5b3ede1 100755 --- a/nsfw/nsfw.php +++ b/nsfw/nsfw.php @@ -38,7 +38,7 @@ function nsfw_addon_settings(&$a,&$s) { $a->page['htmlhead'] .= '' . "\r\n"; - + $enable_checked = (intval(get_pconfig(local_user(),'nsfw','disable')) ? '' : ' checked="checked" '); $words = get_pconfig(local_user(),'nsfw','words'); if(! $words) $words = 'nsfw,'; @@ -46,6 +46,10 @@ function nsfw_addon_settings(&$a,&$s) { $s .= '
'; $s .= '

' . t('"Not Safe For Work" Settings') . '

'; $s .= '
'; + + $s .= ''; + $s .= ''; + $s .= '
'; $s .= ''; $s .= ''; $s .= '
'; @@ -64,6 +68,9 @@ function nsfw_addon_settings_post(&$a,&$b) { if($_POST['nsfw-submit']) { set_pconfig(local_user(),'nsfw','words',trim($_POST['nsfw-words'])); + $enable = ((x($_POST,'nsfw-enable')) ? intval($_POST['nsfw-enable']) : 0); + $disable = 1-$enable; + set_pconfig(local_user(),'nsfw','disable', $disable); info( t('NSFW Settings saved.') . EOL); } } @@ -71,6 +78,9 @@ function nsfw_addon_settings_post(&$a,&$b) { function nsfw_prepare_body(&$a,&$b) { $words = null; + if(get_pconfig(local_user(),'nsfw','disable')) + return; + if(local_user()) { $words = get_pconfig(local_user(),'nsfw','words'); } -- 2.39.5