diff options
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Hashtags.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Zotlabs/Module/Hashtags.php b/Zotlabs/Module/Hashtags.php new file mode 100644 index 000000000..d87a82818 --- /dev/null +++ b/Zotlabs/Module/Hashtags.php @@ -0,0 +1,29 @@ +<?php + +namespace Zotlabs\Module; + + +class Hashtags extends \Zotlabs\Web\Controller { + + function init() { + $result = []; + + logger(print_r($_REQUEST,true)); + + $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' => strtolower($rv['term']) ]; + } + } + logger(print_r($result,true)); + json_return_and_die($result); + } +}
\ No newline at end of file |