aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-08-23 20:02:28 -0700
committerzotlabs <mike@macgirvin.com>2017-08-23 20:02:28 -0700
commitf2e802229acb871e0b50afb729445cdef8586951 (patch)
tree5058ec7ef87211d9fe90fc2b86ebf10529efc98f
parent64cf36a2b5dc314728fbb262471f1dd7b0ad2d96 (diff)
downloadvolse-hubzilla-f2e802229acb871e0b50afb729445cdef8586951.tar.gz
volse-hubzilla-f2e802229acb871e0b50afb729445cdef8586951.tar.bz2
volse-hubzilla-f2e802229acb871e0b50afb729445cdef8586951.zip
add new conv_sort option
-rw-r--r--Zotlabs/Module/Cards.php2
-rw-r--r--include/conversation.php6
2 files changed, 7 insertions, 1 deletions
diff --git a/Zotlabs/Module/Cards.php b/Zotlabs/Module/Cards.php
index c542cd6ff..33688cba0 100644
--- a/Zotlabs/Module/Cards.php
+++ b/Zotlabs/Module/Cards.php
@@ -159,7 +159,7 @@ class Cards extends \Zotlabs\Web\Controller {
if($items) {
xchan_query($items);
$items = fetch_post_tags($items, true);
- $items = conv_sort($items,'created');
+ $items = conv_sort($items,'updated');
}
else
$items = [];
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'])