]> git.mxchange.org Git - friendica-addons.git/commitdiff
gpluspost: Optimizations to the RSS feed.
authorMichael Vogel <icarus@dabo.de>
Thu, 14 Mar 2013 22:16:35 +0000 (23:16 +0100)
committerMichael Vogel <icarus@dabo.de>
Thu, 14 Mar 2013 22:16:35 +0000 (23:16 +0100)
gpluspost/gpluspost.php

index 9f0f010275c305268bae9694b0613cdac2cabfc9..db240aa3eeee20229e0645ec3d61ba4237129ffa 100644 (file)
@@ -327,6 +327,16 @@ function gpluspost_feeditem($pid, $uid) {
                                $link = current($links);
                        }
                        $multiplelinks = (sizeof($links) > 1);
+
+                       if ($multiplelinks) {
+                               $html2 = bbcode($msg, false, false);
+                               $links2 = collecturls($html2);
+                               if (sizeof($links2) > 0) {
+                                       reset($links2);
+                                       $link = current($links2);
+                                       $multiplelinks = (sizeof($links2) > 1);
+                               }
+                       }
                }
 
                $msglink = "";
@@ -350,8 +360,8 @@ function gpluspost_feeditem($pid, $uid) {
                        $title = $lines[0];
                }
 
-               if ($image != $msglink)
-                       $html = trim(str_replace($msglink, "", $html));
+               //if ($image != $msglink)
+               //      $html = trim(str_replace($msglink, "", $html));
 
                $title = trim(str_replace($msglink, "", $title));
 
@@ -360,6 +370,8 @@ function gpluspost_feeditem($pid, $uid) {
                if ($uid == 0)
                        $title = $item["author-name"].": ".$title;
 
+               $msglink = htmlspecialchars(html_entity_decode($msglink));
+
                $title = str_replace("&", "&amp;", $title);
                //$html = str_replace("&", "&amp;", $html);