mirror of
https://github.com/friendica/friendica
synced 2025-05-02 16:24:24 +02:00
Use a constant for the profile photo album
This commit is contained in:
parent
f05fecaec1
commit
a33185f835
7 changed files with 17 additions and 53 deletions
|
@ -45,6 +45,7 @@ use Friendica\Util\Strings;
|
|||
class Photo
|
||||
{
|
||||
const CONTACT_PHOTOS = 'Contact Photos';
|
||||
const PROFILE_PHOTOS = 'Profile Photos';
|
||||
|
||||
const DEFAULT = 0;
|
||||
const USER_AVATAR = 10;
|
||||
|
@ -563,25 +564,6 @@ class Photo
|
|||
$image_url = DI::baseUrl() . "/photo/" . $resource_id . "-4." . $Image->getExt() . $suffix;
|
||||
$thumb = DI::baseUrl() . "/photo/" . $resource_id . "-5." . $Image->getExt() . $suffix;
|
||||
$micro = DI::baseUrl() . "/photo/" . $resource_id . "-6." . $Image->getExt() . $suffix;
|
||||
|
||||
// Remove the cached photo
|
||||
$a = DI::app();
|
||||
$basepath = $a->getBasePath();
|
||||
|
||||
if (is_dir($basepath . "/photo")) {
|
||||
$filename = $basepath . "/photo/" . $resource_id . "-4." . $Image->getExt();
|
||||
if (file_exists($filename)) {
|
||||
unlink($filename);
|
||||
}
|
||||
$filename = $basepath . "/photo/" . $resource_id . "-5." . $Image->getExt();
|
||||
if (file_exists($filename)) {
|
||||
unlink($filename);
|
||||
}
|
||||
$filename = $basepath . "/photo/" . $resource_id . "-6." . $Image->getExt();
|
||||
if (file_exists($filename)) {
|
||||
unlink($filename);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$photo_failure = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue