diff options
author | zotlabs <mike@macgirvin.com> | 2017-11-01 02:53:12 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-11-01 02:53:12 -0700 |
commit | 22d45a8d1ecfa0a0a2b8429ec3233e7099e84b66 (patch) | |
tree | ba3e5f2a8d612d5987563c610e078196785856f4 /Zotlabs/Module/Pubstream.php | |
parent | 7d9d1e0cdb21e47aec20b64148a0714323383914 (diff) | |
download | volse-hubzilla-22d45a8d1ecfa0a0a2b8429ec3233e7099e84b66.tar.gz volse-hubzilla-22d45a8d1ecfa0a0a2b8429ec3233e7099e84b66.tar.bz2 volse-hubzilla-22d45a8d1ecfa0a0a2b8429ec3233e7099e84b66.zip |
support for netselect query
Diffstat (limited to 'Zotlabs/Module/Pubstream.php')
-rw-r--r-- | Zotlabs/Module/Pubstream.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php index 15e2d8a74..e83de6bc0 100644 --- a/Zotlabs/Module/Pubstream.php +++ b/Zotlabs/Module/Pubstream.php @@ -31,6 +31,7 @@ class Pubstream extends \Zotlabs\Web\Controller { $item_normal_update = item_normal_update(); $static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0); + $net = ((array_key_exists('net',$_REQUEST)) ? escape_tags($_REQUEST['net']) : ''); if(! $update && !$load) { @@ -81,7 +82,8 @@ class Pubstream extends \Zotlabs\Web\Controller { '$tags' => '', '$dend' => '', '$mid' => $mid, - '$verb' => '', + '$verb' => '', + '$net' => $net, '$dbegin' => '' )); } @@ -112,6 +114,10 @@ class Pubstream extends \Zotlabs\Web\Controller { $page_mode = 'list'; else $page_mode = 'client'; + + + $net_query = (($net) ? " left join xchan on xchan_hash = author_xchan " : ''); + $net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : ''); $simple_update = (($update) ? " and item.item_unseen = 1 " : ''); @@ -134,9 +140,10 @@ class Pubstream extends \Zotlabs\Web\Controller { if($mid) { $r = q("SELECT parent AS item_id FROM item left join abook on item.author_xchan = abook.abook_xchan + $net_query WHERE mid like '%s' $uids $item_normal and (abook.abook_blocked = 0 or abook.abook_flags is null) - $sql_extra3 $sql_extra $sql_nets LIMIT 1", + $sql_extra3 $sql_extra $sql_nets $net_query2 LIMIT 1", dbesc($mid . '%') ); } @@ -144,10 +151,11 @@ class Pubstream extends \Zotlabs\Web\Controller { // Fetch a page full of parent items for this page $r = q("SELECT distinct item.id AS item_id, $ordering FROM item left join abook on item.author_xchan = abook.abook_xchan + $net_query WHERE true $uids $item_normal AND item.parent = item.id and (abook.abook_blocked = 0 or abook.abook_flags is null) - $sql_extra3 $sql_extra $sql_nets + $sql_extra3 $sql_extra $sql_nets $net_query2 ORDER BY $ordering DESC $pager_sql " ); } @@ -156,19 +164,21 @@ class Pubstream extends \Zotlabs\Web\Controller { if($mid) { $r = q("SELECT parent AS item_id FROM item left join abook on item.author_xchan = abook.abook_xchan + $net_query WHERE mid like '%s' $uids $item_normal_update $simple_update and (abook.abook_blocked = 0 or abook.abook_flags is null) - $sql_extra3 $sql_extra $sql_nets LIMIT 1", + $sql_extra3 $sql_extra $sql_nets $net_query2 LIMIT 1", dbesc($mid . '%') ); } else { $r = q("SELECT distinct item.id AS item_id, $ordering FROM item left join abook on item.author_xchan = abook.abook_xchan + $net_query WHERE true $uids $item_normal_update AND item.parent = item.id $simple_update and (abook.abook_blocked = 0 or abook.abook_flags is null) - $sql_extra3 $sql_extra $sql_nets" + $sql_extra3 $sql_extra $sql_nets $net_query2" ); } $_SESSION['loadtime'] = datetime_convert(); |