remove checkjs reloader from mod_display also
This commit is contained in:
parent
a9bbfe9c4f
commit
9b620b2a35
@ -21,8 +21,6 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
$module_format = 'html';
|
$module_format = 'html';
|
||||||
}
|
}
|
||||||
|
|
||||||
$checkjs = new \Zotlabs\Web\CheckJS(1);
|
|
||||||
|
|
||||||
if($load)
|
if($load)
|
||||||
$_SESSION['loadtime'] = datetime_convert();
|
$_SESSION['loadtime'] = datetime_convert();
|
||||||
|
|
||||||
@ -253,53 +251,44 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$sql_extra = public_permissions_sql($observer_hash);
|
$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",
|
||||||
require_once('include/channel.php');
|
intval(local_channel()),
|
||||||
$sys = get_sys_channel();
|
dbesc($target_item['parent_mid'])
|
||||||
$sysid = $sys['channel_id'];
|
);
|
||||||
|
if($r) {
|
||||||
if(local_channel()) {
|
$updateable = true;
|
||||||
$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
|
// 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
|
// make that content unsearchable by ensuring the owner uid can't match
|
||||||
|
|
||||||
if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
|
if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
|
||||||
$sysid = 0;
|
$sysid = 0;
|
||||||
|
|
||||||
$r = q("SELECT item.id as item_id from item
|
$r = q("SELECT item.id as item_id from item
|
||||||
WHERE mid = '%s'
|
WHERE mid = '%s'
|
||||||
AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = ''
|
AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = ''
|
||||||
AND item.deny_gid = '' AND item_private = 0 )
|
AND item.deny_gid = '' AND item_private = 0 )
|
||||||
and uid in ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
|
and uid in ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
|
||||||
OR uid = %d )
|
OR uid = %d )
|
||||||
$sql_extra )
|
$sql_extra )
|
||||||
$item_normal
|
$item_normal
|
||||||
limit 1",
|
limit 1",
|
||||||
dbesc($target_item['parent_mid']),
|
dbesc($target_item['parent_mid']),
|
||||||
intval($sysid)
|
intval($sysid)
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -373,14 +362,19 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
case 'html':
|
case 'html':
|
||||||
|
|
||||||
if ($checkjs->disabled()) {
|
if ($update) {
|
||||||
$o .= conversation($items, 'display', $update, 'traditional');
|
|
||||||
if ($items[0]['title'])
|
|
||||||
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$o .= conversation($items, 'display', $update, 'client');
|
$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;
|
break;
|
||||||
|
|
||||||
@ -435,7 +429,7 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$o .= '<div id="content-complete"></div>';
|
$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",
|
$r = q("SELECT id, item_deleted FROM item WHERE mid = '%s' LIMIT 1",
|
||||||
dbesc($item_hash)
|
dbesc($item_hash)
|
||||||
|
Reference in New Issue
Block a user