mirror of
https://github.com/friendica/friendica
synced 2025-04-20 19:10:11 +00:00
Usage of the new tag tables
This commit is contained in:
parent
5367620467
commit
c2a9b3b9e9
3 changed files with 51 additions and 35 deletions
|
@ -25,15 +25,12 @@ use Friendica\BaseModule;
|
|||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Util\Strings;
|
||||
use Friendica\Model\Tag;
|
||||
use Friendica\Model\Term;
|
||||
|
||||
/**
|
||||
* Hashtag module.
|
||||
*/
|
||||
class Hashtag extends BaseModule
|
||||
{
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
{
|
||||
$result = [];
|
||||
|
@ -43,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(Tag::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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue