]> git.mxchange.org Git - friendica-addons.git/commitdiff
Access media via index
authorMichael <heluecht@pirati.ca>
Mon, 6 Mar 2023 00:49:30 +0000 (00:49 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 6 Mar 2023 00:49:30 +0000 (00:49 +0000)
tumblr/tumblr.php

index c71b1cfb5bcd11b99ffc892dc04fe0afaa132534..fb844ffb70fa1992b1dfe54c9af4dbd8638d9bbb 100644 (file)
@@ -364,33 +364,33 @@ function tumblr_send(array &$b)
                        if (!empty($body)) {
                                $params['caption'] = BBCode::convertForUriId($b['uri-id'], $body, BBCode::CONNECTORS);
                        } elseif (!empty($params['caption'])) {
-                               $params['caption'] = $photo['description'];
+                               $params['caption'] = $media[$photo]['description'];
                        }
-                       $params['source'] = $photo['url'];
+                       $params['source'] = $media[$photo]['url'];
                } elseif ($link != false) {
                        $params['type']        = 'link';
-                       $params['title']       = $link['name'];
-                       $params['url']         = $link['url'];
+                       $params['title']       = $media[$link]['name'];
+                       $params['url']         = $media[$link]['url'];
                        $params['description'] = BBCode::convertForUriId($b['uri-id'], $body, BBCode::CONNECTORS);
 
-                       if (!empty($link['preview'])) {
-                               $params['thumbnail'] = $link['preview'];
+                       if (!empty($media[$link]['preview'])) {
+                               $params['thumbnail'] = $media[$link]['preview'];
                        }
-                       if (!empty($link['description'])) {
-                               $params['excerpt'] = $link['description'];
+                       if (!empty($media[$link]['description'])) {
+                               $params['excerpt'] = $media[$link]['description'];
                        }
-                       if (!empty($link['author-name'])) {
-                               $params['author'] = $link['author-name'];
-                       } elseif (!empty($link['publisher-name'])) {
-                               $params['author'] = $link['publisher-name'];
+                       if (!empty($media[$link]['author-name'])) {
+                               $params['author'] = $media[$link]['author-name'];
+                       } elseif (!empty($media[$link]['publisher-name'])) {
+                               $params['author'] = $media[$link]['publisher-name'];
                        }
                } elseif ($audio != false) {
                        $params['type']         = 'audio';
-                       $params['external_url'] = $audio['url'];
+                       $params['external_url'] = $media[$audio]['url'];
                        $params['caption']      = BBCode::convertForUriId($b['uri-id'], $body, BBCode::CONNECTORS);
                } elseif ($video != false) {
                        $params['type']    = 'video';
-                       $params['embed']   = $video['url'];
+                       $params['embed']   = $media[$video]['url'];
                        $params['caption'] = BBCode::convertForUriId($b['uri-id'], $body, BBCode::CONNECTORS);
                } else {
                        $params['type']  = 'text';