From 23352b939b0fadaadad9c6e02d6d1545f00ee0e9 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 17 Nov 2013 19:49:48 -0800 Subject: better job of setting parent created --- include/items.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index f8b698a4a..5625f2c68 100755 --- a/include/items.php +++ b/include/items.php @@ -1783,16 +1783,13 @@ function item_store($arr,$allow_exec = false) { // update the commented timestamp on the parent - q("update item set commented = ( select max(created) from item where parent_mid = '%s' and uid = %d ) - where id = %d limit 1", + $z = q("select max(created) as created from item where parent_mid = '%s' and uid = %d ", dbesc($arr['parent_mid']), - intval($arr['uid']), - intval($parent_id) + intval($arr['uid']) ); - - q("UPDATE item set changed = '%s' WHERE id = %d LIMIT 1", - dbesc(datetime_convert()), + q("UPDATE item set created = '%s', changed = '%s' WHERE id = %d LIMIT 1", + dbesc(($z) ? $z[0]['created'] : (datetime_convert())), intval($parent_id) ); -- cgit v1.2.3