mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 12:15:15 +00:00
connections ordering
This commit is contained in:
parent
e2b3646dca
commit
cf97dae6e1
1 changed files with 19 additions and 2 deletions
|
@ -207,8 +207,25 @@ class Connections extends Controller {
|
|||
$total = $r[0]['total'];
|
||||
}
|
||||
|
||||
switch($_REQUEST['order']) {
|
||||
case 'date':
|
||||
$order = 'abook_created desc';
|
||||
break;
|
||||
case 'created':
|
||||
$order = 'abook_created';
|
||||
break;
|
||||
case 'cmax':
|
||||
$order = 'abook_closeness';
|
||||
break;
|
||||
case 'name':
|
||||
default:
|
||||
$order = 'xchan_name';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash
|
||||
WHERE abook_channel = %d and abook_self = 0 and xchan_deleted = 0 and xchan_orphan = 0 $sql_extra $sql_extra2 ORDER BY xchan_name LIMIT %d OFFSET %d ",
|
||||
WHERE abook_channel = %d and abook_self = 0 and xchan_deleted = 0 and xchan_orphan = 0 $sql_extra $sql_extra2 ORDER BY $order LIMIT %d OFFSET %d ",
|
||||
intval(local_channel()),
|
||||
intval(App::$pager['itemspage']),
|
||||
intval(App::$pager['start'])
|
||||
|
|
Loading…
Reference in a new issue