From ce6e81c68221a9f462af886626dc02fdfc26f8aa Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 3 Oct 2016 21:48:53 -0700 Subject: more backticks --- Zotlabs/Module/Display.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Zotlabs/Module/Display.php') diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index e9441bbdf..3d3609ee0 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -214,8 +214,8 @@ class Display extends \Zotlabs\Web\Controller { $r = q("SELECT * from item WHERE mid = '%s' - AND (((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' - AND `item`.`deny_gid` = '' AND item_private = 0 ) + AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = '' + AND item.deny_gid = '' AND item_private = 0 ) and owner_xchan in ( " . stream_perms_xchans(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " )) OR uid = %d ) $sql_extra ) @@ -258,8 +258,8 @@ class Display extends \Zotlabs\Web\Controller { $r = q("SELECT * from item WHERE mid = '%s' - AND (((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' - AND `item`.`deny_gid` = '' AND item_private = 0 ) + AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = '' + AND item.deny_gid = '' AND item_private = 0 ) and owner_xchan in ( " . stream_perms_xchans(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " )) OR uid = %d ) $sql_extra ) @@ -282,8 +282,8 @@ class Display extends \Zotlabs\Web\Controller { $parents_str = ids_to_querystr($r,'id'); if($parents_str) { - $items = q("SELECT `item`.*, `item`.`id` AS `item_id` - FROM `item` + $items = q("SELECT item.*, item.id AS item_id + FROM item WHERE parent in ( %s ) $item_normal ", dbesc($parents_str) ); @@ -321,7 +321,7 @@ class Display extends \Zotlabs\Web\Controller { /* elseif((! $update) && (! { - $r = q("SELECT `id`, item_flags FROM `item` WHERE `id` = '%s' OR `mid` = '%s' LIMIT 1", + $r = q("SELECT id, item_flags FROM item WHERE id = '%s' OR mid = '%s' LIMIT 1", dbesc($item_hash), dbesc($item_hash) ); -- cgit v1.2.3 From ca948d66a901677665c7a5983dc438918d7fb1c9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 1 Nov 2016 20:21:39 -0700 Subject: feature: static page update as opposed to live update of conversations on the page. Changes will be queued until the page is reloaded. There may or may not be notifications of pending activity updates depending on your notification preferences. Endless scrolling (append) is still performed either way. This only affects changed and new/unseen items being inserted into the page. --- Zotlabs/Module/Display.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Zotlabs/Module/Display.php') diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index 3d3609ee0..42bb6fe14 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -130,6 +130,7 @@ class Display extends \Zotlabs\Web\Controller { if($load) $simple_update = ''; + $static = ((local_channel()) ? intval(feature_enabled(local_channel(),'static_updates')) : 0); if((! $update) && (! $load)) { @@ -154,6 +155,7 @@ class Display extends \Zotlabs\Web\Controller { '$fh' => '0', '$nouveau' => '0', '$wall' => '0', + '$static' => $static, '$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1), '$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0), '$search' => '', -- cgit v1.2.3 From f91031bd657f6c7bb25d93fc2c69a84846ee9f03 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 2 Nov 2016 15:48:29 -0700 Subject: allow your own likes/comments to be updated when in static update mode --- Zotlabs/Module/Display.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Module/Display.php') 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 .= '
' . "\r\n"; $o .= "