diff options
author | zotlabs <mike@macgirvin.com> | 2017-04-20 21:25:37 -0700 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-04-26 14:11:55 +0200 |
commit | 97458b288534d2270a592af141bacdcade84d12c (patch) | |
tree | dde24eafd59c0241ef4894f4cb0e0434b2b1708d | |
parent | 803bff4043dae142999a34e7d706eea176328c69 (diff) | |
download | volse-hubzilla-97458b288534d2270a592af141bacdcade84d12c.tar.gz volse-hubzilla-97458b288534d2270a592af141bacdcade84d12c.tar.bz2 volse-hubzilla-97458b288534d2270a592af141bacdcade84d12c.zip |
make it easier to hook into feed headers in the future
-rw-r--r-- | include/feedutils.php | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/include/feedutils.php b/include/feedutils.php index af382be44..d38f60113 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -73,19 +73,6 @@ function get_feed_for($channel, $observer_hash, $params) { if(! perm_is_allowed($channel['channel_id'],$observer_hash,'view_stream')) http_status_exit(403); } - $items = items_fetch(array( - 'wall' => '1', - 'datequery' => $params['end'], - 'datequery2' => $params['begin'], - 'start' => $params['start'], // FIXME - 'records' => $params['records'], // FIXME - 'direction' => $params['direction'], // FIXME - 'pages' => $params['pages'], - 'order' => 'post', - 'top' => $params['top'], - 'cat' => $params['cat'] - ), $channel, $observer_hash, CLIENT_MODE_NORMAL, App::$module); - $feed_template = get_markup_template('atom_feed.tpl'); @@ -112,8 +99,27 @@ function get_feed_for($channel, $observer_hash, $params) { )); + $x = [ 'xml' => $atom, 'channel' => $channel, 'observer_hash' => $observer_hash, 'params' => $params ]; + call_hooks('atom_feed_top',$x); + + $atom = $x['xml']; + + // a much simpler interface call_hooks('atom_feed', $atom); + $items = items_fetch(array( + 'wall' => '1', + 'datequery' => $params['end'], + 'datequery2' => $params['begin'], + 'start' => $params['start'], // FIXME + 'records' => $params['records'], // FIXME + 'direction' => $params['direction'], // FIXME + 'pages' => $params['pages'], + 'order' => 'post', + 'top' => $params['top'], + 'cat' => $params['cat'] + ), $channel, $observer_hash, CLIENT_MODE_NORMAL, App::$module); + if($items) { $type = 'html'; foreach($items as $item) { |