mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
Fix avatar erros
This commit is contained in:
parent
19000c2f03
commit
574f4918e5
3 changed files with 11 additions and 15 deletions
|
@ -40,9 +40,7 @@ class Club extends RowModel
|
|||
|
||||
function getAvatarUrl(): string
|
||||
{
|
||||
$url = ((!empty($_SERVER['HTTPS'])) ? 'https' : 'http') . '://' . $_SERVER['SERVER_NAME'] . '/';
|
||||
$url = explode('?', $url);
|
||||
$serverUrl = $url[0];
|
||||
$serverUrl = ovk_scheme(true) . $_SERVER["SERVER_NAME"];
|
||||
$avPhoto = $this->getAvatarPhoto();
|
||||
|
||||
return is_null($avPhoto) ? "$serverUrl/assets/packages/static/openvk/img/camera_200.png" : $avPhoto->getURL();
|
||||
|
|
|
@ -103,9 +103,7 @@ class User extends RowModel
|
|||
|
||||
function getAvatarUrl(): string
|
||||
{
|
||||
$url = ((!empty($_SERVER['HTTPS'])) ? 'https' : 'http') . '://' . $_SERVER['SERVER_NAME'];
|
||||
$url = explode('?', $url);
|
||||
$serverUrl = $url[0];
|
||||
$serverUrl = ovk_scheme(true) . $_SERVER["SERVER_NAME"];
|
||||
|
||||
if($this->getRecord()->deleted)
|
||||
return "$serverUrl/assets/packages/static/openvk/img/camera_200.png";
|
||||
|
@ -370,20 +368,16 @@ class User extends RowModel
|
|||
|
||||
if(!$this->getRecord()->status) {
|
||||
$unfilled[] = "status";
|
||||
$incompleteness += 10;
|
||||
$incompleteness += 15;
|
||||
}
|
||||
if(!$this->getRecord()->telegram) {
|
||||
$unfilled[] = "telegram";
|
||||
$incompleteness += 10;
|
||||
$incompleteness += 15;
|
||||
}
|
||||
if(!$this->getRecord()->email) {
|
||||
$unfilled[] = "email";
|
||||
$incompleteness += 20;
|
||||
}
|
||||
if(!$this->getRecord()->phone) {
|
||||
$unfilled[] = "phone";
|
||||
$incompleteness += 20;
|
||||
}
|
||||
if(!$this->getRecord()->city) {
|
||||
$unfilled[] = "city";
|
||||
$incompleteness += 20;
|
||||
|
|
|
@ -156,9 +156,13 @@ function ovk_is_ssl(): bool
|
|||
return $GLOBALS["requestIsSSL"];
|
||||
}
|
||||
|
||||
function ovk_scheme(): string
|
||||
function ovk_scheme(bool $with_slashes = false): string
|
||||
{
|
||||
return ovk_is_ssl() ? "https" : "http";
|
||||
$scheme = ovk_is_ssl() ? "https" : "http";
|
||||
if($with_slashes)
|
||||
$scheme .= "://";
|
||||
|
||||
return $scheme;
|
||||
}
|
||||
|
||||
return (function() {
|
||||
|
|
Loading…
Reference in a new issue