aboutsummaryrefslogtreecommitdiffstats
path: root/mod/public.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/public.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/public.php')
-rw-r--r--mod/public.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/mod/public.php b/mod/public.php
index 1f23a1999..3868f6d6c 100644
--- a/mod/public.php
+++ b/mod/public.php
@@ -10,6 +10,8 @@ function public_content(&$a, $update = 0, $load = false) {
if(get_config('system','disable_discover_tab'))
return;
+ $item_normal = item_normal();
+
if(! $update) {
$maxheight = get_config('system','home_divmore_height');
@@ -95,7 +97,7 @@ function public_content(&$a, $update = 0, $load = false) {
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
left join abook on item.author_xchan = abook.abook_xchan
- WHERE true $uids AND item.item_restrict = 0
+ WHERE true $uids $item_normal
AND item.parent = item.id
and ((abook.abook_flags & %d) = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_nets
@@ -109,7 +111,7 @@ function public_content(&$a, $update = 0, $load = false) {
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
left join abook on item.author_xchan = abook.abook_xchan
- WHERE true $uids AND item.item_restrict = 0
+ WHERE true $uids $item_normal
AND item.parent = item.id $simple_update
and ((abook.abook_flags & %d) = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_nets",
@@ -126,7 +128,7 @@ function public_content(&$a, $update = 0, $load = false) {
$parents_str = ids_to_querystr($r,'item_id');
$items = q("SELECT item.*, item.id AS item_id FROM item
- WHERE true $uids AND item.item_restrict = 0
+ WHERE true $uids $item_normal
AND item.parent IN ( %s )
$sql_extra ",
dbesc($parents_str)