aboutsummaryrefslogtreecommitdiffstats
path: root/include/identity.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2015-07-29 22:04:07 +0200
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2015-07-29 22:04:07 +0200
commit98fa996b3f5125b60e2653bca2218b08041ad6a4 (patch)
tree685c3909ac49f7a25cd39877f74ed56ada9b15e0 /include/identity.php
parent07e890a79a5c506b2e32272edf86ad4aba3b8fba (diff)
parentcbb6d37b6ca7e5d9e476fd3e7bea3ba56d3271e1 (diff)
downloadvolse-hubzilla-98fa996b3f5125b60e2653bca2218b08041ad6a4.tar.gz
volse-hubzilla-98fa996b3f5125b60e2653bca2218b08041ad6a4.tar.bz2
volse-hubzilla-98fa996b3f5125b60e2653bca2218b08041ad6a4.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/identity.php')
-rw-r--r--include/identity.php40
1 files changed, 36 insertions, 4 deletions
diff --git a/include/identity.php b/include/identity.php
index 8ba5d64db..804f316d1 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -583,9 +583,41 @@ function identity_basic_export($channel_id, $items = false) {
/** @warning this may run into memory limits on smaller systems */
- $r = q("select * from item where item_wall = 1 and item_deleted = 0 and uid = %d",
- intval($channel_id)
+ /** export one year of posts. If you want to export and import all posts you have to start with
+ * the first year and export/import them in ascending order.
+ */
+
+ $r = q("select * from item where item_wall = 1 and item_deleted = 0 and uid = %d and created > %s - INTERVAL %s",
+ intval($channel_id),
+ db_utcnow(),
+ db_quoteinterval('1 YEAR')
+ );
+ 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;
+}
+
+
+function identity_export_year($channel_id,$year) {
+
+ if(! $year)
+ return array();
+
+ $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' ",
+ intval($channel_id),
+ dbesc($mindate),
+ dbesc($maxdate)
);
+
if($r) {
$ret['item'] = array();
xchan_query($r);
@@ -1360,10 +1392,10 @@ function get_theme_uid() {
* with the specified size.
*
* @param int $size
-* one of (175, 80, 48)
+* one of (300, 80, 48)
* @returns string
*/
-function get_default_profile_photo($size = 175) {
+function get_default_profile_photo($size = 300) {
$scheme = get_config('system','default_profile_photo');
if(! $scheme)
$scheme = 'rainbow_man';