remove checkjs reloader from mod_display also

This commit is contained in:
zotlabs 2018-08-20 20:07:54 -07:00
parent a9bbfe9c4f
commit 9b620b2a35

View File

@ -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;
require_once('include/channel.php');
$sys = get_sys_channel();
$sysid = $sys['channel_id'];
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;
}
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;
}
}
if(! $r) {
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
// 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;
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)
);
}
$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()) {
$o .= conversation($items, 'display', $update, 'traditional');
if ($items[0]['title'])
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
}
else {
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'];
$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)