if photo is uploaded to "profile photos" album it could not be made into profile photo.
This commit is contained in:
parent
46b220518c
commit
8f1e2efd5b
1 changed files with 7 additions and 1 deletions
|
@ -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()));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue