<?php
+use Friendica\App;
+use Friendica\Core\System;
+
/**
* @file include/ForumManager.php
* @brief ForumManager class with its methods related to forum functionality *
$select = '(`forum` OR `prv`)';
}
- $contacts = q("SELECT `contact`.`id`, `contact`.`url`, `contact`.`name`, `contact`.`micro`, `contact`.`thumb` FROM `contact`
- WHERE `network`= 'dfrn' AND $select AND `uid` = %d
+ $contacts = dba::p("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 `success_update` > `failure_update`
$order ",
- intval($uid)
+ $uid
);
if (!$contacts)
return($forumlist);
- foreach($contacts as $contact) {
+ while ($contact = dba::fetch($contacts)) {
$forumlist[] = array(
'url' => $contact['url'],
'name' => $contact['name'],
'thumb' => $contact['thumb'],
);
}
+ dba::close($contacts);
+
return($forumlist);
}
*/
public static function widget($uid,$cid = 0) {
- if (! intval(feature_enabled(local_user(),'forumlist_widget')))
+ if(! intval(feature_enabled(local_user(),'forumlist_widget')))
return;
$o = '';
'name' => $contact['name'],
'cid' => $contact['id'],
'selected' => $selected,
- 'micro' => App::remove_baseurl(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)),
+ 'micro' => System::removedBaseUrl(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)),
'id' => ++$id,
);
$entries[] = $entry;
public static function profile_advanced($uid) {
$profile = intval(feature_enabled($uid,'forumlist_profile'));
- if (! $profile)
+ if(! $profile)
return;
$o = '';
foreach($contacts as $contact) {
$forumlist .= micropro($contact,false,'forumlist-profile-advanced');
$total_shown ++;
-
- if ($total_shown == $show_total) {
+ if($total_shown == $show_total)
break;
- }
}
- if (count($contacts) > 0) {
+ if(count($contacts) > 0)
$o .= $forumlist;
- }
-
- return $o;
+ return $o;
}
/**