3 namespace Friendica\Content\Widget;
5 use Friendica\Core\Cache;
6 use Friendica\Core\L10n;
7 use Friendica\Core\Renderer;
8 use Friendica\Database\DBA;
9 use Friendica\Model\Term;
12 * Trending tags aside widget for the community pages, handles both local and global scopes
14 * @package Friendica\Content\Widget
19 * @param string $content 'global' (all posts) or 'local' (this node's posts only)
20 * @param int $period Period in hours to consider posts
24 public static function getHTML($content = 'global', int $period = 24)
26 if ($content == 'local') {
27 $tags = Term::getLocalTrendingHashtags($period, 20);
29 $tags = Term::getGlobalTrendingHashtags($period, 20);
32 $tpl = Renderer::getMarkupTemplate('widget/trending_tags.tpl');
33 $o = Renderer::replaceMacros($tpl, [
34 '$title' => L10n::tt('Trending Tags (last %d hour)', 'Trending Tags (last %d hours)', $period),
35 '$more' => L10n::t('More Trending Tags'),