3 namespace Friendica\Content\Widget;
5 use Friendica\Core\Renderer;
7 use Friendica\Model\Term;
10 * Trending tags aside widget for the community pages, handles both local and global scopes
12 * @package Friendica\Content\Widget
17 * @param string $content 'global' (all posts) or 'local' (this node's posts only)
18 * @param int $period Period in hours to consider posts
22 public static function getHTML($content = 'global', int $period = 24)
24 if ($content == 'local') {
25 $tags = Term::getLocalTrendingHashtags($period, 20);
27 $tags = Term::getGlobalTrendingHashtags($period, 20);
30 $tpl = Renderer::getMarkupTemplate('widget/trending_tags.tpl');
31 $o = Renderer::replaceMacros($tpl, [
32 '$title' => DI::l10n()->tt('Trending Tags (last %d hour)', 'Trending Tags (last %d hours)', $period),
33 '$more' => DI::l10n()->t('More Trending Tags'),