diff options
author | mrjive <mrjive@mrjive.it> | 2018-04-12 10:12:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-12 10:12:46 +0200 |
commit | ea36ebd0df3d7612e5a524b7a287f9c57b8783b3 (patch) | |
tree | 02d1ed484823bd2c2b34aa85f153af3e1cc3c85e /include/items.php | |
parent | a7ff2cc5ea11afd7b832bef24866abfb0220d022 (diff) | |
parent | 3bd645033330c2db0952e57db1516274487c0712 (diff) | |
download | volse-hubzilla-ea36ebd0df3d7612e5a524b7a287f9c57b8783b3.tar.gz volse-hubzilla-ea36ebd0df3d7612e5a524b7a287f9c57b8783b3.tar.bz2 volse-hubzilla-ea36ebd0df3d7612e5a524b7a287f9c57b8783b3.zip |
Merge pull request #5 from redmatrix/dev
Dev
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php index 6ddab9bf8..8bc4595b6 100755 --- a/include/items.php +++ b/include/items.php @@ -3504,11 +3504,14 @@ function item_getfeedattach($item) { } -function item_expire($uid,$days) { +function item_expire($uid,$days,$comment_days = 7) { if((! $uid) || ($days < 1)) return; + if(! $comment_days) + $comment_days = 7; + // $expire_network_only = save your own wall posts // and just expire conversations started by others // do not enable this until we can pass bulk delete messages through zot @@ -3527,6 +3530,7 @@ function item_expire($uid,$days) { $r = q("SELECT id FROM item WHERE uid = %d AND created < %s - INTERVAL %s + AND commented < %s - INTERVAL %s AND item_retained = 0 AND item_thread_top = 1 AND resource_type = '' @@ -3534,7 +3538,9 @@ function item_expire($uid,$days) { $sql_extra $item_normal LIMIT $expire_limit ", intval($uid), db_utcnow(), - db_quoteinterval(intval($days).' DAY') + db_quoteinterval(intval($days) . ' DAY'), + db_utcnow(), + db_quoteinterval(intval($comment_days) . ' DAY') ); if(! $r) |