if photo is uploaded to "profile photos" album it could not be made into profile photo.

This commit is contained in:
Friendika 2011-09-15 03:06:43 -07:00
parent 46b220518c
commit 8f1e2efd5b

View file

@ -155,9 +155,15 @@ function profile_photo_content(&$a) {
notice( t('Permission denied.') . EOL ); notice( t('Permission denied.') . EOL );
return; return;
} }
$havescale = false;
foreach($r as $rr) {
if($rr['scale'] == 5)
$havescale = true;
}
// set an already uloaded photo as profile photo // set an already uloaded photo as profile photo
// if photo is in 'Profile Photos', change it in db // 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", $r=q("UPDATE `photo` SET `profile`=0 WHERE `profile`=1 AND `uid`=%d",
intval(local_user())); intval(local_user()));