X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FHashtag.php;h=cdf0de6c16d11221d10ddae96f09247a2a92251b;hb=53e38b03130ea798bba44db44ccb7f331dc4b91d;hp=4d091835292e25f69da1ca972a80063c58d06b70;hpb=53e9203d37ee0c1a2afed0faf295e3c622ac2e17;p=friendica.git diff --git a/src/Module/Hashtag.php b/src/Module/Hashtag.php index 4d09183529..cdf0de6c16 100644 --- a/src/Module/Hashtag.php +++ b/src/Module/Hashtag.php @@ -1,7 +1,24 @@ . + * */ + namespace Friendica\Module; use Friendica\BaseModule; @@ -9,16 +26,12 @@ use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\Util\Strings; -require_once 'include/dba.php'; -require_once 'include/text.php'; - /** * Hashtag module. */ class Hashtag extends BaseModule { - - public static function content() + public static function content(array $parameters = []) { $result = []; @@ -27,12 +40,9 @@ class Hashtag extends BaseModule System::jsonExit($result); } - $taglist = DBA::p("SELECT DISTINCT(`term`) FROM `term` WHERE `term` LIKE ? AND `type` = ? ORDER BY `term`", - $t . '%', - intval(TERM_HASHTAG) - ); + $taglist = DBA::select('tag', ['name'], ["`name` LIKE ?", $t . "%"], ['order' => ['name'], 'limit' => 100]); while ($tag = DBA::fetch($taglist)) { - $result[] = ['text' => $tag['term']]; + $result[] = ['text' => $tag['name']]; } DBA::close($taglist);