Browse Source

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

pull/1/head
Friendika 9 years ago
parent
commit
8f1e2efd5b
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      mod/profile_photo.php

+ 7
- 1
mod/profile_photo.php View File

@ -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()));


Loading…
Cancel
Save