From 0bb89778d382fc5758354c6986130ce1ddba7d4c Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 26 Mar 2015 19:55:52 -0700 Subject: add channel_lastpost timestamp to help optimise some outrageously expensive queries. --- mod/item.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mod/item.php') diff --git a/mod/item.php b/mod/item.php index 8aa3d8136..fa40aea03 100644 --- a/mod/item.php +++ b/mod/item.php @@ -860,6 +860,13 @@ function item_post(&$a) { 'otype' => 'item' )); } + + if($uid && $uid == $profile_uid && (! $datarray['item_restrict'])) { + q("update channel set channel_lastpost = '%s' where channel_id = %d", + dbesc(datetime_convert()), + intval($uid) + ); + } } // photo comments turn the corresponding item visible to the profile wall -- cgit v1.2.3