mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 21:35:13 +00:00
add new conv_sort option
This commit is contained in:
parent
64cf36a2b5
commit
f2e802229a
2 changed files with 7 additions and 1 deletions
|
@ -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 = [];
|
||||
|
|
|
@ -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'])
|
||||
|
|
Loading…
Reference in a new issue