aboutsummaryrefslogtreecommitdiffstats
path: root/mod/display.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-06-10 16:59:04 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-06-10 16:59:04 -0700
commitca870dbf31d31455ab4f5e0f461c5af89e1573fa (patch)
tree30bf8c1a116828dc0272b5677b717f7721809b3b /mod/display.php
parent2128d5a2560383e0d3587087a7dd0aab217bc262 (diff)
downloadvolse-hubzilla-ca870dbf31d31455ab4f5e0f461c5af89e1573fa.tar.gz
volse-hubzilla-ca870dbf31d31455ab4f5e0f461c5af89e1573fa.tar.bz2
volse-hubzilla-ca870dbf31d31455ab4f5e0f461c5af89e1573fa.zip
more work on item table optimisation
Diffstat (limited to 'mod/display.php')
-rw-r--r--mod/display.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/mod/display.php b/mod/display.php
index 33fb83e70..2f61e688a 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -157,6 +157,7 @@ function display_content(&$a, $update = 0, $load = false) {
}
$observer_hash = get_observer_hash();
+ $item_normal = item_normal();
$sql_extra = public_permissions_sql($observer_hash);
@@ -175,9 +176,9 @@ function display_content(&$a, $update = 0, $load = false) {
if(local_channel()) {
$r = q("SELECT * from item
- WHERE item_restrict = 0
- and uid = %d
+ WHERE uid = %d
and mid = '%s'
+ $item_normal
limit 1",
intval(local_channel()),
dbesc($target_item['parent_mid'])
@@ -198,13 +199,13 @@ function display_content(&$a, $update = 0, $load = false) {
$r = q("SELECT * from item
- WHERE item_restrict = 0
- and mid = '%s'
+ WHERE mid = '%s'
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 )
+ $item_normal
limit 1",
dbesc($target_item['parent_mid']),
intval($sysid)
@@ -224,7 +225,7 @@ function display_content(&$a, $update = 0, $load = false) {
$items = q("SELECT `item`.*, `item`.`id` AS `item_id`
FROM `item`
- WHERE item_restrict = 0 and parent in ( %s ) ",
+ WHERE parent in ( %s ) $item_normal ",
dbesc($parents_str)
);