]> git.mxchange.org Git - friendica-addons.git/commitdiff
Showmore: A little html bug was fixed (missing </div>)
authorMichael Vogel <icarus@dabo.de>
Fri, 6 Apr 2012 21:36:41 +0000 (23:36 +0200)
committerMichael Vogel <icarus@dabo.de>
Fri, 6 Apr 2012 21:36:41 +0000 (23:36 +0200)
facebook/facebook.php
showmore/showmore.php

index 59acfa978181b8954e3aa4af346bf652a1cd3f70..c5378e546aa880a40b6f8a2dc9c202c987684ca1 100755 (executable)
@@ -1365,21 +1365,26 @@ function fb_consume_stream($uid,$j,$wall = false) {
                        if($entry->description)
                                $quote = $entry->description;
 
-                       foreach ($entry->properties as $property)
-                               $quote .= "\n".$property->name.": [url=".$property->href."]".$property->text."[/url]";
+                       if ($entry->properties)
+                               foreach ($entry->properties as $property)
+                                       $quote .= "\n".$property->name.": [url=".$property->href."]".$property->text."[/url]";
 
                        if ($quote)
                                $datarray['body'] .= "\n[quote]".$quote."[/quote]";
 
-                       if($entry->picture && $entry->link) {
-                               $datarray['body'] .= "\n" . '[url=' . $entry->link . '][img]' . $entry->picture . '[/img][/url]';
-                       }
-                       else {
-                               if($entry->picture)
-                                       $datarray['body'] .= "\n" . '[img]' . $entry->picture . '[/img]';
-                               // if just a link, it may be a wall photo - check
-                               if($entry->link)
-                                       $datarray['body'] .= fb_get_photo($uid,$entry->link);
+                       // Only import the picture when the message is no video
+                       // oembed display a picture of the video as well 
+                       if ($entry->type != "video") {
+                               if($entry->picture && $entry->link) {
+                                       $datarray['body'] .= "\n" . '[url=' . $entry->link . '][img]'.$entry->picture.'[/img][/url]';   
+                               }
+                               else {
+                                       if($entry->picture)
+                                               $datarray['body'] .= "\n" . '[img]' . $entry->picture . '[/img]';
+                                       // if just a link, it may be a wall photo - check
+                                       if($entry->link)
+                                               $datarray['body'] .= fb_get_photo($uid,$entry->link);
+                               }
                        }
 
                        if(trim($datarray['body']) == '') {
@@ -1392,9 +1397,10 @@ function fb_consume_stream($uid,$j,$wall = false) {
                        if ($entry->icon)
                                $datarray['body'] .= "[img]".$entry->icon."[/img] &nbsp; ";
 
-                       foreach ($entry->actions as $action)
-                               if (($action->name != "Comment") and ($action->name != "Like"))
-                                       $datarray['body'] .= "[url=".$action->link."]".$action->name."[/url] &nbsp; ";
+                       if ($entry->actions)
+                               foreach ($entry->actions as $action)
+                                       if (($action->name != "Comment") and ($action->name != "Like"))
+                                               $datarray['body'] .= "[url=".$action->link."]".$action->name."[/url] &nbsp; ";
 
                        $datarray['body'] = trim($datarray['body']);
 
index 6aeb6ff3ba770ae45d503708c116707ead597cad..2b4d5d0fcce8337670120eb0e0ae5ae9633bf831 100755 (executable)
@@ -46,7 +46,8 @@ function showmore_addon_settings(&$a,&$s) {
        $s .= '</div><div class="clear"></div>';
 
        $s .= '<div class="settings-submit-wrapper" ><input type="submit" id="showmore-submit" name="showmore-submit" class="settings-submit" value="' . t('Submit') . '" /></div>';
-//     $s .= '<div class="showmore-desc">' . t('Use /expression/ to provide regular expressions') . '</div></div>';
+//     $s .= '<div class="showmore-desc">' . t('Use /expression/ to provide regular expressions') . '</div>';
+       $s .= '</div>';
 
        return;
 }