diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-04-20 21:05:01 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-04-20 21:05:01 -0400 |
commit | b96eb1c8230ae2f5986d6f22934c606bbca9728e (patch) | |
tree | fecd2279927b61da28801094dc7d6b1cfa8d98fe /Zotlabs/Module/Feed.php | |
parent | 7594796ee11c0b245d02d145868a13ac3d84ebfc (diff) | |
parent | 635580091a227529cb491e6441a5acbfff3177be (diff) | |
download | volse-hubzilla-b96eb1c8230ae2f5986d6f22934c606bbca9728e.tar.gz volse-hubzilla-b96eb1c8230ae2f5986d6f22934c606bbca9728e.tar.bz2 volse-hubzilla-b96eb1c8230ae2f5986d6f22934c606bbca9728e.zip |
Merge branch 'dev' into toggle-context-help
Diffstat (limited to 'Zotlabs/Module/Feed.php')
-rw-r--r-- | Zotlabs/Module/Feed.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Zotlabs/Module/Feed.php b/Zotlabs/Module/Feed.php new file mode 100644 index 000000000..9d33ba2c3 --- /dev/null +++ b/Zotlabs/Module/Feed.php @@ -0,0 +1,48 @@ +<?php +namespace Zotlabs\Module; + + +require_once('include/items.php'); + + +class Feed extends \Zotlabs\Web\Controller { + + function init() { + + $params = array(); + + $params['begin'] = ((x($_REQUEST,'date_begin')) ? $_REQUEST['date_begin'] : NULL_DATE); + $params['end'] = ((x($_REQUEST,'date_end')) ? $_REQUEST['date_end'] : ''); + $params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml'); + $params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0); + $params['top'] = ((x($_REQUEST,'top')) ? intval($_REQUEST['top']) : 0); + $params['start'] = ((x($params,'start')) ? intval($params['start']) : 0); + $params['records'] = ((x($params,'records')) ? intval($params['records']) : 40); + $params['direction'] = ((x($params,'direction')) ? dbesc($params['direction']) : 'desc'); + $params['cat'] = ((x($_REQUEST,'cat')) ? escape_tags($_REQUEST['cat']) : ''); + + $channel = ''; + if(argc() > 1) { + $r = q("select * from channel left join xchan on channel_hash = xchan_hash where channel_address = '%s' limit 1", + dbesc(argv(1)) + ); + if(!($r && count($r))) + killme(); + + $channel = $r[0]; + + if((intval(get_config('system','block_public'))) && (! get_account_id())) + killme(); + + logger('mod_feed: public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $channel['channel_address']); + + echo get_public_feed($channel,$params); + + killme(); + } + + } + + + +} |