From 7ed901c01240f2c48dcd291d5c854998612ad4ef Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 7 Jun 2012 20:45:29 -0700 Subject: [PATCH] autofollow StatusNet mentions/follows --- snautofollow.tgz | Bin 0 -> 1112 bytes snautofollow/snautofollow.css | 14 ++++++++ snautofollow/snautofollow.php | 66 ++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 snautofollow.tgz create mode 100644 snautofollow/snautofollow.css create mode 100644 snautofollow/snautofollow.php diff --git a/snautofollow.tgz b/snautofollow.tgz new file mode 100644 index 0000000000000000000000000000000000000000..57e6db73b0427419cc597cc28880e7fc75db5960 GIT binary patch literal 1112 zcmV-e1gHBSiwFQgb(X&}!uQ2?!k1Z$?Qn0P=g zT~CgOCnqN_;nNEu+vR`vr5|M3Gue2G|KW60^FN#pa3B8;hAkL8ll@2WKj**G>HN4$ zdykV9%}TFV5NCua5QzOEpq!R1Qc z+);;;o&P#=3xkLIKaJC8vhhU!AB{)jz4?#*KeGM*5;%K-jRgP;9{o= z%<9iH3lvK=lVS!x;Z{O43!ti*NHHoxkP%=ab)E^TA*C|q6s}_l2^Hp`UrNJ9=0@e8 zRAq&_VSixWQEM#K49?jlh4Y#TIE%GTXTHDXrXR?}PnC=qr+$LM3v(KO@yExR66GQ= z=3uvymrS5*oO@lIL!GvwYnExMma&wVo*PIZXrQH9W>jk?)|q<Lu(C{LrvI&}QVH5CChGms=VCYhb}n8f0pDQf#Zu6a^$y74fq5v>!6NSm;4&b5 znP*gCj=p>WT)OcNmVdmz_;A>;+RO4)!q8l|+i4@mI#&WMx6!~d#Q-C=_I8!w=?$hJ zaSvTtw#TwiR`iT}$b`Nkyt4GMVafg6HCbdLk{)Q!y(mt%bVWPo$=W@R1ptBtwCK|I0qHHwnU8L)6CP6%x}Tvx2ltFKaS4j@xpQm90nnS2 z&K*r}w2xn<4#bK^bH~M4jjA;!e?>ByD^ucqaQ&z136+?`u7l$#WMuAOcR1iL%%by2 zeG*O;^KT|dj4;TR!a-JyIBI5{39sZEu83k}#p~F14Z$4N|EMww>LYJY*?bNW;Tbj5 z?As|ePWK&H7GGdAL;|2Kb*g<38y#M*vKs2 z0V=8EE*T8j6$G4Q8B$o$-&8m;LKk-rvUX)&65)VPRom eVPRomVPRomVPRomVPRomVevPz>Dx*GC;$Mtjw><% literal 0 HcmV?d00001 diff --git a/snautofollow/snautofollow.css b/snautofollow/snautofollow.css new file mode 100644 index 00000000..243ecaa8 --- /dev/null +++ b/snautofollow/snautofollow.css @@ -0,0 +1,14 @@ + + + +#snautofollow-label { + float: left; + width: 200px; + margin-bottom: 25px; +} + +#snautofollow-checkbox { + float: left; +} + + diff --git a/snautofollow/snautofollow.php b/snautofollow/snautofollow.php new file mode 100644 index 00000000..2efc2128 --- /dev/null +++ b/snautofollow/snautofollow.php @@ -0,0 +1,66 @@ + + * + * + */ + + +function snautofollow_install() { + + register_hook('connector_settings', 'addon/snautofollow/snautofollow.php', 'snautofollow_settings'); + register_hook('connector_settings_post', 'addon/snautofollow/snautofollow.php', 'snautofollow_settings_post'); + +} + + +function snautofollow_uninstall() { + unregister_hook('connector_settings', 'addon/snautofollow/snautofollow.php', 'snautofollow_settings'); + unregister_hook('connector_settings_post', 'addon/snautofollow/snautofollow.php', 'snautofollow_settings_post'); + +} + + +function snautofollow_settings_post($a,$post) { + if(! local_user() || (! x($_POST,'snautofollow-submit'))) + return; + + set_pconfig(local_user(),'system','ostatus_autofriend',intval($_POST['snautofollow'])); + info( t('StatusNet AutoFollow settings updated.') . EOL); +} + +function snautofollow_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"; + + /* Get the current state of our config variable */ + + $snautofollow = get_pconfig(local_user(),'system','ostatus_autofriend'); + if($snautofollow === false) + $snautofollow = false; + + $snautofollow_checked = (($snautofollow) ? ' checked="checked" ' : ''); + + + /* Add some HTML to the existing form */ + + $s .= '
'; + $s .= '

' . t('StatusNet AutoFollow Settings') . '

'; + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + /* provide a submit button */ + + $s .= '
'; + +}