X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FForumManager.php;h=cfd083f9f8c3821010e1f61d3d77a78d1163f278;hb=d2d6200669ddce44ead1813d06c855d75aa6706b;hp=d619db42b21cd9c774390ab0f797064b864d9843;hpb=755f6e8cc1ceb5fab0c0f63deb3ca7048d1ea48d;p=friendica.git diff --git a/src/Content/ForumManager.php b/src/Content/ForumManager.php index d619db42b2..cfd083f9f8 100644 --- a/src/Content/ForumManager.php +++ b/src/Content/ForumManager.php @@ -7,10 +7,13 @@ namespace Friendica\Content; use Friendica\App; use Friendica\Content\Feature; +use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Database\DBM; use dba; +require_once 'include/dba.php'; + /** * @brief This class handles methods related to the forum functionality */ @@ -33,7 +36,7 @@ class ForumManager */ public static function getList($uid, $lastitem, $showhidden = true, $showprivate = false) { - $forumlist = array(); + $forumlist = []; $order = (($showhidden) ? '' : ' AND NOT `hidden` '); $order .= (($lastitem) ? ' ORDER BY `last-item` DESC ' : ' ORDER BY `name` ASC '); @@ -46,7 +49,7 @@ class ForumManager "SELECT `contact`.`id`, `contact`.`url`, `contact`.`name`, `contact`.`micro`, `contact`.`thumb` FROM `contact` WHERE `network`= 'dfrn' AND $select AND `uid` = ? - AND NOT `blocked` AND NOT `hidden` AND NOT `pending` AND NOT `archive` + AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `success_update` > `failure_update` $order ", $uid @@ -57,13 +60,13 @@ class ForumManager } while ($contact = dba::fetch($contacts)) { - $forumlist[] = array( + $forumlist[] = [ 'url' => $contact['url'], 'name' => $contact['name'], 'id' => $contact['id'], 'micro' => $contact['micro'], 'thumb' => $contact['thumb'], - ); + ]; } dba::close($contacts); @@ -102,7 +105,7 @@ class ForumManager foreach ($contacts as $contact) { $selected = (($cid == $contact['id']) ? ' forum-selected' : ''); - $entry = array( + $entry = [ 'url' => 'network?f=&cid=' . $contact['id'], 'external_url' => 'redir/' . $contact['id'], 'name' => $contact['name'], @@ -110,7 +113,7 @@ class ForumManager 'selected' => $selected, 'micro' => System::removedBaseUrl(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)), 'id' => ++$id, - ); + ]; $entries[] = $entry; } @@ -118,13 +121,13 @@ class ForumManager $o .= replace_macros( $tpl, - array( - '$title' => t('Forums'), + [ + '$title' => L10n::t('Forums'), '$forums' => $entries, - '$link_desc' => t('External link to forum'), + '$link_desc' => L10n::t('External link to forum'), '$total' => $total, '$visible_forums' => $visible_forums, - '$showmore' => t('show more')) + '$showmore' => L10n::t('show more')] ); } @@ -158,7 +161,7 @@ class ForumManager $contacts = self::getList($uid, $lastitem, false, false); $total_shown = 0; - + $forumlist = ''; foreach ($contacts as $contact) { $forumlist .= micropro($contact, false, 'forumlist-profile-advanced'); $total_shown ++;