diff options
author | Friendika <info@friendika.com> | 2010-11-04 23:50:32 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2010-11-04 23:50:32 -0700 |
commit | b94cb8d234d70bc534ad1cef767b9f62d10eef26 (patch) | |
tree | 9e8cf0d529421c7b8d8e389478be8c4b196d11e6 /include | |
parent | 71ae08d506130e45f68cf4e09d71f3a1c2e2d782 (diff) | |
download | volse-hubzilla-b94cb8d234d70bc534ad1cef767b9f62d10eef26.tar.gz volse-hubzilla-b94cb8d234d70bc534ad1cef767b9f62d10eef26.tar.bz2 volse-hubzilla-b94cb8d234d70bc534ad1cef767b9f62d10eef26.zip |
add micro profile photo
Diffstat (limited to 'include')
-rw-r--r-- | include/Photo.php | 13 | ||||
-rw-r--r-- | include/items.php | 4 |
2 files changed, 16 insertions, 1 deletions
diff --git a/include/Photo.php b/include/Photo.php index ca9ae0703..98b11ab39 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -235,8 +235,18 @@ function import_profile_photo($photo,$uid,$cid) { if($r === false) $photo_failure = true; + $img->scaleImage(48); + + $r = $img->store($uid, $cid, $hash, $filename, t('Contact Photos'), 6 ); + + if($r === false) + $photo_failure = true; + + + $photo = $a->get_baseurl() . '/photo/' . $hash . '-4.jpg'; $thumb = $a->get_baseurl() . '/photo/' . $hash . '-5.jpg'; + $micro = $a->get_baseurl() . '/photo/' . $hash . '-6.jpg'; } else $photo_failure = true; @@ -244,8 +254,9 @@ function import_profile_photo($photo,$uid,$cid) { if($photo_failure) { $photo = $a->get_baseurl() . '/images/default-profile.jpg'; $thumb = $a->get_baseurl() . '/images/default-profile-sm.jpg'; + $micro = $a->get_baseurl() . '/images/default-profile-mm.jpg'; } - return(array($photo,$thumb)); + return(array($photo,$thumb,$micro)); } diff --git a/include/items.php b/include/items.php index a1aaecc8a..323117e6c 100644 --- a/include/items.php +++ b/include/items.php @@ -792,6 +792,10 @@ function consume_feed($xml,$importer,$contact, &$hub) { $img->scaleImage(80); $r = $img->store($contact['uid'], $contact['id'], $hash, basename($photo_url), t('Contact Photos') , 5); + + $img->scaleImage(48); + $r = $img->store($contact['uid'], $contact['id'], $hash, basename($photo_url), t('Contact Photos') , 6); + if($r) q("UPDATE `contact` SET `avatar-date` = '%s' WHERE `uid` = %d AND `id` = %d LIMIT 1", dbesc(datetime_convert()), |