Skip to content

Commit

Permalink
[Vk2Bridge] Handling albums (#4163)
Browse files Browse the repository at this point in the history
  • Loading branch information
em92 authored Jul 28, 2024
1 parent bba225d commit d28a0fd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bridges/Vk2Bridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ protected function generateContentFromPost($post)
$ret .= "* {$text}: {$votes} ({$rate}%)<br />";
}
$ret .= '</p>';
} elseif ($attachment['type'] == 'album') {
$album = $attachment['album'];
$url = "https://vk.com/album{$album['owner_id']}_{$album['id']}";
$title = 'Альбом: ' . $album['title'];
$photo = $this->getImageURLWithLargestWidth($album['thumb']['sizes']);
$ret .= "<p><a href='{$url}'><img src='{$photo}' alt='{$title}'><br>{$title}</a></p>";
} elseif (!in_array($attachment['type'], ['video', 'audio', 'doc'])) {
$ret .= "<p>Unknown attachment type: {$attachment['type']}</p>";
}
Expand Down

0 comments on commit d28a0fd

Please sign in to comment.