diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-06-29 09:11:22 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-06-29 09:11:22 +0200 |
commit | 3102440d407fe195878b9535aae4fd0da750f437 (patch) | |
tree | b915e72f142daf09bdfb3e110a7fbf93d17b0f37 | |
parent | dcc65bbacb81801b5e138795c18ef9e740dbd26c (diff) | |
parent | 715b1667d928175c0fac5832b998d9ded92974a3 (diff) | |
download | volse-hubzilla-3102440d407fe195878b9535aae4fd0da750f437.tar.gz volse-hubzilla-3102440d407fe195878b9535aae4fd0da750f437.tar.bz2 volse-hubzilla-3102440d407fe195878b9535aae4fd0da750f437.zip |
Merge branch 'dev' into sabre32
-rw-r--r-- | Zotlabs/Lib/SuperCurl.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Viewconnections.php | 5 | ||||
-rw-r--r-- | include/channel.php | 38 |
3 files changed, 43 insertions, 2 deletions
diff --git a/Zotlabs/Lib/SuperCurl.php b/Zotlabs/Lib/SuperCurl.php index fd47c399c..1c8583ff5 100644 --- a/Zotlabs/Lib/SuperCurl.php +++ b/Zotlabs/Lib/SuperCurl.php @@ -64,9 +64,9 @@ class SuperCurl { $this->auth = $v; break; case 'magicauth': + // currently experimental $this->magicauth = $v; \Zotlabs\Daemon\Master::Summon([ 'CurlAuth', $v ]); - sleep(2); break; case 'custom': $this->request_method = $v; diff --git a/Zotlabs/Module/Viewconnections.php b/Zotlabs/Module/Viewconnections.php index 7523c259b..4364d482a 100644 --- a/Zotlabs/Module/Viewconnections.php +++ b/Zotlabs/Module/Viewconnections.php @@ -10,8 +10,11 @@ class Viewconnections extends \Zotlabs\Web\Controller { if(observer_prohibited()) { return; } - if(argc() > 1) + + if(argc() > 1) { profile_load(argv(1)); + } + } function get() { diff --git a/include/channel.php b/include/channel.php index 913768017..95506ed78 100644 --- a/include/channel.php +++ b/include/channel.php @@ -747,6 +747,44 @@ function identity_export_year($channel_id,$year,$month = 0) { return $ret; } +// export items within an arbitrary date range. Date/time is in UTC. + +function channel_export_items($channel_id,$start,$finish) { + + if(! $start) + return array(); + else + $start = datetime_convert('UTC','UTC',$start); + + $finish = datetime_convert('UTC','UTC',(($finish) ? $finish : 'now')); + if($finish < $start) + return array(); + + $ret = array(); + + $ch = channelx_by_n($channel_id); + if($ch) { + $ret['relocate'] = [ 'channel_address' => $ch['channel_address'], 'url' => z_root()]; + } + + $r = q("select * from item where ( item_wall = 1 or item_type != %d ) and item_deleted = 0 and uid = %d and created >= '%s' and created < '%s' and resource_type = '' order by created", + intval(ITEM_TYPE_POST), + intval($channel_id), + dbesc($start), + dbesc($finish) + ); + + if($r) { + $ret['item'] = array(); + xchan_query($r); + $r = fetch_post_tags($r,true); + foreach($r as $rr) + $ret['item'][] = encode_item($rr,true); + } + + return $ret; +} + /** * @brief Loads a profile into the App structure. |