]> git.mxchange.org Git - friendica.git/commitdiff
if photo is uploaded to "profile photos" album it could not be made into profile...
authorFriendika <info@friendika.com>
Thu, 15 Sep 2011 10:06:43 +0000 (03:06 -0700)
committerFriendika <info@friendika.com>
Thu, 15 Sep 2011 10:06:43 +0000 (03:06 -0700)
mod/profile_photo.php

index 8dc8966532d90e80309cd650403578144b085aa5..4de3aaa3e0c255e007d1b7590e9ef9ae3ecd788e 100644 (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()));