aboutsummaryrefslogtreecommitdiffstats
path: root/include/apps.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-04 18:27:46 -0700
committerredmatrix <git@macgirvin.com>2016-05-04 18:27:46 -0700
commit566667a263abd6f4b2a8a24579323e65d0016d7c (patch)
tree674b4a64548d930bc80ba60876f122ffa3f2d5f4 /include/apps.php
parent1b6bc5394b7cf8435928eaa2ace4e321f517ecb6 (diff)
downloadvolse-hubzilla-566667a263abd6f4b2a8a24579323e65d0016d7c.tar.gz
volse-hubzilla-566667a263abd6f4b2a8a24579323e65d0016d7c.tar.bz2
volse-hubzilla-566667a263abd6f4b2a8a24579323e65d0016d7c.zip
provide a tag cloud for app categories and allow filtering apps from this
Diffstat (limited to 'include/apps.php')
-rw-r--r--include/apps.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/apps.php b/include/apps.php
index b3d0c954e..7439be6d4 100644
--- a/include/apps.php
+++ b/include/apps.php
@@ -370,12 +370,29 @@ function app_installed($uid,$app) {
}
-function app_list($uid, $deleted = false) {
+function app_list($uid, $deleted = false, $cat = '') {
if($deleted)
$sql_extra = " and app_deleted = 1 ";
else
$sql_extra = " and app_deleted = 0 ";
+ if($cat) {
+ $r = q("select oid from term where otype = %d and term = '%s'",
+ intval(TERM_OBJ_APP),
+ dbesc($cat)
+ );
+ if(! $r)
+ return $r;
+ $sql_extra .= " and app.id in ( ";
+ $s = '';
+ foreach($r as $rr) {
+ if($s)
+ $s .= ',';
+ $s .= intval($rr['oid']);
+ }
+ $sql_extra .= $s . ') ';
+ }
+
$r = q("select * from app where app_channel = %d $sql_extra order by app_name asc",
intval($uid)
);