diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-06-04 15:54:18 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-06-04 15:54:18 +0200 |
commit | 6019a34da2184519bc535fa771b30695d9580b92 (patch) | |
tree | 2089faf1b49dd4c3b9bb2dd09c23cc873f971bc3 /Zotlabs | |
parent | 5a9e6c8a695f0adac35baf2d63f58fb27424140f (diff) | |
download | volse-hubzilla-6019a34da2184519bc535fa771b30695d9580b92.tar.gz volse-hubzilla-6019a34da2184519bc535fa771b30695d9580b92.tar.bz2 volse-hubzilla-6019a34da2184519bc535fa771b30695d9580b92.zip |
be specific about the term type and do not sort the results
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Network.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 013e9b763..1ab94eff4 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -261,8 +261,11 @@ class Network extends \Zotlabs\Web\Controller { $item_thread_top = ''; if($load || $update) { - $p1 = q("SELECT DISTINCT parent FROM item WHERE uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' OR owner_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' ) $item_normal ORDER BY created DESC"); - $p2 = q("SELECT oid AS parent FROM term WHERE uid = " . intval(local_channel()) . " AND term = '" . dbesc($cid_r[0]['xchan_name']) . "'"); + $ttype = (($cid_r[0]['xchan_pubforum']) ? TERM_FORUM : TERM_MENTION); + + $p1 = q("SELECT DISTINCT parent FROM item WHERE uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' OR owner_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' ) $item_normal "); + $p2 = q("SELECT oid AS parent FROM term WHERE uid = " . intval(local_channel()) . " AND ttype = $ttype AND term = '" . dbesc($cid_r[0]['xchan_name']) . "'"); + $p_str = ids_to_querystr(array_merge($p1,$p2),'parent'); $sql_extra = " AND item.parent IN ( $p_str ) "; } |