aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-11-17 19:49:48 -0800
committerfriendica <info@friendica.com>2013-11-17 19:49:48 -0800
commit23352b939b0fadaadad9c6e02d6d1545f00ee0e9 (patch)
tree369ffb2dc1e86d5555fdcf55d7ba7f9565705375
parent13538cdd21c6e13a2ff108f1b42dbecaab8b375a (diff)
downloadvolse-hubzilla-23352b939b0fadaadad9c6e02d6d1545f00ee0e9.tar.gz
volse-hubzilla-23352b939b0fadaadad9c6e02d6d1545f00ee0e9.tar.bz2
volse-hubzilla-23352b939b0fadaadad9c6e02d6d1545f00ee0e9.zip
better job of setting parent created
-rwxr-xr-xinclude/items.php11
1 files changed, 4 insertions, 7 deletions
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)
);