mirror of
https://github.com/friendica/friendica
synced 2025-04-30 09:44:22 +02:00
Unifiy the creation of photo links
This commit is contained in:
parent
4c40bc164d
commit
7d91cc73de
5 changed files with 34 additions and 14 deletions
|
@ -316,4 +316,32 @@ class Images
|
|||
|
||||
return ['width' => $dest_width, 'height' => $dest_height];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a link to a an image link with a preview
|
||||
*
|
||||
* @param string $resource_id
|
||||
* @param string $nickname
|
||||
* @param integer $preview
|
||||
* @param string $ext
|
||||
* @param string $description
|
||||
* @return string
|
||||
*/
|
||||
public static function getImageUrl(string $resource_id, string $nickname, int $preview, string $ext, string $description): string
|
||||
{
|
||||
return '[url=' . DI::baseUrl() . '/photos/' . $nickname . '/image/' . $resource_id . '][img=' . DI::baseUrl() . '/photo/' . $resource_id . '-' . $preview. '.' . $ext . ']' . $description . '[/img][/url]';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a link to a picture with a preview
|
||||
*
|
||||
* @param string $photo
|
||||
* @param string $preview
|
||||
* @param string $description
|
||||
* @return string
|
||||
*/
|
||||
public static function getPictureUrl(string $photo, string $preview, string $description): string
|
||||
{
|
||||
return '[url=' . $photo . '][img=' . $preview . ']' . $description . '[/img][/url]';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue