diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-10-07 15:40:34 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-10-07 15:40:34 +0200 |
commit | 4c0e8a61aecc5c90d532016dc42f13ab07646335 (patch) | |
tree | e2cb4e0dc85534a3c7eddd0cdade3e1ec734cc76 /Zotlabs | |
parent | dc2c6d00febda8bb92f41f2b4f37bd9de884dd5e (diff) | |
download | volse-hubzilla-4c0e8a61aecc5c90d532016dc42f13ab07646335.tar.gz volse-hubzilla-4c0e8a61aecc5c90d532016dc42f13ab07646335.tar.bz2 volse-hubzilla-4c0e8a61aecc5c90d532016dc42f13ab07646335.zip |
provide single post view for pubstream and rewrite llink to point to /pubstream/?f=&mid=some_mid instead of /display/some_mid for pubs notifications
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Ping.php | 1 | ||||
-rw-r--r-- | Zotlabs/Module/Pubstream.php | 68 |
2 files changed, 45 insertions, 24 deletions
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php index 0acd720d6..e3f430861 100644 --- a/Zotlabs/Module/Ping.php +++ b/Zotlabs/Module/Ping.php @@ -183,6 +183,7 @@ class Ping extends \Zotlabs\Web\Controller { if($r) { xchan_query($r); foreach($r as $rr) { + $rr['llink'] = str_replace('display/', 'pubstream/?f=&mid=', $rr['llink']); $result[] = \Zotlabs\Lib\Enotify::format($rr); } } diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php index 72d5f80fa..4583f912b 100644 --- a/Zotlabs/Module/Pubstream.php +++ b/Zotlabs/Module/Pubstream.php @@ -19,7 +19,9 @@ class Pubstream extends \Zotlabs\Web\Controller { $disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false; if($disable_discover_tab) return; - + + $mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : ''); + $item_normal = item_normal(); $item_normal_update = item_normal_update(); @@ -30,7 +32,8 @@ class Pubstream extends \Zotlabs\Web\Controller { nav_set_selected(t('Public Stream')); - $_SESSION['static_loadtime'] = datetime_convert(); + if(!$mid) + $_SESSION['static_loadtime'] = datetime_convert(); $static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1); @@ -68,7 +71,7 @@ class Pubstream extends \Zotlabs\Web\Controller { '$cats' => '', '$tags' => '', '$dend' => '', - '$mid' => '', + '$mid' => $mid, '$verb' => '', '$dbegin' => '' )); @@ -119,29 +122,46 @@ class Pubstream extends \Zotlabs\Web\Controller { $ordering = "commented"; if($load) { - - // 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 - 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 - ORDER BY $ordering DESC $pager_sql " - ); - - + if($mid) { + $r = q("SELECT parent AS item_id FROM item + left join abook on item.author_xchan = abook.abook_xchan + WHERE mid like '%s' $uids $item_normal + and (abook.abook_blocked = 0 or abook.abook_flags is null) + $sql_extra3 $sql_extra $sql_nets", + dbesc($mid . '%') + ); + } + else { + // 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 + 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 + ORDER BY $ordering DESC $pager_sql " + ); + } } elseif($update) { - - $r = q("SELECT distinct item.id AS item_id, $ordering FROM item - left join abook on item.author_xchan = abook.abook_xchan - 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" - ); + if($mid) { + $r = q("SELECT parent AS item_id FROM item + left join abook on item.author_xchan = abook.abook_xchan + 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", + 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 + 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" + ); + } $_SESSION['loadtime'] = datetime_convert(); } // Then fetch all the children of the parents that are on this page |