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
This commit is contained in:
parent
dc2c6d00fe
commit
4c0e8a61ae
@ -183,6 +183,7 @@ class Ping extends \Zotlabs\Web\Controller {
|
|||||||
if($r) {
|
if($r) {
|
||||||
xchan_query($r);
|
xchan_query($r);
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
|
$rr['llink'] = str_replace('display/', 'pubstream/?f=&mid=', $rr['llink']);
|
||||||
$result[] = \Zotlabs\Lib\Enotify::format($rr);
|
$result[] = \Zotlabs\Lib\Enotify::format($rr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,8 @@ class Pubstream extends \Zotlabs\Web\Controller {
|
|||||||
if($disable_discover_tab)
|
if($disable_discover_tab)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
$mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : '');
|
||||||
|
|
||||||
$item_normal = item_normal();
|
$item_normal = item_normal();
|
||||||
$item_normal_update = item_normal_update();
|
$item_normal_update = item_normal_update();
|
||||||
|
|
||||||
@ -30,7 +32,8 @@ class Pubstream extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
nav_set_selected(t('Public Stream'));
|
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);
|
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1);
|
||||||
|
|
||||||
@ -68,7 +71,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
|
|||||||
'$cats' => '',
|
'$cats' => '',
|
||||||
'$tags' => '',
|
'$tags' => '',
|
||||||
'$dend' => '',
|
'$dend' => '',
|
||||||
'$mid' => '',
|
'$mid' => $mid,
|
||||||
'$verb' => '',
|
'$verb' => '',
|
||||||
'$dbegin' => ''
|
'$dbegin' => ''
|
||||||
));
|
));
|
||||||
@ -119,29 +122,46 @@ class Pubstream extends \Zotlabs\Web\Controller {
|
|||||||
$ordering = "commented";
|
$ordering = "commented";
|
||||||
|
|
||||||
if($load) {
|
if($load) {
|
||||||
|
if($mid) {
|
||||||
// Fetch a page full of parent items for this page
|
$r = q("SELECT parent AS item_id FROM item
|
||||||
|
left join abook on item.author_xchan = abook.abook_xchan
|
||||||
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
|
WHERE mid like '%s' $uids $item_normal
|
||||||
left join abook on item.author_xchan = abook.abook_xchan
|
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
||||||
WHERE true $uids $item_normal
|
$sql_extra3 $sql_extra $sql_nets",
|
||||||
AND item.parent = item.id
|
dbesc($mid . '%')
|
||||||
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
);
|
||||||
$sql_extra3 $sql_extra $sql_nets
|
}
|
||||||
ORDER BY $ordering DESC $pager_sql "
|
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) {
|
elseif($update) {
|
||||||
|
if($mid) {
|
||||||
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
|
$r = q("SELECT parent AS item_id FROM item
|
||||||
left join abook on item.author_xchan = abook.abook_xchan
|
left join abook on item.author_xchan = abook.abook_xchan
|
||||||
WHERE true $uids $item_normal_update
|
WHERE mid like '%s' $uids $item_normal_update $simple_update
|
||||||
AND item.parent = item.id $simple_update
|
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
||||||
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
$sql_extra3 $sql_extra $sql_nets",
|
||||||
$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();
|
$_SESSION['loadtime'] = datetime_convert();
|
||||||
}
|
}
|
||||||
// Then fetch all the children of the parents that are on this page
|
// Then fetch all the children of the parents that are on this page
|
||||||
|
Reference in New Issue
Block a user