use an array of profiles rather than a looping cursor for profile lists

This commit is contained in:
Evan Prodromou
2011-08-27 12:53:15 -04:00
parent 01fd24ce6a
commit f81c1f7554
4 changed files with 36 additions and 31 deletions

View File

@@ -58,22 +58,15 @@ class ProfileMiniList extends ProfileList
return new ProfileMiniListItem($profile, $this->action);
}
function showProfiles()
function maxProfiles()
{
$cnt = 0;
while ($this->profile->fetch()) {
$cnt++;
if ($cnt > PROFILES_PER_MINILIST) {
break;
}
$pli = $this->newListItem($this->profile);
$pli->show();
}
return $cnt;
return PROFILES_PER_MINILIST;
}
function avatarSize()
{
return AVATAR_MINI_SIZE;
}
}
class ProfileMiniListItem extends ProfileListItem