aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-02-22 10:10:46 +0100
committerMario Vavti <mario@mariovavti.com>2018-02-22 10:10:46 +0100
commitbdcee4fc30d3be9c8e986a75f3f05ce2cddca1fd (patch)
treeebe5fea6c5e78efcc6913788306059d52625c129
parenta829256bc4803731881a51bddd19ee59a5a234ff (diff)
downloadvolse-hubzilla-bdcee4fc30d3be9c8e986a75f3f05ce2cddca1fd.tar.gz
volse-hubzilla-bdcee4fc30d3be9c8e986a75f3f05ce2cddca1fd.tar.bz2
volse-hubzilla-bdcee4fc30d3be9c8e986a75f3f05ce2cddca1fd.zip
query for what we need instead of what we do not need
-rwxr-xr-xinclude/items.php20
1 files changed, 13 insertions, 7 deletions
diff --git a/include/items.php b/include/items.php
index 68fa4c3b2..5a98fbbd4 100755
--- a/include/items.php
+++ b/include/items.php
@@ -4003,18 +4003,24 @@ function zot_feed($uid, $observer_hash, $arr) {
$item_normal = item_normal();
if(is_sys_channel($uid)) {
- $r = q("SELECT parent, created, postopts from item
- WHERE uid != %d
- $item_normal
+
+ $nonsys_uids = q("SELECT channel_id FROM channel WHERE channel_system = 0");
+ $nonsys_uids_str = ids_to_querystr($nonsys_uids,'channel_id');
+
+ $r = q("SELECT parent, postopts FROM item
+ WHERE uid IN ( %s )
AND item_wall = 1
- and item_private = 0 $sql_extra ORDER BY created ASC $limit",
- intval($uid)
+ AND item_private = 0
+ $item_normal
+ $sql_extra ORDER BY created ASC $limit",
+ intval($nonsys_uids_str)
);
}
else {
- $r = q("SELECT parent, created, postopts from item
- WHERE uid = %d $item_normal
+ $r = q("SELECT parent, postopts FROM item
+ WHERE uid = %d
AND item_wall = 1
+ $item_normal
$sql_extra ORDER BY created ASC $limit",
intval($uid)
);