diff --git a/gpluspost/gpluspost.php b/gpluspost/gpluspost.php index 586e4254..7c69f2c6 100644 --- a/gpluspost/gpluspost.php +++ b/gpluspost/gpluspost.php @@ -43,13 +43,14 @@ function gpluspost_settings(&$a,&$s) { return; $enabled = get_pconfig(local_user(),'gpluspost','post'); - $checked = (($enabled) ? ' checked="checked" ' : ''); $def_enabled = get_pconfig(local_user(),'gpluspost','post_by_default'); - $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); + $noloop_enabled = get_pconfig(local_user(),'gpluspost','no_loop_prevention'); + $noloop_checked = (($noloop_enabled) ? ' checked="checked" ' : ''); + $s .= '
'; $s .= '

' . t('Google+ Post Settings') . '

'; $s .= '
'; @@ -62,11 +63,15 @@ function gpluspost_settings(&$a,&$s) { $s .= ''; $s .= '
'; + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + /* provide a submit button */ $s .= '
'; $s .= 'Register an account at Hootsuite, add your G+ page and add the feed-url there.
'; - //$s .= 'Feed-url: '.$a->get_baseurl().'/gpluspost/'.$a->user["uid"].'
'; $s .= 'Feed-url: '.$a->get_baseurl().'/gpluspost/'.urlencode($a->user["nickname"]).''; } @@ -75,6 +80,7 @@ function gpluspost_settings_post(&$a,&$b) { if(x($_POST,'gpluspost-submit')) { set_pconfig(local_user(),'gpluspost','post',intval($_POST['gpluspost'])); set_pconfig(local_user(),'gpluspost','post_by_default',intval($_POST['gpluspost_bydefault'])); + set_pconfig(local_user(),'gpluspost','no_loop_prevention',intval($_POST['gpluspost_noloopprevention'])); } } @@ -119,8 +125,8 @@ function gpluspost_send(&$a,&$b) { return; // if post comes from Google+ don't send it back - //if($b['app'] == "Google+") - // return; + if (!get_pconfig($b["uid"],'gpluspost','no_loop_prevention') and ($b['app'] == "Google+")) + return; $itemlist = get_pconfig($b["uid"],'gpluspost','itemlist'); $items = explode(",", $itemlist);