Commit 2c060a23 authored by Mario's avatar Mario

provide prebuilt grayscale kitties for default_profile_photo()

parent 1e83952d
a temp folder for cached avatar generation
...@@ -10,17 +10,17 @@ ...@@ -10,17 +10,17 @@
function cavatar_load() { function cavatar_load() {
\Zotlabs\Extend\Hook::register('create_channel_photo', 'addon/cavatar/cavatar.php', 'cavatar_channel_photo'); \Zotlabs\Extend\Hook::register('create_channel_photo', 'addon/cavatar/cavatar.php', 'cavatar_channel_photo');
// \Zotlabs\Extend\Hook::register('default_profile_photo', 'addon/cavatar/cavatar.php', 'cavatar_default_profile_photo'); \Zotlabs\Extend\Hook::register('default_profile_photo', 'addon/cavatar/cavatar.php', 'cavatar_default_profile_photo');
// $old = get_config('system','default_profile_photo',EMPTY_STR); $old = get_config('system','default_profile_photo',EMPTY_STR);
// if($old !== 'cavatar') { if($old !== 'cavatar') {
// set_config('cavatar','original_profile_photo',$old); set_config('cavatar','original_profile_photo',$old);
// } }
// set_config('system','default_profile_photo','cavatar'); set_config('system','default_profile_photo','cavatar');
} }
function cavatar_unload() { function cavatar_unload() {
\Zotlabs\Extend\Hook::unregister('create_channel_photo', 'addon/cavatar/cavatar.php', 'cavatar_channel_photo'); \Zotlabs\Extend\Hook::unregister('create_channel_photo', 'addon/cavatar/cavatar.php', 'cavatar_channel_photo');
// \Zotlabs\Extend\Hook::unregister('default_profile_photo', 'addon/cavatar/cavatar.php', 'cavatar_default_profile_photo'); \Zotlabs\Extend\Hook::unregister('default_profile_photo', 'addon/cavatar/cavatar.php', 'cavatar_default_profile_photo');
set_config('system','default_profile_photo',get_config('cavatar','original_profile_photo',EMPTY_STR)); set_config('system','default_profile_photo',get_config('cavatar','original_profile_photo',EMPTY_STR));
} }
...@@ -33,7 +33,8 @@ function cavatar_channel_photo(&$x) { ...@@ -33,7 +33,8 @@ function cavatar_channel_photo(&$x) {
function cavatar_default_profile_photo(&$x) { function cavatar_default_profile_photo(&$x) {
if($x['scheme'] === 'cavatar') { if($x['scheme'] === 'cavatar') {
$x['url'] = 'cavatar?f=&seed=' . random_string(14) . '&size=' . $x['size']; //$x['url'] = 'cavatar?f=&seed=' . random_string(14) . '&size=' . $x['size'];
$x['url'] = 'addon/cavatar/cache/cavatar-' . $x['size'] . '.png';
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment