mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Users, Groups: Fix URL avatar output
This commit fixes the avatar URL output for those who visit the website with a port (e.g. ovk.domain.tld:1337)
This commit is contained in:
parent
20196cc259
commit
e5afb0fc88
2 changed files with 2 additions and 12 deletions
|
@ -40,7 +40,7 @@ class Club extends RowModel
|
|||
|
||||
function getAvatarUrl(): string
|
||||
{
|
||||
$serverUrl = ovk_scheme(true) . $_SERVER["SERVER_NAME"];
|
||||
$serverUrl = ovk_scheme(true) . $_SERVER["HTTP_HOST"];
|
||||
$avPhoto = $this->getAvatarPhoto();
|
||||
|
||||
return is_null($avPhoto) ? "$serverUrl/assets/packages/static/openvk/img/camera_200.png" : $avPhoto->getURL();
|
||||
|
@ -64,16 +64,6 @@ class Club extends RowModel
|
|||
else
|
||||
return "/club" . $this->getId();
|
||||
}
|
||||
/*
|
||||
function getAvatarUrl(): string
|
||||
{
|
||||
$avAlbum = (new Albums)->getUserAvatarAlbum($this);
|
||||
$avCount = $avAlbum->getPhotosCount();
|
||||
$avPhotos = $avAlbum->getPhotos($avCount, 1);
|
||||
$avPhoto = iterator_to_array($avPhotos)[0] ?? NULL;
|
||||
|
||||
return is_null($avPhoto) ? "/assets/packages/static/openvk/img/camera_200.png" : $avPhoto->getURL();
|
||||
} */
|
||||
|
||||
function getName(): string
|
||||
{
|
||||
|
|
|
@ -104,7 +104,7 @@ class User extends RowModel
|
|||
|
||||
function getAvatarUrl(): string
|
||||
{
|
||||
$serverUrl = ovk_scheme(true) . $_SERVER["SERVER_NAME"];
|
||||
$serverUrl = ovk_scheme(true) . $_SERVER["HTTP_HOST"];
|
||||
|
||||
if($this->getRecord()->deleted)
|
||||
return "$serverUrl/assets/packages/static/openvk/img/camera_200.png";
|
||||
|
|
Loading…
Reference in a new issue