From 803e85caeb959c730fcb69135aa2ccd55bea751b Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 14 May 2018 23:10:20 -0700 Subject: make get_default_profile_photo() pluggable --- include/channel.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/channel.php') diff --git a/include/channel.php b/include/channel.php index 42a392e8e..1a62dcd3c 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1776,6 +1776,17 @@ function get_default_profile_photo($size = 300) { if(! $scheme) $scheme = 'rainbow_man'; + if(! is_dir('images/default_profile_photos/' . $scheme)) { + $x = [ 'scheme' => $scheme, 'size' => $size, 'url' => '' ]; + call_hooks('default_profile_photo',$x); + if($x['url']) { + return $x['url']; + } + else { + $scheme = 'rainbow_man'; + } + } + return 'images/default_profile_photos/' . $scheme . '/' . $size . '.png'; } -- cgit v1.2.3