diff --git a/fromgplus/README b/fromgplus/README index db5bb38e0..82a29f663 100644 --- a/fromgplus/README +++ b/fromgplus/README @@ -7,4 +7,9 @@ $a->config['fromgplus']['poll_interval'] = 10; You need an API key for "Simple API Access". -You get it via https://code.google.com/apis/console/ and then "API Access". +- You go to https://code.google.com/apis/console/ +- Then you go to "Services" and activate "Google+ API". +- After that you go to "API Access". +- At the bottom of the page you see "Simple API Access". + +The value after "API key:" is the key that you need. diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index a6760ca50..f7841300f 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -327,22 +327,27 @@ function fromgplus_fetch($a, $uid) { case "activity": $post = fromgplus_html2bbcode($item->annotation)."\n"; - $post .= fromgplus_html2bbcode("♲"); - //$post .= html2bbcode("♻"); - //$post .= fromgplus_html2bbcode("◌"); - $post .= " [url=".$item->object->actor->url."]".$item->object->actor->displayName."[/url] \n"; - /*$post .= "[share author='".$item->object->actor->displayName. - "' profile='".$item->object->actor->url. - "' avatar='".$item->object->actor->image->url. - "' link='".$item->object->url."']\n";*/ + if (intval(get_config('system','new_share'))) { + $post .= "[share author='".str_replace("'", "'",$item->object->actor->displayName). + "' profile='".$item->object->actor->url. + "' avatar='".$item->object->actor->image->url. + "' link='".$item->object->url."']"; - $post .= fromgplus_html2bbcode($item->object->content); + $post .= fromgplus_html2bbcode($item->object->content); - if (is_array($item->object->attachments)) - $post .= "\n".trim(fromgplus_handleattachments($item)); + if (is_array($item->object->attachments)) + $post .= "\n".trim(fromgplus_handleattachments($item)); - //$post .= "[/share]"; + $post .= "[/share]"; + } else { + $post .= fromgplus_html2bbcode("♲"); + $post .= " [url=".$item->object->actor->url."]".$item->object->actor->displayName."[/url] \n"; + $post .= fromgplus_html2bbcode($item->object->content); + + if (is_array($item->object->attachments)) + $post .= "\n".trim(fromgplus_handleattachments($item)); + } if (isset($item->address)) $location = $item->address; diff --git a/privacy_image_cache/privacy_image_cache.php b/privacy_image_cache/privacy_image_cache.php index a47f0e1ac..3be426208 100644 --- a/privacy_image_cache/privacy_image_cache.php +++ b/privacy_image_cache/privacy_image_cache.php @@ -226,13 +226,21 @@ function privacy_image_cache_cachename($url, $writemode = false) { * @return boolean */ function privacy_image_cache_is_local_image($url) { - if ($url[0] == '/') return true; + if ($url[0] == '/') return true; + if (strtolower(substr($url, 0, 5)) == "data:") return true; + // Check if the cached path would be longer than 255 characters - apache doesn't like it + if (is_dir($_SERVER["DOCUMENT_ROOT"]."/privacy_image_cache")) { + $cachedurl = get_app()->get_baseurl()."/privacy_image_cache/". privacy_image_cache_cachename($url); + if (strlen($url) > 255) + return true; + } + // links normalised - bug #431 - $baseurl = normalise_link(get_app()->get_baseurl()); + $baseurl = normalise_link(get_app()->get_baseurl()); $url = normalise_link($url); - return (substr($url, 0, strlen($baseurl)) == $baseurl); + return (substr($url, 0, strlen($baseurl)) == $baseurl); } /**