diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/channel.php | 2 | ||||
-rw-r--r-- | include/hubloc.php | 8 | ||||
-rw-r--r-- | include/text.php | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/include/channel.php b/include/channel.php index 296615524..c36e50f19 100644 --- a/include/channel.php +++ b/include/channel.php @@ -3086,6 +3086,6 @@ function channel_url($channel) { } function get_channel_hashes() { - $r = q("SELECT channel_hash FROM channel WHERE channel_removed = 0"); + $r = dbq("SELECT channel_hash FROM channel WHERE channel_removed = 0"); return flatten_array_recursive($r); } diff --git a/include/hubloc.php b/include/hubloc.php index 0236e4ae7..4d2980a6b 100644 --- a/include/hubloc.php +++ b/include/hubloc.php @@ -392,3 +392,11 @@ function z6_discover() { } } + +function get_hubloc_id_urls_by_x($xchan) { + $r = q("SELECT hubloc_id_url FROM hubloc WHERE hubloc_deleted = 0 AND hubloc_hash = '%s' order by hubloc_primary desc", + dbesc($xchan) + ); + return flatten_array_recursive($r); +} + diff --git a/include/text.php b/include/text.php index 35ce465d6..a09d1bd7b 100644 --- a/include/text.php +++ b/include/text.php @@ -2621,13 +2621,13 @@ function xchan_query(&$items, $abook = true, $effective_uid = 0) { if(count($arr)) { if($abook) { $chans = q("select * from xchan left join hubloc on hubloc_hash = xchan_hash left join abook on abook_xchan = xchan_hash and abook_channel = %d - where xchan_hash in (" . protect_sprintf(implode(',', $arr)) . ") and hubloc_primary = 1", + where xchan_hash in (" . protect_sprintf(implode(',', $arr)) . ") and hubloc_deleted = 0 order by hubloc_primary desc", intval($item['uid']) ); } else { $chans = q("select xchan.*,hubloc.* from xchan left join hubloc on hubloc_hash = xchan_hash - where xchan_hash in (" . protect_sprintf(implode(',', $arr)) . ") and hubloc_primary = 1"); + where xchan_hash in (" . protect_sprintf(implode(',', $arr)) . ") and hubloc_deleted = 0 order by hubloc_primary desc"); } $xchans = q("select * from xchan where xchan_hash in (" . protect_sprintf(implode(',',$arr)) . ") and xchan_network in ('rss','unknown', 'anon', 'token')"); if(! $chans) |