From: friendica Date: Fri, 8 Jun 2012 03:45:29 +0000 (-0700) Subject: autofollow StatusNet mentions/follows X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7ed901c01240f2c48dcd291d5c854998612ad4ef;p=friendica-addons.git autofollow StatusNet mentions/follows --- diff --git a/snautofollow.tgz b/snautofollow.tgz new file mode 100644 index 00000000..57e6db73 Binary files /dev/null and b/snautofollow.tgz differ 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 .= '
'; + +}