summaryrefslogtreecommitdiff
path: root/lib/profilelist.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-11-20 05:57:26 -0500
committerEvan Prodromou <evan@prodromou.name>2008-11-20 05:57:26 -0500
commit383e7409204ec6b62f172185f6800c281f5a2908 (patch)
tree127c4d5016271c70a3a62bd0a975c51b678d353c /lib/profilelist.php
parentd94e5f57acd1954460c37812279b3c2e2eb830da (diff)
better looping in profile list
darcs-hash:20081120105726-84dde-bc863f49370dca492d46a5f46c65f46d01862acb.gz
Diffstat (limited to 'lib/profilelist.php')
-rw-r--r--lib/profilelist.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/profilelist.php b/lib/profilelist.php
index 4c2037e05..b17b0ac92 100644
--- a/lib/profilelist.php
+++ b/lib/profilelist.php
@@ -33,14 +33,15 @@ class ProfileList {
function show_list() {
common_element_start('ul', array('id' => 'profiles'));
+
+ $cnt = 0;
- for ($i = 0; $i < min($cnt, PROFILES_PER_PAGE); $i++) {
- if ($this->profile->fetch()) {
- $this->show();
- } else {
- // shouldn't happen!
+ while ($this->profile->fetch()) {
+ $cnt++;
+ if($cnt > PROFILES_PER_PAGE) {
break;
}
+ $this->show();
}
common_element_end('ul');