X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2FForumManager.php;h=8473035affe43faf33440faa3479f22543c77584;hb=96501bda816bb3db29ea19d89e6ffc0e83f350b3;hp=47a4d55a47737ca4bf8c91c1e18c1439ef287681;hpb=9c2c4839968169a191084d6d2b0d629d82430e67;p=friendica.git diff --git a/include/ForumManager.php b/include/ForumManager.php index 47a4d55a47..8473035aff 100644 --- a/include/ForumManager.php +++ b/include/ForumManager.php @@ -1,5 +1,8 @@ `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'], @@ -59,6 +62,8 @@ class ForumManager { 'thumb' => $contact['thumb'], ); } + dba::close($contacts); + return($forumlist); } @@ -76,7 +81,7 @@ class ForumManager { */ 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 = ''; @@ -92,7 +97,7 @@ class ForumManager { $id = 0; - foreach ($contacts as $contact) { + foreach($contacts as $contact) { $selected = (($cid == $contact['id']) ? ' forum-selected' : ''); @@ -102,7 +107,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; @@ -136,7 +141,7 @@ class ForumManager { public static function profile_advanced($uid) { $profile = intval(feature_enabled($uid,'forumlist_profile')); - if (! $profile) + if(! $profile) return; $o = ''; @@ -151,20 +156,16 @@ class ForumManager { $total_shown = 0; - foreach ($contacts as $contact) { + 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; } /**