aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Display.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Display.php')
-rw-r--r--Zotlabs/Module/Display.php90
1 files changed, 42 insertions, 48 deletions
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index fe0408c6f..bdaed0933 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -21,8 +21,6 @@ class Display extends \Zotlabs\Web\Controller {
$module_format = 'html';
}
- $checkjs = new \Zotlabs\Web\CheckJS(1);
-
if($load)
$_SESSION['loadtime'] = datetime_convert();
@@ -253,53 +251,44 @@ class Display extends \Zotlabs\Web\Controller {
$sql_extra = public_permissions_sql($observer_hash);
- if(($update && $load) || ($checkjs->disabled()) || ($module_format !== 'html')) {
+ if((! $update) || ($load)) {
- $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']),intval(\App::$pager['start']));
+ $r = null;
- if($load || ($checkjs->disabled()) || ($module_format !== 'html')) {
+ require_once('include/channel.php');
+ $sys = get_sys_channel();
+ $sysid = $sys['channel_id'];
- $r = null;
+ if(local_channel()) {
+ $r = q("SELECT item.id as item_id from item WHERE uid = %d and mid = '%s' $item_normal limit 1",
+ intval(local_channel()),
+ dbesc($target_item['parent_mid'])
+ );
+ if($r) {
+ $updateable = true;
+ }
+ }
- require_once('include/channel.php');
- $sys = get_sys_channel();
- $sysid = $sys['channel_id'];
+ if(! $r) {
- if(local_channel()) {
- $r = q("SELECT item.id as item_id from item
- WHERE uid = %d
- and mid = '%s'
- $item_normal
- limit 1",
- intval(local_channel()),
- dbesc($target_item['parent_mid'])
- );
- if($r) {
- $updateable = true;
- }
- }
+ // in case somebody turned off public access to sys channel content using permissions
+ // make that content unsearchable by ensuring the owner uid can't match
- if(! $r) {
-
- // in case somebody turned off public access to sys channel content using permissions
- // make that content unsearchable by ensuring the owner uid can't match
-
- if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
- $sysid = 0;
-
- $r = q("SELECT item.id as item_id 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 uid in ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
- OR uid = %d )
- $sql_extra )
- $item_normal
- limit 1",
- dbesc($target_item['parent_mid']),
- intval($sysid)
- );
- }
+ if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
+ $sysid = 0;
+
+ $r = q("SELECT item.id as item_id 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 uid in ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
+ OR uid = %d )
+ $sql_extra )
+ $item_normal
+ limit 1",
+ dbesc($target_item['parent_mid']),
+ intval($sysid)
+ );
}
}
@@ -373,14 +362,19 @@ class Display extends \Zotlabs\Web\Controller {
case 'html':
- if ($checkjs->disabled()) {
+ if ($update) {
+ $o .= conversation($items, 'display', $update, 'client');
+ }
+ else {
+ $o .= '<noscript>';
$o .= conversation($items, 'display', $update, 'traditional');
+ $o .= '</noscript>';
+
if ($items[0]['title'])
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
- }
- else {
+
$o .= conversation($items, 'display', $update, 'client');
- }
+ }
break;
@@ -435,7 +429,7 @@ class Display extends \Zotlabs\Web\Controller {
$o .= '<div id="content-complete"></div>';
- if((($update && $load) || $checkjs->disabled()) && (! $items)) {
+ if(((! $update) || ($load)) && (! $items)) {
$r = q("SELECT id, item_deleted FROM item WHERE mid = '%s' LIMIT 1",
dbesc($item_hash)