From 1c0ece841152ea507e1cbaf031460078c2c22ad8 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 14 Sep 2017 18:48:55 -0700 Subject: provide a hook for importing a channel photo at channel creation time --- include/channel.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/channel.php') diff --git a/include/channel.php b/include/channel.php index 213676f52..204f375b1 100644 --- a/include/channel.php +++ b/include/channel.php @@ -7,6 +7,7 @@ require_once('include/zot.php'); require_once('include/crypto.php'); require_once('include/menu.php'); require_once('include/perm_upgrade.php'); +require_once('include/photo/photo_driver.php'); /** * @brief Called when creating a new channel. @@ -273,6 +274,17 @@ function create_identity($arr) { return $ret; } + $a = q("select * from account where account_id = %d", + intval($arr['account_id']) + ); + + $z = [ 'account' => $a[0], 'channel' = $r[0], 'photo_url' => '' ]; + call_hooks('create_channel_photo',$z); + + if($z['photo_url']) { + import_channel_photo_from_url($z['photo_url'],$arr['account_id'],$r[0]['channel_id']); + } + if($role_permissions && array_key_exists('limits',$role_permissions)) $perm_limits = $role_permissions['limits']; else -- cgit v1.2.3 From 67348547765876faa847fa53f92d37a6b4bc4aa5 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 14 Sep 2017 18:50:43 -0700 Subject: typocheck --- include/channel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/channel.php') diff --git a/include/channel.php b/include/channel.php index 204f375b1..7072bb4ce 100644 --- a/include/channel.php +++ b/include/channel.php @@ -278,7 +278,7 @@ function create_identity($arr) { intval($arr['account_id']) ); - $z = [ 'account' => $a[0], 'channel' = $r[0], 'photo_url' => '' ]; + $z = [ 'account' => $a[0], 'channel' => $r[0], 'photo_url' => '' ]; call_hooks('create_channel_photo',$z); if($z['photo_url']) { -- cgit v1.2.3