X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcommunity.php;h=5ffb00729fd8aa8a33aebc037174aea275795080;hb=5f2028b657332c7dceb1e14dc0e1cd175fc61a7c;hp=063e1c693eafcd5d9d5a49d0b0f9b0eecd67d981;hpb=acaee626f5f23f4c1dc19c31896a0797a251b58f;p=friendica.git diff --git a/mod/community.php b/mod/community.php index 063e1c693e..5ffb00729f 100644 --- a/mod/community.php +++ b/mod/community.php @@ -4,16 +4,18 @@ */ use Friendica\App; +use Friendica\Content\Feature; use Friendica\Content\Nav; use Friendica\Content\Pager; +use Friendica\Content\Widget\TrendingTags; use Friendica\Core\ACL; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Renderer; use Friendica\Database\DBA; -use Friendica\Model\Contact; use Friendica\Model\Item; +use Friendica\Model\User; function community_init(App $a) { @@ -44,16 +46,16 @@ function community_content(App $a, $update = 0) if ($a->argc > 2) { switch ($a->argv[2]) { case 'person': - $accounttype = Contact::ACCOUNT_TYPE_PERSON; + $accounttype = User::ACCOUNT_TYPE_PERSON; break; case 'organisation': - $accounttype = Contact::ACCOUNT_TYPE_ORGANISATION; + $accounttype = User::ACCOUNT_TYPE_ORGANISATION; break; case 'news': - $accounttype = Contact::ACCOUNT_TYPE_NEWS; + $accounttype = User::ACCOUNT_TYPE_NEWS; break; case 'community': - $accounttype = Contact::ACCOUNT_TYPE_COMMUNITY; + $accounttype = User::ACCOUNT_TYPE_COMMUNITY; break; } } @@ -197,6 +199,14 @@ function community_content(App $a, $update = 0) $o .= $pager->renderMinimal(count($r)); } + if (empty($a->page['aside'])) { + $a->page['aside'] = ''; + } + + if (Feature::isEnabled(local_user(), 'trending_tags')) { + $a->page['aside'] .= TrendingTags::getHTML($content); + } + $t = Renderer::getMarkupTemplate("community.tpl"); return Renderer::replaceMacros($t, [ '$content' => $o, @@ -218,9 +228,9 @@ function community_getitems($start, $itemspage, $content, $accounttype) } $r = DBA::p("SELECT `item`.`uri`, `author`.`url` AS `author-link` FROM `thread` - INNER JOIN `user` ON `user`.`uid` = `thread`.`uid` AND NOT `user`.`hidewall` - INNER JOIN `item` ON `item`.`id` = `thread`.`iid` - INNER JOIN `contact` AS `author` ON `author`.`id`=`item`.`author-id` + STRAIGHT_JOIN `user` ON `user`.`uid` = `thread`.`uid` AND NOT `user`.`hidewall` + STRAIGHT_JOIN `item` ON `item`.`id` = `thread`.`iid` + STRAIGHT_JOIN `contact` AS `author` ON `author`.`id`=`item`.`author-id` WHERE `thread`.`visible` AND NOT `thread`.`deleted` AND NOT `thread`.`moderated` AND NOT `thread`.`private` AND `thread`.`wall` AND `thread`.`origin` $sql_accounttype ORDER BY `thread`.`commented` DESC LIMIT ?, ?", $values);