diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-08-17 22:23:23 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-08-17 22:23:23 -0700 |
commit | 9763c46b7eebe4ab537e5499e34a0d92618fb029 (patch) | |
tree | 2ddaa18018eb9e7a452df7080a4fcfdfddc27558 /include/identity.php | |
parent | abe362bdd442739580d065b0b66300522cfab316 (diff) | |
parent | f6823259241484a761bc7e69ce44db281a6cb825 (diff) | |
download | volse-hubzilla-9763c46b7eebe4ab537e5499e34a0d92618fb029.tar.gz volse-hubzilla-9763c46b7eebe4ab537e5499e34a0d92618fb029.tar.bz2 volse-hubzilla-9763c46b7eebe4ab537e5499e34a0d92618fb029.zip |
Merge https://github.com/redmatrix/redmatrix into pending_merge
Conflicts:
include/identity.php
Diffstat (limited to 'include/identity.php')
-rw-r--r-- | include/identity.php | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/include/identity.php b/include/identity.php index bce578d87..871d85700 100644 --- a/include/identity.php +++ b/include/identity.php @@ -604,15 +604,27 @@ function identity_basic_export($channel_id, $items = false) { } -function identity_export_year($channel_id,$year) { +function identity_export_year($channel_id,$year,$month = 0) { if(! $year) return array(); + if($month && $month <= 12) { + $target_month = sprintf('%02d',$month); + $target_month_plus = sprintf('%02d',$month+1); + } + else + $target_month = '01'; + $ret = array(); - $mindate = datetime_convert('UTC','UTC',$year . '-01-01 00:00:00'); - $maxdate = datetime_convert('UTC','UTC',$year+1 . '-01-01 00:00:00'); - $r = q("select * from item where item_wall = 1 and item_deleted = 0 and uid = %d and created >= '%s' and created < '%s' ", + + $mindate = datetime_convert('UTC','UTC',$year . '-' . $target_month . '-01 00:00:00'); + if($month && $month < 12) + $maxdate = datetime_convert('UTC','UTC',$year . '-' . $target_month_plus . '-01 00:00:00'); + else + $maxdate = datetime_convert('UTC','UTC',$year+1 . '-01-01 00:00:00'); + + $r = q("select * from item where item_wall = 1 and item_deleted = 0 and uid = %d and created >= '%s' and created < '%s' order by created", intval($channel_id), dbesc($mindate), dbesc($maxdate) |