diff options
author | zotlabs <mike@macgirvin.com> | 2017-04-20 21:25:37 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-04-20 21:25:37 -0700 |
commit | 02ea713d6a12b767250eba12918018bb72cf4e38 (patch) | |
tree | ce4b62cc020a1d747c5caac385feda598eacf732 /include/feedutils.php | |
parent | 94f15e355166f0abd3698414948abff2397a7ad0 (diff) | |
download | volse-hubzilla-02ea713d6a12b767250eba12918018bb72cf4e38.tar.gz volse-hubzilla-02ea713d6a12b767250eba12918018bb72cf4e38.tar.bz2 volse-hubzilla-02ea713d6a12b767250eba12918018bb72cf4e38.zip |
make it easier to hook into feed headers in the future
Diffstat (limited to 'include/feedutils.php')
-rw-r--r-- | include/feedutils.php | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/include/feedutils.php b/include/feedutils.php index 03eb1f256..079d57072 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -63,7 +63,7 @@ function get_public_feed($channel, $params) { */ function get_feed_for($channel, $observer_hash, $params) { - if(! channel) + if(! $channel) http_status_exit(401); if($params['pages']) { @@ -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) { |