X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FWidget%2FTagCloud.php;h=23aac19eb79a2a0c7c9ad6cfaf5a14b77898776e;hb=8a46c786f37550160d81e7b7ecbcacb4c9fff493;hp=53c4daae4512ea522d49a484031415ba94365e3f;hpb=6cf50a14fae25210a0cdb617c29d549abcfde9ac;p=friendica.git diff --git a/src/Content/Widget/TagCloud.php b/src/Content/Widget/TagCloud.php index 53c4daae45..23aac19eb7 100644 --- a/src/Content/Widget/TagCloud.php +++ b/src/Content/Widget/TagCloud.php @@ -6,13 +6,14 @@ namespace Friendica\Content\Widget; -use dba; use Friendica\Core\L10n; +use Friendica\Core\Renderer; use Friendica\Core\System; -use Friendica\Database\DBM; +use Friendica\Database\DBA; +use Friendica\Model\Item; +use Friendica\Util\Security; require_once 'include/dba.php'; -require_once 'include/security.php'; /** * TagCloud widget @@ -38,7 +39,7 @@ class TagCloud $o = ''; $r = self::tagadelic($uid, $count, $owner_id, $flags, $type); if (count($r)) { - $contact = dba::selectFirst('contact', ['url'], ['uid' => $uid, 'self' => true]); + $contact = DBA::selectFirst('contact', ['url'], ['uid' => $uid, 'self' => true]); $url = System::removedBaseUrl($contact['url']); foreach ($r as $rr) { @@ -49,8 +50,8 @@ class TagCloud $tags[] = $tag; } - $tpl = get_markup_template('tagblock_widget.tpl'); - $o = replace_macros($tpl, [ + $tpl = Renderer::getMarkupTemplate('tagblock_widget.tpl'); + $o = Renderer::replaceMacros($tpl, [ '$title' => L10n::t('Tags'), '$tags' => $tags ]); @@ -74,7 +75,7 @@ class TagCloud */ private static function tagadelic($uid, $count = 0, $owner_id = 0, $flags = '', $type = TERM_HASHTAG) { - $sql_options = item_permissions_sql($uid); + $sql_options = Item::getPermissionsSQLByUserId($uid); $limit = $count ? sprintf('LIMIT %d', intval($count)) : ''; if ($flags) { @@ -88,7 +89,7 @@ class TagCloud } // Fetch tags - $r = dba::p("SELECT `term`, COUNT(`term`) AS `total` FROM `term` + $r = DBA::p("SELECT `term`, COUNT(`term`) AS `total` FROM `term` LEFT JOIN `item` ON `term`.`oid` = `item`.`id` WHERE `term`.`uid` = ? AND `term`.`type` = ? AND `term`.`otype` = ? @@ -99,7 +100,7 @@ class TagCloud $type, TERM_OBJ_POST ); - if (!DBM::is_result($r)) { + if (!DBA::isResult($r)) { return []; }