From 7d694dca074f905fb120da9b60d1a665b40e5293 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 3 Dec 2018 18:50:45 -0800 Subject: more work on z6 commenting --- include/channel.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/channel.php') diff --git a/include/channel.php b/include/channel.php index 1e5570f6b..95a3f96cf 100644 --- a/include/channel.php +++ b/include/channel.php @@ -2333,6 +2333,21 @@ function channelx_by_hash($hash) { return(($r) ? $r[0] : false); } + +/** + * @brief Get a channel array by a channel_hash. + * + * @param string $hash + * @return array|boolean false if channel ID not found, otherwise the channel array + */ +function channelx_by_portid($hash) { + $r = q("SELECT * FROM channel left join xchan on channel_portable_id = xchan_hash WHERE channel_portable_id = '%s' and channel_removed = 0 LIMIT 1", + dbesc($hash) + ); + + return(($r) ? $r[0] : false); +} + /** * @brief Get a channel array by a channel ID. * -- cgit v1.2.3