tag lister

This commit is contained in:
friendica 2012-07-05 22:06:42 -07:00
parent ec7f06ec54
commit 55907cf599
2 changed files with 21 additions and 0 deletions

View File

@ -32,3 +32,12 @@ function country_widget() {
}
return $o;
}
function get_taglist($limit = 50) {
$r = q("select distinct(term), count(term) as total from tag group by term order by count(term) desc limit %d",
intval($limit)
);
return $r;
}

12
mod/tags.php Normal file
View File

@ -0,0 +1,12 @@
<?php
function tags_init(&$a) {
if($a->argc > 1)
$limit = intval($a->argv[1]);
require_once('widget.php');
echo json_encode(get_taglist(($limit) ? $limit : 50));
killme();
}