X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofile_photo.php;h=4de3aaa3e0c255e007d1b7590e9ef9ae3ecd788e;hb=8bf6a29d4e05af5d461da3f01999785dc12ee7da;hp=b1fd0fc6ef41cc059ad67c8906fb410f94fab755;hpb=0c51305c72acd244dc92bb18c393fdf8fba4889b;p=friendica.git diff --git a/mod/profile_photo.php b/mod/profile_photo.php index b1fd0fc6ef..4de3aaa3e0 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -155,9 +155,15 @@ function profile_photo_content(&$a) { notice( t('Permission denied.') . EOL ); return; } + $havescale = false; + foreach($r as $rr) { + if($rr['scale'] == 5) + $havescale = true; + } + // set an already uloaded photo as profile photo // if photo is in 'Profile Photos', change it in db - if ($r[0]['album']== t('Profile Photos')){ + if (($r[0]['album']== t('Profile Photos')) && ($havescale)){ $r=q("UPDATE `photo` SET `profile`=0 WHERE `profile`=1 AND `uid`=%d", intval(local_user())); @@ -236,7 +242,7 @@ function profile_photo_crop_ui_head(&$a, $ph){ $r = $ph->store(local_user(), 0 , $hash, $filename, t('Profile Photos'), 0 ); if($r) - notice( t('Image uploaded successfully.') . EOL ); + info( t('Image uploaded successfully.') . EOL ); else notice( t('Image upload failed.') . EOL );