better job of setting parent created

This commit is contained in:
friendica 2013-11-17 19:49:48 -08:00
parent 13538cdd21
commit 23352b939b

View File

@ -1783,16 +1783,13 @@ function item_store($arr,$allow_exec = false) {
// update the commented timestamp on the parent // update the commented timestamp on the parent
q("update item set commented = ( select max(created) from item where parent_mid = '%s' and uid = %d ) $z = q("select max(created) as created from item where parent_mid = '%s' and uid = %d ",
where id = %d limit 1",
dbesc($arr['parent_mid']), dbesc($arr['parent_mid']),
intval($arr['uid']), intval($arr['uid'])
intval($parent_id)
); );
q("UPDATE item set created = '%s', changed = '%s' WHERE id = %d LIMIT 1",
q("UPDATE item set changed = '%s' WHERE id = %d LIMIT 1", dbesc(($z) ? $z[0]['created'] : (datetime_convert())),
dbesc(datetime_convert()),
intval($parent_id) intval($parent_id)
); );