aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-07-16 20:20:42 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-07-16 20:20:42 -0700
commit3c60a0c22cc7945d8298a76d9dc2e30c1b2fb3c3 (patch)
treeda39e7c9dda2e1c210f014b58b61b95c81f6d38f /mod
parent4299ae65a4ec406bbd932e0948197c5127a57b3b (diff)
downloadvolse-hubzilla-3c60a0c22cc7945d8298a76d9dc2e30c1b2fb3c3.tar.gz
volse-hubzilla-3c60a0c22cc7945d8298a76d9dc2e30c1b2fb3c3.tar.bz2
volse-hubzilla-3c60a0c22cc7945d8298a76d9dc2e30c1b2fb3c3.zip
provide any single year of exported items
Diffstat (limited to 'mod')
-rw-r--r--mod/uexport.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/mod/uexport.php b/mod/uexport.php
index edcb2fa84..8217a17c4 100644
--- a/mod/uexport.php
+++ b/mod/uexport.php
@@ -9,9 +9,17 @@ function uexport_init(&$a) {
require_once('include/identity.php');
+ if(argc() > 1 && intval(argv(1)) > 1900) {
+ $year = intval(argv(1));
+ }
+
header('content-type: application/octet_stream');
- header('content-disposition: attachment; filename="' . $channel['channel_address'] . '.json"' );
+ header('content-disposition: attachment; filename="' . $channel['channel_address'] . (($year) ? '-' . $year : '') . '.json"' );
+ if($year) {
+ echo json_encode(identity_export_year(local_channel(),$year));
+ killme();
+ }
if(argc() > 1 && argv(1) === 'basic') {
echo json_encode(identity_basic_export(local_channel()));
@@ -34,7 +42,9 @@ function uexport_content(&$a) {
'$basictitle' => t('Export Channel'),
'$basic' => t('Export your basic channel information to a small file. This acts as a backup of your connections, permissions, profile and basic data, which can be used to import your data to a new hub, but does not contain your content.'),
'$fulltitle' => t('Export Content'),
- '$full' => t('Export your channel information and all the content to a JSON backup. This backs up all of your connections, permissions, profile data and all of your content, but is generally not suitable for importing a channel to a new hub as this file may be VERY large. Please be patient - it may take several minutes for this download to begin.')
+ '$full' => t('Export your channel information and all the content to a JSON backup. This backs up all of your connections, permissions, profile data and the last year of posts. This file may be VERY large. Please be patient - it may take several minutes for this download to begin.'),
+ '$by_year' => t('Export your posts from a given year.'),
+
));
return $o;
}