diff options
author | friendica <info@friendica.com> | 2013-01-03 19:34:04 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-01-03 19:34:04 -0800 |
commit | bec7d9f483d63a2330694cc34377b0f79d1afcba (patch) | |
tree | d3f7ac3ad142dcd1002972899e63013a64f81f61 /include/items.php | |
parent | cf0e960a90cf4216d85d38d23d147cb62cd70644 (diff) | |
download | volse-hubzilla-bec7d9f483d63a2330694cc34377b0f79d1afcba.tar.gz volse-hubzilla-bec7d9f483d63a2330694cc34377b0f79d1afcba.tar.bz2 volse-hubzilla-bec7d9f483d63a2330694cc34377b0f79d1afcba.zip |
temporary feed import/export (public only for the moment) until this is integrated with remote permissions
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php index 432f26804..6192de108 100755 --- a/include/items.php +++ b/include/items.php @@ -4246,3 +4246,45 @@ function fetch_post_tags($items) { return $items; } + + + +function zot_feed($uid,$observer,$mindate) { + + $result = array(); + $mindate = datetime_convert('UTC','UTC',$mindate); + if(! $mindate) + $mindate = '0000-00-00 00:00:00'; + + if(! perm_is_allowed($uid,$observer,'view_stream')) { + return $result; + } + +// FIXME +// $sql_extra = item_permissions_sql($r[0]['channel_id'],$remote_contact,$groups); + + if($mindate != '0000-00-00 00:00:00') + $sql_extra .= " and created > '$mindate' "; + + $limit = 200; + + $items = q("SELECT item.* from item + WHERE uid = %d AND item_restrict = 0 + AND (item_flags & %d) + $sql_extra ORDER BY created DESC limit 0, $limit", + intval($uid), + intval(ITEM_WALL) + ); + if($items) { + xchan_query($items); + $items = fetch_post_tags($items); + } else { + $items = array(); + } + + foreach($items as $item) + $result[] = encode_item($item); + + return $result; + +} |