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
*/
*/
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 ');
"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
}
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);
*/
public static function widget($uid, $cid = 0)
{
- if (! intval(feature_enabled(local_user(), 'forumlist_widget'))) {
+ if (! intval(Feature::isEnabled(local_user(), 'forumlist_widget'))) {
return;
}
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'],
'selected' => $selected,
'micro' => System::removedBaseUrl(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)),
'id' => ++$id,
- );
+ ];
$entries[] = $entry;
}
$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')]
);
}
*/
public static function profileAdvanced($uid)
{
- $profile = intval(feature_enabled($uid, 'forumlist_profile'));
+ $profile = intval(Feature::isEnabled($uid, 'forumlist_profile'));
if (! $profile) {
return;
}
$contacts = self::getList($uid, $lastitem, false, false);
$total_shown = 0;
-
+ $forumlist = '';
foreach ($contacts as $contact) {
$forumlist .= micropro($contact, false, 'forumlist-profile-advanced');
$total_shown ++;