diff options
author | Mario Vavti <mario@mariovavti.com> | 2021-09-29 21:47:36 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2021-09-29 21:47:36 +0200 |
commit | fbefff6eedd056011dfcc93ece9e2444d9452b19 (patch) | |
tree | 5a6fee0438a6e63aadd88e8157f0cee2273b274d /include/channel.php | |
parent | 4ba47698d7d0ef6c799bd0a28045c1d1e49c76f3 (diff) | |
parent | 2688abf25a0bfc2a9e3b7537afc08a8d44f49e0c (diff) | |
download | volse-hubzilla-fbefff6eedd056011dfcc93ece9e2444d9452b19.tar.gz volse-hubzilla-fbefff6eedd056011dfcc93ece9e2444d9452b19.tar.bz2 volse-hubzilla-fbefff6eedd056011dfcc93ece9e2444d9452b19.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'include/channel.php')
-rw-r--r-- | include/channel.php | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/include/channel.php b/include/channel.php index ed46904e7..53b781eb6 100644 --- a/include/channel.php +++ b/include/channel.php @@ -802,7 +802,6 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals /* * basic channel export */ - if(! $sections) { $sections = get_default_export_sections(); } @@ -1117,7 +1116,7 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals and created > %s - INTERVAL %s and resource_type = '' order by created", intval($channel_id), db_utcnow(), - db_quoteinterval('3 MONTH') + db_quoteinterval('1 MONTH') ); if($r) { $ret['item'] = array(); @@ -1239,11 +1238,11 @@ function channel_export_items_date($channel_id, $start, $finish, $zap_compat = f * * @param int $channel_id The channel ID * @param int $page - * @param int $limit (default 50) + * @param int $limit (default 10) * @return array */ -function channel_export_items_page($channel_id, $start, $finish, $page = 0, $limit = 50, $zap_compat = false) { +function channel_export_items_page($channel_id, $start, $finish, $page = 0, $limit = 10, $zap_compat = false) { if(intval($page) < 1) { $page = 0; @@ -1253,8 +1252,8 @@ function channel_export_items_page($channel_id, $start, $finish, $page = 0, $lim $limit = 1; } - if(intval($limit) > 5000) { - $limit = 5000; + if(intval($limit) > 1000) { + $limit = 1000; } if(! $start) @@ -1279,6 +1278,17 @@ function channel_export_items_page($channel_id, $start, $finish, $page = 0, $lim $ret['compatibility']['codebase'] = 'zap'; } + $r = q("select count(id) as total from item where ( item_wall = 1 or item_type != %d ) and item_deleted = 0 and uid = %d and resource_type != 'photo' and created >= '%s' and created <= '%s'", + intval(ITEM_TYPE_POST), + intval($channel_id), + dbesc($start), + dbesc($finish) + ); + + if ($r) { + $ret['items_total']= $r[0]['total']; + $ret['items_page']= $limit; + } $r = q("select * from item where ( item_wall = 1 or item_type != %d ) and item_deleted = 0 and uid = %d and resource_type != 'photo' and created >= '%s' and created <= '%s' order by created limit %d offset %d", intval(ITEM_TYPE_POST), |