From 99d97170deb1d2b04e649b8f7a3170145ff2a19d Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 15 May 2014 17:15:22 -0700 Subject: apps: provide a default photo if none was set. For now it's the default profile photo until we have a default app photo --- include/apps.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'include/apps.php') diff --git a/include/apps.php b/include/apps.php index 38812ef83..244c2adb7 100644 --- a/include/apps.php +++ b/include/apps.php @@ -40,14 +40,27 @@ function get_system_apps() { function parse_app_description($f) { $ret = array(); + $baseurl = z_root(); + $channel = get_app()->get_channel(); + $address = (($channel) ? $channel['channel_address'] : ''); + + //future expansion + + $observer = get_observer(); + + + $lines = @file($f); if($lines) { foreach($lines as $x) { if(preg_match('/^([a-zA-Z].*?):(.*?)$/ism',$x,$matches)) { - $ret[$matches[1]] = trim($matches[2]); + $ret[$matches[1]] = trim(str_replace(array('$baseurl','$nick'),array($baseurl,$address),$matches[2])); } } } + if(! $ret['photo']) + $ret['photo'] = $baseurl . '/' . get_default_profile_photo(80); + return $ret; } -- cgit v1.2.3