]> git.mxchange.org Git - friendica-addons.git/commitdiff
Merge pull request #88 from fermionic/20121222-support-smarty3-template-engine
authorfriendica <info@friendica.com>
Sun, 23 Dec 2012 07:05:34 +0000 (23:05 -0800)
committerfriendica <info@friendica.com>
Sun, 23 Dec 2012 07:05:34 +0000 (23:05 -0800)
update addons to support Smarty3

fromgplus/README
fromgplus/fromgplus.php
privacy_image_cache/privacy_image_cache.php

index db5bb38e0613c3917afe1de8b721540c0b564faa..82a29f6635e414dcc9c6aef6b2e11beb48c3d4e6 100644 (file)
@@ -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.
index a6760ca50eda8764af73b7524ede4cb4185652bc..f7841300f3531d5a3f7bd5d15082eaf59b932229 100644 (file)
@@ -327,22 +327,27 @@ function fromgplus_fetch($a, $uid) {
 
                                case "activity":
                                        $post = fromgplus_html2bbcode($item->annotation)."\n";
-                                       $post .= fromgplus_html2bbcode("&#x2672;");
-                                       //$post .= html2bbcode("&#x267B;");
-                                       //$post .= fromgplus_html2bbcode("&#x25CC;");
-                                       $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("'", "&#039;",$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]";
+                                       } else {
+                                               $post .= fromgplus_html2bbcode("&#x2672;");
+                                               $post .= " [url=".$item->object->actor->url."]".$item->object->actor->displayName."[/url] \n";
+                                               $post .= fromgplus_html2bbcode($item->object->content);
 
-                                       //$post .= "[/share]";
+                                               if (is_array($item->object->attachments))
+                                                       $post .= "\n".trim(fromgplus_handleattachments($item));
+                                       }
 
                                        if (isset($item->address))
                                                $location = $item->address;
index a47f0e1ac5294b7aa0cf405ed619afa4655f79f9..3be4262088310dbf8751c9ff791d071b115deefa 100644 (file)
@@ -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);
 }
 
 /**