]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Hashtag.php
Replace `$parameters` argument per method with `static::$parameters`
[friendica.git] / src / Module / Hashtag.php
index 50719774fb51cb5f3595e8c3adf5e7567b62e756..aebe15dd0d0e325e8d3ffa979ec7751af8264fe6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -31,8 +31,7 @@ use Friendica\Util\Strings;
  */
 class Hashtag extends BaseModule
 {
-
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $result = [];
 
@@ -41,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);