From: Michael Date: Mon, 6 Mar 2023 00:49:30 +0000 (+0000) Subject: Access media via index X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=878538c151b75e54d1f795f6b17e8fd976b28cb7;p=friendica-addons.git Access media via index --- diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index c71b1cfb..fb844ffb 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -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';