tag lister
This commit is contained in:
parent
ec7f06ec54
commit
55907cf599
2 changed files with 21 additions and 0 deletions
|
@ -32,3 +32,12 @@ function country_widget() {
|
||||||
}
|
}
|
||||||
return $o;
|
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
12
mod/tags.php
Normal 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();
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue