Added description, removed sorting
This commit is contained in:
parent
91ad7936f3
commit
806e6a230e
|
@ -1541,12 +1541,6 @@ function sort_thr_received_rev(array $a, array $b)
|
||||||
*/
|
*/
|
||||||
function sort_thr_commented(array $a, array $b)
|
function sort_thr_commented(array $a, array $b)
|
||||||
{
|
{
|
||||||
if ($b['pinned'] && !$a['pinned']) {
|
|
||||||
return 1;
|
|
||||||
} elseif (!$b['pinned'] && $a['pinned']) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return strcmp($b['commented'], $a['commented']);
|
return strcmp($b['commented'], $a['commented']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -143,6 +143,15 @@ class Item extends BaseObject
|
||||||
return (bool)$useritem['pinned'];
|
return (bool)$useritem['pinned'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Select pinned rows from the item table for a given user
|
||||||
|
*
|
||||||
|
* @param integer $uid User ID
|
||||||
|
* @param array $selected Array of selected fields, empty for all
|
||||||
|
*
|
||||||
|
* @return boolean|object
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
public static function selectPinned(int $uid, array $selected = [])
|
public static function selectPinned(int $uid, array $selected = [])
|
||||||
{
|
{
|
||||||
$useritems = DBA::select('user-item', ['iid'], ['uid' => $uid, 'pinned' => true]);
|
$useritems = DBA::select('user-item', ['iid'], ['uid' => $uid, 'pinned' => true]);
|
||||||
|
|
Loading…
Reference in a new issue