aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-11-17 15:53:59 +0100
committerFabio Comuni <fabrix.xm@gmail.com>2011-11-17 15:53:59 +0100
commit79603e31463eb143392c5d27a5b2c87687b2460c (patch)
tree88783dde1e52edbb53d28ed1eb1aac1fac5ac140 /include/items.php
parent844a36e2b6c9cd8e934b57b7d56b7a9863f12929 (diff)
downloadvolse-hubzilla-79603e31463eb143392c5d27a5b2c87687b2460c.tar.gz
volse-hubzilla-79603e31463eb143392c5d27a5b2c87687b2460c.tar.bz2
volse-hubzilla-79603e31463eb143392c5d27a5b2c87687b2460c.zip
expire settings for items, notes and photos.
show default privacy acl in popup
Diffstat (limited to 'include/items.php')
-rw-r--r--include/items.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php
index ecf19a86e..8c9a714cd 100644
--- a/include/items.php
+++ b/include/items.php
@@ -2723,15 +2723,33 @@ function item_expire($uid,$days) {
if(! count($r))
return;
+
+ $expire_items = get_pconfig($uid, 'expire','items');
+ $expire_items = (($expire_items===false)?1:intval($expire_items)); // default if not set: 1
+
+ $expire_notes = get_pconfig($uid, 'expire','notes');
+ $expire_notes = (($expire_notes===false)?1:intval($expire_notes)); // default if not set: 1
+
+ $expire_photos = get_pconfig($uid, 'expire','photos');
+ $expire_photos = (($expire_photos===false)?0:intval($expire_photos)); // default if not set: 0
logger('expire: # items=' . count($r) );
+ logger("expire: items: $expire_items, notes: $expire_notes, photos: $expire_photos");
foreach($r as $item) {
// Only expire posts, not photos and photo comments
- if(strlen($item['resource-id']))
+ logger('expire: item '.$item['type'].' id '.intval($item['id']).' "'.$item['body'].'" '.$item['resource-id']);
+
+ if($expire_photos==0 && strlen($item['resource-id']))
+ continue;
+ if($expire_notes==0 && $item['type']=='note')
continue;
+ if($expire_items==0 && $item['type']!='note')
+ continue;
+
+ logger('expire');
$r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `id` = %d LIMIT 1",
dbesc(datetime_convert()),
@@ -2751,7 +2769,7 @@ function item_expire($uid,$days) {
}
proc_run('php',"include/notifier.php","expire","$uid");
-
+
}