diff options
author | Mario Vavti <mario@mariovavti.com> | 2021-09-23 21:52:27 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2021-09-23 21:52:27 +0200 |
commit | dff8ef91a6e2e2b2fddb816218e15750061c4c2b (patch) | |
tree | 1bb780a332d74cc8bcafc2ba643bf14efbc30a49 /include/items.php | |
parent | 4eb8921635add33215bffc4820f95c34b902f819 (diff) | |
download | volse-hubzilla-dff8ef91a6e2e2b2fddb816218e15750061c4c2b.tar.gz volse-hubzilla-dff8ef91a6e2e2b2fddb816218e15750061c4c2b.tar.bz2 volse-hubzilla-dff8ef91a6e2e2b2fddb816218e15750061c4c2b.zip |
implement the top option in items_fetch
Diffstat (limited to 'include/items.php')
-rw-r--r-- | include/items.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php index f451358f8..933d94f3c 100644 --- a/include/items.php +++ b/include/items.php @@ -4212,6 +4212,9 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C $item_uids = " item.uid = " . intval($uid) . " "; } + if($arr['top']) + $sql_options .= " and item_thread_top = 1 "; + if($arr['star']) $sql_options .= " and item_starred = 1 "; @@ -4367,7 +4370,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C if ($arr['total']) { $items = dbq("SELECT count(item.id) AS total FROM item WHERE $item_uids $item_restrict - $simple_update + $simple_update $sql_options $sql_extra $sql_nets $sql_extra3" ); if ($items) { @@ -4378,7 +4381,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C $items = dbq("SELECT item.*, item.id AS item_id FROM item WHERE $item_uids $item_restrict - $simple_update + $simple_update $sql_options $sql_extra $sql_nets $sql_extra3 ORDER BY item.received DESC $pager_sql" ); |