X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FPhoto.php;h=4a9e11c55472deb4123d375dbcdf8c80284185ef;hb=e0a763b07f12ecb7389925100959f9ac6ebe85a8;hp=372e875ea7b587e5f4dcd35802fa68d834c72976;hpb=f3fc1f36caf9139f8d72611b85849a2b7e6759c3;p=friendica.git diff --git a/src/Model/Photo.php b/src/Model/Photo.php index 372e875ea7..4a9e11c554 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -16,8 +16,6 @@ use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\Security; -require_once 'include/dba.php'; - /** * Class to handle photo dabatase table */ @@ -97,7 +95,7 @@ class Photo $photo = DBA::selectFirst( 'photo', ['resource-id'], ['uid' => $uid, 'contact-id' => $cid, 'scale' => 4, 'album' => 'Contact Photos'] ); - if (x($photo['resource-id'])) { + if (!empty($photo['resource-id'])) { $hash = $photo['resource-id']; } else { $hash = self::newResource(); @@ -115,7 +113,7 @@ class Photo $type = Image::guessType($image_url, true); $Image = new Image($img_str, $type); if ($Image->isValid()) { - $Image->scaleToSquare(175); + $Image->scaleToSquare(300); $r = self::store($Image, $uid, $cid, $hash, $filename, 'Contact Photos', 4); @@ -172,7 +170,7 @@ class Photo } if ($photo_failure) { - $image_url = System::baseUrl() . '/images/person-175.jpg'; + $image_url = System::baseUrl() . '/images/person-300.jpg'; $thumb = System::baseUrl() . '/images/person-80.jpg'; $micro = System::baseUrl() . '/images/person-48.jpg'; } @@ -253,7 +251,7 @@ class Photo DBA::escape(L10n::t('Contact Photos')) ); } - Cache::set($key, $albums, CACHE_DAY); + Cache::set($key, $albums, Cache::DAY); } return $albums; } @@ -265,7 +263,7 @@ class Photo public static function clearAlbumCache($uid) { $key = "photo_albums:".$uid.":".local_user().":".remote_user(); - Cache::set($key, null, CACHE_DAY); + Cache::set($key, null, Cache::DAY); } /**