From 1426b7a6dc56250bc528c21028975ac9d68a2d95 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 27 Aug 2023 20:29:30 +0000 Subject: order by hubloc_id like everywhere else for this reason and do not include deleted hublocs --- 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 2e8aefaaa..50cd77d6c 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1937,7 +1937,7 @@ function zid_init() { call_hooks('zid_init', $arr); if(! local_channel()) { - $r = q("select hubloc_url, hubloc_hash, hubloc_network from hubloc where hubloc_addr = '%s' order by hubloc_connected desc", + $r = q("select hubloc_url, hubloc_hash, hubloc_network from hubloc where hubloc_addr = '%s' and hubloc_deleted = 0 order by hubloc_id desc", dbesc($tmp_str) ); if(! $r) { -- cgit v1.2.3 From 166c45f97fd8834770b51e6b93e5f589fe9b2f19 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 20 Nov 2023 19:22:06 +0000 Subject: do not provide channel info for templates --- include/channel.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/channel.php') diff --git a/include/channel.php b/include/channel.php index 50cd77d6c..dc164eba1 100644 --- a/include/channel.php +++ b/include/channel.php @@ -2397,8 +2397,12 @@ function get_zcard($channel, $observer_hash = '', $args = array()) { // $scale = (float) $maxwidth / $width; // $translate = intval(($scale / 1.0) * 100); - $channel['channel_addr'] = channel_reddress($channel); - $zcard = array('chan' => $channel); + $zcard = [ + 'chan' => [ + 'xchan_name' => $channel['xchan_name'], + 'channel_addr' => channel_reddress($channel) + ] + ]; $r = q("select height, width, resource_id, imgscale, mimetype from photo where uid = %d and imgscale = %d and photo_usage = %d", intval($channel['channel_id']), -- cgit v1.2.3 From febebc8d3da6a77d8c71dc31c364b7b1a6cf0c84 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 20 Nov 2023 20:21:03 +0000 Subject: more do not provide channel info for templates and code cleanup --- include/channel.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'include/channel.php') diff --git a/include/channel.php b/include/channel.php index dc164eba1..640274348 100644 --- a/include/channel.php +++ b/include/channel.php @@ -2397,11 +2397,10 @@ function get_zcard($channel, $observer_hash = '', $args = array()) { // $scale = (float) $maxwidth / $width; // $translate = intval(($scale / 1.0) * 100); - $zcard = [ - 'chan' => [ - 'xchan_name' => $channel['xchan_name'], - 'channel_addr' => channel_reddress($channel) - ] + $zcard['chan'] = [ + 'xchan_name' => $channel['xchan_name'], + 'xchan_url' => $channel['xchan_url'], + 'xchan_addr' => $channel['xchan_addr'] ]; $r = q("select height, width, resource_id, imgscale, mimetype from photo where uid = %d and imgscale = %d and photo_usage = %d", @@ -2474,8 +2473,11 @@ function get_zcard_embed($channel, $observer_hash = '', $args = array()) { $pphoto = array('mimetype' => $channel['xchan_photo_mimetype'], 'width' => 300 , 'height' => 300, 'href' => $channel['xchan_photo_l']); } - $channel['channel_addr'] = channel_reddress($channel); - $zcard = array('chan' => $channel); + $zcard['chan'] = [ + 'xchan_name' => $channel['xchan_name'], + 'xchan_url' => $channel['xchan_url'], + 'xchan_addr' => $channel['xchan_addr'] + ]; $r = q("select height, width, resource_id, imgscale, mimetype from photo where uid = %d and imgscale = %d and photo_usage = %d", intval($channel['channel_id']), -- cgit v1.2.3