aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-03-26 16:09:07 -0700
committerfriendica <info@friendica.com>2014-03-26 16:09:07 -0700
commit79f5fd8e2a4959b78cf8be6312962849e14e9d85 (patch)
treee245fc0558f7639daef304a462823920b3cafedc /include/items.php
parentbd7be38da5fea67d2302693e28a4c070cdad8f4b (diff)
downloadvolse-hubzilla-79f5fd8e2a4959b78cf8be6312962849e14e9d85.tar.gz
volse-hubzilla-79f5fd8e2a4959b78cf8be6312962849e14e9d85.tar.bz2
volse-hubzilla-79f5fd8e2a4959b78cf8be6312962849e14e9d85.zip
allow zotfeed to create a firehose of a site.
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php31
1 files changed, 20 insertions, 11 deletions
diff --git a/include/items.php b/include/items.php
index 428767676..dd5f4aac1 100755
--- a/include/items.php
+++ b/include/items.php
@@ -3763,24 +3763,33 @@ function zot_feed($uid,$observer_xchan,$mindate) {
$items = array();
- $r = q("SELECT item.*, item.id as item_id from item
- WHERE uid = %d AND item_restrict = 0 and id = parent
- AND (item_flags & %d)
- $sql_extra ORDER BY created ASC $limit",
- intval($uid),
- intval(ITEM_WALL)
- );
- if($r) {
+ if(is_sys_channel($uid)) {
+ $r = q("SELECT item.*, item.id as item_id from item
+ WHERE uid in (" . stream_perms_api_uids(PERMS_PUBLIC) . ") AND item_restrict = 0 and id = parent
+ AND (item_flags & %d)
+ $sql_extra ORDER BY created ASC $limit",
+ intval($uid),
+ intval(ITEM_WALL)
+ );
+ }
+ else {
+ $r = q("SELECT item.*, item.id as item_id from item
+ WHERE uid = %d AND item_restrict = 0 and id = parent
+ AND (item_flags & %d)
+ $sql_extra ORDER BY created ASC $limit",
+ intval($uid),
+ intval(ITEM_WALL)
+ );
+ }
+ if($r) {
$parents_str = ids_to_querystr($r,'id');
$items = q("SELECT `item`.*, `item`.`id` AS `item_id` FROM `item`
- WHERE `item`.`uid` = %d AND `item`.`item_restrict` = 0
+ WHERE `item`.`item_restrict` = 0
AND `item`.`parent` IN ( %s ) ",
- intval($uid),
dbesc($parents_str)
);
-
}
if($items) {