X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=fromgplus%2Ffromgplus.php;h=0699f75bbf178d3d6a64191c5b830d26e29128c2;hb=31823eb729d4a7c14d40d632ff592cd1805e9ca8;hp=a6d3d84ff05d7fe9da6f7660a9afc0581b06e49b;hpb=6509bdcb99c78534080741a8de9ae41e87139cd1;p=friendica-addons.git diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index a6d3d84f..0699f75b 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -9,6 +9,14 @@ define('FROMGPLUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes +use Friendica\Core\Config; +use Friendica\Core\PConfig; +use Friendica\Object\Image; + +require_once 'mod/share.php'; +require_once 'mod/parse_url.php'; +require_once 'include/text.php'; + function fromgplus_install() { register_hook('connector_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings'); register_hook('connector_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post'); @@ -30,11 +38,23 @@ function fromgplus_addon_settings(&$a,&$s) { if(! local_user()) return; - $enable_checked = (intval(get_pconfig(local_user(),'fromgplus','enable')) ? ' checked="checked"' : ''); - $account = get_pconfig(local_user(),'fromgplus','account'); + // If "gpluspost" is installed as well, then the settings are displayed there + $result = q("SELECT `installed` FROM `addon` WHERE `name` = 'gpluspost' AND `installed`"); + if (count($result) > 0) + return; + + $enable_checked = (intval(PConfig::get(local_user(),'fromgplus','enable')) ? ' checked="checked"' : ''); + $keywords_checked = (intval(PConfig::get(local_user(), 'fromgplus', 'keywords')) ? ' checked="checked"' : ''); + $account = PConfig::get(local_user(),'fromgplus','account'); + + $s .= ''; + $s .= '

'. t('Google+ Mirror').'

'; + $s .= '
'; + $s .= '