diff options
author | zotlabs <mike@macgirvin.com> | 2017-08-23 20:02:28 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-08-23 20:02:28 -0700 |
commit | f2e802229acb871e0b50afb729445cdef8586951 (patch) | |
tree | 5058ec7ef87211d9fe90fc2b86ebf10529efc98f /include | |
parent | 64cf36a2b5dc314728fbb262471f1dd7b0ad2d96 (diff) | |
download | volse-hubzilla-f2e802229acb871e0b50afb729445cdef8586951.tar.gz volse-hubzilla-f2e802229acb871e0b50afb729445cdef8586951.tar.bz2 volse-hubzilla-f2e802229acb871e0b50afb729445cdef8586951.zip |
add new conv_sort option
Diffstat (limited to 'include')
-rw-r--r-- | include/conversation.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/conversation.php b/include/conversation.php index e0de6fdce..2448775af 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1461,6 +1461,8 @@ function conv_sort($arr, $order) { usort($parents,'sort_thr_created'); elseif(stristr($order,'commented')) usort($parents,'sort_thr_commented'); + elseif(stristr($order,'updated')) + usort($parents,'sort_thr_updated'); elseif(stristr($order,'ascending')) usort($parents,'sort_thr_created_rev'); @@ -1502,6 +1504,10 @@ function sort_thr_commented($a,$b) { return strcmp($b['commented'],$a['commented']); } +function sort_thr_updated($a,$b) { + return strcmp($b['updated'],$a['updated']); +} + function find_thread_parent_index($arr,$x) { foreach($arr as $k => $v) if($v['id'] == $x['parent']) |