X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2FForumManager.php;h=039b4f5d248af865a626228229c7399243a5de11;hb=98686e9091189b536d7a08ced3bcafe3f41cca7c;hp=17a6b6730b6956c72e8d26aede56e108dc8a4f3f;hpb=01b02dbcaa8532f965389375e961d9c47d74eeec;p=friendica.git diff --git a/include/ForumManager.php b/include/ForumManager.php index 17a6b6730b..039b4f5d24 100644 --- a/include/ForumManager.php +++ b/include/ForumManager.php @@ -1,5 +1,9 @@ forum name * 'id' => number of the key from the array * 'micro' => contact photo in format micro + * 'thumb' => contact photo in format thumb */ public static function get_list($uid, $showhidden = true, $lastitem, $showprivate = false) { @@ -38,25 +43,28 @@ class ForumManager { $select = '(`forum` OR `prv`)'; } - $contacts = q("SELECT `contact`.`id`, `contact`.`url`, `contact`.`name`, `contact`.`micro` 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'], 'id' => $contact['id'], 'micro' => $contact['micro'], + 'thumb' => $contact['thumb'], ); } + dba::close($contacts); + return($forumlist); } @@ -86,7 +94,7 @@ class ForumManager { $total = count($contacts); $visible_forums = 10; - if(count($contacts)) { + if (DBM::is_result($contacts)) { $id = 0; @@ -100,7 +108,7 @@ class ForumManager { '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;