aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2011-11-21 04:57:56 -0800
committerfabrixxm <fabrix.xm@gmail.com>2011-11-21 04:57:56 -0800
commitea04263f52dc30ca21e2bfb61ff41cf4428f69f2 (patch)
tree9234db8ab0c946ed65123181acba0df71524a8eb /include/items.php
parentaaedac8f574278fba89cd11d3d8f1adaeb6b030e (diff)
parentcb05e677a96e1312263c0a1c63ee10cea62268b1 (diff)
downloadvolse-hubzilla-ea04263f52dc30ca21e2bfb61ff41cf4428f69f2.tar.gz
volse-hubzilla-ea04263f52dc30ca21e2bfb61ff41cf4428f69f2.tar.bz2
volse-hubzilla-ea04263f52dc30ca21e2bfb61ff41cf4428f69f2.zip
Merge pull request #8 from fabrixxm/master
expire settings, clean html from php, more work on quattro
Diffstat (limited to 'include/items.php')
-rw-r--r--include/items.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/include/items.php b/include/items.php
index 4e5617627..fd36dcadb 100644
--- a/include/items.php
+++ b/include/items.php
@@ -2814,14 +2814,27 @@ 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=' . count($r). "; expire items: $expire_items, expire notes: $expire_notes, expire photos: $expire_photos");
foreach($r as $item) {
// Only expire posts, not photos and photo comments
- if(strlen($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;
$r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `id` = %d LIMIT 1",
@@ -2842,7 +2855,7 @@ function item_expire($uid,$days) {
}
proc_run('php',"include/notifier.php","expire","$uid");
-
+
}