blob: 30048519608157d966423e317de1699dcbd1a7f7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<?php
namespace Zotlabs\Module;
class Hashtags extends \Zotlabs\Web\Controller {
function init() {
$result = [];
$t = escape_tags($_REQUEST['t']);
if(! $t)
json_return_and_die($result);
$r = q("select distinct(term) from term where term like '%s' and ttype = %d order by term",
dbesc($t . '%'),
intval(TERM_HASHTAG)
);
if($r) {
foreach($r as $rv) {
$result[] = [ 'text' => $rv['term'] ];
}
}
json_return_and_die($result);
}
}
|