From: friendica Date: Tue, 29 May 2012 06:24:10 +0000 (-0700) Subject: Provide backend option to only expire other peoples' conversations. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0241bd1fbf28e15daeb939bc14976cd2fd6d3251;p=friendica.git Provide backend option to only expire other peoples' conversations. --- diff --git a/include/items.php b/include/items.php index 66e111b55a..4b79003f6a 100644 --- a/include/items.php +++ b/include/items.php @@ -3076,13 +3076,20 @@ function item_getfeedattach($item) { function item_expire($uid,$days) { - if((! $uid) || (! $days)) + if((! $uid) || ($days < 1)) return; + // $expire_network_only = save your own wall posts + // and just expire conversations started by others + + $expire_network_only = get_pconfig($uid,'expire','expire_network_only'); + $sql_extra = ((intval($expire_network_only)) ? " AND wall = 0 " : ""); + $r = q("SELECT * FROM `item` WHERE `uid` = %d AND `created` < UTC_TIMESTAMP() - INTERVAL %d DAY AND `id` = `parent` + $sql_extra AND `deleted` = 0", intval($uid), intval($days)