diff options
author | zotlabs <mike@macgirvin.com> | 2016-11-02 15:48:29 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-11-02 15:48:29 -0700 |
commit | f91031bd657f6c7bb25d93fc2c69a84846ee9f03 (patch) | |
tree | c069bf265f7b18bf40cdebcf841fe20890cff867 /Zotlabs/Module | |
parent | 5d3e04216d466e57dfeefe0319dd14b26e8487a2 (diff) | |
download | volse-hubzilla-f91031bd657f6c7bb25d93fc2c69a84846ee9f03.tar.gz volse-hubzilla-f91031bd657f6c7bb25d93fc2c69a84846ee9f03.tar.bz2 volse-hubzilla-f91031bd657f6c7bb25d93fc2c69a84846ee9f03.zip |
allow your own likes/comments to be updated when in static update mode
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Channel.php | 8 | ||||
-rw-r--r-- | Zotlabs/Module/Display.php | 8 | ||||
-rw-r--r-- | Zotlabs/Module/Network.php | 11 | ||||
-rw-r--r-- | Zotlabs/Module/Pubstream.php | 10 | ||||
-rw-r--r-- | Zotlabs/Module/Search.php | 6 |
5 files changed, 35 insertions, 8 deletions
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index e8bc53b5e..41b396c5c 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -74,6 +74,7 @@ class Channel extends \Zotlabs\Web\Controller { $category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : ''); $hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : ''); + $static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0); $groups = array(); @@ -110,6 +111,8 @@ class Channel extends \Zotlabs\Web\Controller { if(! $update) { + $static = intval(feature_enabled(\App::$profile['profile_uid'],'static_updates')); + $o .= profile_tabs($a, $is_owner, \App::$profile['channel_address']); $o .= common_friends_visitor_widget(\App::$profile['profile_uid']); @@ -176,6 +179,9 @@ class Channel extends \Zotlabs\Web\Controller { if($load) $simple_update = ''; + if($static && $simple_update) + $simple_update .= " and item_thread_top = 0 and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' "; + if(($update) && (! $load)) { if($mid) { @@ -304,7 +310,7 @@ class Channel extends \Zotlabs\Web\Controller { '$nouveau' => '0', '$wall' => '1', '$fh' => '0', - '$static' => intval(feature_enabled(\App::$profile['profile_uid'],'static_updates')), + '$static' => $static, '$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1), '$search' => '', '$order' => '', diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index 42bb6fe14..25153839c 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -121,6 +121,8 @@ class Display extends \Zotlabs\Web\Controller { return ''; } } + + $static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0); $simple_update = (($update) ? " AND item_unseen = 1 " : ''); @@ -130,11 +132,13 @@ class Display extends \Zotlabs\Web\Controller { if($load) $simple_update = ''; - $static = ((local_channel()) ? intval(feature_enabled(local_channel(),'static_updates')) : 0); - + if($static && $simple_update) + $simple_update .= " and item_thread_top = 0 and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' "; if((! $update) && (! $load)) { + + $static = ((local_channel()) ? intval(feature_enabled(local_channel(),'static_updates')) : 0); $o .= '<div id="live-display"></div>' . "\r\n"; $o .= "<script> var profile_uid = " . ((intval(local_channel())) ? local_channel() : (-1)) diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 206761fc8..ed6ee1cc0 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -54,6 +54,7 @@ class Network extends \Zotlabs\Web\Controller { $datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : ''); $datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : ''); $nouveau = ((x($_GET,'new')) ? intval($_GET['new']) : 0); + $static = ((x($_GET,'static')) ? intval($_GET['static']) : 0); $gid = ((x($_GET,'gid')) ? intval($_GET['gid']) : 0); $category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : ''); $hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : ''); @@ -186,6 +187,8 @@ class Network extends \Zotlabs\Web\Controller { $status_editor = status_editor($a,$x); $o .= $status_editor; + + $static = intval(feature_enabled(local_channel(),'static_updates')); } @@ -295,7 +298,7 @@ class Network extends \Zotlabs\Web\Controller { '$fh' => (($firehose) ? $firehose : '0'), '$nouveau' => (($nouveau) ? $nouveau : '0'), '$wall' => '0', - '$static' => intval(feature_enabled(local_channel(),'static_updates')), + '$static' => $static, '$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0), '$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1), '$search' => (($search) ? $search : ''), @@ -402,7 +405,8 @@ class Network extends \Zotlabs\Web\Controller { $page_mode = 'client'; $simple_update = (($update) ? " and item_unseen = 1 " : ''); - + + // This fixes a very subtle bug so I'd better explain it. You wake up in the morning or return after a day // or three and look at your matrix page - after opening up your browser. The first page loads just as it // should. All of a sudden a few seconds later, page 2 will get inserted at the beginning of the page @@ -419,6 +423,9 @@ class Network extends \Zotlabs\Web\Controller { $simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) "; if($load) $simple_update = ''; + + if($static && $simple_update) + $simple_update .= " and item_thread_top = 0 and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' "; if($nouveau && $load) { // "New Item View" - show all items unthreaded in reverse created date order diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php index e354be8c3..54f3b7937 100644 --- a/Zotlabs/Module/Pubstream.php +++ b/Zotlabs/Module/Pubstream.php @@ -22,9 +22,12 @@ class Pubstream extends \Zotlabs\Web\Controller { $item_normal = item_normal(); - $static = ((local_channel()) ? intval(feature_enabled(local_channel(),'static_updates')) : 0); + $static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0); + if(! $update) { + + $static = ((local_channel()) ? intval(feature_enabled(local_channel(),'static_updates')) : 0); $maxheight = get_config('system','home_divmore_height'); if(! $maxheight) @@ -99,7 +102,10 @@ class Pubstream extends \Zotlabs\Web\Controller { $simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) "; if($load) $simple_update = ''; - + + if($static && $simple_update) + $simple_update .= " and item_thread_top = 0 and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' "; + //logger('update: ' . $update . ' load: ' . $load); if($update) { diff --git a/Zotlabs/Module/Search.php b/Zotlabs/Module/Search.php index 796f95d6e..9ebd50a2c 100644 --- a/Zotlabs/Module/Search.php +++ b/Zotlabs/Module/Search.php @@ -53,6 +53,8 @@ class Search extends \Zotlabs\Web\Controller { $tag = true; $search = ((x($_GET,'tag')) ? trim(rawurldecode($_GET['tag'])) : ''); } + + $static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0); if((! local_channel()) || (! feature_enabled(local_channel(),'savedsearch'))) $o .= search($search,'search-box','/search',((local_channel()) ? true : false)); @@ -96,10 +98,12 @@ class Search extends \Zotlabs\Web\Controller { // OR your own posts if you are a logged in member // No items will be shown if the member has a blocked profile wall. - $static = ((local_channel()) ? intval(feature_enabled(local_channel(),'static_updates')) : 0); if((! $update) && (! $load)) { + $static = ((local_channel()) ? intval(feature_enabled(local_channel(),'static_updates')) : 0); + + // This is ugly, but we can't pass the profile_uid through the session to the ajax updater, // because browser prefetching might change it on us. We have to deliver it with the page. |